Two-Way Radio User Manual

3. Instruction Set
3-65
Program example 1:
1. When M1168 = OFF (in BCD mode) and X0 = ON, the 4
th
(thousand) and 3
rd
(hundred) digit
of the decimal value in D10 start to move to the 3
rd
(hundred) and 2
nd
(ten) digit of the
decimal value in D20. 10
3
and 10
0
of D20 remain unchanged after this instruction is executed.
2. When the BCD value exceeds the range of 0 ~ 9,999, PLC detects an operation error and will
not execute the instruction. M1067, M1068 = ON and D1067 stores the error code OE18
(hex).
SMOV
M1168
D10 K2 D20
K3
K4
10
3
10
2
10
1
10
0
10
3
10
2
10
1
10
0
No variation No variation
D10(BIN 16bit)
D10(BCD 4 digits)
D20(BIN 16bit)
D20(BCD 4 digits)
Shift move
Auto conversion
Auto conversion
M100
1
X0
If D10 = K1234, D20 = K5678 before execution, D10 remains unchanged and D20 = K5128
after execution.
Program example 2:
When M1168 = ON (in BIN mode) and SMOV instruction is in use, D10 and D20 will not be
converted in BCD format but be moved in BIN format (4 digits as a unit).
SMOV
M1168
D10 K2 D20 K3K4
No variation No variation
D10(BIN 16bit)
D20(BIN 16bit)
Shift move
M1000
X0
Digit 4 Digit 3 Digit 2 Digit 1
Digit 4 Digit 3 Digit 2 Digit 1
If D10 = H1234, D20 = H5678 before execution, D10 remains unchanged and D20 = H5128 after
execution.