Functions

The categories of functions include:

  • Conditional. Applies conditional logic.

  • Unit conversion. Computes a target unit from source channels.

  • Date. Evaluates or returns dates and times.

  • Inline scalar. Computes a single value across time for an interval stream, and returns that value in each interval of the result.

  • Math. Performs standard mathematical functions on interval data.

  • Special. Returns results based on specific input data.

  • Status. Reads or writes the interval status.

  • Transformer Losses.

  • Miscellaneous. Performs functions that do not fit into the other categories (and are not complex enough to warrant a separate category).

The UCE uses the following functions:

Note: Arguments for vector functions can be interval channels or expressions that result in interval channel (unless noted otherwise).

Table 73 Functions

Function

Category

Description

Format

Overload

@if

Conditional

Returns the second expression if the first expression is true; otherwise, it returns the third expression.

@if(Condition,True_Expression,False_Expression)

 

AND

Conditional

Performs a logical AND operation on the two operands.

 

 

OR

Conditional

Performs a logical OR operation on the two operands

 

 

NOT

Conditional

Performs a logical NOT operation on the left operand.

 

 

@ampsi2h

Unit Conversion

sqrt(IPH * args[0].value)

@ampsi2h(I2h_ch)

 

@cast

Unit Conversion

Reinterprets the values as though they were of the specified UOM.

 

 

@i2hi

Unit Conversion

SQ(args[0].value)/IPH

@i2hi(amps_ch)

 

@i2hih

Unit Conversion

SQ(args[0].value * IPH)/IPH

@i2hih(Ih_ch)

 

@i4hi2h

Unit Conversion

IPH * SQ(args[0].value)

@i4hi2h(I2h_ch)

 

@ihi2h

Unit Conversion

sqrt(args[0].value * IPH)/IPH

@ihi2h(I2H_ch)

 

@kqhvarh

Unit Conversion

(args[1].value * SQRT3 + args[0].value)/2

@kqhvarh(kwh_ch,kvarh_ch)

 

@kvah

Unit Conversion

SQRT_SUM_SQS(args[0].value, args[1].value)

@kvah(kwh_ch,kvarh_ch)

 

@kvarh

Unit Conversion

SQRT_DIFF_SQS(args[1].value, args[0].value)

@kvarh(kwh_ch,kvah_ch)

 

@kvarhq

Unit Conversion

(2 * args[1].value) - args[0].value)/ sqrt(3)

@kvarhq(kwh_ch,kQh_ch)

 

@kwh

Unit Conversion

SQRT_DIFF_SQS(args[1].value, args[0].value)

@kwh(kvarh_ch,kvah_ch)

 

@pf

Unit Conversion

args[0].value/SQRT_SUM_SQS(args[0].value, args[1].value))

@pf(kwh_ch,kvarh_ch)

 

@pfwva

Unit Conversion

divide(req,args[0].value,args[1].value)

@pfwva(kwh_ch,kvah_ch)

 

@v2hv

Unit Conversion

SQ(args[0].value)/IPH

@v2hv(volts_ch)

 

@v2hvh

Unit Conversion

SQ(args[0].value * IPH)/IPH

@v2hvh(Vh_ch)

 

@v4hv2h

Unit Conversion

IPH * SQ(args[0].value)

@v4hv2h(V2h_ch)

 

@vhv2h

Unit Conversion

sqrt(args[0].value * IPH)/IPH

@vhv2h(V2h_ch)

 

@ConvertToIntervals

Unit Conversion

Converts one AstDataType to another.

DELETE?

 

@voltsv2h

Unit Conversion

sqrt(IPH * args[0].value)

@voltsv2h(V2h_ch)

 

@date

Date

The date in YYYYMMDD format Feb. 6, 2012 = 20120206.0.

@date(ch or 0)

 

@datetime

Date

The datetime in YYYYMMDDHHMMSS format.

@datetime(ch or 0)

 

@day

Date

A number from 1-31 signifiying day of the month

@day(ch or 0)

 

@daytype

Date

A number from 1-7 where 1=Sunday

@daytype(ch or 0)

 

@holiday

Date

A value of 1.0 if the interval is on a holiday. Otherwise the value is 0.0.

@holiday(holiday_list)

 

@month

Date

A number from 1-12 where January=1

@month(ch or 0)

 

@time

Date

The time in HHMMSS format, 10:24:45 = 102445.0

@time(ch or 0)

 

@year

Date

The year (for example, 2012).

@year(ch or 0)

 

@AVG

Inline Scalar

The scalar average across the interval stream.

@AVG(ch)

 

@CODE_SCALARCOINLOW

Inline Scalar

Returns the first n (arg0) lows in the aaggregate (arg1) and also returns the coincident values from the contributors (remaining args).

 

 

@CODE_SCALARCOINPEAK

Inline Scalar

Returns the first n (arg0) peaks in the aaggregate (arg1) and also returns the coincident values from the contributors (remaining args).

 

 

@LF

Inline Scalar

Calculates the load factor for an interval value.

@LF(ch)

 

@NLOW

Inline Scalar

Returns the nth lowest interval during the specified time span.

@NLOW(n,ch)

 

@NPEAK

Inline Scalar

Returns the nth highest interval during the specified time span.

@NPEAK(n,ch)

 

@SABS

Inline Scalar

Returns the absolute value of a single scalar value, or an expression that evaluates to a single scalar value.

@SABS(exp)

 

@SCALARAVG

Inline Scalar

Computes the average across the stream of data.

 

 

@SCALARCOINLOW

Inline Scalar

Finds the first low in the aggregate (arg0) and returns the coincident value from the contributor (arg1).  Must be given exactly two expressions.

 

 

@SCLALARCOINPEAK

Inline Scalar

Finds the first peak in the aggregate (arg0) and returns the coincident value from from contributor (arg1).  Must be given exactly two expressions.

 

 

@SCALARLOW

Inline Scalar

Returns the 'n' lowest values in the interval stream.

 

 

@SCALARPEAK

Inline Scalar

Returns the 'n' highest values in the interval stream.

 

 

@SCALARPEAKTIME

Inline Scalar

Returns the timestamps of the 'n' highest values in the interval stream.

 

 

@SCALARSUM

Inline Scalar

Computes the sum across the stream of data.

 

 

@SIF

Inline Scalar

Returns the second expression if the first expression is true; otherwise, returns the third expression.

@SIF(Condition,True_Expression,False_Expression)

 

@STATUSCOUNT

Inline Scalar

Returns the number of times given status appears in the interval stream.

@STATUSCOUNT(ch,status)

 

@SUM

Inline Scalar

Returns the scalar sum across the interval stream.

@SUM(ch)

 

@ZEROCOUNT

Inline Scalar

Returns the total number of zero intervals (tolerance of 0.00001).

@ZEROCOUNT(ch)

 

@abs

Math

Returns the absolute value of the the operand.

@abs(ch)

Overloaded for intervals, registers and temporal scalars.

@arccos

Math

Returns the arc cosine in degrees of its operand.

@arccos(ch)

Overloaded for intervals, registers, and temporal scalars.

@arcsin

Math

Returns the arc sine in degrees of its operand.

@arcsin (ch)

Overloaded for intervals, registers, and temporal scalars.

@arctan

Math

Returns the arc tangent in degrees of its operand.

@arctan(ch)

Overloaded for intervals, registers, and temporal scalars.

@cos

Math

Returns the cosine of its operand.

@cos(ch)

Overloaded for intervals, registers, and temporal scalars.

@iavg

Math

Returns the average of the expression operands for each interval; intervals from channel references (possibly in expressions) are excluded if they have one of the specified exclude conditions.

@ivag(ch 1,ch 2,..,ch n,status 1, status 2,…,status n)

 

@imax

Math

Returns the maximum of the expression operands for each interval; intervals from channel references (possibly in expressions) are excluded if they have one of the specified exclude conditions.

@imax(ch 1,ch 2,..,ch n,status 1, status 2,…,status n)

 

@imin

Math

Returns the minimum of the expression operands for each interval; intervals from channel references (possibly in expressions) are excluded if they have one of the specified exclude conditions.

@imin(ch 1,ch 2,..,ch n,status 1, status 2,…,status n)

 

@isum

Math

Returns the sum of the expression operands for each interval; intervals from channel references (possibly in expressions) are excluded if they have one of the specified exclude conditions.

@isum(ch 1,ch 2,..,ch n,status 1, status 2,…,status n)

 

@neg

Math

Returns zero if its operand is greater than zero; otherwise it returns its operand.

@neg(ch)

Overloaded for intervals, registers, and temporal scalars.

@pos

Math

Returns zero if its operand is less than zero; otherwise it returns its operand.

@pos(ch)

Overloaded for intervals, registers, and temporal scalars.

@sin

Math

Returns the sine of its operand.

@sin(ch)

Overloaded for intervals, registers, and temporal scalars.

@sqrt

Math

Returns the square root of its operand.

@sqrt(ch)

Overloaded for intervals, registers, and temporal scalars.

@square

Math

Returns the square of its operand.

@square(ch)

Overloaded for intervals registers, and temporal scalars.

@tan

Math

Returns the tangent of its operand.

@tan(ch)

Overloaded for intervals, registers, and temporal scalars.

@consumption

Special

Converts a demand interval value into consumption.

 

 

@demand

Special

Converts a consumption interval value into demand.

@demand(ch)

 

@energy

Special

Energy is a no-op solely for documentation purposes.

@energy(ch)

 

@primary

Special

Converts the literal service point channel to primary (instead of secondary units).

@primary(literal ch)

 

@secondary

Special

Converts the literal service point channel to secondary (instead of primary units).

@secondary(literal ch)

 

@pulse

Special

Converts an interval value into pulses

@pulse(literal ch or @kqhkvarh(literal ch, literal_ch))

 

@regusage

Special

Returns the usage for a register channel, in KWH, over the specified time span.

 

 

@set

Status

Sets the status of the interval to the specified statuses. It can also be used to reset a status. Use "!" to reset the status. For example, !HARMONIC resets the harmonic status.

@set(value_expression \status 1,status 2,…, status n)

 

@status

Status

Returns 1 if the interval has all of the listed statuses set (AND) or any of the listed statuses set (OR).

@status(ch \AND|OR,status 1,status 2,…, status n)

 

@statuscount

Status

Returns a register value containing the number of intervals with the specified statuses.

 

 

Collate

 

Collates two operands.

 

 

@tlosses

Transformer Losses

Calculates T-Model based transformer losses.

 

 

@delta

Miscellaneous

Returns the first derivative of its argument.

(A:1[1]-A:[0], A:1[2]-A:[1], and so forth)

 

@tou

Special

TimeOfUse is a special function that buckets values based on time.