Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Retriggerable one shot - polarity change

I'm using a NI-6602 to create retriggerable, one-shot generation on 4 channels. I can get the correct pulse generation for low to hi to low polarity, but simply changing the high to low on the idle state does not invert the signal. I'm using the DAQmx Create Channel node, and my counters are all synchronized, but the program doesn't create the correct output.  Any thoughts?  Thanks.

Marshall
0 Kudos
Message 1 of 4
(4,276 Views)

Marshall,

I took a look at this, and to invert your counter pulse, you will have to invert the high and low times as well as the idle state.  The problem is that dependent on the idle state, the channel will run either the high or low times first.  See the attached VI for the example that I was working on.

Josh W. | National Instruments | Applications Engineer

Josh W.
Certified TestStand Architect
Formerly blue
0 Kudos
Message 2 of 4
(4,266 Views)
Yeah, the method for reversing polarity was one of the quirks of moving from Trad. NI-DAQ to DAQmx.  Under the traditional drivers, you defined a pulse as a delay interval followed by a pulse interval.  You didn't explicitly set a high time and a low time.  The counter would be in its idle state during the delay and in active state during the pulse.  To define polarity, you would set a single parameter (I don't remember the syntax anymore...), and then the driver would figure out how to map from delay/pulse to low/high.
 
I think the high time / low time terminology of DAQmx is more universally understandable, but there are occasions where it slightly complicates the configuration of output pulses.  A couple careers ago, I was putting together apps for automatic motor testing that often used a PWM-based speed control.  Some motors had active high PWM and others were active low.  In traditional NI-DAQ, this was actually a little simpler to accomodate than if I were doing it now with DAQmx.  Not that I want to go back or anything -- DAQmx's advatages far outweigh the relatively few inconveniences.
 
Sorry for the ramble, we now return you to our regularly scheduled inquiries...
 
-Kevin P.
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 3 of 4
(4,244 Views)
Thanks all! That's an interesting change, slightly non-intuitive and perhaps oversimplified for most, but I agree DAQmx is way better than the alternative. Thanks for the help.

Marshall
0 Kudos
Message 4 of 4
(4,241 Views)