Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous Pulse generation question

Hi all, I am trying to generate a continuous pulse train using the PCI-6601 Ni-DAQmx device. I would like to generate the pulse and move on to other parts of my labview program. I do not want the pulse to go away once generated.  There are examples floating around with the pulse generation inside a while loop that will continue until a user input stop button is pressed. The problem is I want to generate the pulse and then execute other parts of my program, I do not want to be in a loop forever. Is there a way to have a counter output a continuous pulse without going into a loop that freezes my program midway?
0 Kudos
Message 1 of 2
(3,289 Views)

Sure you can.  Here's a couple different ways to approach it:

1. Use LabVIEW's parallel multi-tasking.  While the loop is executing and looking for user input, place other code above or below the loop without any wire connections to the loop.  Voila!  LabVIEW will run your new code in parallel with the example loop code.

2. Replace the While loop with your code.  After calling DAQmx Start, the counter hardware will keep generating a pulse train until your code calls either DAQmx Stop or DAQmx Clear.  It will also stop if your entire vi stops running because LabVIEW clears up "dangling" tasks when your vi completes.

-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 2
(3,284 Views)