Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: DanieGouws on August 06, 2021, 09:43:43 AM

Title: Setting Zero Fixture Z to zero using an external button
Post by: DanieGouws on August 06, 2021, 09:43:43 AM
Hi,

On my Denford CNC lathe, running a Pokeys57 card and Mach4 I'm trying to zero the Zero Fixture Z using an external button. I have done that very successfully for Cycle Start, Spindle Start and Spindle Stop by mapping external buttons to inputs and then editing the Mach4 Screen using "Edit Screen". Then I loaded the "Screen Load Script" and adding:

[mc.ISIG.INPUT0]=function (state)
        if (state ==1) then
               CycleStart()
        end
end,

I assume I need to replace the CycleStart() with a variable the refers to the "Zero Fixture Z"; for the "Zero Fixture Z" key, under properties/events I found the variable "Zero Z" but that gives me a compiler error....

Hope you can help,

Kind regards and thank you
Danie
Title: Re: Setting Zero Fixture Z to zero using an external button
Post by: Bill_O on August 06, 2021, 09:52:00 AM
Try this;

mc.mcAxisSetPos(inst, 2, 0.0)
Title: Re: Setting Zero Fixture Z to zero using an external button
Post by: DanieGouws on August 07, 2021, 04:23:47 PM
Hi,

It works perfectly! Thank you very much. Is there an easy way to determine the correct "parameter/ structure" for other buttons?

Regards

Danie
Title: Re: Setting Zero Fixture Z to zero using an external button
Post by: Bill_O on August 09, 2021, 08:43:59 AM
In your Mach4 folder there is a file called Mach4CoreAPI.chm
That has most of them
Title: Re: Setting Zero Fixture Z to zero using an external button
Post by: DanieGouws on August 09, 2021, 12:29:23 PM
I will go and look, thanks again,

Regards Danie