Page 1 of 1

Tool Zero does not zero

PostPosted: Tue Sep 29, 2020 2:17 am
by Bluebell
I have switched fro Mach3 to UCCNC. The process has been relatively painless and I find UCCNC easier to use than MACH3.

But I am having trouble with the tool zero macro. My Mac3 macro worked fine,. But, in its original form, M31 did not seem to zero Z work coordinates, and it is much more complicated with its tool offsets and so on than I need for my simple 6040.

So after much research I came up with this macro:

exe.code(G31 Z-10 F100")
while(exec.IsMoving()){};

exec.Setvar(0,228); //Set Z DRO to zero
AS3.Validatefield(228);

But, this did not set the Z axis DRO, which seems to be field 228 , to zero It sets it to 1mm above zero.

I then deleted the last two lines so the probe stops on contact , and I then manually zero the Z DRO

.
While this works, it is a bit clumsy.

Can anyone suggest why the above macro sets Z to 1mm above the work surface, and what the macro should be to properly set the tool Z to zero?

Re: Tool Zero does not zero

PostPosted: Tue Sep 29, 2020 10:56 am
by ger21
Code: Select all
AS3.Setfield(0, 228); // Set Z axis DRO to new zeroed position
AS3.Validatefield(228);

Re: Tool Zero does not zero

PostPosted: Tue Sep 29, 2020 11:20 pm
by Bluebell
Thanks Ger.

Reading only Pidgin C++ and writing even less of the C# dialect, in my hours of attempted self teaching i missed the Setfield instruction

Now I can cut my PCBs with less pain, I shall now retire to the relative comfort of PicBasic and Pic micro controllers.

Re: Tool Zero does not zero

PostPosted: Wed Sep 30, 2020 12:01 am
by cncdrive
You can write macros in Visual Basic too if Basic programming language is more comfortable for you.
You just have to put the #VB to the very first line of the macro and then the software will use the Visual Basic compiler instead of C#.

Re: Tool Zero does not zero

PostPosted: Sat Jun 08, 2024 10:33 am
by Smokie555
Funny I'm in the same position Bluebell (Mach on a 6040 and now onto UCCNC on an Interact). Could you please post your new working Micro so I can see where to insert these new lines, or maybe this is the intire mircro? Many thanks