- Code: Select all
while (exec.IsMoving()); // Wait for the last command to finish
exec.Stop();
while (exec.IsMoving() || exec.GetLED(54)); // Cycle stop and wait to really stop
exec.AddStatusmessage("Insert tool #1");
while (!(exec.GetLED(54) || exec.Ismacrostopped())) Thread.Sleep(20); // Wait for Cycle start/stop
if (exec.Ismacrostopped()) return; // If stopped then finish
while (exec.IsMoving());
//Probing
/*
exec.Code("G00 G53 X0 Y15"); // move to probing location
exec.Code("G00 G53 Z-100"); // dive tool to a comfortable height above the probe for the longest tool you have
exec.Code("G91 G31 Z-150 F100"); // Probe Z quickly to get rough height
exec.Code("G90");
while (exec.IsMoving());
*/
// You can execute a list of commands with one call to be absolute safe
List<string> codelist = new List<string>(); //Create a new List of strings.
codelist.Add("G00 G53 X0 Y15"); //Add g-code lines to the List.
codelist.Add("G00 G53 Z-100");
codelist.Add("G91");
codelist.Add("G31 Z-150 F100");
codelist.Add("G90");
exec.Codelist(codelist); //Execute the List of g-codes.
while (exec.IsMoving());
I added G0s to the move commands, because if the last command was not G0 then it can do strange things.