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: 26
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: 26
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: 26
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: 1026
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: 1919

Currently Online:
59 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: 734

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1523

Posts: 6449

Newest Members:

christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger, howardkennerley, Thomassnism, biancacraft16, edgardo3518

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0

Administrators: admin: 1