Skip to main content

Lua Training

What is Lua? Lua is a powerful, efficient, lightweight, embeddable scripting language. It supports procedural programming, object-oriented programming, functional programming, data-driven programming, and data description. 

For programming, start by checking out Mach4 in SVN. See the steps here: Download and install latest TortoiseSVN

For reference, use the files located in the Mach4 SVN checkout:

 

Mach4_Development\SDK\Include

  • All API calls start with MC.



MachAPI.h

  • Constants

 

Mach4_Development/Modules

Wrapper Module.lua

To search functions, enable Function list and then search for what you are looking for.

image.png

 

Macros

Macros are called from MDI or gcode. 

 

 

Screen

Never do a sleep because it will freeze up the entire Mach4 folder. 

 

 

Common scripts to customize

Under profiles, open Macros/Scripts.

 

UserGUIModuleDefault.mcs.

  • UserGUIPLCScript()

UserMcodeModuleDefault.mcs.