Allowing Jogging during a Macro ?

This is where you talk about Macros, show examples of your macro scripting and SHARE handy segments of script code as examples.

Allowing Jogging during a Macro ?

Postby andrewwong2000 » Sun Mar 22, 2020 8:05 am

Hi all,

When doing manual tool changes, I have forgotten to rezero my tool height one too many times !

So I created a M6 macro that forces me to follow the standard procedure each time.

What I'd like to know is how to enable jogging while the Macro waits for me to then continue.

This would save time during the probing as I can zip the tool close to my touchplate rather than crawling down to it.

Cheers,

Andrew


// AW Modified 2017 Toolchange macro M6
// Go to ToolChangePos exec.Callbutton(20521)
// Call Z-TP exec.Callbutton(20523)
// Call Z-Shim exec.Callbutton(21523)
// Call SafeZ exec.Callbutton(21552)

bool DelayStart = AS3.Getcheckboxstate(20302); // Delay end of macro to allow user to start spindle
String Z_Choice = "";

exec.AddStatusmessage("M6 AW Toolchange Script");

// Go to ToolChangePos
exec.AddStatusmessage("M6 Go to Tool Change Pos");
exec.Callbutton(20521);

while(exec.IsMoving()){}

// Tell user to Change Tool
MessageBox.Show (exec.mainform, "Change the Tool now", "Manual Tool Change", MessageBoxButtons.OK, MessageBoxIcon.Error);

// Ask which Z Operation to do

Z_Choice = exec.TextQuestion("Connect TouchProbe\n\nType 1 for Shim or \n Enter for TouchPlate");

// I'd like to be able to jog my machine while waiting for this input

if (Z_Choice == "1")
{
// Call Z-Shim
exec.AddStatusmessage("M6 Shim Zero");
exec.Callbutton(21523);
}
else
{
// Call Z-TP
exec.AddStatusmessage("M6 TP Zero");
exec.Callbutton(20523);
}

if (DelayStart)
{
MessageBox.Show (exec.mainform, "Tool Change has been paused." + "\n" + "Press OK when ready to continue.", "Tool Change Pause", MessageBoxButtons.OK, MessageBoxIcon.None);
}

// End Tool Change macro
andrewwong2000
 
Posts: 29
Joined: Sun Nov 25, 2018 12:57 pm

Return to Macros

Who is online

Users browsing this forum: No registered users and 4 guests