M800V/M80V Series PLC Programming Manual (1/2)
8 Function Instructions
8.10 Character String Processing Instructions
Operation errors
In the following cases, an arithmetic error occurs, the error flag (SM0) turns ON, and an error code is stored at SD0.
- A character other than "0" to "9" is put in the data of (S). (Error code: 34)
- The range of the device designated by (S) exceeds the relevant device range. (Error code: 82)
Program example
The following program converts the sign and the decimal ASCII data set to D20 to D22 to BCD 4-digit data, and stores the
result of the conversion at D0.
SM400
0
4
b15
D20
34H(4)
D21
34H(4)
The following program converts the decimal ASCII data set to D20 to D23 to BCD 8-digit data, and stores the result of the
conversion at D10 and D11, and also stores it at D0 and D1.
SM400
0
7
b15
34H(4)
D20
D21
37H(7)
39H(9)
D22
D23
39H(9)
" 4972949"
[Ladder mode]
DABCDP D20 D0
END
[Operation]
b8b7
20H
(space)
39H(9)
" 494"
[Ladder mode]
DDABCDP D20 D10
DMOV D10 D0
END
[Operation]
b8b7
b0
(space)
20H
39H(9)
(Regarded as
04972949)
32H(2)
34H(4)
Steps
Inst.
0
LD
1
DABCDP
4
END
b0
0
(Regarded as 0494)
Steps
Inst.
0
LD
1
DDABINP D20
4
DMOV
7
END
D11
D10
0 4 9 7 2 9 4 9
BCD value
329
[List mode]
Device
SM400
D20
D0
D0
4
9
4
BCD value
[List mode]
Device
SM400
D10
D10
D0
DMOV
D0
D1
0 4 9 7 2 9 4 9
BCD value
IB-1501667-B