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 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
209
Hi all. I'm working on a rehab and I'm trying to figure stuff out. See screenshot at the bottom. Local:5:I.Data[6] in BTD instruction is a...
Replies
6
Views
697
Hello all, First post here. Hitting a wall with finding info on this topic online, and none of my coworkers have a clue. I have a PanelView...
Replies
10
Views
1,334
Hello, We monitor the temperature of a pipe via a 4-20mA temperature transducer. This goes into DB135(Read Analog Inputs). The issue I have is the...
Replies
0
Views
622
5069 IF8 with a 4-20ma 0-100psi, sealed fixed, no calibration, transducer attached. IF8 is scaled 4ma= 0 psi, 20ma=100psi. If over time the...
Replies
12
Views
2,578
Back
Top Bottom