Duplicating AB SCP Command in another PLC

thunderstrike

Member
Join Date
Sep 2009
Location
Walkerton, IN
Posts
2
How would you aaproach duplicating the Scale with Parameters command in another plc like EzAutomation Touch PLC of which they do not have any scaling so I assume it all has to be done in straight math. I am having trouble coming up with a good routine that works. Any help on that would be great.
 
The SCP instruction just actively solves the equation for a line, which is Y = mx + b where, mapped to SCP instruction text:

Y -> SCP Output
m -> SCP ((Scaled Max. - Scaled Min.) / (Input Max - Input Min.)) (slope)
x -> SCP Input
b -> SCP (Scaled Min. - (((Scaled Max. - Scaled Min.) / (Input Max - Input Min.)) * Input Min.)) (y-intercept)

Keith
 
I think you are missing something in your break down. I agree you first simple equation for slope, but your supplemental equations have something wrong. If I plug numbers in as follows:

Input Min = 5
Input Max = 100
Scaled Min = 32
Scaled Max = 60
Input = 25

m = (60-32)/100-5) = 28/96 = .305268
B = (32-(28/95))* 5 = 158.473685

So plug that into your first equation: Where 25 is my in.

y = (.305263 * 25)) + 158.473685 = 166.10526

This is greater the the input max so I know something is wrong...??
 
You have your parentheses in the wrong spot.

It shouldn't be:

B = (32-(28/95))* 5 = 158.473685

It should be:

B = (32-((28/95)* 5) = 30.542

I added parentheses in places I didn't really need them for clarity. Apparently it didn't make things any more clear.

You can do this all in one fell swoop with substitution:

Output = Scaled Min. + (((Scaled Max. - Scaled Min.) / (Input Max - Input Min.)) * (Input - Input Min.))

after a little moving around of terms.

Keith
 
Last edited:

Similar Topics

I copied a panel in factory talk HMI for an identical system. The label names are still the same as the original panel but I am trying to change...
Replies
1
Views
151
Hello Everyone, I have multiple machines that do the same thing, only the IP's are different. Some of the machines have AB drives while others...
Replies
16
Views
1,263
Sorta a dumb question but... I want to duplicate a picture to work on some changes to the graphic.. so "picOriginal", I want a copy of that...
Replies
3
Views
1,931
Reading Bering C Sparky's thread about his seafaring adventures (Congrats on the new job by the way),led me to the discussion about Stage...
Replies
6
Views
2,311
Hi, I have a HMI MP277 which is currently installed in the customers factory. The customer would like another HMI exactly the same as the first...
Replies
3
Views
4,135
Back
Top Bottom