11-30-2011 12:19 PM
I am attempting to continously write the data from a NI 9227 Current module (mod3), NI 9221temp module (mod2),and a NI 9205 voltage (mod1) in a cDAQ bus to a spreadsheet file. I used MAX to create a task containing the three channels I want to write to file (cDAQ1/mod1/ai0, cDAQ/mod2/ai0, and cDAQ/mod3/ai1, and selected the sample clock of NI 9227 (mod3) in advanced timing to make sure the data samples from each channel are being obtained simultaneously. Once the task was created I used it in the block diargam to automatically generate code. When I run the code that was produced and open the tdms file in excel the data looks good initally, but then after a while it starts to get broken up into chunk ofs 5-6 columns. How can i fix this problem? I have attached my VI. Thanks for the help.
11-30-2011 01:09 PM
Also, I receive this error immediately when running the VI about half of the time.
Possible reason(s):
Attempted to read samples that are no longer available. The requested sample was previously available, but has since been overwritten.
Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem.
Property: RelativeTo
Corresponding Value: Current Read Position
Property: Offset
Corresponding Value: 0
Task Name: _unnamedTask<56>
11-30-2011 02:09 PM
Hi mbrupb,
the old problem: your file writing is slowing down the loop and so the DAQ part gets to slow to handle your aquired data...
Use separate loops with a queue to send data from one loop to the other (aka Producer-Consumer-pattern)!