28
« on: August 13, 2016, 03:09:59 PM »
Yep, GETOEMLED(13). That was a typo. And yes, I enabled the coolant option.
This is not a huge issue except I have things I want to do that are not quite norm for a mill. In the PLC world, this is easy because it scans the entire program and I am in control of the entire program. Don't really even need to ask as the only way it could be ON is if I turned it on.
In mach, this is very different. Coolant function being perfect example. Mach has control once that option is turned on. No big deal, just have to deal with that. So the main idea in this case was to avoid having to turn on and off coolant in the g-code program. It would have been no big deal to just have my CAM software always add the coolant function before and after tool changes. And then of course edit program if I didn't really want it on. Would very much so like to avoid this.
On my machine, I will have an air gun, vacuum, and atleast 3 independant coolant nozzles (6 would be great). I cut a lot of plastic parts and the chips can be overwelming at times. Thus the shop vac that is just a suction tube mounted just like the coolant nozzles. This allows me to suck the chips out as I'm cutting or to make a pass with no tool and clean out pockets and so on. But 99 percent of the time, if coolant or vac or air gun (or all) was ON before a toolchange, its gonna be ON after the tool change. But I don't want any of them ON during the tool change (Coolant and compressed air blowing into carosel while its open). Thus the need to know if they were ON before the change was requested. I could always just turn them all OFF and require myself to turn the right one back on in the GCode program. Wheres the fun in that. I have a programmable controller at my disposal.
Point being, I'm learning how to use MACH. But with CSLabs hardware, I have a ton of I/O that I want to get real creative with. I can think of a bunch of cool things that could be done with the extra I/O.
As for using the UserLeds and matching them to particular outputs. This would allow them to be turned ON or Off, and also just be monitored from any script. Unless I'm missing something. A UserLed would stay ON when the script is finished. And then could be looked at and/or changed later by any other script. Just have to always do the two step. Set the UserLed and set the output.