SIS function blocks > SIS Math Blocks > Logic Solver Calculation function block > Expressions in DeltaV SIS Software

Constants in Logic Solver Expression

Constants are predefined, unchangeable values represented by keywords in expressions. Constants let you test values against system values without having to know their internal representations. These constants can be used as numerical values only. Never use keywords as temporary variables in Logic Solver Calc/Logic blocks.

The Logic Solver Calc/Logic block accepts the following constant types:

Named Constants

The following tables list the named constants supported in expressions for the Logic Solver. These tables are organized into types of named constants for easy reference.

Table: TRUE/FALSE Constants

Constant

Explanation

FALSE

Boolean FALSE. This is always equivalent to 0.0 whether comparing or assigning.

TRUE

Boolean TRUE. If assigning ('item' := TRUE) then 'item' is set to 1.0.  If comparing to TRUE ('item' = TRUE) the statement is TRUE if the value of 'item' is >= 1.0.

Note

Comparing TRUE/FALSE constants in an expression should only be used against Boolean elements or when the floating point value is either 0.0 (FALSE) or >=1.0 (TRUE).

DeltaV Status Constants

Status constants are implemented as an 8-bit status word. The numeric value of the status word is determined by which bits are set.

A Logic Solver Calc/Logic block's OUT parameters default to a status of BAD (0). The expression must explicitly set the status. Status propagation is not automatic in the Logic Solver Calc/Logic blocks. You can set the status to a numeric value.

You can also use the GOOD, BAD or UNC constants (for example, 'out1.st' := UNC). There are also constants for the limit status (the two least significant bits of the status word). If the signal is also limited or constant, you can use these additional constant words (LIMITED_CONSTANT, LIMITED_HIGH, LIMITED_LOW), but you must combine them with the status constant (GOOD, BAD, UNC). For example, to set the status to GOOD High Limited, use the expression 'out1.st':= GOOD | LIMITED_HIGH. The "|" operator is a bitwise OR function. The expression writes a value of 130 to the status. 

Constant

Explanation

BAD

If assigning BAD to a parameter status, the status is set to BAD NonSpecific NotLimited (numeric value 0).

When comparing a status to BAD, the expression evaluates to TRUE if the status is <=63.

GOOD

If assigning GOOD to a parameter's status, the status is set to GoodNonCascade NonSpecific NotLimited (numeric value 128). 

When comparing a status to GOOD, the expression evaluates to TRUE if the status is GoodNonCascade (that is, in the range of (inclusive) 128 to 191).

To test a status for the entire range of GOOD statuses (GoodNonCascade and GoodCascade), use the greater than or equal to operator (>=). That is, the value is >= 128.

LIMITED_CONSTANT

When a status field is compared to LIMITED_CONSTANT using the equality operator (=), the result will be TRUE if the limit status is LIMITED_CONSTANT. 

LIMITED_HIGH

When a status field is compared to LIMITED_HIGH using the equality operator (=), the result will be TRUE if the limit status is LIMITED_HIGH.

LIMITED_LOW

When a status field is compared to LIMITED_LOW using the equality operator (=), the result will be TRUE if the limit status is LIMITED_LOW. 

UNC

If assigning UNC to a parameter status, the status is set to Uncertain NonSpecific NotLimited (numeric value 64).

When comparing a status to UNC, the expression evaluates to TRUE if the status has a value in the range of (inclusive) 64 to 127.

Named State Constants

Named state constants are members of named sets in the form: '<named set name>: <named state name>'. For example to use the Tripped state of an LSCEM block use '$CEM_state:Tripped'.