584,879 active members*
5,329 visitors online*
Register for free
Login
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2019
    Posts
    2

    Need mach3 scripting and editor/debugger help

    I need help to determine why a 3 or 4 line macro, in mach3 (final version) , won't run without compile or syntax errors. Single code snippets run fine! (GetVar, SetVar, Code"xxx")
    But as soon as I embed a snippet in a simple " If-Then-End If" construct, I get a compile error at the time of the macro execution.

    Example M888: Runs without errors: reads/writes #Vars in G code program verified with "Operator/Var monitor"

    SetVar(100, GetVar(101)+3) M99


    Example M888: Faults on runtime execution, issues "Compile error"

    If GetVar(103) > GetVar(104) Then
    SetVar(100, GetVar(101)+3)

    End If
    M99

    Running the debugger produces a compile and syntax error but no reference to the offending line or instruction.

    Another oddity:
    Works: SetVar(100, GetVar(101)+3) M99

    Faults: SetVar(100, GetVar(101)+3)
    M99

    Can't figure out why moving M99 would make a difference

  2. #2
    Join Date
    Mar 2003
    Posts
    35538

    Re: Need mach3 scripting and editor/debugger help

    M99 should not work at all.
    It should be:
    Code"M99"

    And I doubt that it would work on the same line as SetVAR.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  3. #3
    Join Date
    Mar 2003
    Posts
    35538

    Re: Need mach3 scripting and editor/debugger help

    Also, I'd try
    somenumber = Getvar(101) +3
    SetVar(100, somenumber)
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  4. #4
    Join Date
    Jul 2019
    Posts
    2

    Re: Need mach3 scripting and editor/debugger help

    Thanks for the help. Moving M99 into the o100 area of the g code program , after the macro call, removed the compile errors and I was able to use the if- then statement. The debugger offered no help in isolating the problem.Using the m99 on the same line as the setvar didn't work(return me to the subroutine call line, but it didn't generate a compile error either which led me down the wrong path for a while. Hey, it's all good.

Similar Threads

  1. Debugger detected in loader
    By Jarnodal in forum HURCO
    Replies: 0
    Last Post: 02-02-2015, 08:47 AM
  2. does the X3 post debugger actually work?
    By foxsquirrel in forum Mastercam
    Replies: 2
    Last Post: 06-15-2010, 08:46 AM
  3. couldn't activate the debugger
    By Bala in forum Post Processors for MC
    Replies: 3
    Last Post: 04-05-2010, 12:09 AM
  4. Post Debugger
    By littlebrewman in forum Mastercam
    Replies: 1
    Last Post: 02-24-2010, 03:33 AM
  5. Using VB as a G-Code debugger / editor
    By BonusODJ in forum Visual Basic
    Replies: 1
    Last Post: 12-22-2008, 08:49 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •