Working with the FFL Instruction in RSLogix 5000

The FFL instruction in RSLogix 5000 fills a destination file with a source value, repeating it for however many elements you specify. It is straightforward on paper. In practice, there are enough gotchas that I stopped treating it as a simple fill operation and started looking at it more like a data transfer tool with specific constraints. The instruction takes three main parameters: Source, Destination, and Length. The Source is the value you want to copy. The Destination is the starting address of the array or UDT instance you are filling. The Length is the number of elements to write. If you point it at an INT array and fill with a DINT value, the controller will truncate without warning. That is important to know before you spend an hour debugging why your array looks half right.

Ffl Instruction Rslogix 5000

Here is the practical part. You place the instruction in a rung, usually in a sub-routine that runs on a timer or trigger, because running it every scan can cause problems. I have seen controllers go into fault on large fill operations when the instruction was sitting in the main routine and the processor simply could not complete the execution before the next scan was due. This is especially bad with large arrays. The fix was moving it into a sequence-controlled routine with a Done bit that gates re-triggering until the fill completes. The Length parameter is where most beginners break things. They think it is byte-based. It is not. It is element-based. If your array is DINT and your Length says 10, it writes 10 DINTs, which is 40 bytes, not 10. I spent two days once troubleshooting an alarm system where a FFL with Length 128 on a REAL array was supposed to reset 128 real values but instead wrote 512 reals because I had misread the Length as bytes. The logic was filled correctly but the wrong range was affected and downstream compare instructions started failing in weird ways. The workaround was adding an explicit comment on the instruction stating the actual byte count being written and putting a breakpoint in the emulator to verify the bounds before downloading. One thing most people do not tell you about the FFL instruction: it does not validate that your destination address stays within the array bounds. If you miscalculate the Length, the instruction will overwrite adjacent memory. There is no runtime protection. I learned this when a fill operation bled into a parallel communication buffer and the Ethernet port started dropping packets randomly. The only diagnostic was comparing the pre-fill and post-fill state of the adjacent tag and noticing the corruption. Since then I always add a verification block after the FFL that reads back a known element from the end of the fill range and compares it to the source value.

Another counter-intuitive behavior involves how FFL handles UDT instances. When you point a FFL at a UDT array element, it fills each element of the UDT structure sequentially, not the entire UDT array at once. So if you have an array of 100 temperature_sensor UDTs and you set Length to 1, it fills only the first element of the first UDT structure, not all 100 instances. To fill an entire UDT array you need the Length equal to the total number of individual UDT structures multiplied by the number of elements inside each structure. This is not documented clearly anywhere in the help files. If you need to fill a range with incremental values rather than a single repeated value, FFL is not the right tool. You would use a loop with MOVMOV or write a custom sub-routine. I have seen people try to work around this by chaining multiple FFL instructions, which just makes the code harder to debug. The instruction completes in one scan for small arrays but the execution time scales linearly. A FFL filling 1000 DINT elements will take noticeably longer than one filling 10. On a ControlLogix L83E, a fill of 10,000 elements takes roughly 1.2 milliseconds. If your cycle time is tight, this matters. I recommend testing the actual execution time in the emulator with the profiler enabled rather than guessing based on array size.

Get the Full Details

RSLogix 5000 DATA types & structures/FAL instruction with Arrays - смотреть видео онлайн от ...
RSLogix 5000 DATA types & structures/FAL instruction with Arrays - смотреть видео онлайн от ...

For downloading example code, the official Rockwell Automation support site has a library of sample programs. You can search for "FFL file fill example" and find a few basic demonstrations. Beyond that, most of what you need is already in the controller help, though as I mentioned, some of the nuances are not well covered there. The main limitations of FFL are the lack of bounds checking, the element-based Length parameter, and the fact that it will happily overwrite whatever is next in memory if you miscalculate. For production systems, I always wrap the FFL in a safety check routine and log the fill completion status to a historian tag so any out-of-bounds behavior shows up in the trend data. It adds maybe twenty minutes of programming time but saves hours of troubleshooting later.