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
DataValue.getStatusCode
June 30, 2017
11:20, EEST
Avatar
patduflot
Member
Members
Forum Posts: 6
Member Since:
May 16, 2017
sp_UserOfflineSmall Offline

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

June 30, 2017
12:36, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 983
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

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

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
28 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 680

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6260

Newest Members:

sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com, aytule

Moderators: 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