Can FIFO and LIFO instructions be used on the same data structure in Rockwell PLCs?

373 Views Asked by At

I'm programming a Rockwell Automation Allen-Bradley Studio 5000 ControlLogix PLC.

I'm using FIFO instructions on an array, and I have a situation where I would like to unload either the First In or the Last In, depending on the circumstances. Rockwell has both FIFO instructions (FFL and FFU) and LIFO instructions (LFL and LFU).

I have two questions:

  1. Is there any reason why I can't use both an FFU and an LFU on the same structure?

  2. FFL and LFL (the two load instructions) appear to do exactly the same thing. Is there any difference between the two instructions?

1

There are 1 best solutions below

0
Claus Nielsen On

You can, just use the same control tag. The control tag keeps track of the current stack/queue size and the FFL, FFU, LFL and LFU instructions will update it when triggered.

Remember that Logix only ensures 32 bit integrity so make sure the instructions can't overlap if called from different tasks.