Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to collect data after triggered 6 microseconds.

// DAQmx Configure Code
/*********************************************/
DAQmxErrChk (DAQmxCreateTask("Multi Channel sample",&taskHandle));
DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,"Dev2/ai0:1","",DAQmx_Val_Diff,-10.0,10.0,DAQmx_Val_Volts,NULL));
DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,"",SampleFreq,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,NOSPP));
DAQmxErrChk (DAQmxCfgDigEdgeStartTrig(taskHandle,"/Dev2/PFI2",DAQmx_Val_Rising));
DAQmxErrChk (DAQmxSetStartTrigRetriggerable(taskHandle,1));
 
// maybe use the funtion "DAQmxSetDelayFromSampClkDelay"?
//when  add  DAQmxSetDelayFromSampClkDelayUnits and  DAQmxSetDelayFromSampClkDelay line ,i can't get the data from NICard . IF  don't add the funtions , i  can get the right data .
DAQmxErrChk (DAQmxSetDelayFromSampClkDelayUnits(taskHandle,DAQmx_Val_Seconds));
DAQmxErrChk (DAQmxSetDelayFromSampClkDelay(taskHandle, 0.000006));
/*Config interrupt*/
DAQmxErrChk(DAQmxRegisterEveryNSamplesEvent(taskHandle,DAQmx_Val_Acquired_Into_Buffer,NOSPP,0,EveryNCallback,NULL));
DAQmxErrChk (DAQmxRegisterDoneEvent(taskHandle,0,DoneCallback,NULL));
0 Kudos
Message 1 of 4
(1,335 Views)

Do you have a question?

0 Kudos
Message 2 of 4
(1,301 Views)

The question is when i  add the DAQmxSetDelayFromSampClkDelay line ,i can't get the data from NICard and error code is -200077 . IF  don't add the funtions that is normal. how to add the dealy  time after each trriger trrigered?

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

1. Not all DAQmx properties are valid across all DAQ devices.

2. It sounds like you may be conflating the "trigger" with the "sample clock".  This is a somewhat common source of misunderstanding, perhaps because the terminology isn't used the same way by all mfgrs.

3. There are similar properties available for setting the delay from the trigger -- perhaps your device supports those?

 

4. Can you give us a detailed description of what your task needs to do?  Please be careful about terms like trigger and sample clock.   In DAQmx:

- a start trigger is a signal that initiates 1 full acquisition sequence.  No matter how many samples you collect, you only respond to a single start trigger signal throughout the acquisition time

- the sample clock causes the device to ADC convert one sample of each channel in the task.  There will be many cycles of the sample clock within each acquisition, and the number is indefinite when you do "continuous sampling".

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 4 of 4
(1,247 Views)