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

PI System Management Tools

Avg (Tag-based PE function)

  • Last UpdatedOct 04, 2024
  • 1 minute read

Return the average of all the arguments.

Syntax

Avg (x1,[...])

Arguments

x1, [...]

May be numbers, times, or periods but all must be the same data type.

Returns

The average of the arguments. The result is the same data type as the operands.

Exceptions

Arguments whose run-time values are character strings or digital states are not included in the average. If all values are character strings or digital states, Avg returns an error value.

Example

Avg(TagVal('tag1', '*'),TagVal('tag2', '*'),1,2)

  • The average of the value of tag1 at the current time ('*'), tag2 at the current time ('*'), and the values 1 and 2.

    Avg('*', 't', '14-Dec-97', '14 8:00')

  • The average of four different time values.

    Avg('tag1', 'tag2')

  • The average of the current values of tag1 and tag2.

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