Thank you.MD4 is REAL
MD8 is DINT
MW10 is INT
MW12 is INT
To convert from REAL to INT, you have to either ROUND or TRUNC the REAL into a DINT. Then you extract the 2 high bytes into an INT.
On the downside, depending on what your REAL value is, you're losing all of the data after the decimal point. There are ways around that too, holler if you need help with it.
It's super fun and totally intuitive. Thanks Siemens. Good Luck
View attachment 39942
The function i need is that i read a 4-20mA signal and i will use this value to compare set points (3 set points) i have set in the HMI.
For each of this 3 set points of the analog input value i have a set point that should transfer a value to a analog output. As every set point and actual is read and write on a HMI i want everything to be in INT.
So i want a integer value from the input and then the set points are integer so i can use the compare equal or higher INT . So if the value is equal or greater i will move the set value for the analog output for the corresponding set value of the analog input.