Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: Ironwright on December 13, 2022, 03:14:49 PM

Title: touchscreen shut down button
Post by: Ironwright on December 13, 2022, 03:14:49 PM
I have a touchscreen on my machine and would like to create a shutdown button.  Any ideas what lua code I would need to shutdown the program safely?  I wrote a batch file to shutdown the computer, but mach needs to be closed properly before that to avoid corrupting's the INI file.
Title: Re: touchscreen shut down button
Post by: SwiftyJ on December 14, 2022, 12:07:17 PM
You can use:

scr.Exit(false)
Title: Re: touchscreen shut down button
Post by: Ironwright on December 14, 2022, 03:21:17 PM
Works like a charm. Thanks!

I move the machine just off the home position, then  call the screen exit and a call to os.execute a shutdown.bat file after that.  I put a 6 second delay in the shutdown to give Mach4 plenty of time to shutter.