05-21-2009 04:32 PM
Hi.
I am reading a single channel of analog data with this function call.
It works fine the first time but if called the second time it errors out because the data array is full.
I want to overwrite the data array every time this function is called.
How do I reset the analog channel so I can do anpother read and overwrite the data array?
Thanks.
05-22-2009 04:06 PM
Hi
You can use the DAQmx_Val_OverwriteUnreadSamps function (C reference help) and that will overwrite your data if the buffer fills. In this function you can set the read position to read just the most recent data acquired. With this function you should not see a buffer overflow error. This is a configuration setting for the device so it will need to be placed before the DAQmx start task function.
I would recommend to review the DAQmx C reference help if you are unsure exactly how to use this function. Hope this helps!
Start>>Programs>>National Instruments>>NI DAQ>>Text Based Code Support
05-22-2009 04:30 PM
Hi Jordan.
The documentation seems to be discontinuously spread out over LabWindows Help, NI-DAQmx Help and NI-DAQmx C Reference Help without a well written overview of all the required setup steps.
I tried all the combinations of reset and overwrite calls but no luck.
I was able to get it to work by starting and stopping the task every time I call DAQmxReadAnalogF64() which works for me.
Thanks.
05-10-2021 06:23 AM
Hi Jordan.
I have the same problem, so I would like to know how DAQmx_Val_OverwriteUnreadSamps is used.