FFL Reset

Using an FFL to load temperature values every second into array of 60. After it is done I am averaging those values to get a 1 minute rolling average. Once the FFL is done can I use a reset bit to put the position back to zero or do I have to use a MOV function? Also if there is an easier way of achieving this please let me know.
 
you can use FFU to shift the entire array towards zero, this clears .DN and the next FFL will put data at .POS
This^

In your case you don't really need the destination it would seem, so I guess you have to have a dummy tag to dump it to.

Maybe use the FIFO.DN bit to trigger the FFU that way it fills up before starting to unload.
 
I'm using an FFL/FFU pair to handle certain things in a press project. Stop time tracking, alarm history, etc. I use an FFL until the DN bit is true, then I also use an FFU.
 
Using an FFL to load temperature values every second into array of 60. After it is done I am averaging those values to get a 1 minute rolling average. Once the FFL is done can I use a reset bit to put the position back to zero or do I have to use a MOV function? Also if there is an easier way of achieving this please let me know.
either should work.

Be careful with the reset instruction if that one-second trigger is not a one-shot, as the reset also clears the .EN bit, and if that trigger sets the input rung to the FFL on the next scan cycle, then the fact that the .EN is 0 means the FFL will "detect" a rising edge and push the first temperature onto the FIFO even though one second has not passed since the previous second. For this reason, I would go with the MOV (or CLR).

A FFL's logic is available here (non-@OkiePC-safe link), but there is a (minor?) bug in that flowchart.

P.S. if you reset .POS to zero, whether by RESet, MOVe or CLR, then that is a 1-minute average, not a rolling average. To get a rolling average, once the FIFO's array is full (.DN value is 1), triggering an FFU before the FFL at each one-second trigger (as suggested by others) and recalculating the average at each second would make it a rolling average. That said, if you want a rolling (moving average) then you could use the MAVE instruction and skip all of the extra code.
 
either should work.

Be careful with the reset instruction if that one-second trigger is not a one-shot, as the reset also clears the .EN bit, and if that trigger sets the input rung to the FFL on the next scan cycle, then the fact that the .EN is 0 means the FFL will "detect" a rising edge and push the first temperature onto the FIFO even though one second has not passed since the previous second. For this reason, I would go with the MOV (or CLR).

A FFL's logic is available here (non-@OkiePC-safe link), but there is a bug in that flowchart.

P.S. if you reset .POS to zero, whether by RESet, MOVe or CLR, then that is a 1-minute average, not a rolling average. To get a rolling average, once the FIFO's array is full (.DN value is 1), triggering an FFU before the FFL at each one-second trigger (as suggested by others) and recalculating the average at each second would make it a rolling average. That said, if you want a rolling (moving average) then you could use the MAVE instruction and skip all of the extra code.
Wasn't aware of MAVE. That seems like a great solution to a common need.
 
Thank you all for the replies. I misspoke when I said moving average. It just needs to be a 1 minute average. I thought about using an FFU but once the average is taken I no longer need those values, and they can just be written over with the new values.
 
That said, if you want a rolling (moving average) then you could use the MAVE instruction and skip all of the extra code.
Using MAVE if you wanted a 60 second average would the best way be to set a sample size of 60 and use a 1 second blinker to cycle the EnableIn?

Edit: It would probably make more sense just to have the function block in a 1000ms period task.
 
Thank you all for the replies. I misspoke when I said moving average. It just needs to be a 1 minute average. I thought about using an FFU but once the average is taken I no longer need those values, and they can just be written over with the new values.
then you want the reset or the mov/clr.
 

Similar Topics

Hi all, I'm trying to build a first-in/first-out sequence for different sectors using FFLs and FFUs, but I'm having trouble with it. Basically...
13
Replies
2,475
Views
I have a pick and place system. Where a robot(R01) drops parts in 3 different locations .R02 picks the part from any one of the locations. I want...
9
Replies
2,059
Views
I have a project that is loading pallets into 10 test bays and then unloading them when the test is complete. I am using an array to store which...
3
Replies
685
Views
EDIT: I suppose i should mention, RSLogix 500 V8.40, SLC 5/04 (1747-L542C) Is there is a way to use the FFL instruction in a way that doesn't...
4
Replies
1,799
Views
So once again i am trying to create a program in unity pro from an Ab program. i have an FFL and FFU in rslogix 500 and need to use something like...
2
Replies
2,923
Views
Top