Subtract Date
Instruction Parameters
Supported PLC Series
| XPnA/1R | XPnB | XPnE | XPnF | CP3A/B/P/U CP4A~D/U | CPnE | CPnF | BP | PLC-S |
|---|---|---|---|---|---|---|---|---|
| ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Supported Data Registers
| M | X | Y | K | L | F | T | C | S | Z | R | Q | D | @D | Constant | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| S1 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - | ✓ | - | ✓ | ✓ | ✓ | ✓ |
| S2 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - | ✓ | - | ✓ | ✓ | ✓ | ✓ |
| D | ✓ | - | ✓ | ✓ | ✓ | - | ✓ | ✓ | - | ✓ | - | ✓ | ✓ | ✓ | - |
Supported Flags
| Flag | Bit | Support |
|---|---|---|
| Error | F11.0 | ✓ |
| Zero | F11.1 | - |
| Carry | F11.2 | - |
Number of Steps
| Steps |
|---|
| 4 |
Operands
| Operand | Description |
|---|---|
| S1 | The first operand. Entries are WORD data registers or constants. This requires 3 data registers. The value range is 0 ~ 23 (hours) or 0 ~ 59 (minutes and seconds). |
| S2 | The second operand. Entries are WORD data registers or constants. This requires 3 data registers. The value range is 0 ~ 23 (hours) or 0 ~ 59 (minutes and seconds). |
| D | The third operand. Entries are only WORD data registers. This is where the difference is saved. This requires 3 data registers. |
Notice
Error Flag (F11.0) Notice
The error flag, F11.0, will be ON for one scan when the address of the data register assigned by @D exceeds the range of the data register, D. The range of the data register, D, is dependent on the CPU type.
F11.0 turns ON when the value of the data for subtracting exceeds the data register assigned to S1 or S2.
Instruction Behavior
The DATE+ and** DATE+P** instructions behave as follows:
- The value of S1 and S2 should follow this format:
- Hour: 0 ~ 23
- Minute: 0 ~ 59
- Second: 0 ~ 59
- The sum will be saved in the same format starting at the data register D.
- If the sum of S1 + S2 exceeds 24 hours, 24 hours will be added from the difference.
Tip: Operand Subtraction Format
S2 is subtracted from S1.
(S1 - S2)