2
-
43
(1) Inputting numeric values externally to the CPU module
When setting a numeric value to the CPU module externally using a digital switch, BCD (binary-coded decimal)
can be used as DEC (decimal) by the method given in (b).
(a) Numeric values used inside the CPU module
The CPU module performs program operations in binary.
If the value set in binary-coded decimal is used without conversion, the CPU module performs program
operations regarding the set value as binary.
Therefore, the program operations are not performed correctly. (
(b) Using any numeric data regardless of the data type
To convert the data set in binary-coded decimal into binary, which can be used in the CPU module, use the BIN
instruction.
The BIN instruction allows the CPU module to use any external numeric data regardless of the data type.
Remark
For details of the BIN instruction, refer to the following.
MELSEC-Q/L Programming Manual (Common Instruction)
Figure 2.44 Inputting data from a digital switch to the CPU module
[Setting numeric data]
Digital switch
XF
X0
to
4
3
2
1
CPU module
Input data in BCD.
BIN data
BINP K4X0 DO
BCD D5 K4Y30
Содержание 00JCPU
Страница 1: ......
Страница 2: ......
Страница 96: ...2 51 2 4 5 Character string data 1 Definition The CPU module uses shift JIS code character strings...
Страница 541: ......
Страница 542: ......