Instruction Parameters
Supported PLC Series
| PLC-AES | PLC-FB | PLC-ES |
|---|---|---|
| ✓ | ✓ | ✓ |
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 only DWORD data registers. This is the location of the data register to read a BOOL value from. |
| S2 | The second operand. Entries are only WORD data registers. This is the bit number to read of the data register, S1. The value range is 0 ~ 31. |
| D | The third operand. Entries are only BOOL data registers. This is the bit address of the data register to write the value read from the data register, S1. |
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.
Instruction Behavior
The DTEST and DTESTP instructions behave as follows:
- The value, S2, is value from 0 ~ 31.
- If the value, S2, is greater than 15, the remainder of S2 ÷ 32 is the equivalent.
- Example: if S2 = 34, the remainder is 2. This is the same as S2 = 2.
- If the value, S2, is greater than 15, the remainder of S2 ÷ 32 is the equivalent.
- If the BOOL data register, D, is 0, the status of the BOOL data register, D, is OFF.
- If the BOOL data register, D, is 1, the status of the BOOL data register, D, is ON.
Ladder Diagram Examples
DTEST

The DTEST instruction reads a BOOL value from the DWORD data register, S1, at the bit number, S2, and saves the result in an assigned BOOL data register, D.

When the contact, M1.0, is powered ON (1), the DTEST instruction examines the 21st bit of the data register, D30 and D31.

Since bit 21 is 1, the result BOOL data register, D33.0, is set to 1.
Memory Monitor

DTESTP

The DTESTP one-shot instruction reads a BOOL value from the DWORD data register, S1, at the bit number, S2, and saves the result in an assigned BOOL data register, D. Every time this instruction executes, it energizes the output only once.

When the contact, M2.0, is powered ON (1), the DTEST instruction examines the 30th bit of the data register, D40 and D41.

Since bit 30 is 0, the result BOOL data register, D43.0, is set to 0.
Memory Monitor

