Total (Tag-based PE function)
- Last UpdatedNov 15, 2024
- 1 minute read
- PI System
- PI Server 2023
- PI Server
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
-
Purpose: Use Total to sum numeric values, tag data, or time periods.
-
Context: Commonly used in PI Performance Equations, PI DataLink, or PI System Management Tools.
-
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.