Omron SYSMAC C200HS Operation Manual page 220

Programmable controllers
Hide thumbs Also See for SYSMAC C200HS:
Table of Contents

Advertisement

BCD Calculations
Flags
Example
TR 0
00003
Address
00000
00001
00002
00003
00004
00005
210
ER:
Mi, M+1,Su, or Su+1 are not BCD.
Indirectly addressed DM word is non-existent. (Content of ∗DM word is
not BCD, or the DM area boundary has been exceeded.)
CY:
ON when the result is negative, i.e., when Mi is less than Su.
EQ:
ON when the result is 0.
The following example works much like that for single-word subtraction. In this
example, however, BSET(71) is required to clear the content of DM 0000 and
DM 0001 so that a negative result can be subtracted from 0 (inputting an 8-digit
constant is not possible).
25504
25504
HR 2100
Instruction
Operands
LD
00003
OUT
TR
CLC(41)
@SUBL(55)
HR
DM
0100
AND
25504
@BSET(71)
#
0000
DM
0000
DM
0001
CLC(41)
@SUBL(55)
DM 0100
@BSET(71)
DM 0000
DM 0001
CLC(41)
@SUBL(55)
DM 0000
DM 0100
DM 0100
Turned ON to indicate
negative result.
Address
Instruction
00006
CLC(41)
0
00007
@SUBL(55)
20
120
00008
LD
00009
AND
00010
OR
00011
OUT
Section 5-19
First
subtraction
HR 20
120
#0000
Second
subtraction
HR 2100
Operands
DM
0000
DM
0100
DM
0100
TR
0
25504
HR
2100
HR
2100

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents