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?
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?