Reading Flattened Numbers from String in LabVIEW Returns Unexpected Values

Updated Oct 26, 2023

Reported In

Software

  • LabVIEW

Issue Details

When unflattening a number from a string that has previously been written to a file, certain written values give a different number from what was written to the file. 
Flatten Image.png

Why is this happening? 

Solution

This is due to one of the optional settings on the File I/O functions Convert EOL.
By disabling this function you'll get the correct output values.
 Convert EOL.png

Sometimes, when flattening data to a string, the resulting string may contain characters such as "/r" "/n" or "/r/n".
These are termination characters and are used to indicate a line break in text files. 
The Convert EOL function will convert any termination character to one that is supported by your OS. As the Write to text file function is supported on different platforms, this helps combat cross-platform issues.