6 - 31 6 - 31
MELSEC-Q/QnA
6 BASIC INSTRUCTIONS
(2) The values for
S1
,
S2
, and
D
can be between 0 to 9999 (BCD 4-digit data).
(3) The following will result if an underflow is generated by the subtraction operation:
The carry flag in this case does not go ON.
999800030001
-
[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
S1
,
S2
, or
D
BCD data is outside the 0 to 9999 range. (Error code: 4100)
[Program Example]
(1) The following program adds the D3 BCD data and the Z1 BCD data when X20 goes ON, and
outputs the result to Y8 to Y17.
[Ladder Mode] [List Mode]
Steps
Instruction Device
(2) The following program subtracts the BCD data at D20 from the BCD data at D10 when X20
goes ON, and stores the result at R10.
[Ladder Mode] [List Mode]
Steps
Instruction
Device
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com