Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

pulse generation with NI9401 in cDAQ

Hi

I am looking at the Gen Dig Pulse Train-Finite.vi and the DAQmx Timing(implicit) is used to state to generate a finite number of samples and configure the number of pulses to generate.

My question is if I can use DAQmx Timing(sample clock) to generate a finite number of pulses. If so, how to choose clock source?

 

Following this, I look into 5_Multi-Function-Ctr Pulse Train Generation for AI Sample Clock.vi.

My project is to generate 10 pulses of 1kHz, duty cycle=0.5 from NI9401. Total time to run = 1/1000* 10 = 10mili seconds.

Simultaniously to start to aquire analog samples at 100kHz from NI9206. Aquiring 1000 samples at 100kHz which also cause system time to run=1/100 000 * 1000 = 10mili seconds

However, I have to following errors

Error -200284 occurred at DAQmx Read (Analog 1D Wfm NChan NSamp).vi:1

 

Thank you for all your help

Bing

Newcastle

0 Kudos
Message 1 of 4
(7,012 Views)

Hi Bing,

I have had a look at your code and I have found a solution. You needed some form of triggering so I put in a DAQmx Start Trigger. Please see solution in attached file

 

Hope this helps

Ben

NI

0 Kudos
Message 2 of 4
(6,987 Views)

Thank you Ben for you quick respose.

 

My task is to generate a finite number of 10 pulses from cDAQ9174 Counter/Timer and route it out by ctr0(PFI3) of NI9401. The digital pulse is 1kHz squarewave. Analog acquisition with sampling frequecy of 100kHz on ch0 of NI9206 is to start simultaneously with pulse generation. In another way, this means to synchrously aquire 100 sample during each pulse period (1ms).

I have some questions regarding the above task as well.


Question1: Does every module (NI9401 and NI9206 here) share the same onboard timebase 20MHz in cDAQ9174 automaticlly? If so, to achieve above task, do I just need to start simultaneously the pulse generation and analog input sampling by a same START TRIGGER, as shown in attachment1.

 

Question2: If the timebase answer is 'NO' to Question1, do I need to set the 'SampleClk Timebase Src Property Node' and what should be the source?

 

Question3: in attachment1, why the CO channel Sample Clock Rate does not display a reading?

 

in attachmet1, cDAQ1Mod1 is NI9206 and cDAQ1Mod4 is NI9401

0 Kudos
Message 3 of 4
(6,983 Views)

Hi Bing

Answer to Q1

I've had a look at the cDAQ 9174 chassis and each module plugged in will derive its timing from the onboard clock.

 

Answer to Question 3

You will not be able to see the clock rate because it is not being sampled by anything. The counter task is not a sampled task and not a buffered task so it isn't taking discrete samples.

 

Hope this helps

Ben

0 Kudos
Message 4 of 4
(6,972 Views)