Jason Posted June 14, 2006 Report Share Posted June 14, 2006 Hopefully a simple problem: I need to append data acquired to a binary file. Every time I try it overwrites. I have spent the last few hours trying to get this to work using LabView help and browsing these forums but I just cannot figure it out. Any help is greatly appreciated. Additional Information: LabView 8.0 I am acquring data every second in clumps of 2000 and would like to write this data to a binary file. I will be writing data for several hours thus the reason I need to use binary. Junior in college- physics major. I apologize if this has been discussed previously; I was not able to find a previous post that helped me. Quote Link to comment
JDave Posted June 15, 2006 Report Share Posted June 15, 2006 Hopefully a simple problem:I need to append data acquired to a binary file. Every time I try it overwrites. I have spent the last few hours trying to get this to work using LabView help and browsing these forums but I just cannot figure it out. Any help is greatly appreciated. Additional Information: LabView 8.0 I am acquring data every second in clumps of 2000 and would like to write this data to a binary file. I will be writing data for several hours thus the reason I need to use binary. Junior in college- physics major. I apologize if this has been discussed previously; I was not able to find a previous post that helped me. The standard file writing VIs open, write, and close the file all at once if you give it a path. If you open the file first and pass the reference to the Write to Binary File, then it can append the data. Look at the help for the Write to Binary File VI. David Quote Link to comment
mayday Posted June 15, 2006 Report Share Posted June 15, 2006 Try something like this one attached below. It could be a way to append data: at first it checks for an existing file, if nothing is found a new file is created; if a file is alredy present then it "appends" data. Let me know what do you think about that Fabio Download File:post-5312-1150347999.vi Quote Link to comment
Jason Posted June 15, 2006 Author Report Share Posted June 15, 2006 Download File:post-5311-1150390835.vi Try something like this one attached below.It could be a way to append data: at first it checks for an existing file, if nothing is found a new file is created; if a file is alredy present then it "appends" data. Let me know what do you think about that Fabio This program worked very well for awhile. It solved a few problems I was having. The only problem I am having now is that when the programs reads the file and inserts new data into the array, the array eventually becomes too large for the computer to handle. I tried modifying your program slightly so that new data would simply be appended to the end of the binary file but have still had no luck. I've looked through the writings Vis and the helps several times. Is there a way to do this? Mayday's slightly modified Vi: Download File:post-5311-1150390835.vi Quote Link to comment
Jason Posted June 15, 2006 Author Report Share Posted June 15, 2006 For any who might be interested: I was finally able to successfully append data to a binary file by adding a "Set File Position" Vi in the sample Vi "Write to Binary". I swear I tried this before and it did not work. Anyway, the following Vi is what I am now using. Download File:post-5311-1150408994.vi Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.