// M1031 // Plasma Touch Off Macro for Ohmic and Floating Head, using relays to isolate inputs as per PoMo MiniTHC // Robertspark 10/1/2016 // -------------------------------- // CONFIGURATION SETUP // -------------------------------- double ProbeFreedrate = 600; // probing feedrate (mm/min) double OhmicOffset = 0.1; // Ohmic offset (mm) double FloatOffset = 1.4; // Floating Head Offset (mm) // Turn on outputs for port2/pin4 & port2/pin7 exec.Setoutpin(1, 4); //port, pin exec.Setoutpin(1, 7); //port, pin // check input port1/pin12, if enabled, disable output port2/pin4 & run probling routine to set offset to floating head if(exec.GetLED(12)) // { exec.Clroutpin(1, 4); // port, pin exec.Code("G31 Z-100 " + ProbeFreedrate); while(exec.IsMoving()){} exec.Wait(100); exec.Code("G92 Z-" + FloatOffset); return; } exec.Code("G31 Z-100 F600"); // run probing routine while(exec.IsMoving()){} exec.Wait(100); // check if input port1/pin12 is enabled (if so, set offset to ohmic input) if(exec.GetLED(12)) // { exec.Code("G92 Z-" + OhmicOffset); return; } exec.Code("G92 Z-" + FloatOffset); // else set offset as floating head // Turn OFF outputs for port2/pin4 & port2/pin7 exec.Clroutpin(1, 4); // port, pin exec.Clroutpin(1, 7); // port, pin // End of Macro