Hello Guest it is April 16, 2024, 12:01:56 AM

Author Topic: Is there a "Fail safe mode" for starting Mach4  (Read 2604 times)

0 Members and 1 Guest are viewing this topic.

Is there a "Fail safe mode" for starting Mach4
« on: June 03, 2016, 07:32:39 AM »
After my last change in the screen load script, Mach 4 hangs on startup.

Of course my code is completely free from bugs, so that can't be the problem  ;D
Seriously, though. If my code is the problem I think Mach4 handles the problem in a bad way. How do I move along from here? Can Mach4 be started in fail safe mode, i.e. without Screen Load script?

Problem signature:
  Problem Event Name:   APPCRASH
  Application Name:   Mach4GUI.exe
  Application Version:   4.2.0.2914
  Application Timestamp:   56ceae3e
  Fault Module Name:   MSVCR120.dll
  Fault Module Version:   12.0.21005.1
  Fault Module Timestamp:   524f7ce6
  Exception Code:   40000015
  Exception Offset:   000a7676
  OS Version:   6.1.7601.2.1.0.256.48
  Locale ID:   1053
  Additional Information 1:   8ccb
  Additional Information 2:   8ccbf50f74772a5b09503a87e4456582
  Additional Information 3:   dd5e
  Additional Information 4:   dd5e0c108ab7904ae436f4262ef7da0a

edit:
I have now verified that MSVCR120.dll is not corrupted by running a complete system integrity check (sfc /scannow)
« Last Edit: June 03, 2016, 07:46:32 AM by Michael Sageryd »
Re: Is there a "Fail safe mode" for starting Mach4
« Reply #1 on: June 03, 2016, 09:06:57 AM »
I found the solution and thought I'd post it for others to find.

Simply add /e to the Mach4GUI.exe at the command line to jump straight into screen edit mode.

"Mach4GUI.exe /h" will list the command line options.
Re: Is there a "Fail safe mode" for starting Mach4
« Reply #2 on: June 03, 2016, 09:42:04 AM »
This is really weird, or I have totally misunderstood something.

This is the code that makes Mach4 crash badly:

    mc.mcSignalSetState(mc.OSIG_OUTPUT10, 1);

What is wrong with it?
It seems to comply with the syntax description in the Core API help file.
Re: Is there a "Fail safe mode" for starting Mach4
« Reply #3 on: June 03, 2016, 09:49:24 AM »
I'll reply to this one as well..  :-[

I need to get a handle for the signal first. I know I have read this somewhere, but somehow I forgot it when I coded. Here is the working code for my soon to be PoKeys control panel:

---------------------------------------------------------------
-- Toggle axis selection lights for MPG.
---------------------------------------------------------------
function SelectAxisForMPG(axis)
    local X_LIGHT_SIG = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT10)
    local Y_LIGHT_SIG = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT11)
    local Z_LIGHT_SIG = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT12)

    mc.mcMpgSetAxis(inst, MPG_JOG, axis);

    mc.mcSignalSetState(X_LIGHT_SIG, (axis == X_AXIS));
    mc.mcSignalSetState(Y_LIGHT_SIG, (axis == Y_AXIS));
    mc.mcSignalSetState(Z_LIGHT_SIG, (axis == Z_AXIS));
end
Re: Is there a "Fail safe mode" for starting Mach4
« Reply #4 on: June 03, 2016, 12:13:13 PM »
I'll reply to this one as well..  :-[

I need to get a handle for the signal first.


I made this same mistake a few days ago.  Used the output rather than the handle to the output.
Re: Is there a "Fail safe mode" for starting Mach4
« Reply #5 on: October 06, 2016, 06:08:16 PM »
I just did the same (added mc.mcSignalSetState without handle in screen load script) but adding /e is not working.  I also tried /p MyProfile /e and it still crashes on load.  I also tried loading a profile backup from earlier this morning but it still crashes.  

Any ideas how to fix? ???


-EDIT:  I remembered that I had used "Package Current Profile" this morning as an extra precaution.  I was able to import that package and it worked.  I lost a few hours of work but It's better than starting from scratch!

I wonder why the /e option didn't work for me though?

« Last Edit: October 06, 2016, 06:21:44 PM by beezerlm »