Ok, it's been a while since I used a PC-TIO-10 and even then I didn't explore it all that much (mainly continuous pulsetrains and period measurement, which worked kinda weird). I'll try to work through a method that doesn't involve changing boards, but if you *could* change boards, you could then use new features in DAQmx which allow you to simultaneously perform logical-AND-style gating and buffered-sampling-style gating. With traditional NI-DAQ it's got to be one or the other.
Toward the end of your message, you mention expecting an array containing 1200 elements, one per gate period. This suggests that your MIO counter should buffer a count value on each edge of the 4 kHz pulsetrain that occurs while the 300 msec pulse is ON. Is this right?
It also sounds like it should only spend 238 usec of each 250 usec gate period actually counting the PMT pulses b/c the first 12 usec should be ignored. Is this right? You said that this gating is accomplished with an external circuit -- are you satisfied with this aspect of gating? For this reply, I'm assuming not.
Finally, your PMT pulses are 9 nsec duration. This is slightly less than the 10 nsec pulsewidth spec for edge counting on the MIO card, so you're skating on thin ice in any event.
With that combination of requirements, I'm also having trouble finding a solution that doesn't require an external logic circuit. It seems that you're looking to apply 3 different gating operations to a single counter measurement task.
1. Buffered-sample gating -- store a count value in a buffer once per falling edge of a 4 kHz pulsetrain.
2. Logical-AND gating -- only count during 238 usec of each 250 usec interval.
3. Logical-AND gating -- only count and store counts during a 300 msec interval while a pulse is HIGH
Under traditional NI-DAQ (which you're stuck with while using the PC-TIO-10), you can accomplish #3 in the pulse generation task, but you can't program for both #1 and #2. You'll need to accomplish #2 with some simple external logic circuitry -- AND's and NOT's. Here's what I'd do:
1. Logically AND the 4 kHz pulsetrain with the 300 msec pulse. Call this the gated laser trigger. You may be able to do this with just the PC-TIO-10 without any external circuit. You definitely can do it with an MIO counter. You would setup the 4 kHz pulsetrain to be "level-gated" by the 300 msec pulse.
2. Logically AND the 238 usec portion of the 4 kHz pulsetrain with the PMT pulses using an external circuit. This may require a logical NOT or two along with the AND. Call this the gated PMT.
3. Program the MIO counter to perform buffered period measurement. The falling edge of the gated laser trigger (#1 above) would be the "gate" (a.k.a. sampling clock) signal. The rising (maybe falling depending on how you do your logic) edges of the gated PMT pulses (#2 above) would be the source signal.
4. Behavior: Every 250 usec during a 300 msec timed interval, a count value will be stored in the buffer. The value of each count will be the # of gated PMT pulses that occurred during the 238 active usec of the most recent 250 usec interval.
Again note that ALL of the above could be done with a single 6601 board using DAQmx. 1 counter to generate a 300 msec pulse. 1 counter to generate a 4 kHz pulsetrain only during the 300 msec pulse's HIGH time. 1 counter to buffer counts with the gated 4 kHz pulsetrain acting as both a sampling clock and an active-low pause trigger.
-Kevin P.
CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).