I need to convert and integer number from a PIW to a real number. What is the easiest way to do this. I don't see any standard function that is capable of converting this.
You may also use S7 standard function-blocks:
"I_DI" followed by "DI_R"
To convert back from REAL to INT you use
the command "RND":
Load <REAL> become: L <REAL>
Round become: RND
Transfer <INT> become: T <INT>
These 3 commands goes fine, if you first ensure
that <REAL> is within the limits
from -32768.0 to +32767.0
Please note that Siemens use reverse polish
calculation. Example, if <A> and <B> are REAL:
L <A>
L <B>
+R
T <A+B>
Good luck
Jan Steen Nielsen
Denmark
L-N [at] mbox301.get2net.dk
I think you are looking for the SCALE function. This function converts the input of an analog input card to the engineering units you specify. This is a standard library block available in step 7. There is also an UNSCALE function for driving analog outputs (Real to PQW).