EasyManua.ls Logo

Omron CP - PROGRAMMING MANUAL 05-2007 - Page 368

Omron CP - PROGRAMMING MANUAL 05-2007
1175 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
335
Increment/Decrement Instructions Section 3-9
Description The – –BL(597) instruction subtracts 1 from the 8-digit BCD content of Wd+1
and Wd. The content of the specified words will be decremented by 1 every
cycle as long as the execution condition of – –BL(597) is ON. When the up-
differentiated variation of this instruction (@– –BL(597)) is used, the content
of the specified words is decremented only when the execution condition has
gone from OFF to ON.
The Equals Flag will be turned ON if the result is 0000 0000 and the Carry
Flag will be turned ON when a digit changes from 0 to 9.
Flags
Precautions The content of Wd+1 and Wd must be BCD. If it is not BCD, an error will occur
and the Error Flag will be turned ON.
Examples Operation of – –BL(597)
In the following example, the 8-digit BCD content of D2001 and D2000 will be
decremented by 1 every cycle as long as CIO 0.01 is ON.
Index Registers ---
Indirect addressing
using Index Registers
,IR0 to ,IR15
–2048 to +2047, IR0 to –2048 to +2047, IR15
DR0 to DR15, IR0 to IR15
,IR0+(++) to ,IR15+(++)
,–(– –)IR0 to, –(– –)IR15
Area Wd
Wd+1 Wd Wd+1 Wd
Name Label Operation
Error Flag ER ON if the content of Wd+1 and Wd is not BCD.
OFF in all other cases.
Equals Flag = ON if the result is 0000 0000 after execution.
OFF in all other cases.
Carry Flag CY ON if a digit in Wd+1 or Wd went from 0 to 9 during exe-
cution.
OFF in all other cases.
D2000 D2001 D2000 D2001
0.01
D2000
CIO 0.01
Decrement Decrement Decrement Decrement
Wd:Wd+1: Wd:Wd+1:
1
Decremented every cycle
while CIO 0.01 is ON.
: Execution of − −BL(597)
0000 0000

Table of Contents

Related product manuals