Checking for a button push

Hi,

I am using IG to create a user interface and drive a metrology tool. The user enter a recipe and hit start and the system run and returns data - that all works.

I would like to add a stop/abort button since the run can last an hour and if there is something amiss I would like to gracefully stop.

In the main loop of data gathering I have to check the gantry for movement and issue a stop data collection command when it stops moving and the timing of this is important for positioning synchronization. Currently I am using a regular loop within a user procedure for this and it works. Between scans the gantry has to reset and I have some time and this is when I would like to check for a button push. If i use a regular user procedure with loops the interface doesn't update until all is complete and if I put the function in a background task I risk not having priority of the timing when I need it.

Any suggestions on how to accomplish this?
Have the button set a variable. Have a background task (you current one, or a new one) check the variable. If the variable says that the button has been pressed, do something.
hegedus wrote:
That does the trick.

Quote:
if I put the function in a background task I risk not having priority of the timing when I need it.

I think you still have this problem. A background task doesn't run while a dialog is up unless you use

CtrlBackground dialogsOK=1

and even then it will stop if you pull down a menu, or run a long user function.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com