05-30-2019 10:53 AM - edited 05-30-2019 10:57 AM
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?
05-30-2019 03:18 PM
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
05-31-2019 02:19 AM
Thank you for the answer! This is really nice approach.