Signal 4 byte (4xdint) convert to 1xfloat
Using Function Designer I cannot find any suitable function block to do this conversion.
Signal is collected on ProfiNET on 4 x dint.
This signal represents a Volt L1 on a power analyzer.
Would like to present the value as a AOC in 800xA.
I do have PPLib, but cannot find any function blocks there.
Any suggestions?
Answers
You can likely use the IEEE-754 standard to calculate it out. Most of the time there are two 16-bit registers. Each holds half of the required data and they need to be combined to get the floating point value.
Maybe try the functions "words_to_real()" and "dword_to_real()". They look like they can be used in Control Builder.
https://en.wikipedia.org/wiki/Single-precision_floating-point_format
words_to_real() is the base system library function block that does this. You will need to convert the dint values to words first. (dint_to_word). Watch for byte order.
Since you are reading the value from a remote source, this is an "input" and you should probably use an AIC.
I cannot find any words_to_real function block. Maybe something is missing in my 800xA?
Add new comment