Calculation Engine Comparison Functions
The following are functions for value comparison and bit-level logic to be used in the OAS Calculation Engine:
Bit Compare
Bit compare of a specific bit postion of an integer value.
Parameters:
- Integer value to evaluate
- Bit position
Examples:
BITC([Tag.Value],4)
BITC(4096,[Tag.Value])
Bit Shift Left
Bit shift left a specified number of bits of an integer value.
Parameters:
- Integer value to evaluate
- Number of bits to shift left
Examples:
BITSHIFTLEFT([Tag.Value],2)
BITSHIFTLEFT(2048, [Tag.Value])
Bit Shift Right
Bit shift right a specified number of bits of an integer value.
Parameters:
- Integer value to evaluate
- Number of bits to shift right
Examples:
BITSHIFTRIGHT([Tag.Value],2)
BITSHIFTRIGHT(2048, [Tag.Value])
Bitwise And
Bitwise AND of 2 integers.
Parameters:
- Integer value to evaluate
- Integer value to evaluate
Examples:
BITWISEAND([Tag1.Value],[Tag2.Value])
BITWISEAND(2048,[Tag.Value])
BITWISEAND([Tag.Value],64)
Equal
Comparison operator placed between two values, returning true if the first is equal to the second
Examples:
[Tag1.Value] = [Tag2.Value]
100.0 = [Tag.Value]
[Tag.Value] = -50
Greater Than
Comparison operator placed between two values, returning true if the first is greater than the second
Examples:
[Tag1.Value] > [Tag2.Value]
100.0 > [Tag.Value]
[Tag.Value] > -50
Greater Than or Equal
Comparison operator placed between two values, returning true if the first is greater than or equal to the second
Examples:
[Tag1.Value] >= [Tag2.Value]
100.0 >= [Tag.Value]
[Tag.Value] >= -50
High Byte
Returns the high byte of a word.
Parameters:
- Value to convert
Example:
HIGHBYTE([Tag.Value])
High Word
Returns the high word of an integer.
Parameters:
- Value to convert
Example:
HIGHWORD([Tag.Value])
Less Than
Comparison operator placed between two values, returning true if the first is less than the second
Examples:
[Tag1.Value] < [Tag2.Value]
100.0 < [Tag.Value]
[Tag.Value] < -50
Less Than or Equal
Comparison operator placed between two values, returning true if the first is less than or equal to the second
Examples:
[Tag1.Value] <= [Tag2.Value]
100.0 <= [Tag.Value]
[Tag.Value] <= -50
Low Byte
Returns the low byte of a word.
Parameters:
- Value to convert
Example:
LOWBYTE([Tag.Value])
Low Word
Returns the low word of an integer.
Parameters:
- Value to convert
Example:
LOWWORD([Tag.Value])
Not Equal
Comparison operator placed between two values, returning true if the first is not equal to the second
Examples:
[Tag1.Value] <> [Tag2.Value]
100.0 <> [Tag.Value]
[Tag.Value] <> -50