Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

cDAQ 9174 CtrlInternalOutput duty time

Solved!
Go to solution

Hi everyone,

I am new to the LabVIEW coding. I have a application for analog data sampling with cDAQ 9174, NI 9401 and NI 9215 programmed by my former colleague. In this app, he set the rate and duty cycle of a counter in NI 9401 but used cDAQ-9174/CtrlInternalOutput as the sampling clock source for analog data input. But he just set the sampling rate in DAQmx Timing VI for analog input task. Does anyone know how to know the duty time of cDAQ 9174 internal counter 1. Was the duty cycle of  cDAQ-9174/CtrlInternalOutput related with that in NI 9401 counter 1?

Thanks very much.

0 Kudos
Message 1 of 3
(2,317 Views)
Solution
Accepted by topic author Shiwei

The 9401 does not have any counters onboard.  You can use the 9401 to acquire/generate digital signals, or you can use its pins as GPOIs to access the 9174's counters.  When you generate a task that uses a counter with a 9401 channel, you need to specify the counter used (for example, "cDAQ-9174\ctr0").  You can also configure the frequency, duty cycle, and where you route that counter (for example, "9401\PFI0").

 

If the code uses Ctr1InternalOutput as the sample clock source for an analog task, then that analog task will NOT execute unless the counter has been configured.  So, if your code runs and there is other DAQmx counter code running that you haven't talked about in your post, then the counter used for the 9401 task is the same as what is routed to the analog input task.  When you use the "Ctr1InternalOutput", the cDAQ is smart enough to automatically share the ctr1 output signal with the analog input's timing engine even if you're also routing that signal to a 9401 channel. 

 

Your colleague specified the sample rate for the DAQmx Timing VI for the analog input, but this number is for the most part ignored by DAQmx in this case because the actual sample rate is going to be the frequency of ctr1.  The rate you specify is just one thing DAQmx considers when it sizes the acquisition buffer in software.  You don't need to worry about this process, but it's a good practice to make sure that the sample rate you route to DAQmx timing is the same as the counter frequency you use so that the DAQ buffer is not configured to be too small.

 

I hope that helps!

Message 2 of 3
(2,268 Views)

Hello Croohcifer,

Thank you very much. You really help me to correct my misunderstanding in NI 9401.

0 Kudos
Message 3 of 3
(2,243 Views)