Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

1 ms time delay in simultaneous buffered event countin

Hello all,

I am doing single molecule spectroscopy, and I use Labview 7 for data aquisition. We have dual Avalance Photodetectors who must have data collected in synchronism so as to be able to match 'events' in each channel. We wrote a labview program using buffered event counting, and the timers are simultaneously armed with a pulse from counter 3.

In troubleshooting, we saw that we have a 1 ms delay in the acceptor channel, in that the two do not start collecting at the same time, even though the program should initialize them together.

Any advice on how to fix this problem would be much appreciated!

Thank you very much,

Chuck
0 Kudos
Message 1 of 6
(3,829 Views)
Sorry, I should have mentioned that we're running dual BNC cables into a BNC-2121 which is connected to a PCI-6602 card.

Thanks again

-Chuck
0 Kudos
Message 2 of 6
(3,828 Views)
Chuck,

Looking over your vi and considering default values for Gate and Trigger specs, it looks like you're using rising edges of Ctr3 to be both the Gating signal (aka "sampling clock" in DAQmx) and the Trigger signal. I see two possible problems:

1. When the same edge of the same signal acts as both the trigger and the gate, there may be a race condition. You might buffer your first value at the same instant as the trigger (give or take some nanoseconds) or you may buffer it one cycle later. In your case, with a pulsetrain of 1000 Hz, that's exactly 1 msec. I suppose in theory that the behavior could be different for each of the two buffered counters, race conditions being indeterminate and all.

Now, I actually don't think this is the cause of your immediate problem, but it could come back to get you sometime. So I would recommend using the falling edge as a trigger signal if you want the rising edge to be the gate.

2. Very likely, the main problem is that your Ctr3 pulsetrain is started and running before your buffered counters are started. As your code executes, one of your buffered counters is started just before the other. It may well see a trigger and gate before the code to start the other counter can run.

This problem would go away if you start Ctr3 after starting the two buffered counters.

Good luck!

-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 6
(3,814 Views)
Thanks very much Kevin,

Could you offer a simple way to rearrange Ctr3 to after initializing the counters? I'm still very much a newbie at Labview 😞

Thank you very much!

-Chuck
0 Kudos
Message 4 of 6
(3,811 Views)
Chuck,

I believe that Kevin was referencing the actual programmatic flow of your code. Notice that the Counter Control.vi for group zero has the output error cluster wired to the input error cluster of the Counter Control.vi for group one. By moving the Route Signal.vi so that the output error cluster of the Counter Control.vi is routed to the error cluster input, you can force the program to start the counters before the pulse is being routed.

-Andy F.
-----------------------------------------------------------------
National Instruments
0 Kudos
Message 5 of 6
(3,785 Views)
Chuck,

Here's a modified version of the vi you posted, including the changes I suggested.

-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 6 of 6
(3,781 Views)