Mitsubishi Electric MELSEC Q Series Programming Manual page 49

Structured text
Hide thumbs Also See for MELSEC Q Series:
Table of Contents

Advertisement

4 ST PROGRAM EXPRESSIONS
4 - 9
(2) IF ... ELSE conditional statement
[Format]
IF <Boolean expression> THEN
<Statement1 ... >
ELSE
<Statement2 ... >
END_IF;
[Explanation]
Statement 1 is executed when the Boolean expression (conditional
expression) is TRUE.
Statement 2 is executed if the value of the Boolean expression is FALSE.
Conditional
expression
TRUE
Statement 1
[Description example]
(a) When actual device is used in Boolean expression
IF X0 THEN
D0 : = 0;
ELSE
D0 : = 1;
END_IF;
(b) When operator is used in Boolean expression
IF (D0*D1) <= 200 THEN
D0 : = 0;
ELSE
D0 : = 1;
END_IF;
(c) When function is used in Boolean expression
IF INT_TO_BOOL (D0) = FALSE THEN
D0 : = 0;
ELSE
D0 : = 1;
END_IF;
FALSE
Statement 2
(* If the X0 area is X0= TRUE, the meaning is *)
(* the same.
(* If X0 is ON, 0 is assigned to D0.
(* If X0 is not ON, 1 is assigned to D0.
(* If D0*D1 is less than or equal to 200
(* 0 is assigned to D0.
(* If D0*D1 is not less than or equal to 200 *)
(* 1 is assigned to D0.
(* If INT_T0_BOOL(D0) is FALSE
(* 0 is assigned to D0.
(* If INT_T0_BOOL(D0) is not FALSE *)
(* 1 is assigned to D0.
*)
*)
*)
*)
*)
*)
*)
*)
*)
4 - 9

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents