fifo help in rslogix 500 please

You really don't want to use a bit-shift register because you are dealing with 20 word values, not individual bits. I don't see any easy efficient way to use bit-shift registers for this problem.

The FIFO instructions are effectively word-shift registers. An alternative in some cases is using the COPY instruction with indirect addressing.
 
Last edited:
I typically put the FFU right before the FFL, if I am keeping a full size queue. XIC DN, FFU, next rung or branch will be the FFL logic. No need to unload anything until right before you need space, it keeps the DN bit true for a full scan which is handy. If you are unloading until the que is empty, you can condition the FFU with the (XIO) .EM bit (empty bit)...it is a bit tidier than GRT R6:0.pos 0.
 
Last edited:
I was thinking of a word register, not a bit register.

A word shift register CAN take more instructions than a FIFO depending on how the values are shifted. Even so the more involved technique isn't that bad, it's just a couple of copy instructions. As in:

BST COP N7:0 N7:10 9 NXB COP N7:10 N7:1 9 NXB MOV N7:20 N7:0 BND

This will move values 'up' one position (0 to 1, 1 to 2, etc.) and insert the new/latest value, N7:20, at position 0. You must include conditioning logic such that the rung is executed only once per shift impulse. Otherwise it'll operate on every scan and shift your data out toot sweet! This assumes the ten values of interest reside in N7:0 thru N7:9.

The alternate method is just one COP and a MOV:

BST COP N7:1 N7:0 9 NXB MOV N7:20 N7:9

This shifts the data 'down' in the register and puts new data in at the top, N7:9.
 
The FFL and FFU instructions are used together. The FFL loads logic words into a user created file called a FIFO stack. The FFU instruction is used to unload the words from the FIFO stack, in the same order as the words were entered. The first word entered is the first word out.
 
Can the floats be used in FFL source. Or will I have to move the valve into a N. Also on the unload am I ment to see the N moved to the unload N
 
Can the floats be used in FFL source?
No, not in the FIFO instructions, but Floating-Point numbers can be used in the COP instruction (which can be used as a word-shift instruction).

Also on the unload, am I meant to see the N moved to the unload N?
Only if you pause the action (or save the intermediate value) long enough to go look at the value before it gets erased by the next instruction (proabably another FFU).
 
hi guys
I am having issues with the unloading of the fifo it only unloads 1 I thought it will unload the length say 5 values?
can you look at the bit map and see what I have done wrong . thanks stu

LINEC FIFO.jpg
 
A FFU unloads only one word for EACH TIME it is enabled. The PLC will only do one FFU (and one FFL) when your FINAL WATER WEIGHED bit goes from off to on. If FINAL WATER WEIGHED goes on and stays on, then only one FFU and one FFL will happen.

Your logic looks a little screwy. I have never had a need to do both a FFU and FFL in the same rung. Usually the condition that triggers a FFL is totally DIFFERENT from the condition that triggers the FFU. The idea is that stuff is accumulated in a stack using the FIFO Load (FFL) command, then later and under other circumstances, that same data is Unloaded to another location in the "First In is the First Out" order. In other words, one bit causes the Load, but another different trigger bit later causes the Unload. One of the most commonly used unload trigger bits is XIO R6:0/DN (the FIFO still contains data because it is not Done), where R6:0 is the FIFO Control word.
 
Last edited:
One of the most commonly used unload trigger bits is XIO R6:0/DN (the FIFO still contains data because it is not Done), where R6:0 is the FIFO Control word.
Correction: My old memory is faulty. It is "XIO R6:0.POS NEQ 0" (FIFO stack Position is not 0) which is commonly used to indicate that the FIFO stack still has data that has not been Unloaded. You may need to combine that comparison with some other trigger bit that will always produce an off-to-on transition.

Looking at the FFL and FFU as 2 parts that always happen together and triggered by the same bit is a common mistake. There are situations where it makes sense to do a Unload immediately after a Load, but in the real world, the big advantage of using a FIFO stack is that the Unload can occur much later, and for a completely unrelated reason, than the Load.
 
Last edited:
The ONS bit also makes sure that you only get one each of FFU, FFL, and the MOVe. Probably the MOV is the reason you put in the ONS, so put MOV on a separate rung along with the ONS.

Also you are resetting R6:0 after the FFU. Because you use the same R6:0 Control word for the FFL, then when it is reset, all the data in the common R6:0 disappears, setting your FIFO stack back to the beginning.
 
The ONS bit also makes sure that you only get one each of FFU, FFL, and the MOVe. Probably the MOV is the reason you put in the ONS, so put MOV on a separate rung along with the ONS.

Also you are resetting R6:0 after the FFU. Because you use the same R6:0 Control word for the FFL, then when it is reset, all the data in the common R6:0 disappears, setting your FIFO stack back to the beginning.


Thanks for the reply , that's does seem logical I know I did something wrong but couldn't pin point it I will give it a go tonight
Thanks again for all your help ,Stu
 
Also you are resetting R6:0 after the FFU. Because you use the same R6:0 Control word for the FFL, then when it is reset, all the data in the common R6:0 disappears, setting your FIFO stack back to the beginning.
Lancie1 is correct about setting the FIFO to an initial unloaded state (although any previously loaded data remains, it will just be overwritten when new operations begin).

Why is the FIFO being reset?
 
I thought that's what I'd need to do do when the fifo it's 5 it will reset back to 0 and start again ?
 

Similar Topics

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...
Replies
5
Views
2,695
Hey guys, I have a scenario where I need to fill a data register with characters, likely alpha numeric. Lets say I have 4 momentary push...
Replies
4
Views
1,972
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,573
Hey, I am trying to implement a FIFO as a sort of memory option when I am trying to log the last 30 values of a variable. Due to the lack of...
Replies
10
Views
4,272
I have read the various threads on the FFU/FFL uses. I am trying to chase down an issue I am having with a program one of my predecessors wrote. I...
Replies
15
Views
3,796
Back
Top Bottom