Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Why my data acquisition stopped before the process is done

I am using a software analog trigger to acqure one waveform at the time. The code is as followed:

m_CWAI.GetStopCondition().SetType(cwaiSWAnalog);
m_CWAI.GetStopCondition().SetLevel(m_TriggerLevel);
m_CWAI.GetStopCondition().SetSource("1");
m_CWAI.GetStopCondition().SetPreTriggerScans(PreTriggerScans);
m_CWAI.GetStopCondition().SetMode(cwaiFalling);
m_CWAI.SetNScansPerBuffer(Scans);
m_CWAI.SetNScans(Scans);
m_CWAI.GetScanClock().SetFrequency(ScanRate);
m_CWAI.GetStopCondition().SetHysteresis (0.0);
m_CWAI.Configure();
m_CWAI.Start();

Basically the way the program works is that it will acquire one waveform at the time then stop data acquisition until the user presses the right keybord, then i
t will start data acquisition again. The program pretty much loops among start data acquisiton, acquired 1 waveform, stop data acquisition and wait for the right key.

My problem is that if I set a very small period of the waveform to be acquired (either small sampling rate or small record size or both), the program does not work consistingly. It does not start data acquistion when the right key was pressed. This was never a probelm if the period of the waveform was set long enough. What would be a problem?

Thanks.
Yajai.
0 Kudos
Message 1 of 2
(2,592 Views)
Hi Yajai,

Since you will be acquiring a finite number of samples, you don't need to set the "SetNScansPerBuffer" parameter. Otherwise, your code looks like it should work correctly. Since this is only a problem with small buffers or quick sampling rates this leads me to believe that you are missing your data all together. The problem is that it takes on the order of 10-100ms to configure the card and then start the operation. You are probably missing your trigger condition.

I would test it using a digital trigger and you connecting the 5V pin to your trigger pin to "stop" the acquisition. I'm pretty sure that it will acquire small record sizes at small sampling rates. The key is to have your card waiting for the trigger and making sure that the tr
igger condition is met. I have a feeling that the device is never receiving the trigger condition.

Anyway, hope that helps. Have a good day.

Ron
Message 2 of 2
(2,592 Views)