6 - 29 6 - 29
MELSEC-Q/QnA
6 BASIC INSTRUCTIONS
(2) The values for
S
and
D
can be between 0 to 9999 (BCD 4-digit).
(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
S
or
D
BCD data is outside the 0 to 9999 range. (Error code: 4100)
[Program Example]
(1) The following program adds BCD data 5678 and 1234, stores it at D993, and at the same time
outputs it to from Y30 to Y3F.
[Ladder Mode]
Stores 5678 at D993
Adds BCD 1234 and D993, and
stores the result in D993
Outputs data at D993 to Y30 to Y3F
[List Mode]
Steps
Instruction
Device
(2) The following program subtracts the BCD data 4321 from 7654, stores the result at D10, and
at the same time outputs it to Y30 to Y3F.
[Ladder Mode]
Stores 7654 at D10 as BCD
Subtracts data in D10 from BCD
4321 and stores result at D10
Outputs data at D10 to Y30 to Y3F
[List Mode]
Steps
Instruction
Device
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com