Hello Guest it is October 31, 2024, 08:06:17 PM

Author Topic: Screen script location/modifying outside of Mach4  (Read 2022 times)

0 Members and 1 Guest are viewing this topic.

Screen script location/modifying outside of Mach4
« on: January 25, 2022, 12:02:07 PM »
I have been modifying the Screen Script in Lua to include saving and retrieving variables to/from the INI file. My last function call in the screen script, mc.mcProfileGetString, was not typed correctly and is now causing Mach4 to crash every time I try to run it. That means I cannot get into Mach4 to fix the script, and every time I try to modify C:\Mach4Industrial\ScreenScript.lua outside of Mach4 (to comment out that line), the file is restored to the previously broken Screen Script on Mach4 launch.

Obviously the ScreenScript.lua file gets recompiled every time Mach4 launches, so how can I modify the Screen Script outside of Mach4?

Offline jbuehn

*
  •  101 101
Re: Screen script location/modifying outside of Mach4
« Reply #1 on: January 25, 2022, 12:13:53 PM »
You can open Mach in screen editor mode.

See this thread...
https://www.machsupport.com/forum/index.php?topic=45158.msg288110#msg288110
Re: Screen script location/modifying outside of Mach4
« Reply #2 on: January 25, 2022, 01:06:07 PM »
That fixed it, thank you!
Re: Screen script location/modifying outside of Mach4
« Reply #3 on: January 25, 2022, 08:45:09 PM »
Hi,
thats why I always try to write code in a script file....so I can test it out BEFORE loading it into the Screen Load script and causing yourself some grief.
Just wait until you have a F'up in the PLC script....that'll have you pulling your hair out! The fault gets triggered each time the script runs, a hundred times a second or so.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Screen script location/modifying outside of Mach4
« Reply #4 on: January 26, 2022, 02:01:30 PM »
Hit F7 on your keyboard while in ZeroBrane , it will compile it and throw up any errors with the code. It doesn't always capture everything, but most things. There is also Shift + F7 for more detail