Gerry,
Because M0 works wrong in a macro, I wrote a pause macro. exec.Code("M0") will execute
after the calling macro has finished. Calling this macro while waiting for tool replacement (and M31 if needed) from M6 works fine. The other advantage of this pause macro is that you can continue with Cycle Start, even if it is pressed on a pendant or a trigger input. The middle of M6:
- Code: Select all
exec.Code("M20900"); // Pause
while(exec.IsMoving()){}
I put a LED on the Start button to show pause state:
- PauseLED.png (3.37 KiB) Viewed 23398 times
And here is the macro:
- Code: Select all
if (!exec.GetLED(54)) return; // No Cycle -> no pause
int PauseLED = Convert.ToInt32(exec.Readkey("DASH", "PauseLED", "499"));
while(exec.IsMoving()){}
exec.Stop();
while(exec.IsMoving()){}
exec.SetLED(true, PauseLED);
while(exec.IsMoving()){}
while(!(exec.GetLED(54) || exec.Ismacrostopped())) exec.Wait(20); // Wait for Cycle Start or Stop
exec.SetLED(false, PauseLED);
You can replace the read of PauseLED number with a constant, I always use values from the profile.
Feel free to use this pause macro instead of MessageBox in your screenset if you like it.