Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

New at this, have Continous Strin Gage VI of NI- need save to file-Help

I am a Machanical Labs Technician at a University.
I am very new at LabView.
 
Faculty has placed a modified lab using LabView at the last moment. We need to take Strain gage measurements and record them to disc.
I found the Continuous Acquisiton Strain Gage samples (with calibration).VI In the LabView examples. I tried adding the Write Measurement File under the Function/Express area.
 
After I conected it to the 'measuremnt' wire in the last while loop of the Cont Aqc Strain vi I got an error, one part of it refered a possible solution as to increace the buffer size.
 
Could some one help me with this. I am under the gun and do not want to disappoint the engineering students.
 
Terry
0 Kudos
Message 1 of 2
(6,415 Views)
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


Message 2 of 2
(6,400 Views)