4 - 14 4 - 14
4 ST PROGRAM EXPRESSIONS
(c) When function is used in integer expression
CASE DINT_TO_INT (dData) OF
1:
(* If DINT_TO_INT (dData) is 1
*)
D1 : = 0; (* 0 is assigned to D1.
*)
2, 3:
(* If DINT_TO_INT (dData) is 2 or 3
*)
D1 : = 1; (* 1 is assigned to D1.
*)
4..6:
(* If DINT_TO-INT(dData) is any of 4 to 6
*)
D1 : = 2; (* 2 is assigned to D1.
*)
ELSE
(* If DINT_TO_INT (dData) is other than the above
*)
D1 : = 3; (* 3 is assigned to D1.
*)
END_CASE;
Precaution for use of integer selection
When a CASE conditional statement has multiple values of the same integer
selection, the statement on the upper line is executed with priority and the latter
statement having the same integer selection is not executed. For example,
when the D100 value is 3 in the following CASE conditional statement,
statement 3 having integer selection 3 is executed and statement 4 having the
same integer selection is not executed.
CASE D100 OF
1:
< Statement 1 ...>
2:
< Statement 2 ...>
3:
< Statement 3 ...>
3, 4:
< Statement 4 ...>
ELSE
< Statement 5 ...>
END_CASE;
To specify the <integer selection *>, only a decimal number without K
specification can be used.
Содержание MELSEC L series
Страница 1: ...Programming Manual Structured Text ...
Страница 2: ......
Страница 73: ...4 33 4 33 4 ST PROGRAM EXPRESSIONS MEMO ...
Страница 297: ......