6 - 77 6 - 77
MELSEC-Q/QnA
6 BASIC INSTRUCTIONS
[Operation Errors]
(1) In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
code is stored at SD0.
• The range n-points from the
S
or
D
device exceeds the relevant device.
• The data n-points at the
S
device is outside the 0 to 9999 range.
• The
S
and
D
devices overlap.
[Program Example]
(1) The following program converts BCD data the number of points from D100 corresponding to
the value stored at D0 to BIN data when X20 goes ON, and stores the result from D200
onward.
[Ladder Mode] [List Mode]
Steps
Instruction
Device
BIN conversions (when D0=3)
0 0 0 1 1 1 1 1 1 0 0 100 0 0
0 0 0 1 1 1 0 1 1 1 1 001 1 0
0 0 1 0 0 1 1 1 0 0 0 011 1 1
1 0 0 0 0 0 0 0 1 0 0 000 0 0
0 1 1 1 0 1 1 0 0 1 0 101 0 0
1 0 0 1 1 0 0 1 1 0 0 110 0 1
D200 BIN 8080
D202 BIN 9999
D201 BIN 7654
D100 BCD 8080
D102 BCD 9999
D101 BCD 7654
8192
4096
2048
1024
512
256
128
64
32
16
8
4
2
1
2000
1000
800
400
200
100
80
40
20
10
8
4
2
1
4000
8000
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com