Solution
LabVIEW is constant-folding and caching the 'String Length' of the '
End of Line Constant ', which should be platform dependent (\r\n vs. \n). This means if the VI compiles and executes first on the cRIO, it will correctly determine length = 1 (\n). Then if the same VI is moved and executed on Windows, LabVIEW will incorrectly use the cached length (1) instead of the correct length = 2 (\r\n)
This is a known issue in LabVIEW 2020 and was fixed in the 2021 version. There are several options or workarounds to fix this issue:
- Enable the 'Separate compiled code from source file' in the VI properties for the 1D String Array to Delimited String VI.
- Fully deploying the code to the Real-Time target by using Build and Run as Startup. This will cause a true full compile and skips any problems with the compiler cache.
- Use LabVIEW 2021 to run the code in which the bug was fixed.