Math functions SLC500

showshocka

Member
Join Date
Mar 2011
Location
USA
Posts
510
Hey guys. this is a bit of programming, but just trying to grasp the concept. let's say i have 100lbs. of something on a scale that has a 4-20ma output signal from its transducer that goes back to the SLC500 to read. The scales limit is form 0 -200lbs. how would it be configured in the PLC to read correctly? if the same signal was going to a PLC5 or logix5000,would the math instructions be different or the same? and why would it be or not?
 
Showshocka,

The general equation is Y = mx + b, where m is the slope and b is the offset (or Y-intercept point).

To do the scaling, you need to know Input Min (0), Input Max (2000), Output Min, Output Max. The Output Min and Max are dependent on the parameters of your specific PLC Input card. You have to look those up in the manual for the brand and model of the input module that you are using.
 
Here is an equation that I use for 4-20 ma signal conversion to pounds, psi, whatever you're measuring.

Y=(16/Z)(X-N)+4

Where:
Z=Range of Measured Units
X=Measured Variable (in Units)
16=Range of mA signal (20-4)
Y=Measured signal (in mA)
4=Offset from zero of mA signal
N=Offset from zero of measured units

So in your example we can plug 100 (lbs) in for X, 200 (lbs) for Z and 0 for N since there is no offset on the X-axis.

Y=(16/200)*100+4
Y= 12 mA

If your analog input card is configured for 4-20 mA, then your input on the SLC will read 4000-20000 units. Here is one way to handle the conversion to the 0-200 lbs range that you want to read:

Scale with Parameters.jpg

You could use a CPT instruction with the y=mx+b equation as the expression, but the SCP is easier to use IMHO

Cheers,
Dustin

🍻
 
Go to Ron's website http://www.ronbeaufort.com/ and click the sample lessons link on the right hand side. Then scroll down and read both "scaling with y=mx+b" articles. You will be very hard pressed to find a better explanation of how scaling works than those two articles.
 
Showshocka:

The SLC500 PLCs have two Scaling Instructions. The Scale Data Instruction (SCL), and the Scale with Parameters Instruction (SCP). I prefere the SCP, but it is not available in all SLC Processors. For the SCL Instruction, you have to apply the Formulas listed above. For the SCP Instruction, it is basically fill in the blanks.

For more information have a look at Instruction Help in RSLogix500, or the SLC Instruction Reference.

Stu....
 

Similar Topics

I have equipment that use encocder to measure part. Currently stores value in register. Holds history of 50 parts. Moving value into registers...
Replies
0
Views
1,677
I'm writing a program to control the speed of a motor with an encoder. As part of the program the motor turns a worm gear attached to a linear...
Replies
5
Views
3,742
I am trying to post a percentage to an HMI. Micrologix 1000 The trouble is getting a decimal in a numerical file. I am using N7 registers.
Replies
16
Views
4,597
For Simatic s5-135U/155U programming we use the following STL codes for addition, substraction, multiplication and division: +, -, X and :: How...
Replies
6
Views
7,931
I have an expression in a structured text routine of a Logix controller that looks more or less like the following: ResultInteger := Integer1 *...
Replies
13
Views
389
Back
Top Bottom