FIFO in RSLogix5000 help needed

asteroide

Member
Join Date
Jul 2010
Location
der
Posts
158
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 to the FIFO and the last element should go out (garbage). So, just 10 element should be in the FIFO.


I have done some tries with FFL and FFU instructions but without sucess.


Also, I have try to save just a tag (DINT), but without sucess. I have could save the values in the FIFO, but I am not sure how to displace the elements.


Somebody could help me?


Thanks in advance.
 
Post some logic?
Some possibilities:
1) The FFL and FFU instructions should reference the SAME control structure.
2) Try using a single one shot to clock in (and out) the values..

3) Use the .DN bit of the control structure to unload the FIFO, so that it only unloads when it is full (Position = Length).

[LAD]
ONS TriggerBit bst FFL (whatever) nxb ControlData.DN FFU (Whatever)
[/LAD]

FIFO's work fine in Logix 5000 with UDT's, so make an array of your UDT type with the String and DINT as the data members.
 
Please explain what is the source of the STRING tag that you want to store in your FIFO. If it is internal (i.e. the STRINGS are defined in the PLC), then you could just store a pointer DINT to the string data, instead of storing 10 string tags.

Back to your problem.... You could do this without the complexity of FFL/FFU instructions, by doing as rdrast suggests...

rdrast said:
FIFO's work fine in Logix 5000 with UDT's, so make an array of your UDT type with the String and DINT as the data members.

.. and then using simple COP instructions to "shift" the UDT array before inserting your new data. The array would need to be stored "backwards" (oldest data -> newest data) so that the shifting works correctly. This can be overcome if you can't have your records "backwards", but it would need a buffer array to temporarily store your data while shifting.

The screenshot shows this actually working - I have already entered 3 "records", with record 4 ready to be stored. You can see how "New" records are inserted at the "top" of the stack after the stack is shifted downwards.

Wrapping the COP instructions with UID and UIE ensures that the whole of the "shift/insert" is done without interruption, using CPS would be pointless, as the task could be interrupted in-between the CPS instructions.

2016-12-21_004635.jpg
 
Last edited:
Hello

The string is a barcode, I want to show the last 10 barcode readings.

I have used the logic that you posted and it is working. Just what I needed¡

Thanks a lot(y)
 

Similar Topics

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,813
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,830
I am not sure if this is possible but if there is a way, you guys would be the ones to know. I am currently working on a project where we are...
Replies
7
Views
226
Hello all, I'm using a 5069-L330ER in a project and I need to essentially capture some data that will be shown as a trend on a screen. The data...
Replies
9
Views
968
Hello! I have a network of conveyors bringing raw product to 4 machines. A sensor in the hopper of each machine calls for more product. I'm...
Replies
15
Views
5,888
Back
Top Bottom