174
« on: February 01, 2021, 04:26:36 PM »
When I make control panels I make them as simple as possible in the Screen Script. I make it easy on myself, I use the provided code that has been commented out and copy it to each of my inputs that I'm using for button presses.
The Cycle Start and feedhold I use just like they are in the SigLib, I just change the input# to match what I have it mapped to.
No need to make a new function if the code is already being provided my Artsoft. From your first post, it seems like the stock functions will do what you want them to do.
You will need to make a function to adjust your MPG handle to switch Axis, but that could be as simple as making a new function and calling the appropriate API calls to set the axis and the increments that you want. Call those functions on the button press, just like the cylcestart and feedhold are called.
I also made a keyboard toggle button to toggle the keyboard inputs enable/disable that way I can easily push a button and edit code or mess with CAM without having to use a mouseclick to turn off the keyboard inputs.
Having an LED... I get the handle of the feedhold state and use that to set an output on or off based on it's state.
To have an LED on when code is running, use the GCodeRunning output. That's the easiest way to do that.
That's how I utilize the stack light I put on machines. I also run most things through a PLC, but it can all be done in Mach4.