Unique Scaling?

jeff_t

Member
Join Date
Feb 2014
Location
Oregon
Posts
5
So I'm following a programmer who has done a few things that I don't completely understand. This is in a GE RX3i PLC. First of all, he used 250 ohm resistors for analog inputs, effectively making everything 1 to 5 Volts. In a GE PLC, that corresponds to 3200 to 16000 counts.

To convert to engineering units, rather than use floating point and y=mx+b, the previous programming did something I've never seen before. He combined a divide, subtract, multiply, and divide block. For instance, to convert 3200-16000 to 0-600: y=(x/8 - 400)(3/8). It looks like the point of this is to avoid an overflow when multiplying the x times the slope. A 3/8 has been factored out of what would be the normal y=mx+b equation.

My question is: is this commonly done?

My second question is: what about when you're going to something that's not a nice, even range. Like 0 to 1875 or something like that. How do you go about coming up with the equation in the form that I mentioned above?

Thanks.
 
Scaling formula

(((Scaled Max-Scaled Min)/(Max Raw Input-Min Raw Input))*(Raw Input-Min Raw Input))+Scaled Min = Scaled Value
 
Ok, I appreciate the help, but I was specifically asking about the formula that was used in the original post. Is that unusual? How does one go about calculating the constants for that form of the equation?
 
The original formula has the transmitter range of 0-600 factored into it, presumably to make the numbers smaller and the formula simpler for the original programmer.

No, this isn't common.

The form Mickey provided is more common. I prefer it because you can use registers containing the transmitter full scale and min values in the formula, and then if the transmitter changes you can easily change the register values without messing up your program.
 

Similar Topics

commentaire communiqué siemens s7-1200 avec vfd delta ? (cablage et sur tia portal )
Replies
0
Views
128
Found this HMI password inside a door. Somebody thinks highly of themselves.:site:
Replies
21
Views
7,334
Hi there I've got a module in a project that has started 'faulting' (i.e. the Diagnostic buffer is full of errors from the module and OB82 is...
Replies
6
Views
2,829
Hi, I'm looking for a method to uniquely identify TP1200 HMI panels. At first we tried to use this: Dim object Dim computerName Set object =...
Replies
1
Views
2,166
Last year at about this time I was invited to go to the National Airport Pavement Test Facility to help out with their test system. Usually our...
Replies
8
Views
7,556
Back
Top Bottom