Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: cd_edwards on February 18, 2026, 08:55:01 AM
-
I've noticed a few people have LED's on there CNC to show what it happening on the CNC. there are Tower lights available but seem to be very simple.
I've created a LUA script which pairs with an arduino. 3 outputs from your BOB are needed so it's not for everyone if you don't have them.
I used an arduino mini pro for mine. Just about any arduino will work though. maybe not ATTINY's though. 3 inputs and one output. Arduino
bit bangs the addressable RGB LED strip. I used a 1 meter (39") long strip with 144 LED's in it. Still a couple of little niggles to investigate, but it's working.
script's and code are available on github at
https://github.com/cdedwards/Tower-Script/tree/main
This will eventually work on MachPro as well. (a little problem where it's giving me an error about an ='s sign)
Colten
-
I got this working on MachPro with the available code. I have pasted the towerscript.PLC script into the PLC Script file, under the Operator > Screen Editor, [Screen Name] PLC Script, as follows:
if m.CommonPLCScript ~= nil then
m.CommonPLCScript()
end
if towerscript == nil then
towerscript = require "towerscript" -- Load's towerscript.lua from a path. probably C:\Mach4\Modules
end
towerscript.PLCScript()
-
I'm attempting this using the "recommended" global Monitoring System. So far I get some of it working as advertised, but this is not quite ladder logic and is rather limited. I'll keep plugging away at it thoug.
-
I've seen a YouTube video done by Carl on the Global Monitoring System and its use for non-alarm type things. So far I've not got my head wrapped around it. Seems incongruent with how I see things. Hoping for more documentation and good examples of how to use it.