Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Semiperiod measurement with 6602

Hello,
I am using a PXI 6602 card with LabView 7.1 to perform PWM signal measurement.
DAQmx assistant works well : when choosing buffered semiperiod measurement, I retrieve a table containing duration of all levels of my signal on GATE input.

My problem is : how to know what was the level (logic sate : 0 or 1) of my signal when the card started counting ?

I tried to find a way to associate an active edge detection for GATE input, but was unable to make it work...

Would you please have a solution ?
0 Kudos
Message 1 of 5
(3,907 Views)
Inpriser,
I can describe how I did it under traditional NI-DAQ 6.9.x and LabVIEW 6.1. I expect a similar thing can be done under DAQmx, but I'm not near enough my daq pc to check right now.

By setting the "gate polarity" property, you can control which edge will be registered first. For example if you set rising edge polarity, the first element in your data acq array will be the time from when you started the acquisition until the first rising edge. All subsequent entries will alternate as expected.

Note that you may miss an initial falling edge in this setup. Also note that even if
you haven't explicitly defined the gate polarity, a default value is likely being used anyway -- that should keep your results consistent from run to run.

If you can't afford to miss the initial falling edge, reply and I'll try to help some more.

-Kevin P.
CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 2 of 5
(3,895 Views)
Thanks for your answer Kevin,
I also checked for "gate polarity" with DAQmx, but I didn't find this property anywhere.

As you notice, even if I do not specify it, I could expect a default value to be used. Nevertheless, the successive attempts do not give same results from run to run...
I explain my setup : I use a signal generator as input on GATE, with 10kHz square wave with the following duty cycle : 4ms at "0" and 6ms at "1".
I use the DAQmx buffered semiperiod measurement and get an array of consecutive "4" and "6" ms, as expected. But from run to run, it sometimes starts at 4 and sometimes at 6ms... (note that I always discard the first measurement).

I had a look on "traditional" VIs, but I did not find out how to perform semiperiodic measurements. Maybe by combinating high-level and low-level period measurements ?
0 Kudos
Message 3 of 5
(3,886 Views)
Hello-

There is currently a known issue with starting edge selection for semi-period measurement in DAQmx. As a workaround until a fix can be put in the driver, you can use the "Arm Start Trigger" to force the counter to start on a rising or falling edge for semi-period measurement. The duty cycle measurement example in DAQmx ("Meas Duty Cycle-Buffered-Finite.vi") is an example of using the Arm Start trigger for this purpose. Sorry for the confusion.

I hope this helps!
gus....
Message 4 of 5
(3,885 Views)
Thanks gus, with the "Arm Start Trigger" it works exactly as I expected !
0 Kudos
Message 5 of 5
(3,873 Views)