Rslogix analog scaling

jwswanger

Member
Join Date
Apr 2012
Location
Levelland
Posts
8
Rslogix 5000, standard version (can only use ladder) analog scaling block does not exist, need to know of any tips and/or tricks to accomplish reading an analog device (transmitter in this case). Is there a something embedded i just cant find? Or whats the deal? Is there a trick to do the scaling witout having to use math blocks? And also, what can i use as a destination to address it to a display, on this display (magelis) it actually has to see an address not a tag name, i only know of creating a tag for an internal relay. As much help as possible needed, thanks.
 
You can scale automatically in the configuration of the Analog module.

Controllogix/Compactlogix are tag based systems, there is no bit address like in the SLC500/Micrologix. Can you give us information on your HMI you are trying to use? Maybe someone here knows about how to use it on the Controllogix platform?
 
Last edited:
If you are using 1756 IO then scaling is done in the module as Tharon suggested. Find the IO module in the IO configuration tree and open it and set the scaling under the configuration tab. This is the best way to do scaling.

If this is a CompactLogix system using 1769 IO cards then you'll need to scale the inputs in your PLC program. Use the CPT instruction or you can download the SCP AOI from the AB Knowledgebase and install it. The SCP AOI works almost exactly like the SLC-500 SCP instruction except that you will need to create a SCP tag instance for each SCP instruction.

Create a tag of type DINT or type REAL for the destination address.

If your Magellis HMI cannot communicate with ControlLogix PLCs but it can communicate with a PLC/5 or SLC500 then in Logix5000 from the menu pick Logic->Map PLC/SLC messages and configure files that are mapped to your ControlLogix tags. Refer to the online help for how to do this.
 
Last edited:
Compact logix5000 PLC ALL IN ONE, no expansion modules. The HMI i am using is a Snieder Electric Magelis. Ive tried to just use a move block and use the analog address as the source and use a real tag as the destination, but the Magelis wants and address. I also tried just using the analog address for the HMI to look at but it doesnt work, for some reason, im sure its something simple, i just cant seem to figure it out. The operation manual does give me any help with the ladder logic, just tells me that i cant use the analog scaling blocks in the logic.
 
Dunno why they decided to leave SCP out of Logix5000. Would have been alot more convenient if it was there!

With a little bit of elementary math, you can achieve the same results with the compute function. You'll just have to derive your scale equations and implement them by hand. There is a post somewhere on these forums has an excel file that explains everything in detail along with the formulas and how to use them.

If you will be doing a lot of scaling in your program, I'd recommend making and Add-on instruction for scale with parameters that would work exactly like the old Logix5/500 instruction. Also, if you go this route, you will just have to copy and paste the code into any future projects you do! I send you an example file with the add-on instruction in it, but i'm not at the office. If you can't figure out how to do it, i'm sure there are other users on this forum that can help you with that.

Edit: It appears TConnolly beat me to it. Take note of his information about AOI.
 
Last edited:
Use the CPT instruction to do your analog scaling.

You will need to work out the rate, and offset (if any) for your equation first.

Then use a CPT instruction with Scaled_Value (or whatever tag name you want the scaled value you to end up in) as the destination.

Expression will be "(rate * raw_input) + offset".

Leave out the offset if it is not required.

Refer to this thread for the formulas and further information http://www.plctalk.net/qanda/showthread.php?t=70375
 
On the CompactLogix platform you must do your scaling in your program using math instructions.

Your options are

1) Use the CPT instruction.

or

2) Download and install the SCP AOI from Rockwell's knowledgebase.


If I may make another suggestion - One of our forum members who is also one of the leading PLC instructors in North America put together an extensive thread on scaling and how to do it a few years back. The thread was oriented to Logix500, however he does get into the principles behind scaling and if you understand them then you'll be able to scale anything on any PLC. You may be tempted to skip over the Logix500 stuff but don't - you need to understand what is going on. The thread is http://www.plctalk.net/qanda/showthread.php?t=15069. Its long, but please take the time to read it.


You might find this wikipedia article helpful. http://en.wikipedia.org/wiki/Y%3Dmx%2Bb Most scaling operations in a PLC use either the slope-intercept line equation or the two point form line equation.
 
Last edited:
The machines I am working on this week use many SCP commands, and I have had to go back an use math to verify that these commands are correct. y=mx+b should get you on the right track
 
The machines I am working on this week use many SCP commands, and I have had to go back an use math to verify that these commands are correct.


Not a very trusting soul are you. Did you do the math outside the PLC?

Or did you trust the PLC"s math instructions?
 
To scale using the CPT instruction and input max and min and scaled max and min values you need to first determine the slope of line.

m = (Scaled_Maximum - Scaled_Minimum) / (Input_Maximum - Input_Minimum)


Now you need the intercept point

b = Scaled_Minimum - (m*input_Minimum)

(Those equations came from the two point line equation on the Wikipedia page I linked earlier and arranged so find m and b.)


For most applications m and b are going to be constants, so get out your calculator and figure them out. Be aware that with some transmitters and analog input combinations that b is going to be zero. If it is zero then omit it.

Once you have m and b then scaling is simply a matter of multiplying your analog input by m and then adding b.

Let me walk you through an example. You didn't tell us what the transmitter was so I'm just going to pick a 0 to 100 PSI pressure transmitter with a 4-20mA output for the example.

If we refer to the manuals for your Compact Logix PLC, we can find the embedded analog input specifications and see that the input minimum is zero and the input maximum is 31104 for both the 10V and 20mA inputs. If the transmitter is a 4-20mA transmitter here is where it gets a little trickier, because the current analog input is a 0 to 20mA input. If the transmitter is 4-20mA then we need to make our input minimum for 4mA. So if we divide 31104 by 20 and then multiply by 4 we get 6221 for an input minimum at 4mA.

So, to find m we plug (100 - 0)/(31104-6221) into our calculator and get m = 4.01881E-3.

Now to find b we plug 0 - (m*6221) into our calculator and get b = -25.

Now we have m and b.

To scale the example transducer on embedded analog input 0 all we have to do is multiply Local:3:I.Ch0Data by m and add b, or (Local:3:I.Ch0Data * 4.01881E-3 - 25)

To use that in a CPT instruction I would program the following:

CPT SCALED_PRESSURE "Local:3:I.Ch0Data*4.01881E-3 - 25"
 
Last edited:
Not a very trusting soul are you. Did you do the math outside the PLC?

Or did you trust the PLC"s math instructions?

I usually am a trusting person, but I was going thru debug on a machine, that had code on it that was known to work. After testing the transducer and the wire that it connects with, both of them were working properly. They all seemed to be connected to the proper locations called out in the print so this was the error checking I was doing for the code/plc portion of my debug. Turns out the transducer needed an additional common wire connection along with the one that was already wired in. Problem solved. Code worked
 

Similar Topics

Hi all! I have a question about RSLOGIX and Analog input/output scaling So we have an existing controller with an IF8I and OF81 card. My...
Replies
3
Views
952
Hello there! I am just a few minutes into this and here is my first post. Hopefully this works out! I am very new to Allen Bradley programming...
Replies
3
Views
2,069
I need to scale analog input. I'm using software RSLogix 5000 and analog card 1769-IF4XOF2. So I want to make scaling for current sensor...
Replies
4
Views
5,074
Hello all, First I'd like to say thank you for viewing my post. I need to learn how to scale an analog input on the RSLogix 5000 without doing so...
Replies
4
Views
6,267
Please take a look at the screen shot attached. I tried to scale the analog channels directly in the module itself but I have no idea where to...
Replies
3
Views
4,160
Back
Top Bottom