09-03-2010 06:37 AM
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
Solved! Go to Solution.
09-03-2010 06:47 AM
Try setting the 'Pre-append array or string size' to true.
That seems to work over here...
09-03-2010 07:04 AM
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...
cheers again
09-03-2010 07:08 AM
What an idiot... Thanks blackadder, I could swear that I've tried that too but it now appears that I hadnt!!
09-03-2010 07:15 AM
no problem 😉
glad to help....