Assignment :=

PLCopen motion icon

Operator - Variable assignment.

Inputs

Input

Data Type

Range

Unit

Default

Description

IN

ANY

 

 

 

Any variable or complex expression.

Outputs

Output

Data Type

Range

Unit

Description

Q

ANY

 

 

Forced variable.

Remarks

FBD Language Example

1 Fbd

FFLD Language Example

  • In the FFLD Language, the input rung (EN) enables the assignment.
    • The output rung keeps the state of the input rung.
  • The copy is executed only if EN is TRUE.
  • ENO has the same value as EN.

1 FFLD

IL Language Example

Op1: FFLD  IN   (* current result is: IN *)
ST  Q    (* Q is: IN *)
FFLDN IN1  (* current result is: NOT (IN1) *)
ST  Q    (* Q is: NOT (IN1) *)
FFLD  IN2  (* current result is: IN2 *)
STN Q    (* Q is: NOT (IN2) *)

ST Language Example

Q := IN; (* copy IN into variable Q *)
Q := (IN1 + (IN2 / IN 3)) * IN4; (* assign the result of a complex expression *)
result := SIN (angle); (* assign a variable with the result of a function *)
time := MyTon.ET; (* assign a variable with an output parameter of a function block *)

See Also

Parenthesis (  )