4 - 11 4 - 11
4 ST PROGRAM EXPRESSIONS
[Description example]
(a) When actual devices are used in Boolean expressions
IF D0 < 100 THEN
(* If D0 is less than 100
*)
D1 : = 0;
(* 0 is assigned to D1.
*)
ELSIF D0 <= 200 THEN
(* If D0 is less than or equal to 200
*)
D1 : = 1;
(* 1 is assigned to D1.
*)
ELSIF D0 <= 300 THEN
(* If D0 is less than or equal to 300
*)
D1 : = 2;
(* 2 is assigned to D1.
*)
END_IF;
(b) When operators are used in Boolean expressions
IF (D0*D1) < 100 THEN
(* If D0*D1 is less than 100
*)
D1 : = 0;
(* 0 is assigned to D1.
*)
ELSIF (D0*D1) <= 200 THEN (* If D0*D1 is less than or equal to 200 *)
D1 : = 1;
(* 1 is assigned to D1.
*)
ELSIF (D0*D1) <= 300 THEN (* If D0*D1 is less than or equal to 300 *)
D1 : = 2;
(* 2 is assigned to D1.
*)
END_IF;
(c) When functions are used in Boolean expressions
IF INT_TO_BOOL (D0) = TRUE THEN
(* If INT_T0_BOOL (D0) is *)
(*
TRUE
*)
D1 : = 0;
(* 0 is assigned to D1.
*)
ELSIF INT_TO_BOOL (D0) = TRUE THEN (* If INT_T0_BOOL(D2) is *)
(*
TRUE
*)
D1 : = 1;
(* 1 is assigned to D1.
*)
END_IF;
Summary of Contents for MELSEC L series
Page 1: ...Programming Manual Structured Text ...
Page 2: ......
Page 73: ...4 33 4 33 4 ST PROGRAM EXPRESSIONS MEMO ...
Page 297: ......