LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Issues upgrading VI from LV 5.1 to 7.1/ binary file

We recently upgraded from LabVIEW 5.1.1 to 7.1 and noticed a problem with the integrated Read/Write File VI. A measurement VI which saved data in binary form seemed to compile and run under 7.1 without problems. But when saving data the files can no longer be read in. Data files saved under 5.1 can be read in without problems. So we think there might be a problem with the "write file VI". So if any of you know of changes of this VI from 5.1 to 7.1 which might explain the described behaviour or maybe even fixes please let us know.
0 Kudos
Message 1 of 6
(2,725 Views)
Hello,

i think there is a error in the configuration of your Read/Write Vi.
Which VIs do you use exactly?
Can you post a reduced example (Input/Output) of your VI (old and new version).

Regards
Markus Weigl
NI Germany
0 Kudos
Message 2 of 6
(2,711 Views)
fkdimler,

Can you illustrate this problem with small example?
I know about one bug: if you will write into binary file array of cluster, and cluster connected to TypeDef,
then you can get different results in old and versions of LabVIEW.

Andrey.
0 Kudos
Message 3 of 6
(2,706 Views)
Thank you for your interest in my problem. I post the simple input/output VI that you wanted. In LV 5.1 I can write and read the sample array. If I open the same VI with LV 7.1 I can still read files written in 5.1 but not those written in 7.1. Actually there is no error message but the data is messed up. If I remove the convert to 4.x data from the read/write vis which are used for backwards compatibility reasons I can write and read the files but of course no longer the old ones.
Any ideas are welcome.
Frank
0 Kudos
Message 4 of 6
(2,698 Views)
To quote the help for Read File:

"If byte stream type is wired and you need to read data created by LabVIEW 4.x or earlier, right-click this function and select Convert 4.x Data from the shortcut menu. In Convert 4.x Data mode, this function interprets the data in LabVIEW 4.x data storage layout and displays the icon for this function with a red 4.x on it. LabVIEW 4.x and earlier stores Boolean data in two bytes unless the data is in an array, in which case LabVIEW stores each Boolean element in a single bit. LabVIEW 5.0 and later stores Boolean values in a single byte, regardless of whether it is in an array. National Instruments recommends reworking any application that uses the Convert 4.x Data mode as a long term solution."

So, the change in binary file storage actually occured from LabVIEW 4.1 to 5.0. It would seem that you used the 4.1 format in your old 5.1 application. How many files do you have in the old format? A mass conversion should be possible. Get a list of all files (sorted by date or by folder), read them with the 4.1 conversion and write them back without the conversion. You might also be able to have a read VI that can handle both data types. Can you read a record with 4.1 format and do a test to see if it's valid? If it's not, through it away and read it again with the existing LabVIEW format.
Message 5 of 6
(2,693 Views)
Thanks for your help. Althought we didn't really get to the bottom of the problem. We did as was suggested and kept an read VI for the old format, but switched the write VI to the new format.
0 Kudos
Message 6 of 6
(2,668 Views)