Adding a cross laser Macro

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

Adding a cross laser Macro

Postby Ian » Sat Feb 08, 2025 3:03 pm

Hello,

I've been a user of UCCNC for quite a while and never needed to add a macro till now.

I'd like to add this https://www.stepcraft-systems.com/forum/software-2/3245-cross-laser-and-uccnc from the Stepcraft forum, I've had a google around but still don't know where to start.

If someone could give some advice I'd be very grateful.

Thanks
Ian
Ian
 
Posts: 10
Joined: Sat Feb 11, 2017 2:55 pm
Location: Switzerland

Re: Adding a cross laser Macro

Postby Ian » Sat Feb 08, 2025 9:15 pm

I’ve found how to do it

Ian
Ian
 
Posts: 10
Joined: Sat Feb 11, 2017 2:55 pm
Location: Switzerland

Re: Adding a cross laser Macro

Postby cncdrive » Sat Feb 08, 2025 10:54 pm

Yes, you can make a macro to offset the cross laser center to the tool center just like how somebody posted on the forum you linked.
cncdrive
Site Admin
 
Posts: 5054
Joined: Tue Aug 12, 2014 11:17 pm

Re: Adding a cross laser Macro

Postby Ian » Sun Feb 09, 2025 7:25 am

Yes thanks, I know it can be done as the link shows, I just wondered how to add it
Ian
 
Posts: 10
Joined: Sat Feb 11, 2017 2:55 pm
Location: Switzerland

Re: Adding a cross laser Macro

Postby 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);

Cosimo83
 
Posts: 37
Joined: Wed Nov 14, 2018 8:22 pm


Return to Macros

Who is online

Users browsing this forum: No registered users and 12 guests