Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: DanielV on September 29, 2016, 12:07:04 PM

Title: Screen buttons - Actions and Scripts
Post by: DanielV on September 29, 2016, 12:07:04 PM
I have been creating some scripts by copying the script in screen buttons and using the content in other scripts.
For example the Cycle Start Gcode button has the left up script CycleStart().
However some buttons like Zero X only have button "Actions" and no script.  Do these button Actions somehow call other functions?  How can I perform the button's action from a separate script without having to press the screen button?
Title: Re: Screen buttons - Actions and Scripts
Post by: DazTheGas on September 29, 2016, 12:20:41 PM
If you take a look in the docs directory you will find the api.chm with all the commands in that are used within the GUI,

IE to zero an axis you would need to look at the axis section and use mc.mcAxisSetPos(number inst, number axisId, number val)

you can gain a lot of insight of using commands by looking in the modules and examples directory and reading the codes there.

DazTheGas