7-216
VAL(P ),DVA L(P)
Program Example
(1) The following program reads the character string data stored from D20 to D22 as an integer,
converts it to a BIN value, and stores it at D0 when X0 is ON.
[Ladder Mode] [List Mode]
[Operation]
(2) The following program reads the character string data stored from D20 to D24 as an integer,
converts it to a BIN value, and stores it at D0 when X0 is ON.
[Ladder Mode] [List Mode]
[Operation]
Step Instruction Device
D21
D22
D23
2DH ( )31H (1)
36H (6)2EH (.)
b15 b8b7 b0
35H (5)34H (4)
D20
00H
1654D0
6
2
D10
D11
Total number of digits
Number of digits in decimal fraction
00H
Set
Step Instruction Device
D21
D22
D23
20H(space)37H (7)
39H (9)31H (1)
b15 b8b7 b0
30H (0)30H (0)
D20
00H
10
3
D10
D11
Total number of digits
Number of digits in decimal fraction
00H
2EH (.)36H (6)
31H (1)31H (1)
D24
D25
79100611
D1 D0
Set