06-10-2014 02:20 PM
I am trying to write a very specific type of binary file in LabVIEW. I need to write an 2D SGL array into the file so that it can later be read and plotted on a waveform graph, but there's always an extra point at the beginning of a file. This extra point presumably comes from the way labview stores array information. How can I get rid of this point at the beginning? I need to alter the writing function, and NOT the reading function. Thank you!
06-10-2014 02:40 PM
You'll note that the binary write function has an input for specifying whether to prepend a count to the data being written. This input defaults to True -- guess what you need to set it to.
Mike...
06-11-2014 06:00 AM
To clarify what Mike is saying..
When you write an array to a binary file, the array size is prepended to the file. In the case of your 2D array, it will have 2 sizes to it (row length, column length). Each of those is an I32. So it should look like 2 extra data points to you (a SGL uses 32 bits).
The simple fix is to wire in a FALSE constant to the "Prepend String and Array Size" input on the top of the Write to Binary File function.
The other fix is with the read function where you just simply read as a 2D array of SGL.