TagMax (Tag-based PE function)
- Last UpdatedOct 04, 2024
- 1 minute read
- PI System
- PI Server 2023
- PI Server
Find the maximum value of a point during a given time, according to values stored in the PI Archive.
Syntax
TagMax(tagname, starttime, endtime [, pctgood])
Arguments
tagname
A tagname.
starttime
A time expression indicating the beginning of the time range to search. Relative times are relative to endtime, if endtime is not itself a relative time.
endtime
End of the time range to search. Relative times are relative to starttime, if starttime is not itself a relative time. This time must be after starttime.
pctgood
Optional. Minimum time percentage over the given time range, that the point's archived values must be good.
Returns
The point's maximum value during the given time.
Exceptions
If the point has no good values or the pctgood minimum is not reached for the given time range, returns an error value.
Notes
Note: The OverRange digital state is not taken into account when evaluating TagMax.
Example
TagMax('tag1', '-1h', '*',95)
-
Here, the starttime is one hour before the endtime, which is now ('*'). During the time span, at least 95% of the values must be good.
TagMax('tag1', 'y', '*')
TagMax('tag1', '-1h', '*',95)
TagMax('tag1', '14-Dec-97', '+1h')