|
Re: UDP from C++ to Labview
LV and most languages support more than one size of floating point number. In particular, the single precision (4 byte), double precision (8 byte), and extended precision (10 or more) are pretty common. In C/C++ they will usually be called single, double, and long double. Sometimes you will see double doubles and other odd numeric types as well.
Check that the size of all three elements are correct, as misalignment of one of the earlier elements will affect the later elements.
The other factor causing this could be the byte order. Multibyte numbers can have their bytes transmitted either left-to-right, or right-to-left. This is often called little-endian and big-endian. It comes into play with memory architectures as well as transmission. By default, LabVIEW always assumes that data coming in from network and file are big-endian and does the work on little-endian machines like Intel to convert back and forth. If your data is in little endian format, then LV will load the bytes in the wrong order. If you are using the unflatten from string node, try wiring up the other byte-order parameter and see if that fixes it.
Greg McKaskle
|