10:46, EET
December 20, 2021
Good morning,
I am using the prosys-opc-ua-sdk-for-java-4.9.0-43-client-server-binary library.
I’m trying to implement an OPC UA server with classes generated by the codegen tool (information model: EUROMAP 82.1 url: https://www.euromap.org/euromap82-1).
Please can you explain me how to handle MultiStateValueDiscreteType? I don’t understand how to set the possible values ​​and how to read the selected value.
I am working with the following variable:
– Parent: DeviceZoneType
– Node Class: Variable
– BrowseName: InternalMeasuringPoint
– DataType: 0:UInt16
– TypeDefinition: 0:MultiStateValueDiscreteType
– Other: O, RW
– file: EUROMAP82.1_Release_1.01.pdf
– page: 17.
Thanks in advance for the support,
Francesco
12:15, EET
Moderators
February 11, 2020
Hello,
First of all, since InternalMeasuringPoint is an Optional component of DeviceZoneType, you must specify that it is created when creating an instance of DeviceZoneType. If you’ve already done this, you can skip the next part.
To create Optional components, you must set the NodeBuilderConfiguration of your NodeManager. To create InternalMeasuringPoint, you would use the following configuration:
TypeDefinitionBasedNodeBuilderConfiguration.Builder conf = TypeDefinitionBasedNodeBuilderConfiguration.builder();
conf.addOptional(UaQualifiedName.from(“http://opcfoundation.org/UA/PlasticsRubber/TCD/”, “InternalMeasuringPoint”));
nodeManager.setNodeBuilderConfiguration(conf.build());
You would then create an instance of DeviceZoneType using the following method:
DeviceZoneType deviceZone = nodeManager.createInstance(DeviceZoneType.class, “DeviceZone”);
At this point you should have an instance of DeviceZoneType that has InternalMeasuringPoint component. You can access this component by calling:
MultiStateValueDiscreteType internalMeasuringPoint = deviceZone.getInternalMeasuringPointNode();
You can then get and set the Values of ValueAsText and EnumValues Properties with the following methods:
internalMeasuringPoint.getValueAsTextNode();
internalMeasuringPoint.setValueAsText(LocalizedText value);
internalMeasuringPoint.getEnumValues();
internalMeasuringPoint.setEnumValues(EnumValueType[] value);
Since the NodeSet file doesn’t specify an initial Value for the EnumValues Property, you will need to set it following the Table 8 of EUROMAP 82.1 companion specification. You would also need to manually set the Value of ValueAsText Property whenever the Value of InternalMeasuringPoint changes. You can do this with an IoManagerListener that uses onWriteValue method to check if a Value is being written to InternalMeasuringPoint and have it update the Value of the ValueAsText Property depending on the Value being written.
Most Users Ever Online: 518
Currently Online:
24 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
hbrackel: 135
pramanj: 86
Francesco Zambon: 81
rocket science: 77
ibrahim: 75
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
fred: 41
Member Stats:
Guest Posters: 0
Members: 682
Moderators: 16
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1467
Posts: 6259
Newest Members:
fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com, aytule, rashadbrownrigg, christi10l, ahamad1, Flores Frederick, ellenmossModerators: Jouni Aro: 1009, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5
Administrators: admin: 1