Hello Guest it is March 28, 2024, 10:29:20 PM

Author Topic: skipping around a g-code file  (Read 3537 times)

0 Members and 1 Guest are viewing this topic.

skipping around a g-code file
« on: July 12, 2016, 09:04:09 PM »
I have a rather large g-code file which I periodically update. I want to execute segments of the file rather than run it all during the testing phase. Often after running one segment of code, I have trouble when trying to run another segment.

I think I found a work around but want to know if there is a better way: I start with the program rewound and move to the first line of the code I want to run. Press "set next line" and press run. When done, I press stop. Then I rewind and move to the next segment.

Thanks in advance,

Rick
Re: skipping around a g-code file
« Reply #1 on: July 15, 2016, 07:42:59 AM »
When I want to test sections of code I do it by posting the operations I wish to test from CAM.
Once all the bits are as I want them I post all operations as one block of code.

 - Nick
Re: skipping around a g-code file
« Reply #2 on: July 15, 2016, 08:42:47 AM »
Nick,

Your approach makes a lot of sense when developing a program. My problem is after it is done. My file is large (6600 lines) but I am changing just a few lines. Running the entire program takes around 8 hours. Running only the segments that have changes is far quicker.

Rick

Offline olf20

*
  •  325 325
    • View Profile
Re: skipping around a g-code file
« Reply #3 on: July 15, 2016, 06:03:42 PM »
Use the "run from here". Works great.
olf20 / Bob
Mach3, Atlas Knee Mill, 4th Axis, VcarvePro, ESS, Super PID.
Been Heating with corn since 1998
Re: skipping around a g-code file
« Reply #4 on: July 16, 2016, 12:23:15 AM »
I'd build the program using subroutines for each of the pieces of program that you'd like to run separately. The top of the program would be a list of subroutine calls in the order you want them executed. Each subroutine should contain all the usual prep stuff, like canceling tool offsets, canceling modal drill routines, starting the spindle etc. If you then use run from here at the appropriate subroutine it'll skip all earlier ones. This makes building a complex program easier too, build it in pieces and then load them all into one file.
Re: skipping around a g-code file
« Reply #5 on: July 16, 2016, 10:49:45 AM »
olf20 - I have found that "run from here" gives erratic results. Clearly I need to look at it again and figure out what I'm doing wrong.

Gary - excellent suggestion. I do have many subroutines but have not structured the entire program this way. I assume I can have subroutines calling subroutines.

Thanks to both of you!
Re: skipping around a g-code file
« Reply #6 on: July 16, 2016, 11:14:06 AM »
Gary,

I found this: 6.2.7.8  "You should not attempt to "Run from here in the middle of a subroutine."

So if the program has been structured to be a series of subroutines, it sounds like I can't use RFH. I must be missing something here.

Rick
Re: skipping around a g-code file
« Reply #7 on: July 16, 2016, 02:07:07 PM »
Rick,
I thought you wanted to run or adjust say a feature of your part, say a pocket. So I was suggesting you run entire subroutine, not part of one.
Re: skipping around a g-code file
« Reply #8 on: July 16, 2016, 07:56:37 PM »
A picture is worth a thousand words.. A video maybe more :-)

Here is a video of my Run From Here problem: https://www.youtube.com/watch?v=_ML7LPLecw4

It shows two strange things: a preparation to move that involves the Y axis in a program which only moves Z. It prompted for it yet did not move Y. Secondly, although I want to be at Z= 1 and was at Z = 0.9, Mach3 moved me all the way down to Z0 and back up. That sure would have ruined the part.

I'm sure there is a "smack me on the head" in all of this but I don't see it.

Thanks in advance,

Rick

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: skipping around a g-code file
« Reply #9 on: July 17, 2016, 04:14:38 AM »
First thing is when I do  a RFH I scroll through the code to select my line rather than entering into the line box. Whether that would make a difference I have no idea.
I think your Z issue however is you likely have Safe Z set up incorrectly.
Hood