Mathematical expressions

Mathematical expressions, functions and operators can be used in the realtime cycle. This applies to the condition of an $IF clause, for variable assignments, etc.

Programing Example

prg_example

Examples of mathematical expressions in the realtime cycle

; Define realtime cycle

#RT CYCLE [SCOPE = PROG]

  ; Expression in condition

  IF SQRT[7 * 5] < 12 * SIN[30]

    ; ...

  $ENDIF

  ; Assign value of a math. expression to external variable

  V.E.VALUE1 = 12 * SIN[V.E.VALUE2] + SQRT[33]

#RT CYCLE END

; End main program

M30