Array of ObjectType|OPC UA Standard|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Array of ObjectType
Avatar
Ben Cloos
New Member
Members
Forum Posts: 2
Member Since:
04/08/2025
sp_UserOfflineSmall Offline
1
04/08/2025 - 07:30
sp_Permalink sp_Print

Hello everybody.
First, I have to admin, that I am pretty new to more complex OPC UA things. In a project, we want to create an Informationmodel of a productionline. To achive this, I created in Siemens SIOME an ObjectType FB_ProductionStation, that describes one productionstation.

The FB_Productionline describes not this productionline, that has several FB_ProductionStations. I would like to gather all the FB_ProductionStation in an array. This woule come in handy, since I am using a CodeSys Controller as the opc ua server. With the array, I could easily iterate over all the objects, during runtime.

 

I somehow have not found a solution to this problem. Creating arrays of normal variables, and eben structs seems to be possible, but nor for objecttypes.

I appreciate any kind of help.Wink

 

Regards from Germany, Ben

Avatar
Randy Armstrong
Admin
Forum Posts: 1620
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
04/09/2025 - 21:43
sp_Permalink sp_Print sp_EditHistory

Objects are not serializable entities in OPC UA. They only exist in the AddressSpace and need to be accessed with Browse.

Variables have a Value which is serializable but Variable itself is not serializable.

The concept of an Array only applies to serializable entities such as the Value of a Variable.

You can collect all of your FB_ProductionStation into a Folder with an Organizes reference which is like an Array.

You can then Browse the Folder to get a list of all FB_ProductionStations which would allow you to interate over the Objects, however, if you needs more information than is returned in the Browse you will Read attributes.

Can you describe what information you need when you are iterating over the Objects?

Avatar
Ben Cloos
New Member
Members
Forum Posts: 2
Member Since:
04/08/2025
sp_UserOfflineSmall Offline
3
04/10/2025 - 00:44
sp_Permalink sp_Print

Thank you for the explanation. I somehow have not found this information yet.

When iterating over the objects, I want to access several informatino, this goes from simple boolean and integer variables to variables of a structured type or enumerations.

 

I understand your solution with the folder, I think it is the same idea as in an aggregation object maybe.

Avatar
Randy Armstrong
Admin
Forum Posts: 1620
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
4
04/14/2025 - 05:33
sp_Permalink sp_Print

Yes, folders allow Nodes to be organized in different ways depending on the use case.

i.e. you can have a physical and logical representation of a plant where the hierarchy changes the same Object exists in both hierarchies.

The expected process for iterating over a list of Objects is:

1) Browse to get list of NodeIds

2) Use NodeIds + BrowsePaths to children in a call to TranslateBrowsePathsToNodeIds to get NodeIds for the components

3) Call Read with the NodeIds of the components to get the Value.

The TranslateBrowsePathsToNodeIds and Read take multiple operations so the above steps are only 3 service calls.

For example:

BoilerType -> OutputLevel (double)
                -> InputFlow (double)

MyBoilers -> Boiler1
               -> Boiler2

1) Browse(MyBoilers) => Boiler1.NodeId, Boiler2.NodeId

2) TranslateBrowsePathsToNodeIds { [ NodeId: Boiler1.NodeId, [ OutputLevel, InputFlow ] ],  [ NodeId: Boiler2.NodeId, [ OutputLevel, InputFlow ]]} 
=> [ Boiler1.OutputLevel.NodeId,  Boiler1.InputFlow.NodeId], [  Boiler2.OutputLevel.NodeId,  Boiler2.InputFlow.NodeId ]

3) Read(Boiler1.OutputLevel.NodeId, Boiler1.InputFlow.NodeId,  Boiler2.OutputLevel.NodeId, Boiler2.InputFlow.NodeId)
=> Boiler1.OutputLevel.Value, Boiler1.InputFlow.Value, Boiler2.OutputLevel.Value, Boiler2.InputFlow.Value
Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online: Christian Burger
Guest(s) 39
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1483
Posts: 5011