LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

AI writes more data than specified

I am aquiring analog input data in the following fashion -- I had used AI Config, AI Start, and AI Read. These functions are acurrately reading my data, however, when I specify my buffer size, scan rate, and the # of scans to read at a time, I find that I have more data written to the file that I have specified. Right now my buffer size is 3360 scans, with a scan rate of 1 scan/sec, and my buffer is reading 240 scans at a time (thus every 4 minutes.). However, when I look at the file that I have written data to, I notice that the file has been written to 17 times, where as if you do the math 3360/240 = 14. So somehow I am writing 3 more full buffers to my file, which causes my program to take 12 minutes longer to execute than planne
d (1 scan/sec, buffer =240, 240 sec/60 = 12 min.)

If anybody can help me figure out what I am doing wrong it would be greatly appreciated.

Thanks.
0 Kudos
Message 1 of 5
(3,071 Views)
At that slow of a scan rate (1 Hz), you're better off using the simple AI Read Channel vi's and using software timing. Alternatively, use the buffered reads at a higher frequency and average the signal. I've seen all sorts of weirdness at scan rates less than 10 Hz on buffered acquisition.


2006 Ultimate LabVIEW G-eek.

0 Kudos
Message 2 of 5
(3,071 Views)
The only reason I have such a slow scan rate is that I am sampling 16 channels in 1000 loops that are 60 minutes long each. If I use a higher scan rate (I am already averaging my data that I write to files) then I end up with some unreasonable amount of data in the long run.

I will look into changing my scan rate, but if you have any other suggestions they would be greatly appreciated.

Thanks a ton.
0 Kudos
Message 3 of 5
(3,071 Views)
Right, but for slower acquisitions, you can use the AI Acquire Waveforms.vi (Functions->Data Acquisition->Analog Input). Set it up for the 16 channels, and then just use either a Wait function or Get Date Time Secs (Time & Dialog functions) to set the acquisition rate in a while loop.


2006 Ultimate LabVIEW G-eek.

0 Kudos
Message 4 of 5
(3,071 Views)
Greetings,

I am curious about the structure of your program. As I understand it, you are starting a finite acquisition of 3360 scans and reading 240 scans at a time in a loop. Is this correct? How are you controlling the number of times AI Read.vi is executed? Would it be possible for you to attach your VI?

Spencer S.
0 Kudos
Message 5 of 5
(3,071 Views)