LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write-read binary file Error 116

Solved!
Go to solution

Hi all,

 

I am saving double, numeric array data into a binary file and then trying to read it back but keep on getting Error 116 (cannot read from binary file).

 

I have attached screenshots of the way I am writing my data into the binary file and then the way I am trying to read it. Basically my data is chunks of 2D double arrays, coming at a rate of 1hz and this is why I have to use the get and set file size functions prior to saving into the file (i.e. so that each time I can append my file with new data).

 

I have tried all combinations for the write to binary and read to binary file functions, thus meaning I have tried little, big and native endian options but I keep getting the same error. Also played with the way I append my data, i.e. I have used both the "offset in bytes" and "end of file" options, just in case this made any difference, but again no luck.

 

Any help would be much much appreciated.

 

Regards,

Harry

Download All
0 Kudos
Message 1 of 5
(3,909 Views)
Solution
Accepted by topic author charmand79

Try setting the 'Pre-append array or string size' to true.

That seems to work over here...

0 Kudos
Message 2 of 5
(3,893 Views)

Just as an amendment to my original post, I can succesfully read my data in MATLAB using the standard fread function with double precision. I presume that this means that there is nothing wrong with the way I write the data into the file. However, it would be useful for me to be able to read it directly from Labview without having to build matlab executables etc etc... Robot Very Happy

 

cheers again

0 Kudos
Message 3 of 5
(3,883 Views)

What an idiot... Thanks blackadder, I could swear that I've tried that too but it now appears that I hadnt!!

Message 4 of 5
(3,881 Views)

no problem 😉

glad to help....

0 Kudos
Message 5 of 5
(3,873 Views)