From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
03-04-2012 09:51 PM
Dear NI engineer,
I generated three AO signals to control my scanner and data aquisition. Two ramp signal is to control galvo scanner (x and y). One TTL signal is to trigger data aquisition. Each time I click stop, the ramp will stop wherever it is when the stop button is clicked, which will cause a voltage jump when start the program again because the ramp will start from the original place (this fast voltage jump may cause damage the galvo scanner ). Could you please give me some suggestion on how to stop only after a whol cycle waveform is finished? Attached is the VI I used. The FLIM control.vi is the main vi which include subvi of Galvo control.vi
Thank you so much!!
Solved! Go to Solution.
03-05-2012 04:07 PM
Hello, dgql!
From a purely programming perspective, there are a few ways you could implement this.
1) Create a conditional stop:
You could add code functionality such that, after you've hit the stop button, the code checks the value of your signal before actually stopping the VI. In pseudo-code: "if signal is >0 and less than a certain value, stop. If not, keep checking signal until value is within this range."
2) Reinitialize the ramp signal with each start of your VI. This may or may not work with your application, depending on if you need to have the previous ramp value carry over.
Let me know if these are of any help!
03-05-2012 04:14 PM
@dgql wrote:
Dear NI engineer,
I generated three AO signals to control my scanner and data aquisition. Two ramp signal is to control galvo scanner (x and y). One TTL signal is to trigger data aquisition. Each time I click stop, the ramp will stop wherever it is when the stop button is clicked, which will cause a voltage jump when start the program again because the ramp will start from the original place (this fast voltage jump may cause damage the galvo scanner ). Could you please give me some suggestion on how to stop only after a whol cycle waveform is finished? Attached is the VI I used. The FLIM control.vi is the main vi which include subvi of Galvo control.vi
Thank you so much!!
The obvious solution is to go to vi properties>>Window apperance>>Customize and UNCHECK "Show abort button." That abort button is a debugging tool using the abort to stop your vi is like using a tree to stop your car!
03-06-2012 03:48 PM
Thank you very much for your reply. May I ask how to check the current AO output value when I click the stop button?
03-06-2012 03:50 PM
Thank you very much for your reply, Will. May I ask how to check the current AO value when the stop button is clicked?
03-07-2012 03:49 PM
Hello, dgql!
It looks like your code outputs the analog information to your waveform graph. Are you not able to read the value from there?
03-07-2012 04:39 PM
I am pretty new to Labview. I am not sure which function I should use to read the current value of an AO. Could you please give me some suggestions? Thank you very much!
03-08-2012 01:30 PM
Sure thing!
In your "FLIM Control" VI that you posted, there is a waveform graph which should display the analog output (AO). So it looks like you've got what you need in place already. Are you looking to output a different signal?
03-08-2012 04:00 PM
I guess maybe my expression make you confused 🙂
I want to do it as what you say:"You could add code functionality such that, after you've hit the stop button, the code checks the value of your signal before actually stopping the VI. In pseudo-code: "if signal is >0 and less than a certain value, stop. If not, keep checking signal until value is within this range."
But I am not sure how to "checks the value of my signal before actually stopping the VI". I should continuously check this value, but I am not sure how to check. Hope this will be better to understand 🙂
Thank you very much!!
03-09-2012 05:15 PM
Ah, my apologies : )
I think I'll actually take a step back on this - I think it will be better for you to just reset your ramp value to zero when you stop your code.
The ramp will stay at whatever value it is when the VI is stopped, so if you choose to stop it at (say) 5V, it will continue outputting the 5V, which is (assumedly) not what you want.
The method I thought to use for this does not seem to be working - I will look at it a bit more and let you know. In the mean time, the community may have some answers, too : )