ControlLogix File Search Compare

Introduction to ControlLogix File Search Compare

The ControlLogix File Search Compare will search through arrays for specific conditions. Element by element, the instruction will look to see if a specific expression is true. For example, we have an array of temperatures. We want to check for any temperature that is above 110 degrees. The FSC will find where this expression is true, and set the Found (FD) bit. Our logic could then warn an operator of a high temperature based on the position where the FSC landed.

On the other hand, let’s say that each temperature has a separate setpoint… In that case, we would need two arrays. One with the actual temperatures, and the other array contains the setpoints for each element.

The FSC has 2 modes: All and incremental. Obviously, the “ALL” mode will search all elements of the arrays when the instruction goes true. While INC (incremental) simply does one element at a time. To index through the arrays, the FSC uses indirect addressing based on the position of the control tag.

Set up Tags

First, we’ll set up some tags we need for the FBC. We’ll need a control element. This tag is simply a workspace for the instruction to operate. This element keeps track of the length, position, and status bits. The type of this element is “Control”. Additionally, we’ll create two DINT arrays of 10 elements each. This will compare actual temperatures to a setpoint. Keep in mind what our goal is. We want to find any actual temperature that exceeds the setpoing.

Next we’ll populate the tags. Since I’m just simulating temperatures, I’ll just populate the ActualTemeratureArray with random values.

At this point, I’ll populate the SetPointArray with a setpoint for each temperature. To keep it simple, all of these values will be 100.

Configure the ControlLogix File Search Compare

At this point, we’re ready to set up the logic. I’m entering the logic below.

Most of this is self-explanatory except for the Expression. In the expression we are using Indirect Addressing. Instead of specifying a direct address surch as ActualTemperatureArray[0], we use the position of the control element. Basically, this allows the element number to change as the position changes. Likewise, we need the array element of SetPointArray to follow the position of the FSC.

Recall that all of our setpoints were 100. Therefore, when the FSC reached element #6, we found a position where the expression is true. At that point, the FSC will stop. If you monitor the control element, you will see the FD (Found) and IN (Inhibit) bits are true. Once we take action, simply have your logic shut off the IN (inhibit) bit, and the FSC will find the next position where the expression is true.

As you can see, once I unlatched the IN bit, the FSC continued to the next element, and found another location where the expression is true. This is elementOnc 7.

Once element 9 is reached, the instruction sets the DN bit.

At this point, we toggle the “StartFSC” bit off then on again, and the FSC will restart at the beginning of the arrays.

For more information on ControlLogix, visit the Category Page!

— Ricky Bryce

For Customized automation training, visit my employer's website at!

Leave a comment

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

× five = fifteen