I am a novice at LBR programming and I have a question about the application lifecycle, especially in T1 mode.
My run() function consists of an endless loop handling events and driving the robot to various positions.
Unfortunately I cannot find in the manual any condition to check to decide to abort the loop terminate the run() method - every solution I found is somewhat unsatisfactory.
At the moment I tried this:
- Running the loop in a thread and stop the run function from terminating with a modal dialog. Right after the dialog is closed, i interrupt the thread. Drawback - I have an annoying dialog on top of the output window
- Using an user key to set a flag that gets checked at every cycle. Drawback: it is cumbersome, as there seems to be no way to automatically activate a specific set of userkeys (not that i found at least)
Not tried - the user button on the flange. Drawback - it can be in a position uncomfortable to reach.
What I would really like to know is how to handle the red square stop button on the smartpad - is it possible to programmatically detect it has been pressed? Is it setting something detectable by code?
Any help would be really appreciated!