05-24-2013 09:50 AM
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!
05-24-2013 10:18 AM - edited 05-24-2013 10:19 AM
@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? 🙂
05-24-2013 10:44 AM
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.