Mitsubishi MELSEC QCPU Programming Manual page 184

Programmable logic controller
Table of Contents

Advertisement

6 BASIC INSTRUCTIONS
(2) The values for
(3) The following will result if an underflow is generated by the subtraction operation:
The carry flag in this case does not go ON.
[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
[Program Example]
(1) The following program adds the BCD data 12345600 and 34567000, stores the result at D887
and D888, and at the same time outputs them to from Y30 to Y4F.
[Ladder Mode]
[List Mode]
Steps
Instruction
(2)The following program subtracts the BCD data 98765432 from 12345678, stores the result at
D100 and D101, and at the same time outputs it from Y30 to Y4F.
[Ladder Mode]
[Ladder Mode]
Steps
6 - 33
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
and
can be between 0 to 99999999 (BCD 8-digit).
S
D
-
1
2
3 4 5 6 7 8
1
or
BCD data is outside the 0 to 99999999 range. (Error code: 4100)
D
Device
Instruction
Device
2
3 4 5 6 7 9
9
9
9 9 9 9 9 9
Stores 12345600 at D887,D888 as BCD
Adds BCD 34567000 and D887,D888
and stores the result in D887,D888
Outputs data at D887,D888 to Y30 to Y4F
Stores 98765432 at D100,D101 as BCD data.
Subtracts 12345678 from data in D100,D101
and stores result as BCD data at D100,D101
Outputs data at D100,D101 to Y30 to Y4F
MELSEC-Q/QnA
6 - 33

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec qnacpuMelsec q modeMelsec q series

Table of Contents