0:35, EET
December 16, 2013
Hello,
I’m trying the OPC UA Java SDK and at the same time becoming familiar with the OPC UA specifications.
I am following the Java SDK Server Tutorial and have created an instance of UaObjectTypeNode – in the tutorial, this object is named “myDeviceType”.
I understand that it is possible to add Components and Properties to myDeviceType, in order to provide a complete definition of this Type in the OPC UA Server Address Space.
After fully defining myDeviceType, with all its Components and Properties, I now want to instantiate several UaObjectNode objects based on the definition of myDeviceType – for example, myDevice1, myDevice2, myDevice3.
However, I cannot see a simple way of creating these UaNodeObject instances, complete with all the Components and Properties I defined for myDeviceType. It seems that I need to explicitly add all the same Components and Properties to each instance of myDeviceType.
Am I missing something?
Regards,
Martin Boers
8:43, EET
December 21, 2011
Yes, that is unfortunately the case with the SDK 1.x.
With SDK 2.0 we will have ways to instantiate objects from the type definitions. You should have received a notification of the public beta last week. Please send mail to sales at prosysopc.com, if you missed that.
In the new SampleConsoleServer there is a createTestInstance() method which shows an example of it. The exact syntax is still subject to change, though, so I won’t mention it here.
With SDK 1.x, the best option is to write a Java class that implements the complete structure. For SDK 2.0 we will also provide a way to generate this kind of Java classes.
Most Users Ever Online: 1919
Currently Online:
16 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 88
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 725
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1525
Posts: 6456
Newest Members:
ernestoportus31, martin123, rickie5305, shaylamaggard4, rickyjuarez140, jonathonmcintyre, fannielima, kristiewinkle8, rust, christamcdowallModerators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1028, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0
Administrators: admin: 1