7.10. Logical Expression

Logical Expression can be done on front-end tag field, and it is achieved by putting a leading dollar sign ($) in front of a tag name. IntegraXor supports simple mathematic calculation to full fledge complicated logic operation. Tagname must be compliant to Variable Naming convention or the result will be unpredictable, i.e. contains no operation symbol like dash or asterisk etc, and shall not start with a number. A bad example is such that a dash in a tag name will be treated as minus.

Expression for front-end is handy to be used when a tag value need to be converted to different engineering unit or shown in different format. For instance a pressure value is received as bar and being used as it is through out the project, but need to be displayed in kPa in certain places. Then instead of entering the tag name directly, user may enter an expression like this: $tagname * 100 .

For a logical operation instance, a project requirement is such that a value need to be shown as zero at all time unless when a boolean tag has been turned on: ($tag_bool)? $tag_int: 0 . Another practical use of Expression is to display a default value when a tag is not initialized: $tag||1.01325 .

Expression being used in default template's overview.svg showing AM/PM based on current hour.

[Note] Note

Despite Expression being very convenient to be used, it does come with a price and that is it will impact the front-end performance in certain level, due to the nature that the logic will only be executed before viewing. So excessive use of Expression at front-end should be avoided on low performance CPU.