09-08-2010 12:52 PM
I am using the cDAQ-9172 with the 9205 for AI.
For this application I need to sample a number of readings (50 samples at 10KHz fs) each time I recieve a trigger pulse. I am using the PFI0 digital trigger.... configured as a reference trigger. Each time I recieve a rising edge, I read 50 pulses centered on the rising edge (25 pretrigger samples).... and in my callback I stop and restart the task. I am using C# and have based my code off the .NET examples included with the instllation.
The problem I have is that the pulses occur every 10 to 20ms, and by the time I recieve my data callback and stop and restart my task, I have missed quite a few trigger pulses. From what I measure, it takes my task 150 to 200ms to recieve the samples and restart the task. Obviously, by the time the task is restarted I hae missed between 10 and 20 trigger pulses.
Is there a way to have the DAQ hardware cofigured to continually send data when a trigger pulse is recieved without having to manually reinitialize the trigger each time? It is a unique problem, but the timing of the pulses to the sampling is critical, so continuous sampling is not an option.
Please let me know if you have any ideas that might apply to this application.
Thanks,
Luke Letter
09-09-2010
10:31 AM
- last edited on
03-27-2025
11:24 AM
by
Content Cleaner
Hi Luke,
Here is a great Community Example that accomplishes this, and the introduction goes over the details behind it. I would recommend using a new USB X-Series Card, such as the USB-6341. This is because the X-Series cards allow you to perform finite retriggerable analog input wtihout routing through a counter at all.
To use this example with the cDAQ 9172 chassis, you will need a module such as the 9401 in slots 5 or 6 of the chassis to access the counter, with which you will output a finite number of pulses every time the digital trigger is detected. We will then use the finite number of pulses as the sample clock for the analog input.
Best,