585,712 active members*
4,139 visitors online*
Register for free
Login
Results 1 to 8 of 8
  1. #1
    Join Date
    Oct 2005
    Posts
    1145

    Possible bug in subroutines

    I have run into a possible bug in running a subroutine. The problem comes when you switch modes between G90 > G91 or G91 > G90. PathPilot errors and the sub crashes out.

    IF someone has the time could you test the code on your end to make SURE it is not something else wrong here before I submit a trouble report to Tormach. It is a very simple probing sub. I am starting to transfer all of our Mach/UCCNC/Fanuc/Haas probing codes over to PathPilot and there is a LOT of them to do.

    o <20901> sub
    G90 F20
    G0 X0 Y0 Z0
    G0 X5
    G1 Z-1
    G91
    G38.3 X2 F20 (probe X+)
    G1 X-.1 (pullback)
    G90
    G0 Z0
    G0 X5
    o <20901> end sub

  2. #2
    Join Date
    Apr 2013
    Posts
    1788

    Re: Possible bug in subroutines

    There is too much snow here to comfortably go to the workshop so I tried running your code on the Pathpilot virtual machine. I added a call to your subroutine and commented out the G38.3 line but otherwise left it unchanged. It runs without errors. This is with PP 2.2.1 configured as a 770M. What error do you get? What version of PP? What machine?

  3. #3
    Join Date
    Oct 2005
    Posts
    1145

    Re: Possible bug in subroutines

    12:50:11 | subroutines/192 = cycle time 00:00:09 run time 00:00:09
    12:50:11 | Probe Complete
    12:50:09 | mode G91
    12:50:09 | G38 completed
    12:50:03 | Mode G91
    12:50:02 | Test mode G91 Started as Gcode file

    12:49:26 | subroutines/192 = cycle time 00:00:00 run time 00:00:00 last line 18
    12:49:12 | Unable to execute command: (EMC_AXIS_ABORT:120) in MDI mode
    12:49:12 | Unable to execute command: (EMC_AXIS_ABORT:120) in MDI mode
    12:49:12 | Unable to execute command: (EMC_AXIS_ABORT:120) in MDI mode
    12:49:12 | Unable to execute command: (EMC_AXIS_ABORT:120) in MDI mode
    12:49:12 | Mode G91
    12:49:10 | Test mode G91 <<< started as sub


    I have tired it as a o call and as M98 Pxx same results

  4. #4
    Join Date
    Oct 2005
    Posts
    1145

    Re: Possible bug in subroutines

    When you said " I added a sub call to teh subroutine". What exactly did you add ?? Maybe I am missing something here (;-).

    (;-) TP

  5. #5
    Join Date
    Apr 2013
    Posts
    1788

    Re: Possible bug in subroutines

    We're probably both missing a lot!

    I initially removed the <> around the subroutine number since that is not the documented syntax for LinuxCNC programs. I just retried using exactly your code and invoked it as "O20901 call" via the MDI. It runs without an issue and with no messages on the Status tab.

  6. #6
    Join Date
    Oct 2005
    Posts
    1145

    Re: Possible bug in subroutines

    OK teh <20901> is how Tormach does it adn that does work.

    There must be a problem in usuing teh SIM version of PP. It is Version 2.3.6 running in sim mode and fails every time when called as a sub with either o call or M98 Pxx.

    Thanks For teh help, (;-) TP

  7. #7
    Join Date
    Apr 2013
    Posts
    1788

    Re: Possible bug in subroutines

    You piqued my curiosity so I braved the snow and tried your subroutine on a real 770-3 running PP 2.3.6. Invoking it via the MDI as "O20901 call" produces the expected result. "M98 P20901" (is that the correct FANUC syntax?) gives the error message " 'O.... sub' subroutine must be called with 'O.... call' "

  8. #8
    Join Date
    Oct 2005
    Posts
    1145

    Re: Possible bug in subroutines

    Teh M98 sub call requires you to write teh sub as a Fanuc Sub

    o190 ( Sub Name)
    gcode
    gcode
    etc
    etc

    M99

Similar Threads

  1. Subroutines from MDI
    By kstrauss in forum Tormach PathPilot™
    Replies: 8
    Last Post: 02-08-2019, 01:32 AM
  2. Subroutines
    By JohnToner in forum Tormach PathPilot™
    Replies: 7
    Last Post: 11-21-2015, 01:12 AM
  3. with subroutines
    By Thad Swarfburn in forum G-Code Programing
    Replies: 0
    Last Post: 06-25-2009, 02:37 AM
  4. EMC and Subroutines?
    By watchman in forum LinuxCNC (formerly EMC2)
    Replies: 9
    Last Post: 06-17-2007, 08:30 PM
  5. Oi subroutines help
    By mishikwest in forum Fanuc
    Replies: 1
    Last Post: 08-01-2006, 11:17 PM

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
  •