Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

HELP ! HELP ! Data Aqusition with Digital Trigger

Hi
 
I am very new to the field of Data Acqusition and I am currently working on a project that requires it. I am running Linux system and I finally have the NI 6220 DAQ working. I am using C as the programming language. I managed to run the Acq-IntClk.c example without any problem. The problem arises when I am trying to use Acq-IntClk-DigRef and Acq-IntClk-DigStartRef examples. It just seems like I am being dumb and doing something incorrectly.
 
I have an external clock that runs at 10% duty cycle with the pulse width of 2ms. I need the DAQ to be acquiring data only during the pulse width... well that's for the long run... Right now I just need to be able to start the reading on the rising edge of this external clock driven by another timing card.
 
Right now I have connected ai0 to the analog voltage and the PFI0 is connected to the external clock.
 
Can someone who's already got DAQ working with digital trigger help me out with this.... I'll probably need a step by step help to get this example working.
 
Thank you very much...
 
Kaushal
0 Kudos
Message 1 of 3
(3,037 Views)
Hi Kaushal,

Since you are currently using only one external clock in addition to the analog input voltage, the Acq-IntClk-DigRef.c would be the example to work with.  Most of the changes that you must make to this particular example to get it to run are in the "DAQmx Configure Code" section.

Here is a copy of this portion of the example, with the parameters of most concern to you in bold:

DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai0","",DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_Volts,NULL));
DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,"",10000.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,1000));
DAQmxErrChk (DAQmxCfgDigEdgeRefTrig(taskHandle,"/Dev1/PFI0",DAQmx_Val_Rising,100));

The DAQmxCreateAIVoltageChan function is used to configure the analog input channel for your acquisition.  DAQmxCfgDigEdgeRefTrig is used to configure the terminal used as the source for your digital reference trigger.  This example acquires 1000 total samples of the analog waveform, 100 of those samples being pretrigger.  A good source of information about the various DAQmx function calls can be found in the NI-DAQmx C Reference Help.  This documentation can be found by going to Start>>Programs>>National Instruments>>NI-DAQ>>NI-DAQmx C Reference Help.

In addition, there is good information about getting started with and using DAQmx here.

Regards,
Andrew W
National Instruments
0 Kudos
Message 2 of 3
(3,022 Views)
Thank you for the help Andrew, really appreciate it.
0 Kudos
Message 3 of 3
(3,017 Views)