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.
Reference Information
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:
checkout.
Mach4_Development\SDK\IncludeInclude:
- All API calls start with MC.
MachAPI.h
- Constants
Mach4_Development/ModulesModules:
Wrapper Module.lua
CommonGUIModule.lua
Other Modules.
To search functions, enable Function list and then search for what you are looking for.
Macros
Macros are called from MDI or gcode.
Screen
Never do a sleep because it will freeze up the entire Mach4 folder.
Common
Custom scripts to customizeScripts
Under profiles,the profile you are running, open Macros/Scripts.
Remove the Default from the name of the script you want to run and then recompile modules in Mach4.
UserGUIModuleDefault.mcs.mcs
- UserGUIPLCScript() runs about every 2 milliseconds
- Any function hook
UserMcodeModuleDefault.mcs.mcs
- Any mcode
- Any mcode hook
