Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt
Image RemovedImage Added

Multi-line scripting language with syntax highlighting, usable in smart rules Equation, Formula and Script, and also in Modbus and Packet parser interfaces.

...

Code Block
SWITCH( MODBUSR(H, 168, UInt16),
  0, 0,
  0x0002, 1,
  0x0004, 2,
  0x0008, 3,
  0x0010, 4,
  0x0040, 5,
  0x0800, 6,
  NaN)

Loop

LOOP / WHILE ... repeats a series of commands based on a specified condition until that condition is met.
CONTINUE ... skips the execution of commands and continues to the next cycle.
BREAK ... terminates the loop.

Example with condition at the beginning:

Code Block
int i := 10;
while i > 0
    i := i - 1;
    
    if i > 5
        continue;
    else
        break;
    end
loop

Example with condition at the end:

Code Block
int i := 10;
do
    i := i + i;
loop while i < 10

NaN (not a number) value

NaN can be returned as a value in case real value is not known.

...