FFL/FFU Scan Question

JerryH

Member
Join Date
Mar 2009
Location
Tellico Plains,TN
Posts
110
When executing a FFU to unload the oldest value the data in the file is shifted down and the position value is changed. Does this shifting take place in the same scan or does it happen over multiple scans?

Jerry
 
When executing a FFU to unload the oldest value the data in the file is shifted down and the position value is changed. Does this shifting take place in the same scan or does it happen over multiple scans?
For the SLC 5/02 to 5/05, each time you trigger the FFU instruction, it unloads the oldest value in the stack (from the FIFO address). To unload 100 values, you would need to trigger your FFU 100 times. Each time you trigger the FFU, the POS indicator should decrement by 1.

In order to first have 100 values into the FFU, you have to trigger your FFL 100 times also, so that R6:xx.POS = 100. You can also load the FIFO values by other means, such as MOV or COP (but then the POS must be set manually).
 
Last edited:
The reason why I'm asking is I'm trying to build a trap to capture I/O to another device. With this setup I can have the last 100 I/O changes and can pick the bits apart and figure out what I sent out and what I received. It will help me trouble shoot a problem I'm having.

I'm assuming that the Fifo will update in one scan. If the Fifo takes multiple scans to update then the data I'm recording won't be realistic.

Here is a snippet of the program showing the I/O trap I made. Am I missing something or can anyone suggest a better way?

Jerry
 
sorry that I don't have time to go through your program - but if you're trying to collect data - and sort of "move it through an array" then you might find some helpful hints in the "ratchet" and/or "ripple" ideas covered in the TWO posts which start here:

http://www.plctalk.net/qanda/showthread.php?p=360484&postcount=3

either of these is usually easier to set up than the FIFO arrangement ...

good luck with your project ...
 
Hi Ron,
I have read many of your posts including the ones you referred me to. I think the SLC500 Fifo is extremely easy to implement so I use it quite often. I am just concerned about how fast it updates to be able to catch possible changes in I/O every scan.

I also like to setup rotary registers where I use a pointer to a data file. That way the data doesn't change, just the pointer each time.

Thanks for the advice, I would like to make this work though.

Jerry
 
a couple of thoughts that might help you experiment ...

try this rung on a SPARE (non-production) system ...

LBL -------] [----------JMP

basically you can put this under/after the FFL and/or FFU rungs ... and then have the same condition which executes those instructions also "trigger" this rung into operation ... this will FAULT the processor before it can start/run another scan ... then go back and examine the data which was handled by the FFL/FFU rungs – and you should be able to see just how those operations functioned ...

or ...

experiment with the idea shown below ... it's not as exciting as intentionally faulting the processor – but it basically lets you go step-by-step and rung-by-rung through the ladder file ... you can watch what the various instructions are doing ... note that only RSLogix500 has this ability ...

naturally this should also be done on a non-production system ...

.

single_step.PNG
 
I'm assuming that the Fifo will update in one scan.
You can Unload (FFU) in one scan if your LEN = 100 and POS = 1. If LEN = 100 and POS = 100, then it will take 100 scans. Basically the FIFO instructions can move 1 position for each scan.
 
If you think there's a chance of a data change on consecutive scans you'll need to unlatch the enable bits on the FFL/FFU instructions after each load/unload - you could just make this unconditional on every scan. If there will be at least one program scan of 'not enabled' for the FF rungs after logging you'll be OK.
 
experiment with the idea shown below ...

Good idea Ron. I will experiment with this on an off-line system. Usually a fifo loading/unloading data across multiple scans is no issue. But here I want to make sure it updates in one scan to assure I'm recording all I/O changes for trouble shooting.

Jerry
 
You can Unload (FFU) in one scan if your LEN = 100 and POS = 1. If LEN = 100 and POS = 100, then it will take 100 scans. Basically the FIFO instructions can move 1 position for each scan.

Just had a thought Lancie, if this instruction does only one shift per scan then I would have to have this instruction enabled for 100 scans to move all of the data. The bit I'm using to trigger the fifo is only on for one scan after the I/O I'm monitoring changes.

Wonder what that's doing to me?

Jerry
 

Similar Topics

For those who may recall I had posted previously about the FSC instruction, and while I have a better understanding of how to use it I find myself...
Replies
1
Views
1,381
A couple of questions with RS500 FFL-FFU instruction set. 1-Does the stack load from the bottom or the top, My stack is #N7:50 with a length of...
Replies
7
Views
1,596
I have used fifo's before, and I think I understand the general concept. However I am having trouble trying to create one that stores the...
Replies
19
Views
11,237
Hey guys, I came across one question about the FIFO, FFL & FFU instruction. I want to measure the wheel speed, so I use the RPM encoder as the...
Replies
8
Views
4,001
Hello, I'm currently programming a MicroLogix 1400 in RSLogix Micro, and I'm trying to put data into FIFO queues. Would you know how to use the...
Replies
4
Views
5,084
Back
Top Bottom