Hello Guest it is March 29, 2024, 05:51:18 AM

Author Topic: is a subprogram or Macro faster in the file itself or read from disk?  (Read 1585 times)

0 Members and 1 Guest are viewing this topic.

I want to know if a subprogram or Macro, that is included in the same gcode file will run faster than a subprogram or Macro saved on disk.
I've just noticed that every time i run a Macro using G65 Mach4 pauses for a second. does this have to do with MST? or is the fact that the subprogram is saved to disk?

before i ran a bunch of tests, thought i would ask in the forums in case anyone knows the answer.

thanks!
Re: is a subprogram or Macro faster in the file itself or read from disk?
« Reply #1 on: August 16, 2018, 04:20:18 PM »
so ive been investigating a little more and i guess when you inlcude them in the same file they are called subroutines.
so the real question then would be...are subroutines faster than subprograms?
Re: is a subprogram or Macro faster in the file itself or read from disk?
« Reply #2 on: August 16, 2018, 10:22:18 PM »
Hi,
I don't know... but in one sense it makes no difference. You have noted that there is a slight pause between
the main Gcode program and macro for instance. I believe that is inevitable as a result of motion control
passing from the main program to the macro. There is no way around that as far as I know.

When a separate chunk of Gcode is required the Gcode interpreter will execute the code by passing P(oint)V(elocity)T(ime)
data to the motion controller, commonly with a buffer of hundreds of milliseconds. Given the buffer who cares
which is fastest, once the buffer is full even a quicker executing piece of code must slow down to the rate
the motion controller consumes PVT data.

Were a chunk of code sooooo.. slow to load say that the motion buffer exhausted BEFORE the interpreter could read and
process the first of the new instruction stream...that would be different.....Mach would pause....and fail. But does
it do that?

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: is a subprogram or Macro faster in the file itself or read from disk?
« Reply #3 on: August 17, 2018, 10:16:17 AM »
Check and make sure that pound var 3003 = 0.  G68 should not pause at all if 3003 is zero.  It should be processed at look ahead time.  I am nearly 100% sure that there will be no difference between a local sub and a external sub, from my testing mach loads all the subs when it loads the file.

It might be possible that your look ahead line count is too low.  Normally we run at about 25.
Andrew
MachMotion
Re: is a subprogram or Macro faster in the file itself or read from disk?
« Reply #4 on: August 17, 2018, 02:29:22 PM »
i will check my settings tonight and get back to you guys!
thanks for the replies!