LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmxReadAnalogF64

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.

0 Kudos
Message 1 of 4
(3,733 Views)

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

Regards,
Jordan F
National Instruments
0 Kudos
Message 2 of 4
(3,705 Views)

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.

0 Kudos
Message 3 of 4
(3,701 Views)

Hi Jordan.

I have the same problem, so I would like to know how DAQmx_Val_OverwriteUnreadSamps is used.

0 Kudos
Message 4 of 4
(1,747 Views)