Underlying System with predefined nodes|OPC UA Implementation: Stacks, Tools, and Samples|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
Underlying System with predefined nodes
Avatar
Loko Vik
Member
Members
Forum Posts: 15
Member Since:
08/10/2022
sp_UserOfflineSmall Offline
1
01/20/2023 - 06:24
sp_Permalink sp_Print sp_EditHistory

Hi,

 

I am new to OPC UA. I would like to use predefined Nodeset file as nodes in my server and would like also to map data from external source. I looked into DataAccess example in Workshop folder. But there I understood that in the example Nodes are created separately in the BlockState. Do I need this Underlying System at all? Since, there I need to create all the nodes again. What am I missing here?

 

Thanks in advance!

Regards

Avatar
Loko Vik
Member
Members
Forum Posts: 15
Member Since:
08/10/2022
sp_UserOfflineSmall Offline
2
02/08/2023 - 01:32
sp_Permalink sp_Print

Use BlockState as base of the predefined node object.

Avatar
Randy Armstrong
Admin
Forum Posts: 1564
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
3
02/08/2023 - 02:08
sp_Permalink sp_Print

The underlying system is an abstraction layer that separates the UA model from the specifics of your implementation.

It is a good software design strategy to create an abstraction layer like this.

This abstraction layer is still useful even if the nodes are defined in the nodeset.

Avatar
Loko Vik
Member
Members
Forum Posts: 15
Member Since:
08/10/2022
sp_UserOfflineSmall Offline
4
02/16/2023 - 06:50
sp_Permalink sp_Print sp_EditHistory

Thanks Randy for your reply.

I have one more with architecture of the software. Since the abstraction layer from UA model is created, I tried to use dependency injection to get actual data and event into the underlying system. But I found underlying system is still bound to nodemanger, segment and many other classes. Making underlying system as a singleton class would be an option. I know making a singleton has few important drawback in the code.

Is this right approach? or am I missing here anything?

Thanks in advance!

Regards

Avatar
Randy Armstrong
Admin
Forum Posts: 1564
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
5
02/17/2023 - 00:42
sp_Permalink sp_Print

The issue is there needs to be 2 way communication between the UnderlyingSystem and the NodeManager.

i.e. Reads go from the NodeManager => UnderlyingSystem but updates go from the UnderlyingSystem  => NodeManager .

This detail makes the UnderlyingSystem unsuited for dependency injection which presumes the dependency does know about its container.

You could move to an event model in the UnderlyingSystem where the NodeManager adds event handlers that are used to receive updates from the UnderlyingSystem. This would eliminate the 2 way communication and should allow you to use dependency injection.

Avatar
Loko Vik
Member
Members
Forum Posts: 15
Member Since:
08/10/2022
sp_UserOfflineSmall Offline
6
02/17/2023 - 03:32
sp_Permalink sp_Print

Thanks for your reply.

I didn't understand you completely. How moving events in the UnderlyingSystem will change the situation here? 

Anyway I need publish variable and its value from Underlying System via BlockState. Since, eventing will take place at different places (objects) depending on which event belong to which object in the server.

Avatar
Randy Armstrong
Admin
Forum Posts: 1564
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
7
02/19/2023 - 16:52
sp_Permalink sp_Print

The dependency injection model requires that if A uses B then B cannot use A.

If B needs to provide A with asynchronous updates then it can defines events which A subscribes to.

This would eliminate the need for B to hold a direct reference to A.

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online: MUHAMMAD Naveed
Guest(s) 46
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1435
Posts: 4855