Example - Ladder Diagram
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.
Ladder Diagram Example
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.
Ladder Diagram Example
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.