03 Arithmetic operation
ADD/16-bit addition operation
ADD(P)
Add the BIN 16-bit data specified in (S1) and the BIN 16-bit data specified in (S2), and store the result in the device specified in (D).
-[ADD (S1) (S2) (D)]
Content, range and data type
| Parameter | Content | Range | Data type | Data type (label) |
| (S1) | Addition operation data or the device storing the addition data | -32768 to 32767 | Signed BIN16 | ANY16_S |
| (S2) | Addition operation data or the device storing the addition data | -32768 to 32767 | Signed BIN16 | ANY16_S |
| (D) | Device for storing operation results | Signed BIN16 | ANY16_S |
Device used
| Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||
| KnX | KnY | KnM | KnS | T | C | D | R | SD | K | H | [D] | XXP | ||
| ADD | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
| Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
| Parameter 3 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ||||
Features
Add the BIN 16-bit data specified in (S1) and the BIN 16-bit data specified in (S2), and store the result of the addition in the device specified in (D).

Related device
| Devices | Name | Content |
| SM151 | Carry | When the operation result exceeds 32,767, the carry flag will be (ON). |
| SM152 | Borrow | When the operation result is less than -32,768, the borrow flag will be (ON). |
| SM153 | Zero point | When the operation result is 0, the zero flag will be (ON). |

✎Note:
1.When the source operand and destination operand are specified as the same device:
The source operand and destination operand can also be specified as the same device number.
In this case, if you use continuous execution instructions (ADD, DADD), the result of the addition operation will change every operation cycle.
2.The difference between the ADD instruction and the INC instruction using the +1 addition operation program:
ADD[P] means that every time X001 changes from OFF to ON, the content of D0 is added by one operation.
Although this instruction is very similar to the INCP instruction described later, there are some differences in the following content.
| ADD/ADDP/DADD/DADDP instructions | INC/INCP/DINC/DINCP instructions | |||
| Flag bit (zero, borrow, carry) | Action | No action | ||
| Calculation result | 16-bit operation result | (S) + (+1) = (D) | 32767 → 0 → +1 → +2 → | 32767→-32768→-32767 |
| (S) + (-1) = (D) | ← -2 ← -1 ← 0 ← -32768 | —— | ||
32-bit operation result | (S) + (+1) = (D) | 2147483647 → 0 → +1 → +2 → | 2147483647 → -2147483648→ -2147483647 | |
| (S) + (-1) = (D) | ← -2 ← -1 ← 0 ← -2147483648 | —— | ||
Error code
| Error code | Content |
| 4085H | The output results of (S1) and (S2) in the read application instruction exceed the device range |
| 4086H | The output result of (D) in the write application instruction exceeds the device range |
Example

Add 10 to the data in (D0), and store the operation result in (D2), that is, (D0) + 10 → (D2).
DADD/32-bit addition operation
DADD(P)
Add the BIN32-bit data specified in (S1) and the BIN32-bit data specified in (S2), and store the result in the device specified in (D).
-[DADD (S1) (S2) (D)]
Content, range and data type
| Parameter | Content | Range | Data type | Data type (label) |
| (S1) | Addition data or the device storing the addition data | -2147483648 to 2147483647 | Signed BIN32 | ANY32_S |
| (S2) | Addition data or the device storing the addition data | -2147483648 to 2147483647 | Signed BIN32 | ANY32_S |
| (D) | Device for storing operation results | Signed BIN32 | ANY32_S |
Device used
| Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||||
| KnX | KnY | KnM | KnS | T | C | D | R | SD | LC | HSC | K | H | [D] | XXP | ||
| DADD | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
| Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
| Parameter 3 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ||||||
Features
Add the BIN32-bit data specified in (s1) and the BIN32-bit data specified in (s2), and store the result of the addition in the device specified in (d).

Related device
| Devices | Name | Content |
| SM151 | Carry | When the operation result exceeds 32,767, the carry flag will be (ON). |
| SM152 | Borrow | When the operation result is less than -32,768, the borrow flag will be (ON). |
| SM153 | Zero point | When the operation result is 0, the zero flag will be (ON). |

| ADD/ADDP/DADD/DADDP instructions | INC/INCP/DINC/DINCP instructions | |||
| Flag bit (zero, borrow, carry) | Action | No action | ||
| Calculation result | 16-bit Operation result | (S) + (+1) = (d) | 32767→0→+1→+2→ | 32767→-32768→-32767 |
| (S) + (-1) = (d) | ←-2←-1←0←-32768 | —— | ||
33-Bit operation result | (S) + (+1) = (d) | 2147483647→0→+1→+2→ | 2147483647→-2147483648→-2147483647 | |
| (S) + (-1) = (d) | ←-2←-1←0←-2147483648 | —— | ||
Error code
| Error code | Content |
| 4085H | The output results of (S1) and (S2) in the read application instruction exceed the device range |
| 4086H | The output result of (D) in the write application instruction exceeds the device range |
Example

Add 100000 to the data in (D1, D0), and store the result of the operation in (D3, D2), that is, (D1, D0) + 100000 → (D3, D2).
SUB/16-bit subtraction operation
SUB(P)
Subtract the BIN 16-bit data specified in (S1) and the BIN 16-bit data specified in (S2), and store the result in the device specified in (D).
-[SUB (S1) (S2) (D)]
Content, range and data type
| Parameter | Content | Range | Data type | Data type (label) |
| (S1) | The subtraction data or the device storing the subtraction data | -32768 to 32767 | Signed BIN16 | ANY16_S |
| (S2) | The subtraction data or the device storing the subtraction data | -32768 to 32767 | Signed BIN16 | ANY16_S |
| (D) | Device for storing calculation results | Signed BIN16 | ANY16_S |
Device used
| Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||
| KnX | KnY | KnM | KnS | T | C | D | R | SD | K | H | [D] | XXP | ||
| SUB | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
| Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
| Parameter 3 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ||||
Features
Subtract the BIN 16-bit data specified in (S1) and the BIN 16-bit data specified in (S2), and store the result of the operation in the device specified in (D).

Related device
| Devices | Name | Content |
| SM151 | Carry | When the operation result exceeds 32,767, the carry flag will be (ON). |
| SM152 | Borrow | When the operation result is less than -32,768, the borrow flag will be (ON). |
| SM153 | Zero point | When the operation result is 0, the zero flag will be (ON). |

✎Note:
1. When the source operand and destination operand are specified as the same device:
The source operand and destination operand can also be specified as the same device number.
In this case, if continuous execution type instructions (SUB, DSUB) are used, the result of the subtraction operation will change every operation cycle. Please be careful.
2. The difference between the SUB(P) instruction and the -(P) instruction and DEC(P) instruction executed by the -1 subtraction program
SUB(P) instruction every time X1 changes from OFF to ON, the program of D0 content -1 is similar to -(P) instruction and DEC(P) instruction described later, but the following contents are different.
| SUB/SUBP/DSUB/DSUBP instructions | DEC/DECP/DDEC/DDECP instructions | |||
| Flag bit (zero, borrow, carry) | Action | No action | ||
| Calculation result | 16-bit operation result | (S)-(+1)=(D) | ←-2←-1←0←-32768 | -32768→+32767→32766 |
| (S)-(-1)=(D) | +32767→0→+1→+2→ | —— | ||
| 32-bit operation result | (S)-(+1)=(D) | ←-2←-1←0←-2147483648 | -2147483648→2147483647→2147483646 | |
| (S)-(-1)=(D) | 2147483647→0→+1→+2→ | —— | ||
Error code
| Error code | Content |
| 4085H | The output results of (S1) and (S2) in the read application instruction exceed the device range |
| 4086H | The output result of (D) in the write application instruction exceeds the device range |
Example

Subtract 10 from the data in D0, and store the calculation result in D2, that is, (D0)-10 → (D2).
DSUB/32-bit subtraction operation
DSUB(P)
Subtract the BIN32-bit data specified in (S1) and the BIN32-bit data specified in (S2), and store the result in the device specified in (D).
-[DSUB (S1) (S2) (D)]
Content, range and data type
| Parameter | Content | Range | Data type | Data type (label) |
| (S1) | The subtraction data or the device storing the subtraction data | -2147483648 to 2147483647 | Signed BIN32 | ANY32_S |
| (S2) | The subtraction data or the device storing the subtraction data | -2147483648 to 2147483647 | Signed BIN32 | ANY32_S |
| (D) | Device for storing calculation results | Signed BIN32 | ANY32_S |
Device used
| Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||||
| KnX | KnY | KnM | KnS | T | C | D | R | SD | LC | HSC | K | H | [D] | XXP | ||
| DSUB | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
| Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
| Parameter 3 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ||||
Features
Subtract the BIN32-bit data specified in (S1) and the BIN32-bit data specified in (S2), and store the result of the operation in the device specified in (D).

Related device
| Devices | Name | Content |
| SM151 | Carry | When the operation result exceeds 2,147,483,647, the carry flag will be ON. |
| SM152 | Borrow | When the operation result is less than -2,147,483,648, the borrow flag will be ON. |
| SM153 | Zero point | When the operation result is 0, the zero flag will be ON. |

✎Note:
1. When the source operand and destination operand are specified as the same device:
The source operand and destination operand can also be specified as the same device number.
In this case, if continuous execution type instructions (SUB, DSUB) are used, the result of the subtraction operation will change every operation cycle. Please be careful.
2. The difference between the SUB(P) instruction and the -(P) instruction and DEC(P) instruction executed by the -1 subtraction program
SUB(P) instruction every time X1 changes from OFF to ON, the program of D0 content -1 is similar to -(P) instruction and DEC(P) instruction described later, but the following contents are different.
| SUB/SUBP/DSUB/DSUBP instructions | DEC/DECP/DDEC/DDECP instructions | |||
| Flag bit (zero, borrow, carry) | Action | No action | ||
| Calculation result | 16-bit operation result | (S)-(+1)=(D) | ←-2←-1←0←-32768 | -32768→32767→32766 |
| (S)-(-1)=(D) | +32767→0→+1→+2→ | —— | ||
| 32-bit operation result | (S)-(+1)=(D) | ←-2←-1←0←-2147483648 | -2147483648→2147483647→2147483646 | |
| (S)-(-1)=(D) | +2147483647→0→+1→+2→ | —— | ||
Error code
| Error code | Content |
| 4085H | The output results of (S1) and (S2) in the read application instruction exceed the device range |
| 4086H | The output result of (D) in the write application instruction exceeds the device range |
Example

Subtract 100000 from the data in (D1,D0), and store the result of the operation in (D3,D2), that is, (D1,D0)-10000 → (D3,D2).
MUL/16-bit multiplication
MUL(P)
Multiply the BIN16 bits specified in (S1) with the BIN16 bits specified in (S2), and store the result in the device specified in (D).
-[MUL (S1) (S2) (D)]
Content, range and data type
| Parameter | Content | Range | Data type | Data type (label) |
| (S1) | Multiplication operation data or the device storing multiplication operation data | -32768 to 32767 | Signed BIN 16 bit | ANY16_S |
| (S2) | Multiplication operation data or the device storing multiplication operation data | -32768 to 32767 | Signed BIN 16 bit | ANY16_S |
| (D) | Device for storing calculation results | Signed BIN 32 bit | ANY32_S |
Device used
| Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||||
| KnX | KnY | KnM | KnS | T | C | D | R | SD | LC | HSC | K | H | [D] | XXP | ||
| MUL | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ||
| Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |||
| Parameter 3 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ||||
Features
Multiply the BIN 16-bit data specified in (S1) with the BIN 16-bit data specified in (S2), and store the result of the operation in the device specified in (D).

(D) is the multiplication result in the case of bit device
• K1: lower 4 bits (B0 to B3)
• K4: Lower 16 bits (B0 to B15)
• K8: Lower 32 bits (B0 to B31)
Error code
| Error code | Content |
| 4085H | The output results of (S1) and (S2) in the read application instruction exceed the device range |
| 4086H | The output result of (D) in the write application instruction exceeds the device range |
Example

Multiply the data in (D0) by (D2), and store the operation result in (D5, D4), that is, (D0) × (D2) → (D5, D4).
DMUL/32-bit multiplication
DMUL(P)
Multiply the 32-bit BIN specified in (S1) and the 32-bit BIN specified in (S2), and store the result in the device specified in (D).
-[DMUL (S1) (S2) (D)]
Content, range and data type
| Parameter | Content | Range | Data type | Data type (label) |
| (S1) | Multiplication operation data or device storing multiplication operation data | -2147483648 to 2147483647 | Signed BIN 32 bit | ANY32_S |
| (S2) | Multiplication operation data or device storing multiplication operation data | -2147483648 to 2147483647 | Signed BIN 32 bit | ANY32_S |
| (D) | Device for storing calculation results | Signed BIN64 bit | ANY64_S |
Device used
| Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||||
| KnX | KnY | KnM | KnS | T | C | D | R | SD | LC | HSC | K | H | [D] | XXP | ||
| DMUL | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
| Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
| Parameter 3 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ||||
Features
Multiply the BIN32-bit data specified in (S1) and the BIN32-bit data specified in (S2), and store the result of the operation in the device specified in (D).

(D) is the multiplication result in the case of bit device
• K1: lower 4 bits (B0 to B3)
• K4: Lower 16 bits (B0 to B15)
• K8: Lower 32 bits (B0 to B31)
Error code
| Error code | Content |
| 4085H | The output results of (S1) and (S2) in the read application instruction exceed the device range |
| 4086H | The output result of (D) in the write application instruction exceeds the device range |
Example

Multiply the data in (D1, D0) by (D3, D2), and store the result of the operation in ((D7, D6), (D5, D4)), ie (D1, D0) × (D3, D2) → ((D7, D6), (D5, D4)).
DIV/16-bit division operation
DIV(P)
Divide the BIN 16-bit data specified in (S1) with the BIN 16-bit data specified in (S2), and store the result in the device specified in (D).
-[DIV (S1) (S2) (D)]
Content, range and data type
| Parameter | Content | Range | Data type | Data type (label) |
| (S1) | Division operation data or device storing division operation data | -32768 to 32767 | Signed BIN 16 bit | ANY16_S |
| (S2) | Division operation data or device storing division operation data | -32768 to 32767 | Signed BIN 16 bit | ANY16_S |
| (D) | Device for storing calculation results | Signed BIN 32 bit | ANY32_S |
Device used
| Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||||
| KnX | KnY | KnM | KnS | T | C | D | R | SD | LC | HSC | K | H | [D] | XXP | ||
| DIV | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ||
| Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |||
| Parameter 3 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ||||
Features
Divide the BIN 16-bit data specified in (S1) with the BIN 16-bit data specified in (S2), and store the result of the operation in the device specified in (D).

In the case of a word device, the division result uses a 32-bit storage quotient and remainder, and in the case of a bit device, only a 16-bit storage quotient is used.
• Quotient is stored in the lower 16 bits.
• The remainder is stored in the upper 16 bits. (Can only be stored in the case of word devices.)
✎Note
1. About the opearation result
• The highest bit of the quotient and remainder represents the sign of positive (0) and negative (1).
• When one of (S1) or (S2) is negative, the quotient becomes negative. When (S1) is negative, the remainder becomes negative.
2. The device specified by (D)
• With the digit specification function, when specifying a bit device, the remainder cannot be obtained.
Error code
| Error code | Content |
| 4080H | The input of divisor (S2) is 0 |
| 4085H | The output results of (S1) and (S2) in the read application instruction exceed the device range |
| 4086H | The output result of (D) in the write application instruction exceeds the device range |
Example

Divide the data in (D0) by (D2), and store the result of the calculation: the quotient is stored in (D4), and the remainder is stored in (D5), ie (D0)/(D2) → (D4 (quotient)) (D5 ( remainder)).
DDIV/32-bit division operation
DDIV(P)
Divide the BIN32-bit data specified in (S1) with the BIN32-bit data specified in (S2), and store the result in the device specified in (D).
-[DDIV (S1) (S2) (D)]
Content, range and data type
| Parameter | Content | Range | Data type | Data type (label) |
| (S1) | Division operation data or device storing division operation data | -2147483648 to 2147483647 | Signed BIN 32 bit | ANY32_S |
| (S2) | Division operation data or device storing division operation data | -2147483648 to 2147483647 | Signed BIN 32 bit | ANY32_S |
| (D) | Device for storing calculation results | Signed BIN64 bit | ANY64_S |
Device used
| Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||||
| KnX | KnY | KnM | KnS | T | C | D | R | SD | LC | HSC | K | H | [D] | XXP | ||
| DDIV | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
| Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
| Parameter 3 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ||||
Features
Divide the BIN32-bit data specified in (S1) with the BIN32-bit data specified in (S2), and store the result of the operation in the device specified in (D).

In the case of word devices, the division result uses BIN64 bits to store the quotient and remainder. In the case of bit devices, only the BIN 32-bit storage quotient is used.
✎Note:
1. About the operation result
• The highest bit of the quotient and remainder represents the sign of positive (0) and negative (1).
• When one of (S1) or (S2) is negative, the quotient becomes negative. When (S1) is negative, the remainder becomes negative.
2. The specified device of (D)
• With the digit specification function, when a bit device is specified, the remainder cannot be obtained.
Error code
| Error code | Content |
| 4080H | The input of divisor (S2) is 0 |
| 4085H | The output results of (S1) and (S2) in the read application instruction exceed the device range |
| 4086H | The output result of (D) in the write application instruction exceeds the device range |
Example

Divide the data in (D1, D0) by (D3, D2), and store the result of the calculation: the quotient is stored in (D5, D4), and the remainder is stored in (D7, D6), that is (D1, D0)/ (D3, D2) → (D5, D4) (quotient) (D7, D6) (remainder).
INC/16-bit data increment
INC(P)
Add one to the device (BIN 16-bit data) specified in (D).
-[INC (D)]
Content, range and data type
| Parameter | Content | Range | Data type | Data type (label) |
| (D) | The word device number that stores the data added by one | -32768 to 32767 | Signed BIN 16 bit | ANY16_S |
Device used
| Instruction | Parameter | Devices | Offset modification | Pulse extension | |||||||
| KnY | KnM | KnS | T | C | D | R | SD | [D] | XXP | ||
| INC | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
Add one to the device (BIN 16-bit data) specified in (D).

• If the INC(P) instruction is executed when the content of the device specified in (D) is 32767, -32768 will be stored in the device specified in (D).
• Flags (zero, borrow, carry) do not perform actions.
✎Note: If the continuous execution (INC) instruction is used, the addition operation will be performed every operation cycle, so care should be taken.
Error code
| Error code | Content |
| 4085H | The output results of (D) in the read application instruction exceed the device range |
| 4086H | The output result of (D) in the write application instruction exceeds the device range |
Example

Add one to the device value specified in D0, that is, (D0) + 1 → (D0).
DINC/32-bit data increment
DINC(P)
Add one to the device (BIN 32-bit data) specified in (D).
-[DINC (D)]
Content, range and data type
| Parameter | Content | Range | Data type | Data type (label) |
| (D) | The word device number that stores the data added by one | -2147483648 to 2147493647 | Signed BIN 32 bit | ANY32_S |
Device used
| Instruction | Parameter | Devices | Offset modification | Pulse extension | |||||||||
| KnY | KnM | KnS | T | C | D | R | SD | LC | HSC | [D] | XXP | ||
| DINC | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
Add one to the device (BIN 32-bit data) specified in (D).

• When the DINC(P) instruction is executed when the content of the device specified in (D) is 2147483647, -2147483648 will be stored in the device specified in (D).
• Flags (zero, borrow, carry) do not perform actions.
✎Note: If the continuous execution (INC) instruction is used, the addition operation will be performed every operation cycle, so care should be taken.
Error code
| Error code | Content |
| 4085H | The output results of (D) in the read application instruction exceed the device range |
| 4086H | The output result of (D) in the write application instruction exceeds the device range |
Example

Add one to the device value specified in (D1, D0), that is, (D1, D0) + 1 → (D1, D0).
DEC/16 bit data decrement
DEC(P)
Minus one for the device (BIN 16-bit data) specified in (D).
-[DEC (D)]
Content, range and data type
| Parameter | Content | Range | Data type | Data type (label) |
| (D) | The word device number that stores the data minus by one | -32768 to 32767 | Signed BIN 16 bit | ANY16_S |
Device used
| Instruction | Parameter | Devices | Offset modification | Pulse extension | |||||||
| KnY | KnM | KnS | T | C | D | R | SD | [D] | XXP | ||
| DEC | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
Minus one for the device (BIN 16-bit data) specified in (D).

• If the DEC(P) instruction is executed when the content of the device specified in (D) is -32768, 32767 will be stored in the device specified in (D).
• Flags (zero, borrow, carry) do not perform actions.
✎Note: If using continuous execution (DEC) instructions, subtraction will be performed every operation cycle, so care should be taken.
Error code
| Error code | Content |
| 4085H | The output results of (D) in the read application instruction exceed the device range |
| 4086H | The output result of (D) in the write application instruction exceeds the device range |
Example

Each time M0 is set, the value of the device specified in D0 will be -1, (D0)-1 → (D0).
DDEC/32-bit data decrement
DDEC(P)
Minus one for the device (BIN 32-bit data) specified in (D).
-[DDEC (D)]
Content, range and data type
| Parameter | Content | Range | Data type | Data type (label) |
| (D) | The word device number that stores the data minus by one | -2147483648 to 2147483647 | Signed BIN 32 bit | ANY32_S |
Device used
| Instruction | Parameter | Devices | Offset modification | Pulse extension | |||||||||
| KnY | KnM | KnS | T | C | D | R | SD | LC | HSC | [D] | XXP | ||
| DDEC | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
Minus one for the device (BIN 32-bit data) specified in (D).

If the DDEC(P) instruction is executed when the content of the device specified in (D) is 0, minus one will be stored in the device specified in (D).
• Flags (zero, borrow, carry) do not perform actions.
✎Note: If using continuous execution (DEC) instructions, subtraction will be performed every operation cycle.
Error code
| Error code | Content |
| 4085H | The output results of (D) in the read application instruction exceed the device range |
| 4086H | The output result of (D) in the write application instruction exceeds the device range |
Example

Minus one on the device value specified in (D1, D0), that is, (D1, D0)-1 → (D0).