Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: Blacksmith on July 09, 2015, 11:43:40 AM

Title: external cycle start
Post by: Blacksmith on July 09, 2015, 11:43:40 AM
is it's possible to program a external cycle start in mach4 
Title: Re: external cycle start
Post by: DazTheGas on July 09, 2015, 12:19:06 PM
short n sweet. Yes, using the input signals from your bob.

DazTheGas
Title: Re: external cycle start
Post by: dude1 on July 09, 2015, 04:37:37 PM
its in the Mach4 scripting manual under manuals on the mach web site
Title: Re: external cycle start
Post by: Blacksmith on July 11, 2015, 09:22:06 AM
Thank you, it's working
Title: Re: external cycle start
Post by: Pedio on July 13, 2015, 06:08:51 PM
This may sound funny, but can you put the code on this thread? When I copy and paste from the .pdf my application puts in lots of line breaks and funny stuff. I don't know if everyone has this problem.

Thanks,
Peter
Title: Re: external cycle start
Post by: Blacksmith on July 14, 2015, 01:11:57 AM
it looks like this





local inst = mc.mcGetInstance();

if (sig == mc.OSIG_MACHINE_ENABLED) then
    machEnabled = state;
end

if (sig == mc.ISIG_INPUT1) and (state == 1) then
local inst = mc.mcGetInstance()
mc.mcCntlCycleStart(inst)
end


local inst = mc.mcGetInstance();


if (sig == mc.ISIG_INPUT6) and (state == 1) then
local inst = mc.mcGetInstance()
mc.mcCntlCycleStop(inst)
end
Title: Re: external cycle start
Post by: Blacksmith on July 14, 2015, 01:13:28 AM
and it has to go in to the "signal script"
Title: Re: external cycle start
Post by: Pedio on July 15, 2015, 06:31:29 PM
Works - yeaaaaaa. I had to map my Input B on smartBob to input 1 on Mach4.

Dose this script also allow me to program a feed hold on Input 6?

Thanks,
Peter
Title: Re: external cycle start
Post by: dude1 on July 15, 2015, 07:44:07 PM
yes  what ever you wont you could have it do, it`s just scripting needed if you get the M4 scripting manual it has how to do tables in it
Title: Re: external cycle start
Post by: Pedio on July 17, 2015, 02:22:12 PM
Works - yeaaaaaa. I had to map my Input B on smartBob to input 1 on Mach4.

Dose this script also allow me to program a feed hold on Input 6?

Thanks,
Peter

Yep - the Pause or Feedhold works on Input 6.