Logix5000 FIFO manipulation

As mentioned earlier, I use UDT (1 string + 1 bool) for the FIFO.
The are set\reset from the HMI. Any suggestion on how to setup in plc such that only one bool out of the array can be set at the time? I.e. if one bool already set - disallow setting another, or reset the previous one and set the next.
The trouble I'm facing is that with the FFL and FFU instructions those bools are shifting as well (as I want them to), but I want to ensure only one is set at the time.
 
I am assuming that you are only adding to the array is with the FFL
If that’s the case then before you trigger the Load do a file search on the array and set a bool to true if any of the array elements are true
Then either don’t load the FIFO ir just set the bool in load tag to false
I would need more details on your application to full understand what you need
 
I am assuming that you are only adding to the array is with the FFL
If that’s the case then before you trigger the Load do a file search on the array and set a bool to true if any of the array elements are true
Then either don’t load the FIFO ir just set the bool in load tag to false
I would need more details on your application to full understand what you need

Correct me if I'm wrong, but FSC instruction doesn't work with BOOL arrays
 
I wouldn't use an FSC for this anyway to much overhead
set test tag to 0
set a simple loop for x = 0 to max array size
if array[x] = 1 set test tag to 1
x = x +1
loop
 
I wouldn't use an FSC for this anyway to much overhead
set test tag to 0
set a simple loop for x = 0 to max array size
if array[x] = 1 set test tag to 1
x = x +1
loop

A little more details on my setup.
UDT[100] (1string, 1bool) goes through FIFO - FFL and FFU. The data is stored in the string of the UDT. I use the bools to mark the string for removal or insertion (see above posts for details). This bool is (re)set on the HMI button for each UDT[x]. I want to ensure that pressing one button (setting one of the UDT[X].bool) resets all of the others.

Using your suggested method will indirectly cause the for loop to run every FFL and FFU. I just want to have one UDT[X].bool set, when done so through HMI. But I want to have the function native to PLC. In case someone does testing in the future without HMI.
 
May not be the most elegant solution, but solved with:


  1. get UDT[] FIFO size: FIFO_size

  • get last POS of FIFO: FIFO_size -1 = Last_POS

  • if none of the bools are selected: (all of the UDT[x].bool xic's ANDed)
    FIFO_Select_POS = FIFO_size

  • else:
    move the number associated with the set bool to FIFO_Select_POS

  • clear all bools

  • if 0<FIFO_Select_POS<Last_POS, set udt[FIFO_Select_POS].bool

The idea, if none of the bools are set POS=FIFO_size, else POS = the number associated with the bool position in the UDT[]. And obviously all of my functions before accessing the UDT[FIFO_Select_POS] make sure that 0<FIFO_Select_POS<Last_POS
 
Last edited:

Similar Topics

Hello Friends I need to save 2 tags (String and DINT) in a FIFO of 10 elements. When a programmed condition is true, this 2 tags should enter...
Replies
3
Views
4,556
Anyone know of an easy way to program a FIFO in function block for RSLOGIX500. There appears to be no instruction for this. I'm sure I can put...
Replies
4
Views
2,807
How do I make sure that I only push Unique elements into my FIFO (or I guess into an array)? Should I just write an AOI that loops through the...
Replies
2
Views
1,826
Hi! So my problem is a little funky, I had Studio 5000 v 24 and 30 installed, but forgot to install RSLogix (which I cannot go without). Is there...
Replies
1
Views
49
So I had an odd request from a customer for the above. I have written the logic and tested it all in one PLC with only using 7 outputs and 7...
Replies
15
Views
419
Back
Top Bottom