From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in LV8 : 'Save for previous version' and 'Write to Binary File' VI

Hello

I am using LabVIEW 8's revamped 'Write to Binary File' VI with a 'TRUE' boolean constant wired to the optional 'prepend array or string size?' to write non-trivial structures to a binary file. I then read the file with the 'Read from Binary File' VI and everything is fine. I don't wire anything to the 'file (use dialog)' input (don't know if this can help).

However, after saving my VI for LabVIEW 7.1, I cannot read the binary files created with the LV7 version of the VI anymore. After examining the LV7 converted version of the VI, there is a 'FALSE' boolean constant that is wired to the equivalent of the 'prepend array or string size' input, which breaks the binary format that is expected.

The attached files are LV8 and 'saved for LV7' versions of a dummy VI that writes an array of 5 integers into a binary file. To test the bug, start LV8, open the LV8 version, run it and create a 'test-lv8.bin' file, then open the LV7 version, run it and create a 'test-lv7.bin' file. Check the content of the two files : the size of the array is indeed missing from the 'test-lv7.bin' file, which can be assimilated as a bug in my opinion.

I think I found another one too : if in LV8 I wire the 'cancelled' boolean output of the 'Open/Create/Replace file' to the selector of a case structure, the 'converted to LV7' version VI will have an error, saying the Case Structure selector is not wired.

Could someone please confirm these are indeed bugs ?

Thanks in advance and have a nice day.

Eric Batut
Download All
0 Kudos
Message 1 of 6
(3,026 Views)
OK, since nobody seems to be interested in reading this, could someone please point me to the general "Submit a bug" forum/mail address, if there is one ?

Thanks in advance and remember: once saved for a 7.0/7.1 version, the 'Write to Binary File' VI won't write headers for non-trivial structures, even if it is told to do so.

Eric
0 Kudos
Message 2 of 6
(2,991 Views)

Hi,

I think it was a bug of LabVIEW 8, i send an email to the LabVIEW group in the R&D, and let you know if we have solution.

Thanks,

 

Christophe S.
Account Manager East of France І Certified LabVIEW Associate Developer І National Instruments France

0 Kudos
Message 3 of 6
(2,957 Views)

I'm using LV8.6 and need to read a .bin file created in MATLAB. This file obviously does not contain the 4 byte header that LabVIEW prepends .bin files with. So when I use Read from Binary File, I get no data (I'm trying to read an array of doubles). I've tried making my .bin file both in native and big-endian format and changing the representation (double, int64, float64) but none of this works. I noted that if I create the same array in a .bin file in LabVIEW and wire a FALSE to the "prepend array or string size?", my VI for reading .bin files can't read this file either.

Any work-arounds here?

 

(I'll try attaching my write & read VI's)

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

You've posted to an old and unrelated thread. You should try to post new questions.

 

In any case, it would be nice if you had posted an example of a bin file but if your file has no header information that identifies the array size, you should try setting the data type in the read to a DBL scalar and not an DBL array. If you set the count to -1, the function will return an array. That is how you read the file created by your WriteBinFile.

Message Edited by Dennis Knutson on 03-05-2009 03:57 PM
0 Kudos
Message 5 of 6
(2,665 Views)

Interestingly, I found that the example VI, Read Binary File, does fine reading a 1D array created my MATLAB because it includes the Get File Size function that writes the size to the count terminal. I still can't get this to work if I'm trying to read a 2D array, though.

suggestions?

0 Kudos
Message 6 of 6
(2,662 Views)