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 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| DEV | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | – | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| TBL | – | – | – | – | – | – | – | – | – | ✓ | ✓ | ✓ | ✓ | ✓ | – |
Supported Flags
| Flag | Bit | Support |
|---|---|---|
| Error | F11.0 | ✓ |
| Zero | F11.1 | – |
| Carry | F11.2 | – |
Number of Steps
| Steps |
|---|
| 3 |
Operands
| Operand | Description |
|---|---|
| DEV | The first operand. Entries are WORD data registers or constants. This is the storage location for the first value read. |
| TBL | The second operand. Entries are only WORD data registers. This is the starting address for the table. |
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 data table exceeds the range of the corresponding data register.
Instruction Behavior
The FIFR and FIFRP instructions behave as follows:
- The oldest value, or first value, in TBL + 1 is read.
- The table will remove this value and decrease the overall amount by 1.
- The first value of TBL is an integer number representing the amount of data saved in TBL.
Ladder Diagram Examples
FIFR

The FIFR instruction reads the oldest, or first, WORD value from the table, TBL, and saves the result in an assigned WORD data register, DEV.

Currently, the data register, D10, has a value of 9. Additionally, the data register, D20, has a value of 0.


When the contact, M1.5, is powered ON (1), the FIFR instruction reads the first value in the TBL after the data register, D10 (D11).

As a result, the values of all resulting data registers, D13, D14, D15, D16, D17, D18, and D19, are shifted one data register less than their previous value. The last data register, corresponding to the value of the data register, D10, (D19) has the value set to 0. The value of the data register, D12, is saved in the data register, D20.

When the FIFR instruction executed again, the data register, D10, decreases by one to 7.

The value of each data register is shifted left by one. The value of the data register, D18, is saved in the data register, D20. The previous value saved in the data register, D20, is discarded.
FIFRP

The FIFRP one-shot instruction reads the oldest, or first, WORD value from the table, TBL, and saves the result in an assigned WORD data register, DEV. Every time this instruction executes, it energizes the output only once.

Currently, the data register, D30, has a value of 6. Additionally, the data register, D40, has a value of 0.


When the contact, M1.6, is powered ON (1), the FIFRP instruction reads the first value in the TBL after the data register, D30 (D31).

As a result, the values of all resulting data registers, D33, D34, D35, and D36, are shifted one data register less than their previous value. The last data register, corresponding to the value of the data register, D30, (D36) has the value set to 0. The value of the data register, D32, is saved in the data register, D40.

When the FIFRP instruction executed again, the data register, D30, decreases by one to 4.

The value of each data register is shifted left by one. The value of the data register, D35, is saved in the data register, D40. The previous value saved in the data register, D40, is discarded.
