Hello,
What is the semantic behind DataValue.getStatusCode() ?
Does it represent the status of the communication between OPC client and OPC server?
Or does it represent the state of the underlying signal on the server? For example I have a temperature sensor linked to my CPU. If I unplug one line of the sensor, the sensor status change. Should this status be mapped to the OPC UA DataValue StatusCode?
Thanks,
Patrick
12:36, EEST
April 3, 2012
Hi,
Please read OPC UA Specification (v.1.03) Part 4 section 7.34 on the StatusCode, also section 7.7.5 specifically when it is part of a DataValue.
As a quick summary, when it is part of a DataValue it represents the status of the Value of the DataValue. Normally is this StatusCode.GOOD if the value can be obtained from a data source (e.g. your sensor). If the value cannot be obtained (or it is uncertain) the statuscode tells the problem/situation. Note that the generic StatusCode.BAD should not be used, but instead a more specific should be used. You can create these with new StatusCode(StatusCodes.some_constant). Alternatively at some parts of the SDK you can also throw StatusException.
StatusCodes are also used as Service level return codes. Probably easisest is if you read Part 4 Section 5 (at least the 5.3 Service results).
For example, for a Read call.
1) The whole operation can fail on the Service level if e.g. there is a problem with the connection or the request times out (i.e. it can fail both on the client or server side), in this case you wont receive any DataValues and SDK throws ServiceException, i.e. a single code determines the quality of the service call
2) Each of the read operations part of the Read service call (Operations) can fail individually, you will receive one DataValue per read item, and the StatusCode determines the quality of the value. Note that usually in the SDK API if bad status is received, then a StatusException is thrown.
– Bjarne
Most Users Ever Online: 1919
Currently Online:
17 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: 729
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1529
Posts: 6471
Newest Members:
toneylapham544, rondawolinski7, Marypof5711, roycedelargie91, kourtneyquisenbe, ellis87832073466, zkxwilliemae, gabriellabachus, Deakin, KTP25ZofModerators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1