Showing results for 
Search instead for 
Did you mean: 

DAQmx gate counter output



   I am trying to convert an existing legacy application developed in LabVIEW 6 (Traditional DAQ) into LabVIEW 2012 (DAQmx). The operation requires generating one counter output that is gated by another counter output. I have attached a fully functional example using Traditional DAQ. In the example you can see the Carrier Frequency output (4550 Hz or 5525 Hz) is generated by Counter 1. The counter Gate Frequency is generated by Counter 0. Counter 1 output is now gated by Counter 0 output in which you end up with bursts of the Carrier Frequency at a rate set by the Gate Frequency (from 3 to 21.5 Hz). This works fine but I cannot replicate this in DAQmx. The DAQ board I am using is an NI DAQCard-6062E (in a PCMCIA Slot).

   Any sugestions are appreciated.

Thank You,

Mike Westgate

0 Kudos
Message 1 of 7

Hi Mike,


I wasn't able to properly look at your code since I have not install the Traditional DAQmx (Legacy) driver yet.


But I do have the following links that can help you in transition from Traditional DAQ to DAQmx:

Answers to Frequently Asked Questions about NI-DAQmx and Traditional NI-DAQ (Legacy)

Transition from Traditional NI-DAQ to NI-DAQmx in LabVIEW



Ee Lim

See that button on the left side of this post...

If you feel my post is helpful, all you need is just (at most) 2 seconds to click that button, to show your appreciation. Thank you~~

0 Kudos
Message 2 of 7

I have finally figured out a solution for gating a counter output in DAQmx. I will attach it here.


Thanks anyway,

Mike Westgate


Message 3 of 7

This is very interesting!

Is it possible to force the gated counter to reset to idle state rather than to just pause?

This could be particularly helpful if the gate signal comes from an external asynchronous device...

Thank you!

0 Kudos
Message 4 of 7

I don't think you can do this directly.  You can kinda do it indirectly with another counter.


The new counter will generate re-triggerable single pulses.  It will be triggered by a rising edge from your previous output counter, will have the same high time as previous, and a minimal value for low time and initial delay.


When the gate signal pauses your original output, there will be no more rising edges to re-trigger your new output, so it will revert to idle state.



-Kevin P

Message 5 of 7

I like the idea, but it seems not to work with a device that features two counters only (like the 6289 that I have).

When I understand it right, the retriggerable (slave) counter needs to generate a finite number of samples, so it seems the second counter becomes occupied implicitly, so the other (master) counter reports error -50103.

Or did I do something wrong?

0 Kudos
Message 6 of 7

You did something eminently reasonable but nevertheless wrong.  There's another way to do single pulses.  Simply *omit* any call to DAQmx Timing and you'll get a single pulse without having to occupy 2 counters.  Add in the triggering config, including the property to set retriggerable=True, and you should be ok.


There's a shipping example for single pulse output that can be configured to be retriggerable.  That oughta show you what you need to do.



-Kevin P


Message 7 of 7