05-22-2025 05:51 PM
I have a DAQ USB 6341 with a detector (photon counter) connected to PFI3 and a trigger connected to PFI9. The system is controlled through Matlab. The trigger is a delay stage. When the delay stage starts moving, it emits a pulse that is a trigger signal that should begin data acquisition on the detector; when it stops moving, it emits a pulse that acts as a trigger signal that should stop data acquisition. This works for analog detectors. In this case, the detector is a photon counter that is technically continuously taking data. I use a Counter Input Channel that counts edge counts. I only need to collect the data that is received when the delay stage is moving, hence the need for a trigger.
However, counter input channels do not seem to support trigger signals. Why is this? Is there another way I can trigger just the data collection of the Counter during the periods I want to collect?
05-23-2025 09:27 AM
Since you already use a dummy analog input task to generate the sample clock for the counter input task, you just need to configure the trigger for the dummy AI task. The CI task will synchronize to the AI task.
05-23-2025 06:44 PM
I don't know the syntax needed for Python, but here's a generic description of what I'd do. I'm taking what you say literally -- that at both start and end of motion there's a brief pulse with both a rising and falling edge.
1. To the best of my knowledge, counter tasks do not support Stop or Reference triggers. Counter input tasks do not support regular Start triggers.
2. You can get behavior that is mostly the same as a Start trigger by configuring an "Arm Start" trigger that is *only* available for counters.
3. However, there's a better solution for your immediate problem. You should configure the task as a "Two Edge Separation Measurement" with "Ticks" as the units.
4. You should then configure to use PFI9 as both the 1st and 2nd edge, same polarity in both cases.
5. You should further configure the task to use PFI3 (the detector pulses) as the *timebase* for the measurement.
6. When you read the counter, read as a 32-bit int. This will be the # of detector pulses between the motion pulses.
-Kevin P