Hello Guest it is February 28, 2021, 08:59:50 PM

Author Topic: ScreenScript error after updating  (Read 693 times)

0 Members and 1 Guest are viewing this topic.

ScreenScript error after updating
« on: September 02, 2018, 08:54:45 PM »
Just updated from 3155 to 3804, now when I start M4 I get a lua error in ScreenScript.lua (see attached pics) and the PLC gets disabled, the error says "attempt to index global 'prb' (a nil value)".
My knowledge of lua is VERY basic, I do a lot of cutting and pasting code from the forum post (and watch alot of DazTheGas videos) but need someone who understands lua to give me some guidance on fixing this.
Thanks in advance for any suggestions.
Hit the e-stop! Hit the e-stop!
Re: ScreenScript error after updating
« Reply #1 on: September 02, 2018, 10:07:13 PM »
Hi,
do you have an individually named screen set?

From what you describe I don't think you do. In the lower right of Machs screen there is a window
telling you the screen set in use, I'm guessing something like wx4.set.

Any and all screen modifications you have made over the last few months have been made to and stored in
the screen set file wx4.set or whatever.

When you updated Mach you got a fresh (and updated) copy of wx4.set and all your modifications have been
overwritten.

If you do not have a backup copy of the screen set from before you updated you're stumped. You will have to redo
all those tweaks. This time make an individualised copy of your preferred screen set so that it does not get overwritten
again.

For instance go to the screen folder and make a copy of wx4.set and call CCWoodwx4.set and use that screenset
in your profile.

Craig
My wife left with my best friend...
     and I miss him!
Re: ScreenScript error after updating
« Reply #2 on: September 02, 2018, 11:06:48 PM »
Hi Joe, thanks for responding. I do have a named screen set... it's a modified wx4 screen and was working fine. I loaded it to the new install of mach and all of my modifications were there. I had just recently added a tool zero script (based on a DazTheGas script) and wonder if that may have something to do with the problem (I think the prb.LoadSettings is referring to probing). I have rolled back everything to 3155 before adding the tool zero and will try to update from there.
Hit the e-stop! Hit the e-stop!
Re: ScreenScript error after updating
« Reply #3 on: September 02, 2018, 11:08:43 PM »
Hi,
do you have any custom modules? They will have to be copied separately.

Craig
My wife left with my best friend...
     and I miss him!
Re: ScreenScript error after updating
« Reply #4 on: September 02, 2018, 11:51:28 PM »
No custom modules... I think it's something to do with the wx4 screen set... I just updated back to 3804 and tried some of the screen sets that came with the update, no errors. Tried my screen set Andy_wx4 and got the error, then loaded a screen set from the update and everything worked again... decided to try the un-modified wx4 set that my screen is based on and the error occurred again. Got a couple of jobs to do tomorrow, so I'm gonna roll back to 3155 (I know that version works with my modifications) till I finish them... then I guess, I'll update and start modifying one of the screens that comes with 3804.

Thanks for taking time to reply
Andy
Hit the e-stop! Hit the e-stop!
Re: ScreenScript error after updating
« Reply #5 on: September 03, 2018, 12:06:53 AM »
Hi,
I thought that prb.LoadSettings was the format that you would use if 'prb' is a module.
I never used modules and am unfamiliar with the syntax.

Craig
My wife left with my best friend...
     and I miss him!
Re: ScreenScript error after updating
« Reply #6 on: September 04, 2018, 11:11:04 AM »
prb is a variable configured by the screen load script.  I'm not running your version but in mine the code is:

--Probing module
package.loaded.Probing = nil
prb = require "mcProbing"
--mc.mcCntlSetLastError(inst, "Probe Version " .. prb.Version());


Your error indicates that prb was not successfully initialized.  make sure that the above code is in your screen load script and that the file mcProbing.lua exists in your;
C:\Mach4Hobby\Modules directory.

HTH

RT