DigState
- Last UpdatedJan 11, 2023
- 1 minute read
- PI System
- PI Server 2018
- PI Server
Convert a string into a corresponding Data Archive digital state object, either based on the attribute's digital state enumeration or on a system enumeration set values (for example, ). Use DigState embedded in other functions when Data Archive digital state object is required for input (such as with StateNo) or in conjunction with other functions for comparison with digital state attributes.
Syntax
DigState(s1 [, x])
Arguments
-
s1
A string representing a digital state in double quotes
-
x
Optional: An attribute with PI point digital state reference or of value type enumeration set. If omitted, only the system digital set is searched for the given string.
Returns
An enumeration value
Exceptions
If the string does not represent a digital state of the specified attribute, the function returns . If the attribute is omitted and string does not represent a system digital state, is returned.
Example
-
'att1' > DigState("Program", 'att1')
[Returns True if current digital state of 'att1' is greater than the digital state represented by "Program" value]
-
DigState("No Result")
[Construct a value with system digital state ]