Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI-6221M Counter Triggering problem

Hi,

I have a PCI-6221M card with a BNC-2120 module.


I would like to count the "signal 3" impulses by counter input in my DAQu card.(exactly the number of impulses in one "package"). However, I have not found an option to run the counter only when the gate is open (signal 1).(if there is such a possibility, I would ask for a clue how to do it).

Therefore, I decided to read the gate opening time from the gate opening signal. Next, I trigger the counter input with the rising edge of the gate opening signal and count the impulses for the previously determined time. However, the counting result is different each time you start the program.When I remove the counter triggering and just turn on the counter, which counts "signal 2" impulses for a given time,the result is always correct. So i thnik that there is problem with triggering.

My question: Is the triggering of the counter input correct?

Download All
0 Kudos
Message 1 of 3
(2,325 Views)

I think a good way to approach this is by doing a pulse width measurement of signal 1 using signal 3 as the "Counter Timebase Source".  Each raw u32 count value will be the # of signal 3 edges that arrived while signal 1 was in high state.  You won't need to set up any triggering.

 

(Note that this same approach also extends nicely if you want to do buffered measurements.  You'd need to include a call to DAQmx Timing using "Implicit" as the timing type.  There are other possible approaches, but I think this one is simplest.)

 

 

-Kevin P

 

pulse width example.png

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 2 of 3
(2,288 Views)

Thank you for the answer! This is really nice approach.

0 Kudos
Message 3 of 3
(2,269 Views)