Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

high sample rate recording to CSV file [ VB.NET ]

I have a PXI 6254 AI card in a 1042 chassis.
The chassis is tied to my development PC via MXI-4.

When recording 8 channels at 15, 20 or 30KS/s, I am experiencing
delays in writing CSVs to disk.


I am using SATA drives.

For example, when I record for 2 minutes at 30KS/s...
at the end of the recording the system hangs for 2.5 minutes

at <=1KS/s, this delay does not occur.

during this time the hard drive light is on almost continuously

i have attached my callback acquisition loop and the "write to disk" code:

Thanks.
Philip Newman
General Dynamics
Electric Boat
Download All
0 Kudos
Message 1 of 3
(3,446 Views)
Hello

One think you could try is moving the file i/o to the UI thread and running the timer as fast as possible. I used the queue to get the timestamp at the time the data came in to make sure if the the timer and the async callbacks went out  of sync, the data will still be there.

Im attaching my test app.

Another thing you should look into is writing a binary file. Check out this example for more information

I hope this helps.
Bilal Durrani
NI
0 Kudos
Message 2 of 3
(3,412 Views)
the delay problem appears to have been caused by executing:

streamwriter.flush

and

streamwriter.close

when i press my "stop recording" button

strange!

so what is closing my CSV file now?


Philip Newman
General Dynamics
Electric Boat
0 Kudos
Message 3 of 3
(3,373 Views)