Parenthesis (  )

Operator - Force the evaluation order in a complex expression.

Remarks

These are the default evaluation priority order for ST language operations:

Priority

Operation

Description

1

- NOT

Unary operators

2

* /

Multiply / Divide

3

+ -

Add / Subtract

4

< > <= >= = <>

Comparisons

5

& AND

Boolean And

6

OR

Boolean Or

7

XOR

Exclusive OR

FBD Language Example

Not available.

FFLD Language Example

Not available.

IL Language Example

  • In the IL Language:
    • The default order is the sequence of instructions.
      • Each new instruction modifies the current result sequentially.
    • The opening parenthesis "(" is written between the instruction and its operand.
      • The closing parenthesis ")" must be written alone as an instruction without operand.
Op1: FFLDClosed "Free Form Ladder Diagram"(  IN1
     ADD( IN2
     MUL  IN3
     )
     SUB  IN4
     )
     ST   Q    (* Q is: (IN1 + (IN2 * IN3) - IN4) *)

ST Language Example

Q := (IN1 + (IN2 / IN 3)) * IN4;

See Also

Assignment :=