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
How to set the quality or statuscode of a TUAVariable.Value ?
July 29, 2022
13:29, EEST
Avatar
DenisF
Member
Members
Forum Posts: 22
Member Since:
March 26, 2021
sp_UserOfflineSmall Offline

Hello,

When the OPC client makes a request for the value of a variable (TUAVariable.Value), the first time the value is not yet available, and the client receives BadAttributeIdInvalid.

To avoid this, in the UA server, I would like to assign a temporary value (generally 0) to the variable (TUAVariable.value) with a “bad” attribute, but I can’t figure out how to do that? Is this possible?

I’m using the last version 7.5, for Delphi 10.3. In this version the online help (sentrol.chm) doesn’t work, which could have helped me to find the necessary information. With the reference pdf, it is much more difficult.

Thanks in advance

Best regards

July 29, 2022
14:03, EEST
Avatar
DenisF
Member
Members
Forum Posts: 22
Member Since:
March 26, 2021
sp_UserOfflineSmall Offline

I finally found that I have to use the TUAVariable.DataValue, but I can’t find any info on how and when to modify or create it, what happens when you modify TUAVariable.Value, etc… Is there an explanation of what to do somewhere?

Thanks in advance.

July 29, 2022
18:50, EEST
Avatar
DenisF
Member
Members
Forum Posts: 22
Member Since:
March 26, 2021
sp_UserOfflineSmall Offline

I finally did this to adjust the StatusCode of my variables according to the availability of their value, e.g. to change to a bad value:

if UAVar.DataValue.StatusCode.IsGood
then UAVar.DataValue:= TUADataValue.Create(Bad);

It seems to work. The value of the variable is Null for the OPC client when the status is bad.

August 8, 2022
12:24, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1010
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Hi Denis,

Good that you managed to sort it out and sorry that the support was not available last week due to holidays.

This is the way to do, it, although typically, you would like to use specific status codes (e.g. Bad_OutOfService), instead of the plain Bad.

The operation level status codes, which can be used (although not all are valid for data access), are defined in the Part 4, Table 183 and more specific Data Access codes in Part 8.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
32 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

TimK: 41

Member Stats:

Guest Posters: 0

Members: 681

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

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

Moderators: Jouni Aro: 1010, 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