Read server variables and convert as C # objects | OPC UA Standard | Forum

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
Read server variables and convert as C # objects
Avatar
Male Medeiros
New Member
Members
Forum Posts: 2
Member Since:
02/11/2021
sp_UserOfflineSmall Offline
1
04/03/2021 - 15:47
sp_Permalink sp_Print sp_EditHistory

Dear, I am starting in the opc ua world and I would like to know if there is a way to create objects in C # that represent data structures or variables on an OPCUA server. I saw that there is a library that does this, but it is paid and I have no budget to purchase a license. Thank you very much

Avatar
Randy Armstrong
Admin
Forum Posts: 628
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
04/03/2021 - 23:13
sp_Permalink sp_Print
Avatar
Male Medeiros
New Member
Members
Forum Posts: 2
Member Since:
02/11/2021
sp_UserOfflineSmall Offline
3
04/05/2021 - 16:00
sp_Permalink sp_Print
First of all, thank you very much!

Analyzing the examples, I found no way to represent an existing data structure on an OPC server directly for a C # class.

I tried to use it as follows: 

m_session.ReadValue (new NodeId ("MyNode")). GetValue (myClass.GetType ())

,but without success.
Can you tell me if something like this is possible, or is it necessary to read the nodes individually and fill the C# class ?
Avatar
Randy Armstrong
Admin
Forum Posts: 628
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
4
04/06/2021 - 01:43
sp_Permalink sp_Print

1) You need to create a Session first;

2) The NodeId needs NamespaceIndex (your nodes cannot used NamespaceIndex 0);

3) You can only read the value of a single attribute (i.e. you can't 'read' an object).

4) You can only builtin types or  classes that have been generated with the ModelCompiler and are specified as the DataType of the Value.

https://github.com/OPCFoundati.....elCompiler

Forum Timezone: America/Phoenix
Most Users Ever Online: 202
Currently Online:
Guest(s) 6
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 9
Topics: 854
Posts: 2596