LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

hardware timed digital input with X series multi functional DAQ

1. I was able to read in digital logic pulse waveform by using hardware timed digital input port (port 0) on X series DAQ 6323 with CVI code below:

DAQmxCreateDIChan( TaskHdl[DI], "Dev1/port0", "", DAQmx_Val_ChanForAllLines);  

DAQmxCfgSampClkTiming(TaskHdl[DI], "/Dev1/20MHzTimebase", samp_rate, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, BUF_SZ);

DAQmxReadDigitalU32(TaskHdl[DI], DAQmx_Val_Auto, 1.5, DAQmx_Val_GroupByChannel, Dbuf, BUF_SZ, &actual_samp, 0);

 

2. However, I want a trigger signal so that captured waveform will stay the same. As indicated in X-series DAQ user manual, a square wave functioning as trigger signal was fed into PFI14 line, it works well under MAX (sampling rate at 1MHz, 1000 points continuos). Please see attached figure.DIN_SENT.PNG

 

3. However I could not get the following code to work as MAX. Any idea?

DAQmxCreateDIChan( TaskHdl[DI], "Dev1/port0", "", DAQmx_Val_ChanForAllLines);  

DAQmxCfgSampClkTiming(TaskHdl[DI], "/Dev1/20MHzTimebase", samp_rate, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, BUF_SZ);

DAQmxCfgDigEdgeStartTrig(TaskHdl[DI], "/Dev1/PFI14", DAQmx_Val_Rising);
DAQmxCfgDigEdgeRefTrig(TaskHdl[DI], "/Dev1/PFI14", DAQmx_Val_Rising, pretriggerSamples);

DAQmxReadDigitalU32(TaskHdl[DI], DAQmx_Val_Auto, 1.5, DAQmx_Val_GroupByChannel, Dbuf, BUF_SZ, &actual_samp, 0);

 

 

0 Kudos
Message 1 of 2
(2,293 Views)

Hi Charlie2016,

 

Can I ask what do you mean by it doesn't work? Can you attach a picture of what you are getting so that we can compare? Or are you getting an error?

 

Regards,

Alyssa H.

National Instruments

0 Kudos
Message 2 of 2
(2,252 Views)