ControlLogix FIFO Instructions


Introduction to ControlLogix FIFO Instructions

The ControlLogix FIFO Instructions are a buffer that allow you to take snapshots of data. The processor stores this data into an array. When we unload the register, the first piece if information will unload first. The processor will send this data to the destination tag.

There are several uses for the FIFO instruction. For example, the FIFO might store alarm codes into it’s array. The operator can then scroll through the codes to see the order in which alarms came in. Another use would be for averaging. If you only have access to ladder logic, you can take snapshots of data at regular intervals. Your logic could then average the FIFO buffer.

We’ll cover two instructions in this post: The FIFO Load (FFL), as well as the FIFO Unload (FFU).

Create the Tags

There are a few tags well create at this time. We’ll need a FIFO buffer array to store the data. We also need a tag to get data from, which is the source tag. Another tag we need is the destination tag. This is where the processor places the data it unloads. Additionally, we need a control tag. The Control tag is simply a workspace for the instruction to operate. This tag keeps the status of the FIFO such as EM (Empty), EN (Enabled), Position, and length. We’ll also create a couple tags that we can toggle to test the operation of our FIFO. Normally, you might use a timer for this, or a request from the operator.

In this case, I’ll just use time.second as my source. I already have a GSV command in logic that gets our system time. We will, however create the other tags we need for logic.

Add the Logic

At this point, we’ll just add the logic to our MainRoutine.

As you can see, when we toggle the FifoLoad bit, the current second will enter the FIFO Array. Likewise, when we toggle the FifoUnload bit, the first data that was placed into the FIFO will be sent to the destination tag.

Operation of ControlLogix FIFO Instructions

Before we do anything at all, you will see the Empty (EM) bit is set.

At this point, I’ll toggle the FifoLoad bit. The current second (which is 16) will load into element 0 of the FifoRegister.

When I toggle the FifoLoad bit again, the current seconds (which is 42) will load into element 1.

Each time we toggle the fifo load bit, the current value of time.second loads into the FIFO array. At this point, I’ll toggle the FifoUnload bit. You will see that the first value that we loaded is removed from the FifoRegister. This value (16) will move into the FifoDestination.

If I toggle the FifoUnload bit again, then the only value left, which is 42, moves to the destination. At this point, the FifoRegister is empty once again.

Filling the FIFO

Let’s see what happens when I toggle the FifoLoad bit 10 times. As you can see, our FIFO is full. The processor sets the Done (DN) Bit. At this point, toggling FifoLoad appears to have no effect. We must unload some values by toggling the FifoUnload bit if we wish to store new data into this FIFO.

Summary

In Summary, when we load a value into the FifoRegister, this value goes to the next position in the FIFO Array. On the other hand, when we unload values, all the data shifts upward (toward zero) in the array. The value that was in element 0 is sent to the Destination tag. This is setup in the FFU instruction.

For more information on ControlLogix, visit the category page!

— Ricky Bryce

Leave a comment

Your email address will not be published. Required fields are marked *