Using UaModeler to specify the underlying addr. of a node

Questions regarding the use of UaModeler

Moderator: uamodeler

Post Reply
User avatar
baldo
Sr. Member
Sr. Member
Posts: 13
Joined: 19 Nov 2019, 12:15

Using UaModeler to specify the underlying addr. of a node

Post by baldo »

Hi everyone,

This is a generic question about UaModeler's functionalities and purpose, so I guess I shouldn't provide product data, but here's what I'm using:
- name of the product: UaModeler
- version number: 1.6.3 454
- operating system: Windows 10

Context:
I'm analyzing how much work needs to be done in case I choose to buy the license for your .NET SDK to integrate it to my projects.
Concerning my projects, I have several different machines, maybe similar one another, but in general this means that I need a different server for each machine, thus to configure these servers appropriately we need the UaModeler to define their information models. However, the one who is defining the data to be shown to the client (using the UaModeler) and me that I will code the "Minimal System Adaptation Layer" [1], are two different people. I need to develop the server for my machines just once (at least DA), and I want to leave the server configuration to the one who is responsible for it. Studying your tutorials, I learnt to define the information model with the UaModeler, but the content of those variables and properties (i.e. the value) must be set in the code, reading real time data from the underlying system in my case [2]. Assuming we have addresses to identify the location of the value in the underlying system (e.g. "Machine003.Device001.Axis003"), if we are able to bind a node of the server address space to this address pointing to the value in the underlying system, we are almost done...

Problem:
Can we use the UaModeler to set something like an Attribute for a Node, and use it to write the value address in the underlying system?
This will make every variable/property of the information model carry the information of where its value is in the underlying system, and I can develop the server so that the connection between the nodes in the server address space and the real time data is made dynamically, so I don't need to rewrite code for every machine I have (at least for DA). If this is really feasible, the 1:1 binding between a node and the underlying address would be realized by my colleagues using just one tool (the UaModeler), otherwise I think the only solution would be the development of an extra tool that reads the xml produced by the UaModeler, and makes the user associate the nodes to the underlying addresses.

However, I couldn't find a way to use the UaModeler this way so I'm not sure if it really allows it.
At the beginning I thought about adding a Property to the Variable that I wanted to associate with the underlying address. I would have named the Property "PLCAddress" and I would have set its value to the underlying address (e.g. from above: "Machine003.Device001.Axis003"), but I realized I wasn't able to do it because the UaModeler makes you create only "the container" and not the content.
I realized a better option would have been to create a new Attribute for the nodes but looks like that it's forbidden [3] (I'm not sure if it's an OPC Foundation's decision or if it's your design decision, but looks like it's not a way to solve it). This custom Attribute would be named something like "PLCAddress" and I would set its content to "Machine003.Device001.Axis003".

Is there a way, that I didn't think of, to add this information about the underlying address to a node? Maybe using custom ReferenceType? Or maybe one of those two attempts I made were feasible but I failed to realize them. Or the UaModeler was simply not intended to be used like that, so the only way to avoid changing, for every machine, the code of the "Minimal system adaptation layer" of my server, is to develop an extra tool.


If I wasn't clear enough I can fix it: please let me know.
Best regards,

baldo

References:
[1] "Minimal system adaptation layer": http://documentation.unified-automation ... ction.html
[2] "Underlying system": http://documentation.unified-automation ... ess03.html
[3] "Nodes' attributes are non-extensible": screenshot attached taken from a slide of your courses.

User avatar
baldo
Sr. Member
Sr. Member
Posts: 13
Joined: 19 Nov 2019, 12:15

Re: Using UaModeler to specify the underlying addr. of a nod

Post by baldo »

Can we use the UaModeler to set something like an Attribute for a Node, and use it to write the value address in the underlying system?
In other words:
Does UaModeler allow me to define something like a custom Attribute for every node, so that I can use it to define the address of the related data in the underlying system?

User avatar
baldo
Sr. Member
Sr. Member
Posts: 13
Joined: 19 Nov 2019, 12:15

Re: Using UaModeler to specify the underlying addr. of a nod

Post by baldo »

I see there's no reply yet so, since I noticed I can be more specific using Lesson03 example [4], if this helps I will try to restate the problem with a vocabulary that is more implementation-oriented.

As you know I'm trying to provide the address information in variable user data. In the mentioned example you use the SetVariableConfiguration method. I think that the address information is needed only in the NodeHandleType.ExternalPolled case but I could be wrong: for now let's say that is also my case.
Comparing the Lesson03 example with mine we will have a different SystemAddress class members: instead of having two integers defining Address and Offset, we will have an Address member of string type. We will populate it with strings such as the one mentioned before:
Assuming we have addresses to identify the location of the value in the underlying system (e.g. "Machine003.Device001.Axis003")
So my custom SystemAddress, using the SetVariableConfiguration method, will become the UserData of the variable node and I can use it to poll the real time data overriding the Read method of the BaseNodeManager.

Now comes my question concerning the UaModeler. I won't provide this SystemAddress.Address values from the underlying system as done by Lesson03 example. I would like them to be information nested appropriately directly in the buildingautomation.xml file that, as you know, has been generated by the UaModeler during Lesson02 [5] and that can be used also to define Object instances. It doesn't matter if these strings are than displayed to the Client or not (even if it would be better if it's information kept on Server side, and not shown to the Client). My point is that I would like to read the xml file and get all the address information of the Variable value attributes of those Object instances, that I will use to populate the UserData of those nodes. How to insert that information, if that is possible, using the UaModeler?

After I generated the buildingautomation.xml file I had to manually edit the file in order to add the address information for each variable.
So for example if we had an Object instance AirConditioner1 defined in the xml, and as property a Temperature Variable like this:

Code: Select all

<UAVariable DataType="Double" ParentNodeId="ns=1;i=5002" NodeId="ns=1;i=6035" BrowseName="2:Temperature" AccessLevel="3">
        <DisplayName>Temperature</DisplayName>
        <References>
            <Reference ReferenceType="HasTypeDefinition">i=63</Reference>
            <Reference ReferenceType="HasComponent" IsForward="false">ns=1;i=5002</Reference>
        </References>
</UAVariable>
what I tried to do was adding manually a custom Attribute to specify the address information for that variable value attribute:

Code: Select all

<UAVariable DataType="Double" ParentNodeId="ns=1;i=5002" NodeId="ns=1;i=6035" BrowseName="2:Temperature" AccessLevel="3" PLCAddress="Machine003.Device001.Temperature">
        <DisplayName>Temperature</DisplayName>
        <References>
            <Reference ReferenceType="HasTypeDefinition">i=63</Reference>
            <Reference ReferenceType="HasComponent" IsForward="false">ns=1;i=5002</Reference>
        </References>
</UAVariable>
But I would like not to handwrite this information in the xml. I want to find a way to use the UaModeler to do something like this, as long as it is meant to do that.

And by this example I'm not saying that my aim is to use the UaModeler to add attributes: that's just one solution I came up with, but I know that attributes should be fixed. So maybe a solution could be adding a new node that is child of that Variable, or maybe a reference to another node containing that information. But I feel like all these solutions have conceptual misunderstanding of the UaModeler purpose.

Additional References:
[4] http://documentation.unified-automation ... ess03.html
[5] http://documentation.unified-automation ... ss02a.html

Post Reply