I am trying to write a macro that will probe in both X and Y at the same time however I am having trouble figuring out how to stop the movement once it is executed. I'm trying to tell my machine to move to a specific XY position which will be slight further then the edge of the stock then when the probe touches the stock...stop so I can record the machines position. I have tried a number of combinations but not sure why its not working.
One way I did get it to work was to have this code in a macro loop
- Code: Select all
if(AS3.GetLED(37))
{
exec.Stop();
}
I really want it all in one macro and thought this would work.
- Code: Select all
exec.Code("G01 X10 Y10 F20");
while(exec.IsMoving())
{
if(AS3.GetLED(37))
{
exec.Stop();
}
}
but once the movement has started it won't stop unless I hit the cycle stop button. Can anyone tell me what I'm doing wrong?