LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing SGL array to binary file

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!

0 Kudos
Message 1 of 3
(2,494 Views)

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...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 3
(2,488 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 3
(2,445 Views)