10-26-2006 08:22 AM
10-30-2006
03:06 PM
- last edited on
11-22-2025
05:08 PM
by
Content Cleaner
Manliff,
The 9237's specifications say that it can only sample at rates 50kS/s / n where n is 1,2,3 ... 31. This is actually incorrect, n can only go up to 13 (40R8O95I). So regardless of what rate you give the task, it will be coerced to one of the valid sampling rates (the lowest being about 3.84kS/s).
Your specific error about pulling data fast enough is related to the number of samples per channel, you can sample at higher rates by increasing the number of samples per channel.
Abhinav T
Applications Engineer
National Instruments
Message Edited by abhinav T on 10-30-2006 03:27 PM
Message Edited by Support on 10-30-2006 04:05 PM
10-30-2006
07:06 PM
- last edited on
11-22-2025
05:08 PM
by
Content Cleaner
Manliff,
I wanted to clarify something a little further. The limit for the value of n is a limit on the current version of the NI-DAQmx driver(v8.3). When the 9237 is used with a cRIO chassis, n can be increased to 31. At this time you will not be able to sample any slower. This issue should be fixed in the future however.
Please refer to this post for more details.
Abhinav
01-12-2007 06:53 PM
Manliff,
I seem to be having a similar problem with reading data using the 9237, I have tried setting the rate on the sample clock, changing the number of samples and inserting timers to my loop, but I keep crashing with the error that I need to acquire samples faster (in continuous mode). However, if I do this, I cant write data to file without it being a huge file.
Any advice as to how I can use the finite sample mode on the sample clock? I try using this and getting an error that I try to read past the available sample point, even though I set the sample clock to 600 samples and 5 samples/sec, which should allow it to run for two minutes.
Thanks for any advice.
Alfonso
01-15-2007
12:47 PM
- last edited on
11-22-2025
05:09 PM
by
Content Cleaner
Hello Alfonso,
It sounds like you might be getting errors -200279 and -200278. (In the future, if you post the actual error codes, it helps us to know exactly what is happening). Error -200279 happens when you are performing a hardware-timed acquisition (meaning the data is sampled according to a clock signal on your board), but your LabVIEW program is not reading the values from the buffer allocated for that task in computer memory fast enough. Basically it's a buffer overflow error. It means older samples have been overwritten before you attempted to read them out. As the error message suggests, "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." For more information on this error, please see the KB (DAQmx) Error -200279 During a Continuous, Buffered Acquisition.
Error -200278 happens most often when you have configured a finite acquisition, but are calling the DAQmx Read function in a loop. If you want to perform a finite acquisition, you should only call DAQmx Read once. For more information on this error, see the KB Error -200278 at DAQmx Read.
Finally, please refer to Abhinav's earlier post about the sample rate on the 9237 module. As he described, the NI-DAQmx 8.3 driver will only allow you to set the sample clock to integer divisions of 50k (50,000/n, where n can be 1, 2, 3...13). Since the maximum divisor is 13, the smallest sample rate that can be used is 3.846 kS/s. You can check what value the driver is actually using for the sample clock by reading from the SampClk.Rate property of the DAQmx Timing property node.
I hope this helps! Let me know if you have any questions about what I've described.
Best regards,
01-15-2007 12:54 PM
01-16-2007 12:43 PM
Jarrod and Kyle,
thanks for your comments.
Jarrod, your explanation was very good, I understand what is causing the problems regarding data acquisition and write to file. I will implement discreet data write as per Kyle's suggestion.
Thanks.
01-16-2007 06:44 PM
Jerrod and Kyle,
I have focused my program to deal only with the write portion . I have included it here. the current solution works to cut down the amount of data written to file.
What I did not realize clearly is that all previous runs of this program are stored in the same data file. One is appended to the next.
It would be usefull to write to the same file name each time, but delete the data from previous runs. Can you point me in the direction to clear the file before it is opened?
I tried using "TDSM flush" vi. but this only clears the current memory, not the hard file. I am sure there must be a vi to do this, I just don't know where it is.
Thanks again.
Alfonso