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

PI System Management Tools

Total (Tag-based PE function)

  • Last UpdatedNov 15, 2024
  • 1 minute read

The Total function calculates the sum of two or more values.

Syntax

Total(x1, x2, ..., xn)

Arguments

x1...xn

May be numbers or time periods, but all must be the same.

Returns

The total of the arguments. The result has the same data type as the arguments.

Exceptions

  • Arguments whose run-time values are digital states are not included in the total.

  • If all values are digital states, Total returns an error value.

Usage

  1. Purpose: Use Total to sum numeric values, tag data, or time periods.

  2. Context: Commonly used in PI Performance Equations, PI DataLink, or PI System Management Tools.

  3. Examples:

    • Sum current tag values:

      Total('sinusoid', 'cdt158')

    • Combine tag values and time periods:

      Total('tag1', TagVal('tag2', '*-1h'), '+1h')

      Tips: Ensure all inputs are the same data type to avoid errors.

Examples

The following examples demonstrate how to use the Total function in different scenarios, including numeric calculations, tag-based operations, and combining tags with time periods.

  • Example 1: Summing numeric values

    Total(10.5, 20.3, 5.2)

    Result: 36.0

  • Example 2: Combining tags and functions

    Total('sinusoid', TagVal('cdt158', '*-1h'))

    Results: Adds the current value of sinusoid and the value of cdt158 one hour ago.

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