From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing DAQ setup parameters in real-time during Acquistion

Hi Guys,

I would like to alter the operation setup of my DAQ (E Series 6014) in real-time after it has been initialised to certain value. In particular the only line of code that I want to update with new values is as follows:

iStatus = DAQ_Start(iDevice, iChan, iGain, piBuffer, ulCount, iSampTB, uSampInt);
iRetVal = NIDAQErrorHandler(iStatus, "DAQ_Start", iIgnoreWarning);

In this case, only ulCount varies so that my buffer size accounts for a corresponding change in the sampling frequency (higher sampling frequencies mean that I would like a larger buffer and vice versa).

If anyone knows whether this is possible it would be great.

My code is pretty simple. I use EXTCONV* to externally clock an
analog input. Therefore, I have an AI on the default pin AI0 and DAQ_Config has iExtConv = 1. The addition of double buffering to this means that I can acquire varying amounts of data depending upon the trigger rate.

Kind Regards,

Gaurav
0 Kudos
Message 1 of 2
(2,860 Views)
Gaurav,

It will not be possible to call the DAQ_Start function when an acquisition is already in progress. If you need to change the size of the buffer, you will need to stop the acquisition before you call the DAQ_Start function. Obviously, this will result in the loss of samples. Thus, you may want to consider specifying a buffer large enough to support the fastest expected sample clock and use this buffer for all sampling rates.

Good luck with your application.

Spencer S.
0 Kudos
Message 2 of 2
(2,860 Views)