Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

synchronizing a pulse generator and a A/D read

4-8-08

I have a requirement to measure an analog feedback during a 1%, 2% and 20 % duty cycle. I need to sample the signal during the 35 usec that the duty cycle is low.

I’m using a NI-9172 chasse with a NI-9401 in slot 5 to create the different duty cycles. I have 3 NI-9221s in slots 1, 2, and 3. 1 channel of the 9221 in slot 3 is the one I’m trying to synchronize with the duty cycle pulse A NI-9211 in slot 4, and NI-9485 in 6, 7 and a NI-9481 in slot 8.

I tried triggering the read task with the output of the counter generating the duty cycle pulses but every time my vi gets to this steep I get a resource unavailable error. I have tried the DAQmx connect vi but I loose my duty cycle when I connect it to anything else.

I have tried hardwire jumpers to other inputs and many other things. Dose anybody have any ideas how I can synchronize these two signals.

Thanks

0 Kudos
Message 1 of 2
(3,550 Views)

Hi TeBlues,

If you receive a specific error message (especially an error code number), please be sure to post it.  These error messages often can provide significant clues to want is occurring.  You mentioned a resource unavailable error.  Without the error code or details it is difficult to say what is causing the error.  I have seen error Error 50103 "The Specified Resource is Reserved." The following knowledge base discuss more about this error.  The basic issue is that with the NI-9172 cDAQ chassis you can only have one analog input task and one analog output task.  All of your analog input channels should be in the same task.

Causes of NI-DAQmx Error 50103 "The Specified Resource is Reserved"

As far as synchronization, you might look at this example program. It could be easily modified to meet your needs. It has setup for an external trigger (which you can remove if not needed) and an external sample clock for the analog input (in your case the pulse created from your counter).  You could change the type of counter output from ticks to frequency so that you can set the duty cycle.  The example uses the counter output as a pause trigger, configured by default to take samples when the counter output is high.  This can be changed.

Synchronizing Finite Retriggerable Analog Input with External Sample Clock

Hope this helps.


Jared T.
0 Kudos
Message 2 of 2
(3,530 Views)