floating point scaling slc505

irondesk40

Member
Join Date
Jan 2008
Location
nc
Posts
630
have a question that i hope someone can assist with.
have a application that has a slc505 in it.
in the operator screen the operator selects to run fabric from 0-30 yard per minute. The machine was designed so that the operator always entered a value of 1,2,3,4,5 etc. all the way to 30.
In the program there is a scp instructions that is taking what the operator enters and gives a output of 0- 32764 (0-10v) that is the value going to a inverter.
Not sure how to change it so that if the operator was to enter for example 5.5 yards per minute, or 5.75 yards per minute it could be scaled to give the proper value from 0-32764 (0-10v) to the inverter.
Can you do scp in the slc505 and use floating point values?
confused.
thanks
 
Yes

Entering Parameters:
Input - Enter a value to be scaled. This can be a word address or an address of floating point data elements.

Input Min - Enter a minimum value for the input (low end of range). This value can be a word address, a long (double-word) address, an integer constant, floating point data element, or a floating point constant.

Input Max - Enter a maximum value for the input (high end of range). This value can be a word address, a long (double-word) address, an integer constant, floating point data element, or a floating point constant.

Scaled Min - Enter a minimum scaling value representing the low end of the range to which you want to scale the input. The scaling relationship is linear. The value can be a word address, a long (double-word) address, an integer constant, floating point data element, or a floating point constant.

Scaled Max - Enter a maximum scaling value representing the high end of the range to which you want to scale the input. The scaling relationship is linear. The value can be a word address, a long (double-word) address, an integer constant, floating point data element, or a floating point constant.

Output - Enter an address for the scaled value that is returned after the instruction is executed. This value can be a word address, a long (double-word) address or an address of floating point data elements. If any floating-point file types or floating-point constants are encountered in the above parameters, then the entire instruction is treated as floating point, and all immediate integer data values are converted to immediate floating-point data values.

scpFloat.jpg
 
Thanks
I thought you could was not exactly sure. I know we have some older micro 1200 plc's and can not use floating with scp.
I have to go to arkansas end of week and make the changes and did not have a 505 in the shop.
This site rocks.
 
going a little bit further ...

the maximum scaled value 32764 that you're using is pretty close to the "overflow" value of 32767 ... there's nothing really wrong with that – as long as you don't "break the bank" by having a signal go out of range somewhere along the line ...

it's usually recommended practice to limit your input values BEFORE they are fed into the SCP ... (usually this is done on TWO rungs ... LES-MOV ... GRT-MOV) ... just ask if you need help with this ...

also ... be aware that in some situations, an intermediate (INTERNAL) value inside the SCP's math computations may result in a temporary "math overflow" error ...

worst case scenario: depending on how your system is set up, you could make your program changes in Arkansas – and leave the machinery working perfectly ... then, sometime later, an input signal goes just a teensy bit higher than you expected – and suddenly the system faults and shuts down completely ...

suggestion: if you're not sure about all of this, search for S:5/0 and then post any questions you have after that ... we'll be glad to fill you in ...

the following post will probably give you all you'll need ...

http://www.plctalk.net/qanda/showthread.php?p=14470&postcount=12
 
Since this is pretty straight forward scaling, speed is 0 to 30 and output is 0 to 32764 you can also just use a straight multiply.

32764/30 = 1092.133.

So by simply multiplying the operator input value by 1092.133 you can scale the value input by the operator to the voltage output. As Ron advised, check that the operator input value is between 0 and 30 and then you then won't have to worry about overflow.

30.0 * 1092.133 = 32763.99, which will round to 32764 when you place it in an integer address.

The SCP instruction is a great instruction, but it is doing a lot of repeat calculations internally that aren't always necessary for simple scaling.
 
Thanks for advice, i learned the hard way on a project a couple of years ago about clamping and math errors.
here is a sample from a program where i went back and clamped values based on info from this site.
 

Similar Topics

I need to check an axis actual travel position, and to compare it to the master travel position. To do this I have to multiply the axis travel...
Replies
6
Views
2,562
We have AOIs for projects, which handle material dosing (by hand or by pipes and pumps), obviously they have comparison between setpoint and...
Replies
50
Views
14,205
Hi eveyone. I need transfer signal from system 1 to DCS via modbus. System 1 only can send 32 bit floating point. DCS receive 16 bit integer. How...
Replies
20
Views
10,588
Hi, In my ladder logic, I've got a data register D60 whose value is -0.001 (when using monitor mode to see values). D406 is 0.250. But then...
Replies
5
Views
1,307
Hi, can anybody tell that how can we move floating point data from one Regiter to another register in Fatek PLC.?
Replies
0
Views
1,550
Back
Top Bottom