Please consider registering

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —

— Match —

— Forum Options —

Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
writeValue(..., ...., autoConvert=true) seems not to work correct
June 3, 2019
20:16, EEST
Forum Posts: 6
Member Since:
December 6, 2017
sp_UserOfflineSmall Offline

– Prosys SDK: 4.0.2-808
– Prosys OPC UA Simulation Server (v3.2.0-214)
+ The simulation server is configured with several data nodes (for each numeric data type one variable).
+ Checkbox “Run Simulation” is switched off.

– data to write to the OPC UA server: UnsignedByte value = UnsignedByte.valueOf(28);

Test 1.
– For each data nodes on the server run “writeValue(…, value, false).
– Result:
+ Only the data node with type “UNSIGNED BYTE” succeeded. For the others I got a StatusException: Bad_TypeMismatch.
+ The value on the OPC UA server has changed.
=> Test OK.

Test 2.
– For each data nodes on the server run “writeValue(…, value, true).
– Result:
+ For each data node “writeValue(…, …, true) succeeded.
+ But non of the data nodes on the OPC UA server has changed. (The data node with the correct type hasn’t changed too !)
=> Test FAIL.
I would expect the value 28 could be changed into every other numeric type and written to the data nodes.

The behavior is reproducible with other OPC UA servers too.

June 4, 2019
12:33, EEST
Bjarne Boström
Forum Posts: 522
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline


Thanks for reporting the issue. Would seem to be a bug.

This will happen at least if the UaNode for the DataType of the node to be written is not fetched via AddressSpace.getNode before the writeValue is called. 4.0.0 changed on how the AddressSpace is initialized to fix some other issues, but seems it caused this as a side effect and our tests didn’t catch exactly this scenario.

Will be fixed for future version, before that you could try the following as a workaround:

NodeId dataTypeId = (NodeId) client.readAttribute(nodeId, Attributes.DataType).getValue().getValue();

(not including error handling)

June 4, 2019
14:42, EEST
Forum Posts: 6
Member Since:
December 6, 2017
sp_UserOfflineSmall Offline

Works, thank you. 🙂

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 267

Currently Online:
8 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 100

pramanj: 86

ibrahim: 70

kapsl: 57

gjevremovic: 49

TimK: 41

Fransua33: 39

fred: 37

Rainer Versteeg: 32

Thomas Reuther: 26

Member Stats:

Guest Posters: 0

Members: 1058

Moderators: 14

Admins: 1

Forum Stats:

Groups: 3

Forums: 14

Topics: 981

Posts: 4143

Newest Members:

mats989, Sebastien Petitrenaud, sting2005, Ron Hoppe, Seb, p.devito, g.ilengo, MohamedLazrek, brittr83165991, martintinsley9

Moderators: Jouni Aro: 846, Otso Palonen: 32, Tuomas Hiltunen: 5, janimakela: 0, Pyry: 1, Terho: 0, Petri: 0, Bjarne Boström: 522, Heikki Tahvanainen: 402, Jukka Asikainen: 1, Teppo Uimonen: 20, Markus Johansson: 18, Matti Siponen: 31, Lusetti: 0

Administrators: admin: 0