Hi Terry,
The error you recieved indicates that you are getting a buffer overflow
on your analog input. Basically, when the file I/O is present in
your code, you are not able to read samples out of the aquisition
buffer as fast as they come in, so at some point there is an overflow.
There are a couple ways that I would suggest you go about fixing this problem.
A) Optimize your file I/O.
The first thing to make sure of is that you've not chosen the
option to "Ask User to Choose File" in the Write to Measurement File
Express VI. If you have, then it will prompt the user to enter a
file name via a dialog box. There problem with this is that the
while loop will wait for this user interaction before it commences its
acquisition, so the input buffer will fill up and overflow. If
you want the functionality of this Dialog Interface, without slowing
down your code, call the Write to Measurement File Express VI once
before you start your acquisition so that the user still has the
ability to choose a file, without the acquisition being delayed.
Another thing to make sure of here is that you've chosen the
"Append to File" option in the Write to Measurement File
ExpressVI.
Otherwise it will try to save over the existing file each iteration of
your loop.
B) Decrease your sample rate.
If the suggestions in A don't help, then decreasing your sample rate
will acquire less samples at a time so your buffer will not fill up and
there is also less data to write. Can your application tolerate
decreasing this rate? If so, then this is probably the easiest
and quickest way to fix the problem.
If these suggestions don't help, I recommend posting your code as an
attachment to this forum so that the LabVIEW / DAQ community can take a
look at it and give more suggestions.
Have a great day!
Travis W