TagBad
- Last UpdatedJan 11, 2023
- 1 minute read
- PI System
- PI Server 2018
- PI Server
For an attribute associated with a PI point, test the point for an abnormal state at a specified time. If the point is an integer or real number, any digital state is considered abnormal. For digital points, the states that are defined for that point are normal; all others are abnormal.
Syntax
TagBad(attname [, t1])
Arguments
-
attname
An attribute associated with a PI point
-
time
Optional: A time expression. If omitted, current time ('*') is used.
Returns
False if the point's state at time is normal, True if it is abnormal.
Exceptions
None
Notes
BadVal can test any value or expression; TagBad can only test a PI point.
Example
-
TagBad('att1')
[Returns True if PI point for 'att1' does not exist or its value corresponds to system digital state (No Data, for example)]
-
TagBad('enum_att1', '14-Dec-16')
[Returns True if PI point for 'enum_att1' does not exist or its value corresponds to system digital state (No Data, for example) at 12:00am on December 14th, 2016]