07-11-2014 03:59 PM
I'm trying to continually retrigger a digital output; is there a way to count the number of times the trigger has occurred?
Right now I have it set up where it triggers off the 20MHzTimebase. Would using the counter CI Count Edges on the 20MHzTimebase give a correct reading? Or is there a better/known way to do it?
07-14-2014 07:12 AM
07-14-2014 08:32 AM
Hey,
just one little addition to the vi provided in the previous post from Vij@y,
I would place the Trigger-Button inside the eventcase of the Trigger.valuechange, so it will reset after it is read out without the toggeling.
Regards,
CMW...
07-14-2014 01:15 PM
I don't think the question has anything to do with event structures.
07-14-2014 01:35 PM
CMW.. wrote:just one little addition to the vi provided in the previous post from Vij@y,
I would place the Trigger-Button inside the eventcase of the Trigger.valuechange, so it will reset after it is read out without the toggeling.
In addition, the count indicator belongs before the event structure so it correctly shows zero if the program is started but no button has been pressed yet. (another option would be to enable "clear indicators when called" on the vi properties...execution page).
Still, this has nothing to do with the original question.
07-15-2014 02:34 PM - edited 07-15-2014 02:34 PM
What hardware are you using?
You might be mixing up "trigger" vs. "sample clock". Most NI Multifunction hardware has a max digital output sample clock rate of 10 MHz, and the max trigger rate would be lower than this (since each trigger would generate multiple samples of output). There are of course exceptions...
Assuming you're talking about the sample clock, you might be able to get away with simply querying the TotalSampPerChanGenerated property. If you need to know the exact number of samples generated at a specific time (e.g. relative to an external clock) then you'll need to use a counter.
Best Regards,