FIFO Array Posistion

Hello,
Long time lurker, first time poster. I am working with a CompactLogix 5069, studio 5000 rev 32 and an Ignition HMI. I have 8 different part pick up locations (UDT) that are put into a FIFO array based on when a part was loaded. I would like to display the spot in the FIFO on each location on the HMI. What is the best way to extract each locations spot in the FIFO Array?
 
Does the program only use the FFL and FFU instructions to manipulate the FIFO?

Is the FIFO Length parameter in the FFL and FFU instructions constant?

By "extract each location[']s spot," do you mean keep track of where, i.e. at what index, in the FIFO each location's data reside?
 
Yes only the FFL and FFU Manage the FIFO. My end goal is to have a "Queue number" on the HMI on each pick up image so the operator knows the order of pick up.
 
Yes only the FFL and FFU Manage the FIFO. My end goal is to have a "Queue number" on the HMI on each pick up image so the operator knows the order of pick up.
When an FFL instruction triggers, the Source value is placed at offset .POS in the array. Caveat: specifically at the value of .POS before the FFL instruction triggers.

When an FFU instructions triggers, all of the values in the FIFO array, from index/offset 1 onward, are moved one position toward index/offset 0 in the array.

So saving the .POS value as a location's queue number when that location is loaded onto the FIFO array, and decrementing all locations' queue numbers when the FFU is triggered should do what is desired.

The trick is to know when those events happen, and the .EN and .<I forget> bits of the FIFO 's CONTROL structure can be used for that.
 
I think the bit, that I could not remember, of the CONTROL structure is the .UL bit.

That said, the locations are presumably in the array, and there are only eight of them, so a couple of rungs could continuously look at the array value at index/offset N of the array, and update the queue number as N (or N+1, if ordinal position is desired) for that value (location) if N is less than or equal to . POS, then increment N's value and bit-wise AND the incremented N's value with 7, for the next scan cycle. It will take 8 scan cycles to update all locations' queue numbers after an FFL or FFU triggers, but that may be fast enough.
 
I think the bit, that I could not remember, of the CONTROL structure is the .UL bit.

That said, the locations are presumably in the array, and there are only eight of them, so a couple of rungs could continuously look at the array value at index/offset N of the array, and update the queue number as N (or N+1, if ordinal position is desired) for that value (location) if N is less than or equal to . POS, then increment N's value and bit-wise AND the incremented N's value with 7, for the next scan cycle. It will take 8 scan cycles to update all locations' queue numbers after an FFL or FFU triggers, but that may be fast enough.

FFU:
1751383415328.png

FFL:
1751383444723.png
 
The CONTROL structure is used for many instructions, including array processing and bit shifting. Not all members are used by every instruction. Interesting that Rockwell doesn't appear to document all the bits in one location. The .UL member represents the state of the bit shifted out/unloaded with a BSR/BSL instruction.
1751384795484.png
 
The CONTROL structure is used for many instructions, including array processing and bit shifting. Not all members are used by every instruction. Interesting that Rockwell doesn't appear to document all the bits in one location. The .UL member represents the state of the bit shifted out/unloaded with a BSR/BSL instruction.
View attachment 78975

BSL:
1751385537510.png

The studio 5000 help files are where I have found the bits documented. They have examples and decent explanations as well. Just press F1 on any instruction and it will bring you to the help files.
 
Since there are so few positions, I would probably write code to check each element of the FIFO array to see what unload position is where and use that result to write a value to another array that the HMI looks at.

Several ways to attack it. I would probably use an FSC instruction for each unload position. Or use a single FSC instruction and programmatically change which unload position it's looking for.
 
Working prototype, RSLogix 500.

Caveat: depending how the PLC is "told" to push and pop values from the FIFO array, and especially with the asynchronous I/O of Logix, there may be edge conditions.
 

Attachments

  • 1751408633560.png
    1751408633560.png
    140.9 KB · Views: 9

Similar Topics

Hi All I am using a 42 dint array for a project. Im using a FSC instruction so if any values in the 42 dint array are lower then 32000 it will...
5
Replies
2,645
Views
I am using a distance laser to bring in an analog value. I have converted the value to inches and filling an array using FIFO using RSLogix 5000...
21
Replies
7,815
Views
Hello all, I need some guidance creating a FIFO array to display data into an HMI. The data will be the sum of jams of a conveyor section in an...
5
Replies
3,985
Views
Hello! New to this forum, but have read a lot of different threads. Anyway, I have a question for you all, I have played around with AB PLC's...
0
Replies
5,314
Views
Hi All Im using RSlogix 5000 and compactlogix. I need to store 2 bits of data to a register in the PLC, one is a time stamp from the wall...
12
Replies
16,115
Views
Top