TagVal
- Last UpdatedJan 11, 2023
- 1 minute read
- PI System
- PI Server 2018
- PI Server
Return the value of an attribute at a specified time.
Syntax
TagVal(attname [, t1])
Arguments
-
attname
The name of an attribute with a PI point data reference, enclosed in single quotation marks
-
t1
Optional: A time expression. If you omit this argument, '*' is used
Returns
The value of an attribute at a specified time. This value is interpolated unless the associated PI Point has the Step property set to True or the value type of the attribute cannot be interpolated (for example, if it is a string)
Exceptions
If the associated point does not exist or has no value at the specified time, an error is returned
Example
-
TagVal('att1')
[Return the value of 'att1' at current time]
-
TagVal('att1', 't+8h')
[Return the value of 'att1' at 8am today]
-
TagVal('enum_att1')
[Return the value of 'enum_att1', an attribute from an enumeration set at current time]