by Cosimo83 » Mon Feb 10, 2025 6:25 pm
Se è utile condivido la mia. La utilizzo sul Plasma CNC per fare lo Zero.
- Code: Select all
//MACRO M204 (GoTo-Zero LASER) CS-Tec 2025
if (exec.Ismacrorunning(204) > 1) { return; }
if (!exec.GetLED(56) || !exec.GetLED(57) || !exec.GetLED(58)) { return; }
double laserx = 116 ; // Offset X Laser
double lasery = 15 ; // Offset Y Laser
double LZ = Convert.ToDouble(AS3.Getfield(41)); // Limit Min
exec.AddStatusmessage("GoTo-Zero LASER >>>");
exec.Code("G53 G0 Z0");
while(exec.IsMoving()){}
AS3.Setfield(-LZ,2899);
AS3.Validatefield(2899);
AS3.Setfield(lasery,2898);
AS3.Validatefield(2898);
AS3.Setfield(laserx,2897);
AS3.Validatefield(2897);
exec.Code("G0 X0 Y0");
while(exec.IsMoving()){}
if(exec.Ismacrostopped())
{
exec.AddStatusmessage("GoTo-Zero LASER Interrotto!");
// Console.Beep(1000,250);
// Console.Beep(1000,250);
return;
}
exec.Callbutton(555);
while(exec.IsLoading()){}
exec.AddStatusmessage("GoTo-Zero LASER OK!");
//Console.Beep(1000,500);