
STOP ACQUISITION

Carlo
with igor, my tutor and I, we have created a procedure to aquire the signal by the AFM.
With a while loop, we can make acquisitions at different intervals of time, and through the script of save, we can save the "Wave".
Now we would like to put a stop function: we would like to create a button "STOP" in the graphical interface, which allows to stop the acquisition, and once stopped, automatically save the file until that instant of time.
On the forum I found one scritp "pseudo stop button" but adapting it to our procedure, does not work very well.
you help us?
I suggest you look at the Manual, Chapter IV-6 "Interacting with the User" (p. IV-139) for a code example of how to detect a key press (Escape), control the exit from your function, and perform whatever data save function you create.
May 7, 2015 at 06:03 am - Permalink
In your code, before the acquisition begins, put the following command to open a Panel saying "Press escape to abort"
Then later in the code after all necessary operations have been done for that cycle, before While(1), put something like
Then just before the end of your function, put
You may have to press the Escape key more than once, or make sure it is held down sufficiently long.
May 7, 2015 at 08:53 am - Permalink
This is my procedure.
So, I need to "abort" my acquisition when I want to, so you save all that acquired until then.
If I understand it, I should write down your first script in the DO-while loop, then, before the function acuisizione insert the second script, then?
correct me if I'm wrong.
May 8, 2015 at 03:26 am - Permalink
Here is an edited copy of your main function code, with the addition of my suggested placement of the previously given Escape code sequences. I have indented your code, eliminated many of your comments, and added artificial linewrap indicators to keep line lengths in the Exchange format to a minimum. My insertions are indicated by
// ***NEW***
labels. You might consider performing your last "waveacquire" within thePressEscapeToAbort(1,"","")
if-endif loop. You may notice a delay after the Esc key is pressed.May 12, 2015 at 03:18 am - Permalink
May 12, 2015 at 05:44 am - Permalink