Variable has no values in the Attributes window

Questions regarding the use of the UaExpert.

Moderator: uaexpert

Post Reply
Felix
Jr. Member
Jr. Member
Posts: 1
Joined: 31 May 2023, 13:11

Variable has no values in the Attributes window

Post by Felix »

Hello all,

We work with the TMCNodeSet and get error messages in UaExpert when we call a method.
The problems occur with the MachineModuleProductionType:

Image

When calling the StartProductionOrder method, the following messages appear:
Image

The input argument is a ProductionOrderType.
ProductionOrderType (3038)
ProductionOrderHeaderType (3016)
DataSetType (3018)
MaterialListType (3037)

The method is successfully executed. In code we get the ProductionOrderHeaderType from the Input argument and write it to ProductionOrder VariableNode.
Image

If the ProductionOrder VariableNode is obsereved in Data Access View, the values are visible, but not Attributes-View.
Image

We set the ProductionOrder VariableNode to externalPush, so we override the Read Method in the NodeManager. There we could see that IList<NodeAttributeOperationHandle> operationHandles is empty and therefor doesn't get access to the data.
Image

Are these two separate problems or are they linked?
If you need any more information from me, please let me know.


With kind regards

Felix

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: Variable has no values in the Attributes window

Post by Support Team »

Hello Felix,

with our own sample project we do not get the warning. Maybe because we use the latest version of the UaExpert (1.7.0)? Anyway, the UaExpert just shows a waring but it will work regardless of the warning. It is safe to ignore the warning saying the "not able to get the BuitInType for the Datatype xxxx".

The main problem is, that there is a type confusion in your project with the ProductionOrder property. According to the TMC specification and the Nodeset2.xml file, the property should use the DataType ProductionOrderHeaderType.
Whereas your monitored item in the Data Access View is reporting a value of ProductionOrderType. That is the first thing that should be fixed.

Secondly we recommend to take a look on the BindModel mechanism that was introduced with the 3.3 release of the .NET SDK. It was developed exactly for the use case that business logic is performed in C#. You can find an exhaustive example in the documentation here:
https://documentation.unified-automation.com/uasdknet/3.3.1/html/L2ServerTutMachineDemoServer.html

This gives you type safeness in a C# idiomatic way. The StartProductionOrder method, that copies the header of the POToStart argument onto the ProductionOrder property becomes as simple as it should ever be. The C# type system will not allow you to assign anything other than an instance of ProductionOrderHeaderType (or derived type) to the ProductionOrder property.

Code should look like this when using the new BindModel:

Code: Select all

        public StatusCode StartProductionOrder(
            RequestContext context,
            MachineModuleProductionModel model,
            ProductionOrderType POToStart,
            string[] SourceMaterialLoadingPointIDs,
            string[] DestinationMaterialOutputPointIDs,
            out MethodExecutionFeedbackType ExecutionFeedback
            )
        {
            ProductionOrder = POToStart.Header;

            ExecutionFeedback = new MethodExecutionFeedbackType()
            {
                Success = true,
            };

            return StatusCodes.Good;
        }
Best regards
Unified Automation Support Team

Post Reply