LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Count number of triggered events

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?

0 Kudos
Message 1 of 6
(3,779 Views)

Hi QDTIColin,

 

One of the simple way to count the event

0 Kudos
Message 2 of 6
(3,728 Views)

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...

 

 

 

 

0 Kudos
Message 3 of 6
(3,715 Views)

I don't think the question has anything to do with event structures.

0 Kudos
Message 4 of 6
(3,694 Views)

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.

0 Kudos
Message 5 of 6
(3,685 Views)

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,

John Passiak
0 Kudos
Message 6 of 6
(3,656 Views)