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.
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:
I have finally figured out a solution for gating a counter output in DAQmx. I will attach it here.
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...
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.
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?
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.