Mitsubishi MELSEC Q Series Programming Manual page 237

Common instruction 1/2
Hide thumbs Also See for MELSEC Q Series:
Table of Contents

Advertisement

(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 Error
(1) In the following case, an operation error occurs, the error flag (SM0) turns ON, and an error
code is stored into SD0.
• The
or
S
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]
[List Mode]
Instruction
Step
(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]
[List Mode]
Instruction
Step
0
0
0
1
0
BCD data is outside the 0 to 9999 range.
D
Device
Device
0
0
3
9
9
9
Stores 5678 in BCD to D993.
Adds 1234 in BCD to the value at D993,
and stores the result to D993.
Outputs the data in D993 to Y30 to Y3F.
Stores 7654 in BCD to D10.
Subtracts the value in D10 from 4321 in BCD,
and stores the result to D10.
Outputs the data in D10 to Y30 to Y3F.
B+(P), B-(P)
8
(Error code: 4100)
6-35
1
2
3
4
4
6
7
8

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents