Avatar

Please consider registering
guest

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
Avatar
Predixer
Member
Members
Forum Posts: 6
Member Since:
December 6, 2017
sp_UserOfflineSmall Offline

Hi,
Environment:
– 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
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 365
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

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();
client.getAddressSpace().getType(dataTypeId);
client.writeValue(…)

(not including error handling)

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

Works, thank you. 🙂

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 78

Currently Online:
15 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 89

pramanj: 86

ibrahim: 68

kapsl: 57

gjevremovic: 49

TimK: 41

Fransua33: 39

fred: 36

Rainer Versteeg: 32

peterrob45: 25

Member Stats:

Guest Posters: 0

Members: 841

Moderators: 11

Admins: 1

Forum Stats:

Groups: 3

Forums: 14

Topics: 860

Posts: 3632

Newest Members:

augusthanks, jackbryan, jansmithsmth, uiuida, johnjorge, Ramraj, dimad, aku, Rakshan, claradsouza

Moderators: Jouni Aro: 824, Otso Palonen: 32, Tuomas Hiltunen: 5, janimakela: 0, Pyry: 1, Terho: 0, Petri: 0, Bjarne Boström: 365, Heikki Tahvanainen: 402, Jukka Asikainen: 1, Teppo Uimonen: 14

Administrators: admin: 0