Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: lgr on June 20, 2019, 01:39:54 PM

Title: Run G code from here starts cutting at transfer speed.
Post by: lgr on June 20, 2019, 01:39:54 PM
When I use "Run G code from here" it starts cutting at the transfer speed, not the cut speed, not sure if this is a controller plugin issue or Mach 4. I'm using a Hicon integra controller. I guess I could just stick in an F command on the line I'm starting from, but it seems odd.
Title: Re: Run G code from here starts cutting at transfer speed.
Post by: Chaoticone on June 20, 2019, 11:00:43 PM
Tested with 4162 earlier today and did not see this. Are you using set next line then run from here?
Title: Re: Run G code from here starts cutting at transfer speed.
Post by: joeaverage on June 21, 2019, 04:34:21 PM
Hi,
I have build 4162 also, according to that the action of the <Run Gcode From Here> button is 'RunFromHere'.
Given that it is a stock Mach4 action we cannot see the code behind it

I remember always struggling with <Run From Here> in Mach3 until I understood all the implications of the instruction.
One of the important procedures required to <run from here> is to set the correct machine mode.

When you run a Gcode program at any given instant it might be that the spindle is spinning clockwise, ie that some time
in the immediate past an M3 has been issued, and presumably an S*********x to set the speed. The machine may be in incremental
mode, ie a G91 may be in effect and the current move being a linear interpolating cutting move G1 F*********x in effect.

If you start a Gcode program at some point throughout its length......what mode should the machine start in? You can't tell
without scanning through the Gcode that precedes it. There is an API function that does that called 'dry run':

Code: [Select]
LUA Syntax:
rc = mc.mcCntlDryRunToLine(
number mInst,
number line)

Description:
Process G code forward to a given line without motion.
It has a VERY important note that simply cannot be overlooked:
Code: [Select]
Notes:
Once the dry run is started, the function returns immediately. To wait on the dry run, you must check the state of the control.

I would presume that the stock action, 'RunFromHere', must include this API function or another very similar to it in order for
<Run Gcode From Here> to work. It sounds like from your description that Mach is not 'initializing' itself which suggests to me
that as Chaoticone has suggested may be because it is included in the <Set Next Gcode Line> and you have not used it?

Craig