02-12-2014 01:10 PM
Hello,
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
02-12-2014 09:04 PM
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
02-13-2014 09:23 AM
I have finally figured out a solution for gating a counter output in DAQmx. I will attach it here.
Thanks anyway,
Mike Westgate
02-28-2018 06:17 AM
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!
03-01-2018 04:55 PM
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
03-07-2018 11:13 AM - edited 03-07-2018 11:14 AM
Hello,
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?
03-07-2018 12:53 PM
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