Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Analytics and Notifications for PI System Explorer (PI Server 2018)

DigState

  • Last UpdatedJan 11, 2023
  • 1 minute read

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, Calc Failed). 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 Calc Failed. If the attribute is omitted and string does not represent a system digital state, Calc Failed 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 No Result]

In This Topic
TitleResults for “How to create a CRG?”Also Available in