Need mach3 scripting and editor/debugger help


Results 1 to 4 of 4

Thread: Need mach3 scripting and editor/debugger help

  1. #1
    Member TerryKurtz's Avatar
    Join Date
    Jul 2019
    Posts
    2
    Downloads
    0
    Uploads
    0

    Default 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

    Similar Threads:


  2. #2
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default 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
    [URL]http://www.thecncwoodworker.com/2017.html[/URL]

    Mach3 2010 Screenset
    [URL]http://www.thecncwoodworker.com/2010.html[/URL]

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

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


  3. #3
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default Re: Need mach3 scripting and editor/debugger help

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

    Gerry

    UCCNC 2017 Screenset
    [URL]http://www.thecncwoodworker.com/2017.html[/URL]

    Mach3 2010 Screenset
    [URL]http://www.thecncwoodworker.com/2010.html[/URL]

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

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


  4. #4
    Member TerryKurtz's Avatar
    Join Date
    Jul 2019
    Posts
    2
    Downloads
    0
    Uploads
    0

    Default 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.



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
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Need mach3 scripting and editor/debugger help

Need mach3 scripting and editor/debugger help