Hello Guest it is May 17, 2021, 07:24:14 PM

Author Topic: external cycle start  (Read 3306 times)

0 Members and 1 Guest are viewing this topic.

external cycle start
« on: July 09, 2015, 11:43:40 AM »
is it's possible to program a external cycle start in mach4 

Offline DazTheGas

*
  •  753 753
  • DazTheGas
    • View Profile
Re: external cycle start
« Reply #1 on: July 09, 2015, 12:19:06 PM »
short n sweet. Yes, using the input signals from your bob.

DazTheGas
Theres always time for a choccy biccy

Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: external cycle start
« Reply #2 on: July 09, 2015, 04:37:37 PM »
its in the Mach4 scripting manual under manuals on the mach web site
Re: external cycle start
« Reply #3 on: July 11, 2015, 09:22:06 AM »
Thank you, it's working

Offline Pedio

*
  •  200 200
    • View Profile
Re: external cycle start
« Reply #4 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
Re: external cycle start
« Reply #5 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
Re: external cycle start
« Reply #6 on: July 14, 2015, 01:13:28 AM »
and it has to go in to the "signal script"

Offline Pedio

*
  •  200 200
    • View Profile
Re: external cycle start
« Reply #7 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

Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: external cycle start
« Reply #8 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

Offline Pedio

*
  •  200 200
    • View Profile
Re: external cycle start
« Reply #9 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.