Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

How do i configure an external trigger to stop continuous pulse train output from a 6602

Hi All
 
Following some earlier posts I have managed to write an appliction using DAQmx and C# (Visual Studio 2005) that generates a continuous pulse train from counter 0 of a 6602, on demand, using a software start.  Now the idea behind the application is that the frequency of this output periodically changes from something like 10Hz up to 250Khz in controlled steps, say every few seconds.  I believe this should be possible.  But what I need to be able to do is monitor an external push-button and stop the 6602 when the button is pressed.  Does anyone know how I can configure my 6602 to do this using C#?  I guess what I am looking for is a way to use an external stop trigger.
 
Again any help would be gratefully appreciated.
 
Kind regards
 
Jamie
0 Kudos
Message 1 of 3
(4,036 Views)

Here's a couple ideas:

1. Easier, but with non-deterministic response time:   Wire the button up to one of your I/O pins and poll it.  When you detect the button, issue a software call to stop the pulse train.  If the duration of the button press may be short compared to your polling rate, then wire it to a counter source pin and perform edge counting.  When you poll any value > 0, the press has happened.  (Sometimes the value may be >1 if the switch has "bounce").

2. Trickier, but with deterministic hardware timing:  Configure another counter, call it counter B, for triggered pulse generation.  Wire/configure the button as the trigger.  Make sure that the "high time" of the pulse is long enough to let your software respond, if needed.   Also configure your original continuous pulse train counter to use Ctr B's output as a "pause trigger", specifying to pause when high.   When the button is pressed, counter B will fire a pulse and that pulse will inhibit your original counter's pulse generation.  In short, the pulses will stop until counter B's pulse has completed its full duration.  Your software can monitor for this series of events and stop the original counter task if needed.

-Kevin P.

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 3
(4,022 Views)

Thanks for those ideas.... I may investigate both methods...

 

Thanks again for your help, it is most appreciated.

 

Jamie

0 Kudos
Message 3 of 3
(4,016 Views)