The leader in industrial automation and control solutions

Instruction Parameters

Supported PLC Series

PLC-AESPLC-FBPLC-ES

Supported Data Registers

MXYKLFTCSZRQD@DConstant
DEV
TBL

Supported Flags

FlagBitSupport
ErrorF11.0
ZeroF11.1
CarryF11.2

Number of Steps

Steps
3

Operands

OperandDescription
DEVThe first operand.
Entries are WORD data registers or constants.
This is the storage location for the first value read.
TBLThe 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.

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.

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

Ladder Diagram Example for MapleLogic FIFR/FIFRP instruction.
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).

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

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.

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 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

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.

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

Ladder Diagram Example for MapleLogic FIFR/FIFRP instruction.
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).

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.

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.

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 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.