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 2024 R2)

StateNo

  • Last UpdatedJan 11, 2023
  • 1 minute read

Translate a digital state into its corresponding enumeration value.

Syntax

StateNo(digstate)

Arguments

  • digstate

    An enumeration value

Returns

The offset into the Digital State Set corresponding to digstate

Exceptions

If a point is passed as digstate that is not a digital point, returns an error value

Notes

A digital state may appear more than once in the digital state table. In this case, the value that StateNo returns may vary. If digstate is the value of a digital point, StateNo returns a code number appropriate for that point.

Example

  • StateNo(DigState("No Data"))

    [Returns 248]

  • StateNo(TagVal('enum_att1', '*-1h'))

    [Return the digital state number corresponding to the value of 'enum_att1' an hour ago]

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