LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does the "write to binary file" function add bits at the beginning of the file

I am using labview to strip the file header from a wave file.  I have already done this (it's easy).

THen I want to write the information back to a file.  When I do this I end up with 4 bytes appearing in the file that arn't in the information I am sending.  They arn't the same 4 bytes if I change the informaiton I am sending.

  I think I have it narrowed down to the actual write funtion, If I take the read funtion and wire it to the write function I end up with the 4 extra bytes of data.

 

 

 

 

 

 

Message Edited by crewex on 08-22-2008 09:47 AM
0 Kudos
Message 1 of 6
(4,291 Views)

Hi crewex,

connect a false constant to the top right boolean input of the write binary function. It writes some additional information to the file and this input is true as default.

Mike

0 Kudos
Message 2 of 6
(4,287 Views)

 

 

Also, from the LabVIEW Help:

prepend array or string size? indicates whether LabVIEW includes data size information at the beginning of refnum out when data is an array or string. If prepend array or string size? is FALSE, LabVIEW does not include the size information. The default is TRUE. prepend array or string size? only controls the top-level data size information. Arrays and strings in hierarchical data types such as clusters always include size information.

Message Edited by smercurio_fc on 08-22-2008 09:48 AM
0 Kudos
Message 3 of 6
(4,281 Views)

Thank you that of course was the problem, but now the code is only writing 253 bytes of data instead of the 2300

0 Kudos
Message 4 of 6
(4,258 Views)

Hi crewex,

i think it´s because you divide the file size by 8. You don´t need it. It´s already in bytes.

Mike 

Message Edited by MikeS81 on 08-22-2008 08:11 PM
0 Kudos
Message 5 of 6
(4,253 Views)

I was struggling in saving single at 1uSec into binary and reading back with junk data.

This saved my life. thanks.

Royal
0 Kudos
Message 6 of 6
(3,231 Views)