s7 scaling back to usable int

s7killsme

Member
Join Date
Nov 2010
Location
Texas
Posts
7
Hello,

I know that the scaling functions in S7 have been covered extensively already, but I'm still having issues getting this to work. For my application I want to take a 4-20 mA signal from the analog input and convert it to 400-2000 in integer form.

I can scale it from 0-27648 using FC105 to 4-20 mA, but then I'm kind of stuck with a number I can't use because I don't know how to unscale it back to a usable int. If I use FC 106 I can't figure out how to scale the 4.000-20.000 real back to a 400-2000 int.

Eventually all my values have to be int type to send to a hmi via modbus. Is it just a matter of doing a bunch of integer math to make it work, or should I just do all my math as real type and then convert them to integers at the end (don't know how to do this)?

Per usual, I'm pretty new to S7 and have a tight deadline.

Any advice?
 
Why dont you make your own scaling function, its pretty straightforward after all. y=mx+b. With scl its breeze. Do you have it? In what format do you use it?

Scale and unscale are really for scaling from analog interface to engineering units and vice versa.
 
Last edited:
I do not have scl unfortunately. I'm using ladder logic to program a S300 (315-2 PN/DP). Is there a simple way to convert a real number to an int?

Thank you for your help.
 
If you are programming in ladder, ensure your overview is present in your ladder screen (view-overview).

That shows all the instructions available.

Select converter and it shows all the conversion instructions available.

As mentioned above TRUNC (rounds down) or ROUND (rounds to nearest whole number). The value you get is a double integer.

To convert the other way I_DI (Integer to Double Integer) and then DI_R (Double Integer to Real).
 
s7 fc105

Hi everybody
i want to scale the input signal 4-20 mA and i use the FC105 asttached file, but i donot know my program works or not and my another question is that how can i see the value of MD 80 in the simulation mode, if my program has problems , please kindly inform me about that.......
 

Similar Topics

I have everything set up for vibration monitoring with the code in Controllogix 5000. The thing is that I am not able to read values SCADA in mm/s...
Replies
0
Views
27
Hi, having some issues with scalings (SCP commands) with some Vegapuls 65 guided wave radar level transmitters. I've set the min/max in the...
Replies
5
Views
193
I want to measure the tank level and get the sensor output to the PLC. Below are the details : Tank Height =0 - 3m, the sensor is stalled 0,2m...
Replies
15
Views
652
Hi, I have a ControlLogix system with 1756-IF16 analogue inputs. I can't scale the inputs at the card as there is a requirement to facilitate...
Replies
14
Views
382
I know nothing about simaticnet OPC server. I do know Kepware. I would only ever scale raw to engineering in the PLC, but it is possible to scale...
Replies
5
Views
226
Back
Top Bottom