Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Falling edge events of counter output

Hello,

 

Using labVIEW, I would like to capture the falling edge event of the output of a counter. Below is LV code that captures both rising and falling edge events of a particular counter,  I would like to only record the falling edge events.

 

Capture.PNG

 

Is this possible?

 

Thanks in advance!

 

Bernie 

0 Kudos
Message 1 of 2
(5,608 Views)

Not by using the counter output event directly.*

 

There is more than one way to work around this though.  For example, you could configure a second task, register its sample clock event, and use the falling edge of the counter output as the sample clock for this task.

 

 

The counter output event is generated whenever the counter reaches terminal count.  In the default "toggle" mode, the counter inializes its count register to be Initial Delay counts from terminal count.  When it reaches terminal count, it toggles its output to high and resets the count register to be High Ticks away from terminal count.  When it reaches terminal count again, it toggles it output to low and resets the count register to be Low Ticks away from terminal count.  And so on and so on...

 

*There is an output mode where the counter issues a short pulse whenever it reaches terminal count (rather than toggles).  You can set the mode through a DAQmx Export Signal Property Node (CtrOutEvent.OutputBehavior).  This might be all that you need if (for example) you are using the counter output to clock something and don't actually care about the width of the counter output pulse.  You'll want high ticks and low ticks to be equal (probably) and keep in mind that these now represent the number of ticks between output pulses rather than actually representing high and low times.

 

 

Best Regards,

John Passiak
0 Kudos
Message 2 of 2
(5,599 Views)