Hello Guest it is October 23, 2019, 10:44:25 PM

Author Topic: delay  (Read 209 times)

0 Members and 1 Guest are viewing this topic.

delay
« 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



Re: delay
« Reply #1 on: February 13, 2019, 04:18:35 PM »
any help please
Re: delay
« Reply #2 on: February 13, 2019, 07:49:44 PM »
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
My wife left with my best friend...
     and I miss him!

Offline smurph

*
  • *
  •  1,138 1,138
  • "That there... that's an RV."
    • View Profile
Re: delay
« Reply #3 on: February 14, 2019, 12:23:42 AM »
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
Re: delay
« Reply #4 on: February 14, 2019, 01:23:02 AM »
thans smurph but this was my first try but didnt work
ill try with put in registry global parameter that will change state
thanks