10-11-2011 03:01 PM - edited 10-11-2011 03:01 PM
By "record", I'm assuming that you need to know when the trigger is received.
The following code does this in terms of samples from the 9237. It uses the counter to count the ticks of the sample clock from the 9237. The count register is sampled based on your external trigger.
You'll have to be creative with when you call DAQmx Read--you should poll Available Samples Per Channel or use the Every N Samples Event to determine when the counter sample is available.
Best Regards,
10-12-2011 09:02 AM
I'm trying to understand what you have written.
I have just read NI 9188 manual and I think that I can relate your example with Single Point (On-Demand) Edge counting, right?
Thank you very much.
10-12-2011 11:02 AM
Hi teoprimo,
It is very similar to that, but actually I would recommend using Buffered (Sample Clock) Edge Counting (page 86 in the manual). The idea is that your external digital event is the "clock", which is what is used to actually sample the count register. It sounds like there will be only a single event anyway, but you still use this as the clock so the sampling of the count register will occur precisely when the event occurs.
Best Regards,
10-12-2011 12:10 PM
Perfect! I will try your solution as soon as possibile.
Many thanks!