Hello Guest it is March 29, 2024, 03:27:51 AM

Author Topic: What is this error???  (Read 2684 times)

0 Members and 1 Guest are viewing this topic.

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
What is this error???
« on: January 01, 2017, 10:18:40 AM »
Running some GCode this afternoon ( Oh Happy New Year BTW) first run went ok, loaded second piece of code for the part that would not run the api log shows this

2017-01-01 14:59:15.591 - Signal id 1050, (Output #0), changed from LOW to HIGH.
2017-01-01 14:59:24.232 - API: mcCntlCycleStart() called.
2017-01-01 14:59:24.233 - API: mcCntlCycleStart() returned MERROR_NOT_COMPILED.
2017-01-01 14:59:32.474 - Loggging Enabled.
2017-01-01 14:59:43.014 - API: mcCntlCycleStart() called.
2017-01-01 14:59:43.015 - API: mcCntlCycleStart() returned MERROR_NOT_COMPILED.

However MERROR_NOT_COMPILED isnt listed as one of the errors returned by mcCntlCycleStart() ??

DazTheGas
New For 2022 - Instagram: dazthegas
Re: What is this error???
« Reply #1 on: January 03, 2017, 05:09:10 AM »
Hi DTG,
hope the holiday season treated you well.

I've not seen that error but something like it. A few days ago I added a little script to my CycleStart/MDI button
to prevent me from starting a job without previously referencing the machine. While I was horsing around trying
to get it to work with bad code M4 threw an error 'not compiled'. Turns out I had syntax errors and the script wouldn't
compile.

I can't imagine why a piece of code should change its compilation state between jobs.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: What is this error???
« Reply #2 on: January 03, 2017, 12:12:08 PM »
It means you have a problem with one of your macro scripts.  One of them has a problem that will not compile the LUA script into a chunk.  If you have recently modified a script, open that one up on the LUA editor and try compiling it in the editor.  Do this for every macro script if you don't know which one is giving the problem. 

As Craig mentioned, it could possibly be in a screen script.  But since you are getting it with Cycle Start, I'm thinking macro.

Steve

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: What is this error???
« Reply #3 on: January 03, 2017, 02:13:55 PM »
Sorry guys definately not a code issue with macros or gui as none of these have been changed for a while, and after restarting mach4 the same gcode etc worked fine.

I have a few workless days ahead so will try and retrace every step and see if i can find exactly where it happens.

DazTheGas
New For 2022 - Instagram: dazthegas
Re: What is this error???
« Reply #4 on: January 03, 2017, 02:47:27 PM »
Hi Guys,
this is probably of topic but I am confused by the existence 'LUA script' in the 'Operator' menu.

I've scanned thru it and it looks like a whole bunch of useful functions. It appears that the screen load script is a copy or at least contains
a copy of it. Which version actually runs with M4?. If I wanted to alter a function which version would I place my edits?

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: What is this error???
« Reply #5 on: January 03, 2017, 03:43:23 PM »
Everything that you see in there is a copy of all the lua from screen load, plc, every button, the whole of the gui etc etc. its a very fast way of scanning through all the lua code in that profile for errors, would be rather cool if we could edit from there though.

DazTheGas
New For 2022 - Instagram: dazthegas
Re: What is this error???
« Reply #6 on: January 03, 2017, 04:41:48 PM »
Hi DTG,
thanks. I scanned thru the Lua script file rather more carefully and sure enuf even my little modification was there.
Tried to edit it but no joy, exactly as you suggested. Do you suppose it would compile? Not my intention or
anything, just interest.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: What is this error???
« Reply #7 on: January 03, 2017, 08:25:00 PM »
Daz,

When you hit Cycle Start, the FIRST thing that is done by the core (LUA plugin) is to look at all of the .mcs files and compare them to the date/time of the byte code .mcc files.  If a .mcs file is newer than its' accompanying .mcc file, the .mcs file is assumed to be modified and the LUA plugin tries to recompile it.  Once all of the .mcs files are compiled into .mcc files, all of the .mcc files are rolled up into one big chunk called mcLua.mcc.  If any of this fails, it will result in a MERROR_NOT_COMPILED error return.  So SOMETHING is causing it.  Mach will continue to run on the old mcLua.mcc file if it cannot compile a new one.  

You are correct that the screen LUA scripts are just snippets that get rolled up into a larger script.  That script is what you can see in the Diag menu.  When the GUI starts, it takes all of the screen element scripts and rolls them up into one big script.  So you really can't edit that one because it is generated.  Any changes you made to it would get overwritten once you restarted the GUI or made changes to the screen in the editor.  

I'll try and make a way to find the errors more easily.  Like blanking out the failed .mcc file to zero bytes if it failed to compile.  That way, it would be easy to see which .mcs file has the error in it.  

Steve

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: What is this error???
« Reply #8 on: January 04, 2017, 02:29:23 AM »
Well after a long night of debugging finally found the cause so this is purely for Steve`s info

My screen is totally different and don`t use the mach4 gui, this is hidden on startup with a winapi call from a plugin and my gui loaded written purely in lua.

On loading a gcode file a wxStyledTextCtrl is populated with the gcode and mach4 is passed the name of gcode to load, now also on my screen are dro`s to control jog and feed rates etc. These dro`s use the onFocus event when the mouse moves over them to allow the mouse wheel to change the values.

So heres the chain of events....

I click Load Gcode and a file dialog opens using the ShowModal() method so all should be safe (wrong)
If I accidently move over one of the dro`s then obviously these get focus and because there a part of my screen then this also gets focus moving the file dialog below it.
With the file dialog no longer there thinking it has closed I press Load GCode again, well ofcoarse this will open another file dialog allow me to select file and populate the wxStyledTextCtrl.
However under my screen is a file dialog still in the ShowModal state attached to a hidden mach4........ derrrrrrr me

Now fixed with a simple    local fileDialog = wx.wxFileDialog(MainFrame...etc  instead of local fileDialog = wx.wxFileDialog(wx.NULL...... so my own screen becomes modal.

Sleeeeeeeeeeeep time.

DazTheGas
New For 2022 - Instagram: dazthegas