08-06-2010 05:33 AM
Hi,
I'm trying to take time-stamped pulse counts from a PMT, I'm having trouble both collecting and reading the data, I was hoping for some help.
My set-up uses three counters-
Ctr 1 takes a full, basic count, for the purpose of error checking
Ctr 2 takes does buffered event counting. The idea is that it counts ticks from the internal timebase, and then when a photon arrives, saves the value to a buffer.
Ctr 3 provides the trigger for Ctr 2, in the form of re-triggerable pulse generation.
The problem I am having is with Ctr 2. I have tried triggering it directly from the external source (PFI 35), I have tried triggering it by 'other counter source' - selecting Ctr 1. With any configuration I try, I either get an error, or every value as 0.
I am using labview 6.0, with Ni DAQ drivers 6.8. I am not in a position where I can easily upgrade either of these, which may be a problem...
Also I'm not sure if I have the set up for reading the buffer configured correctly. I want to read it to an array, such that each value of 'ticks' between photons is assigned an element in a 1D array.
Any help with this problem would be greatly appreciated,
Dan
08-06-2010 07:09 PM
Here are a few off-the-cuff observations to try to help move you forward some.
1. Both your simple event counting task and your buffered event counter are trying to use Ctr1. (The actual channel wired in doesn't agree with your comments).
2. The terminology "other counter" actually has a very particular meaning under the traditional NI-DAQ driver. Certain types of functions treat the counters as pairs, and "other counter" refers EXCLUSIVELY to the other member of the pair. The possible pairs are: (0,1), (2,3), (4,5), (6,7). You can't specify which counter you *want* it to mean by wiring the 'attribute value number' input.
3. I *think* you probably mean this on purpose, but did you realize that the simple event counter will start immediately after the buffered event counter? The 2 second delay will begin simultaneously, then both tasks will be stopped.
4. I don't see how you are trying to make the buffered event counter use your retriggerable pulse. It *appears* to me that you'd like the simple event task and the buffered event task to paired counters. Then the PMT pulses coming into the simple event task's Source pin can be successfully referenced in the buffered tasks gate config as "other counter source," causing it to buffer a time value on each incoming pulse.
5. Perhaps (?) you want to let the PMT pulses come into the retriggerable pulse task then have your other counter tasks respond to its output? That could make some sense if you'd like to use the retriggerable pulse task as a type of filter to suppress high-freq PMT pulses. I've recommended such things in the past myself.
However, the retriggerable pulses you are making never appear to get used for anything at all by the other tasks.
6. If you do indeed want to do something like that, I would highly recommend the use of "Route Signal.vi" to send the retriggerable pulse up to a RTSI line. Then you can configure your simple event counting task to use that RTSI line as its source and configure your buffered event task to use it as its gate.
7. I would then further recommend starting the two counting tasks first, then start the retriggerable pulse task. When you are done with your acquisition (2000 msec later), stop the pulse task first then the counting tasks. This method will keep your counts in sync.
-Kevin P
08-09-2010 07:32 AM
Thanks very much for your help - I have implemented some of your suggestions.
The VI is now much simpler, I have Ctr 1 doing simple event counting, with the external source as the input.
I have Ctr 2 doing buffered event counting, with 'other counter source' selected as the gate source.
The third counter is gone completely, there is, as you pointed out, no need for it with this set up.
The problem I am having is that nothing shows up in the array. It appears not to be 'gating' at all, though errors show up. While I was setting this up, I tested it before I had changed the buffered event counting to Ctr 0. When it was still Ctr 2 it was producing an array, but of course it had little to do with the external source. Before I realised it wasn't correlated, I built in a section to remove identical elements of the array, which is the for loop at the end of the VI.
Can anyone see what is wrong with the set up? Why Ctr 0 does not produce anything?
Much appreciated,
Dan
08-09-2010 10:17 AM
*Edit
Just realised I again miss-labelled the counters. Ctr 1 is doing simple event counting, with the source selected as the external input.
Counter 0 is doing buffered event counting, with the source set to the timebase and the gate set to be the source of Counter 1.
08-10-2010 04:56 AM
One thing I'd try is reading the buffer *before* disarming the counter. My memory's a bit rusty on traditional NI-DAQ, so I don't recall for sure whether a "disarm" will make you lose your buffer of data.
-Kevin P
08-11-2010 06:52 AM
You're right, that was the problem. Very silly of me!
I've finished the VI now, and updated it to use the RTSI line configuration you suggested, so that the counts are synchronised.
Thanks very much for the help
Dan