Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI 6602 two edge separation

Hi, I'm trying to trigger the counter card (PCI 6602) with start and stop signal and read back the total amount of rising edges occurring between start and stop triggering events. The start and stop signal are defined as the rising and falling edges of an external logic signal. I need the data to be acquired between only one rising and falling edges. With this signal I need to trigger two different counting channels of the counter card.

 

I'm operating with Labview 2010 with DAQmx where the most suitable solutions appears to be "two edge separation" or "measure pulse width" channels. This two channels combined with an external timing signal (my signal to be counted) seems to meet my needings. Labview examples for both channels do not work, however the counter examples do work, thus I know that a signal could be read from the counter card.

 

Working examples:

 

Hardware and Input>>DAQmx>>Count Digital Events>>Count Digital Events.vi

Hardware and Input>>DAQmx>>Count Digital Events>>Count Digital Events-Pause Trig.vi

 

Not Working examples:

 

Hardware and Input>>DAQmx>>Meas Two-Signal Edge-Separation>>Meas Two Edge Separation.vi

Hardware and Input>>DAQmx>>Period or Pulse Width>>Meas Pulse Width.vi

 

error message is very similare for both examples and reads:

Error-200474 Occured at Meas Pulse Width.vi possible reason specified operation did not complete because of the specified timeout expired.

 

The signal fed into was a square logic signal of period 200ms and could be used with the counting examples. Min and maximum pulsewidth time was adjusted accordingly inside the vi.

 

Thank you for your help

 

 

 

0 Kudos
Message 1 of 5
(6,236 Views)

If your signal is on a single input (i.e. measure the time between the rising and falling edge of a single input), you'll want to go with pulse width.  If it is on different inputs, you'll want two edge separation.  You would use the signal you want to count as the timebase for these tasks.  Read back the value in terms of "ticks".

 

-200474 means that your read call timed out.  It would do that if you didn't have a signal (I mean the start/stop signal) connected.  The start/stop signal should be connected to the gate of the counter for a pulse width measurement, which is a different default PFI than the one used for the count digital events examples (which use the source).  Perhaps this is the issue?

 

 

Best Regards,

John Passiak
0 Kudos
Message 2 of 5
(6,225 Views)

Thanks for your help! Now I'm able to measure a pulse width even with an external clock signal. My issue was in the uncorrect use of gate and source inputs.

 

Now I have two more problems I cannot get through:

 

- I receive a timeout error as I try to count 0 ticks (error: 200474). It is actually quite important to acheive 0 counts without exploiting the timeout error message.

- I'm not able to use a timebase signal with asymmetric time for levels "1" and "0" (error: 200474). Example: The card is working regularly with a clock signal of 5ms period and 50% duty cycle, but not working with 5ms period and 41% duty cycle. Final timebase signal is expected be "1" for 20ns with randomly spaced "0" waiting times.

 

Thanks

 

0 Kudos
Message 3 of 5
(6,205 Views)

Enabling duplicate count prevention using a DAQmx Channel Property Node should fix the first problem:

 

DuplicateCountPrevention.png

 

The second problem doesn't make sense--the 6602 does not require a 50% duty cycle timebase for measuring pulse width.  If you are still having problems detecting a lower duty cycle timebase after fixing the first issue, let us know how you are generating the pulse signal (maybe try scoping it to make sure there isn't something else going on).

 

 

Best Regards,

John Passiak
Message 4 of 5
(6,199 Views)

Problems solved. Thanks for your help!

 

Actually, if you are interested, the solution to the first problem solves even the second. I can "switch" the duty cycle problem on and off changing the input value for the"Duplicate Count Prevention" from "false" to "true".

 

Best regards

 

Giovanni Cerchiari

0 Kudos
Message 5 of 5
(6,188 Views)