Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: mb-ABTech 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?
-
You can open Mach in screen editor mode.
See this thread...
https://www.machsupport.com/forum/index.php?topic=45158.msg288110#msg288110 (https://www.machsupport.com/forum/index.php?topic=45158.msg288110#msg288110)
-
That fixed it, thank you!
-
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
-
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