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: 21
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: 21
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: 21
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: 942
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: 267

Currently Online: cigerxwinchaker@hotmail.com
16 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 120

pramanj: 86

ibrahim: 74

rocket science: 65

kapsl: 57

gjevremovic: 49

Sabari: 44

Xavier: 42

fred: 41

TimK: 41

Member Stats:

Guest Posters: 0

Members: 3124

Moderators: 17

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1277

Posts: 5456

Newest Members:

valentinanoblet, XNXXguini, RobertTop, baileyuup3516, Richardlacle, inezwb11, clarissabeasley, raulakhtar528, claritanisbett4, isiahhughey

Moderators: Jouni Aro: 942, Otso Palonen: 32, Tuomas Hiltunen: 5, janimakela: 0, Pyry: 1, Terho: 0, Petri: 0, Bjarne Boström: 800, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 25, Teppo Uimonen: 21, Markus Johansson: 41, Niklas Nurminen: 0, Matti Siponen: 209, Lusetti: 0

Administrators: admin: 1