Integral_Sampled()

Format

Integral_Sampled(Expr ,StartTime [,EndTime])

Note: This function was named Integral in v2.6.

Returns

Returns the integral of an expression over a range of time.

Inputs

Expr: The expression to be integrated.
Behaviour: Required
Dimension: Collection
Valid data types: Boolean, Decimal, Integer

Note: The integrated function is constructed by using a zero-order hold (that is, step function) on EXPR's sampled points.

StartTime: The start time over which to produce the integral.
Behaviour: Required
Dimension: Collection, SingleValue
Valid data types: DateTime, Decimal, Integer, String

Note: You can use the Time() function to use a valid DateTime argument.

EndTime: The end time over which to produce the integral. If not specified, it assumes the current time. 
Behaviour: Optional 
Dimension: Collection, SingleValue
Valid data types: DateTime, Decimal, Integer, String

Note: You can use the Time() function to use a valid DateTime argument.

How to format data types

When to Use

Integral_Sampled() operates in SI units of time, that is, seconds. If you are integrating a rate to produce a total, ensure that the rate is a per-second quantity so that you produce a meaningful result.

It is possible to retrieve very large volumes of data through indiscriminate use of this function. Retrieving large amounts of Historian data across a slow network can affect system performance for all users of the system.

Examples

Expression: Integral_Sampled(Expr, Time() - 60, Time())
Result: Integral over the last minute (60 seconds).

Expression: Integral_Sampled(Expr, Time() - 60)
Result: Integral over the last minute (60 seconds).

Expression: Integral_Sampled(Expr, Midnight(Time()))
Result: Integral since midnight (the start of the day).

Expression: Integral_Sampled({tag, sampleMethod = "Raw"}, Time() – 60)
Result: Integral of the raw values over the last minute.

Expression: Integral_Sampled(Sampling(Expr, "raw"), Time() - 60)
Result: Integral of the raw values over the last minute.

Expression: Integral_Sampled({HourlyFlowRate}/3600, Midnight(Time()))
Result: Integral of the hourly flow rate since midnight, ie total production for the day (3600 is the number of seconds in an hour).

Expression: Integral_Sampled({ABC} > 10, Midnight(Time()))
Result: The total number of seconds during which the tag ABC has been greater than 10, since midnight. Equality operators (ie =, ==, !=, <, <=, >, >=) evaluate to 1 or 0, so integrating them produces the total time that the expression is true.

 

Comments are closed