LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger the loop with a square wave

I looked through the forums but was not able to find a solution to my problem even though it sounds pretty simple.

 

I need to trigger a while loop every time a function generator creates a rising edge of a square wave that will be driving my laser. The iteration speed of the while loop should be matched to the function generator's frequency. Every time there is a rising edge I want my loop to itterate. I have NI6251 daq board which I'm using to output the square wave to the laser. I use "simulate signal" + "DAQ assistant" as a simple function generator.

 

PS I was trying to do it using daqmx functions and notifies but no luck.  

 

Any help appreciated!

0 Kudos
Message 1 of 3
(2,441 Views)

@ymark wrote:

I looked through the forums but was not able to find a solution to my problem even though it sounds pretty simple.

 

I need to trigger a while loop every time a function generator creates a rising edge of a square wave that will be driving my laser. The iteration speed of the while loop should be matched to the function generator's frequency. Every time there is a rising edge I want my loop to itterate. I have NI6251 daq board which I'm using to output the square wave to the laser. I use "simulate signal" + "DAQ assistant" as a simple function generator.

 

PS I was trying to do it using daqmx functions and notifies but no luck.  

 

Any help appreciated!


The timing of your loop should be governed by the trigger and does not have to be tied to the frequency of the function generator at all.  Your reasoning about the notifiers seems sound... why don't you show us some code so we can poke around a bit?  🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 2 of 3
(2,430 Views)

I have a galvo scanner which moves one step each time the loop iterates. Currently I have a timed loop for that purpose but its not triggered by function gen. I was thinking about replacing timed loop with a while loop and somehow triggering it with the function gen. I'm not sure how to do it using notifies, I read about them but its not too clear so far. I don't want to put function gen inside the loop since it increases the iteration time by a lot. 

 

 

0 Kudos
Message 3 of 3
(2,420 Views)