kitControl-BqlExprComponent

This component creates custom math and logic operations based upon manually-added slots and one or more BQL expression statements. Slots can be various baja types, such as primitives Double, Float, Integer, Boolean, or String, or status types: StatusBoolean, StatusNumeric, and so on. Slots are either inputs or one or more outputs. You enter BQL expressions in the component’s Expr (expression) property.

The ExprLogic and ExprMath components are not strictly speaking logic and math components. Instead, they are adaptations of the Expr component (BqlExprComponent), which provide four-input logic and math functions.

Figure 93.   The three forms of the BqlExprComponent
Image
  • (1) is for logic BQL expressions.
  • (2) is for math BQL expressions.
  • (3) is for general expressions.

The Logic and Math folders also contain expression components. ExprLogic provides a four-input logic AND gate. ExprMath provides a four-input math ADD component. The Util folder of the kitControl palette contains an empty expression component.

For complete information on BQL expressions, refer to Niagara Engineering Notes,BQL Expression component.

Property Value Description
Status read only Indicates the condition of the component at the last check

{ok} indicates that the component is licensed and polling successfully.

{down} indicates that the last check was unsucessful, perhaps because of an incorrect property, or possibly loss of network connection.

{disabled} indicates that the Enable property is set to false.

false indicates another problem . Refer to Fault Cause for more information.

Fault Cause read only Indicates a reason why a system object ( network, device, component, extension, etc.) is in fault. This property is empty unless a fault exists.
Execution Delay hours minutes seconds (defaults to 0) Configures an amount of time to delay before executing the expression.
Expr BQL expression The standard syntax for an expression is as follows: input operator ‘output’, where:

input is the name of one or more slots.

operator is a word or symbol.

‘output’ is the slot that contains the result of the expression. (note apostrophes around slot name)

InA, In B, InC and InD BooleanStatus (true or false for logic), number (for math) Defines four input values.
out read-only BooleanStatus (true or false for logic), number (for math) Defines a single output value, which is the result of executing the expression.

The supported operators for the BQL expression are as follows:

Order of Operation Operator Description
1 !, not, - Logical not, numeric negation
2 * , / multiplication, division
3 +, - addition, subtraction
4 =, !=, >, >=, < <=, like Comparison
5 and, or Logical operators
6 as result operator

Operators are processed by their precedence, that is “order of operation”, from first (1) to last (6). Parentheses is used to override the normal precedence.

Comma is used as a delimiter to create Expr with multiple expression(output slots).

For long statements in a Expr use CR/LF to wrap the text.

BQL Like Query

Image

Following are some examples for Like expression:

  • Multiply four Double properties

    inA * inB * inC * inD as ‘out’

  • Multiply two BStatusNumeric properties to a Double output property

    inA.value * inB.value as ‘out’

  • Negate a Double input property (if inA is 5, out becomes -5)

    -inA as ‘out’