Chapter 7 Second Development Platform VP3000
314
API Instruction code Operand Function
25 D DEC P D BIN decrement (subtract one)
Type
Operand
Bit devices Word devices
16-bit instruction (3 steps)
DEC
Continuous
execution
type
DECP
Pulse
execution
type
32-bit instruction (5 steps)
DECC
Continuous
execution
type
DDECP
Pulse
execution
type
Associated flag: none
X Y M K H KnX KnY KnM T C D
D
Caution for using operand: none
Description
D: destination devices
If the instruction is not a pulse execution one, the content in the designated device D will minus
“1” in every scan period whenever the instruction is executed.
This instruction adopts pulse execution instructions (DECP).
In 16-bit operation, -32,768 minus 1 and obtains 32,767. In 32-bit operation, -2,147,483,648
minus 1 and obtains 2,147,483,647.
Example
When X0 = OFFON, the content in D0 minus 1 automatically.
X0
D0DECP