Lua Inputs & Outputs
Inputs and Outputs
Lua scripting in MASSO includes a dedicated set of Lua Inputs and Lua Outputs.
These are separate from the controller’s standard Auxiliary Inputs and Outputs.

Overview
MASSO provides 16 Lua Inputs and 16 Lua Outputs that can be monitored and controlled directly from Lua scripts.
These act as virtual I/O channels for custom automation, machine monitoring, and process control, without interfering with normal machine wiring or signals.
Lua Inputs (0–15)
Used to read digital signals or logical conditions.
Lua Outputs (0–15)
Used to activate or control devices, signals, or automation logic.
Key Features
Each Lua Output can be mapped to any physical output pin on the MASSO controller.
Lua I/O can be used for:
Custom automation and logic control
Safety interlocks and process validation
Tool or fixture management
External device signalling (e.g. lights, pneumatic valves)
Lua I/O operates independently of G-code and can run in the background or be triggered by event
Mapping Lua Outputs to Physical Outputs
Lua Outputs are virtual outputs and must be mapped to a physical output before they can control hardware.
This allows Lua scripts to control real-world devices connected to MASSO.
How to Map Lua Outputs:
Open the F1 – Setup screen on the MASSO controller.
Go to the Output Settings page.
Select the physical output you want to control.
In the Function dropdown menu, select Lua Output X (0–15).
Save the settings and restart the controller.
After mapping, when a Lua script sets LUA Output X HIGH or LOW, it will control the mapped physical output pin.
Example:
If Output 5 is mapped to Lua Output 3, the following Lua command will activate physical Output 5:
M.io.set_output(3, true)
Tool Changer Inputs and Outputs
When writing scripts for an Automatic Tool Changer (ATC), use the dedicated Tool Changer Inputs and Tool Changer Outputs, not the general Lua I/O.
These I/O channels are reserved for tool changer control and provide safer and more predictable operation.
Typical examples include sensors such as:
Tool Clamp
Arm Home
Magazine Ready
Examples
Example 1: Setting a Lua Output
This example turns a Lua Output ON, waits for 2 seconds, then turns it OFF.
Example 2: Reading a Lua Input
This example reads the state of a Lua Input and prints the result.
Example 3: Conditional Control
This example turns an output ON only when a specific input is active.
Spanish
French
German
Simplified Chinese