ControlLogix SCL Command


Introduction to the ControlLogix SCL Command

We use the ControlLogix SCL command to SCALE data. This simply means that we convert one range of values to another range of values. For example: We use a pressure transducer to measure pressure. A pressure transducer might convert 0 to 200 psi into a 4 to 20ma signal. The analog input module, then reads this signal, and places a raw value into our controller tag. 4 to 20ma (depending on the type of module) might provide a raw value of 6554 to 32767. If your module only returns raw data, then you need to go to the user manual for that module to get the raw values. This value alone is meaningless to an operator. We will use the SCL command to convert this RAW data back into Engineering units (0 to 200 psi).

In this example, I’ve wired a 4 to 20ma signal to a 1794-IE8 module on Flex. This signal is wired to Channel 0 of slot 2. Here is the raw data (7785). This value will range from 6554 to 32767 as the pressure on our transducer varies between 0 and 200psi.

First, we’ll go to Controller Tags. We’ll create a tag called “Pressure” that will be used to store our result.

Writing the Logic

Since the SCL is a function block command, we need to create a function block routine. To do this, I will right click the “Main Program” and create a new routine. I’ll just call this “Scaling”, and be sure it is the function block type.

Remeber, the Scaling routine is a subroutine. I will add a JSR to the MainRoutine so the subroutine will execute.

Next we’ll open our scaling routine. I’m still offline, but if you are online, you will need to put the routine into edit mode. To our function block, add an IREF, an OREF, and an SCL instruction. I always right click on the graph, and choose “Add Element” to add the instructions. Connect the instructions together as shown.

Notice the IREF and OREF have question marks on them. We need to assign tags to these elements. Our IREF (Input Reference) will be the raw data coming from our analog input. the OREF (Output Reference) is the tag we will place the result into. Just double click the question marks inside of the element to assign the tags.

Set up the Scaling

Next, we need to configure the SCL block. The scale needs four more pieces of information to make it functional: Raw Minimum, Raw Maximum, Scaled Minimum (Engineering Units), and Scaled Maximum (Engineering Units). In other words, we will declare the range of inputs we have, and the range of output that we want to scale to.

Click the configuration button (3 dots) within the SCL block to bring up the configuration screen. In this case, I will declare my variables as follows:

This is all that is required to make the scale work. Another option we have is to check the visibility field, and place the variables as IREFs. This will allow the troubleshooter to see the variables more clearly, minimize the chance of inadvertently changing them:

Download, and go online in Remote Run mode. The SCL commands is converting the raw data into engineering units.

The function block also has a few other features you might consider. Check “Limiting” if you need the output to be limited to the EU Min and Max values. Use the alarm feature (and turn on it’s visibility) to set a tag when the raw input has dropped below the minimum raw input, or above the maximum raw output values.

Summary of the ControlLogix SCL Command

Use the SCL command to convert raw data to engineering units. Additionally, for analog output modules, you might convert engineering units back to raw data. Utilize the user manual for the module you have to determine these raw values.

It’s important to realize, though that you might not always need to scale the data in logic. Some modules such as the 1756-IF16 support scaling on board the module. To configure the scaling on these modules, go to the module’s properties. On the properties screen, you can choose the channel you wish to configure. At this point, you will be able to scale the data on board the module. Not only does this reduce memory usage in the controller, but also scan time for your processor.

At any rate, once you scale the data, you can use this value in your logic instead of raw data. This makes your programming and troubleshooting much easier.

For other information on ControlLogix, visit the ControlLogix catagory page!

— Ricky Bryce

Leave a comment

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