Hi
I have been struggling with LUA signal tower script for a while and decided to ask some help. I do not have much experience with LUA (in the context of Mach4) and I´m continuously trying to figure some things out.
About the script. At first I made the logic in PMC, then converted to LUA but couldn´t get it to work. The script seemed very long and complicated one. Then I was suggested to pure LUA approach which I have been working with, but so far without any promising results. I have also used AI input (Gemini, GPT 5), but it seems they are a bit suspicious about giving some appropriate results.
Can anyone suggest some decent LUA script for signal tower logic? Or some hint how to build up the correct one?
I have following setup for my lathe:
- Mach4 version 4.2.0.5036
- CSMIO/IP-S controller (plugin ver 3.501)
Machine conditions (may change):
Blinking Red - Estop condition
Static Yellow - Hold
Blinking Yellow - Tool change
Static Green - Gcode finished
Blinking Green - Gcode running
Mach4 outputs:
Output 0 - green light
Output 1 - yellow light
Output 2 - red light