Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: KatzYaakov on February 11, 2019, 07:14:02 PM
-
hi
after press "hold" if i press start the machine continue the file to fast
i want add delay in the start button
i tried by script and add gcode exitute G4 P5000
but its make mach stack
second problem i have ,i want to check if machine state its hold(then i delay) or not ,so in this case no delay
i try:
InFeedHold, rc = mc.mcCntlFeedHoldState( number mInst)
but its always give me "0"
thanks in advance
yaakov
-
any help please
-
Hi,
I'm far from sure about this but here goes:
When you issue a <FeedHold> Mach enters 'MC_STATE_HOLD'. Thus the GCode interpreter is busy
and cannot process any Gcode.
The only way you can cause Mach to execute Gcode is when 'MC_STATE_IDLE', which can only occurr
if you end the Gcode job or <CycleStop>.
You can test this by loading then starting a Gcode job. Now <FeedHold> and try all the buttons/functions of the GUI,
most of them don't work. That means that the Gcode interpreter chunk is running and therefore the GUI chunk is not.
The only way I could see that would that might achieve what you want is to modify the existing CycleStart() function
in the screen load script, and I may be that you would have a delay whenever you <CycleStart> not just this particular
job.
Craig
-
Ok, try looking at the state of the machine, as Craig alluded to.
In the cycle start button, you can put some more scripting in the up event script.
local mstate = mc.mcCntlGetState()
if (mstate == mc.MC_STATE_HOLD) then
wx.wxMilliSleep(2000) -- two seconds.
end
Steve
-
thans smurph but this was my first try but didnt work
ill try with put in registry global parameter that will change state
thanks