Hello Guest it is March 28, 2024, 07:23:32 PM

Author Topic: Setting Zero Fixture Z to zero using an external button  (Read 619 times)

0 Members and 1 Guest are viewing this topic.

Setting Zero Fixture Z to zero using an external button
« 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

Offline Bill_O

*
  •  563 563
    • View Profile
Re: Setting Zero Fixture Z to zero using an external button
« Reply #1 on: August 06, 2021, 09:52:00 AM »
Try this;

mc.mcAxisSetPos(inst, 2, 0.0)
Re: Setting Zero Fixture Z to zero using an external button
« Reply #2 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

Offline Bill_O

*
  •  563 563
    • View Profile
Re: Setting Zero Fixture Z to zero using an external button
« Reply #3 on: August 09, 2021, 08:43:59 AM »
In your Mach4 folder there is a file called Mach4CoreAPI.chm
That has most of them
Re: Setting Zero Fixture Z to zero using an external button
« Reply #4 on: August 09, 2021, 12:29:23 PM »
I will go and look, thanks again,

Regards Danie