Sign in to follow this  
Followers 0
I_rock_well

Trying to understand FIFO

5 posts in this topic

I would like to store values in an array, in a way that makes sure that the newest data point is always in myArray[0], the second newest in myArray[1] and so forth. FFL seems to do the trick, but only until it is full. If I try to use FFU to unload it, I can not keep it to storing the newest value in myArray[0]. I tried resetting the control bit, moving and copying a zero, or a bool with value zero into the .dn and .em bits, but nothing seems to help.

I am very grateful for any suggestions, this starting to get frustrating. I do not care what happens to the oldest data, and my goal is to display the data on an HMI.

Share this post


Link to post
Share on other sites

You did not mention which CPU you are using. Looking at the Reference Manual for the Micrologix 1100 FFL instruction I can see that the newest entered data is at one address less than the current 'position' (it points to the next available storage address.) From your description of the operation as you view it it doesn't sound like you are using this CPU as (in the ML1100) the newest value is being stored in incrementally higher addresses.

Please state your CPU.

Share this post


Link to post
Share on other sites
27 minutes ago, b_carlton said:

You did not mention which CPU you are using. Looking at the Reference Manual for the Micrologix 1100 FFL instruction I can see that the newest entered data is at one address less than the current 'position' (it points to the next available storage address.) From your description of the operation as you view it it doesn't sound like you are using this CPU as (in the ML1100) the newest value is being stored in incrementally higher addresses.

Please state your CPU.

I am using a Controllogix CPU. Not at work so I can't double check, but I think it's a L73 running firmware 20.xx.

Share this post


Link to post
Share on other sites

I just checked into the Ladder Logic implementation of FFL on a Logix 5000 unit. It follows the same method . To keep MyArray[0] as the last loaded information (and target for the next load) you will have to roll your own.

You SHOULD have seen for sequential FFL - use different data for each to differentiate -  (with no FFU) the data going to MyArray[0] then MyArray[1] then MyArray[2] etc. This would continue until the array is full (.DN bit in the control turns ON). At that point you have to perform at least one FFU before being able to do another FFL.

Share this post


Link to post
Share on other sites

Try fixing the POS value of the control, and doing the FFL and FFU.  You should see the older data scrolling up the array (towards array[0]).  The new data will always be in the expected position in the MyArray[ControlTag.POS].  Then MOV or COP or CPS the MyArray[ControlTag.POS] to another memory location for display. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0