Mitsubishi Electric MELSEC Q Series Programming Manual page 54

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

Advertisement

4 ST PROGRAM EXPRESSIONS
4 - 14
(c) When function is used in integer expression
CASE DINT_TO_INT (dData) OF
1:
D1 : = 0; (* 0 is assigned to D1.
2, 3:
D1 : = 1; (* 1 is assigned to D1.
4..6:
D1 : = 2; (* 2 is assigned to D1.
ELSE
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.
(* If DINT_TO_INT (dData) is 1
(* If DINT_TO_INT (dData) is 2 or 3
(* If DINT_TO-INT(dData) is any of 4 to 6
(* If DINT_TO_INT (dData) is other than the above
*)
*)
*)
*)
*)
*)
*)
*)
4 - 14

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents