Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: Splint on February 17, 2018, 08:22:14 AM

Title: PLC to start cycle and rewind g-code?
Post by: Splint on February 17, 2018, 08:22:14 AM
Hi All,

Is it possible to have PLC operate the cycle start, rewind and reset  functiions?

Thanks
Splint
Title: Re: PLC to start cycle and rewind g-code?
Post by: joeaverage on February 17, 2018, 12:15:47 PM
Hi,
I'm not sure why, the PLC script runs every 10milliseconds or so, you don't think it might be a bit much to hit the cycle start button 100 times
a second?

Craig
Title: Re: PLC to start cycle and rewind g-code?
Post by: Splint on February 18, 2018, 05:02:38 AM
I certainly wouldn't need a frequency that high, probably once every 10 seconds, if that. I was thinking of running a robot in a production environment, using a plc to have control of everything other than the robot then sending a start signal to mach to make the robot play its part. So this would be possible? I'm aware of the kinematics issues with mach and robots, I'm thinking of using the Jcode plugin to teach the robot.
Title: Re: PLC to start cycle and rewind g-code?
Post by: DazTheGas on February 18, 2018, 05:29:20 AM
You can do this with a dummy panel and wxTimer

Code: [Select]
TimerPanel = wx.wxPanel (wx.NULL, wx.wxID_ANY, wx.wxDefaultPosition, wx.wxSize( 0,0 ) )
BotTimer = wx.wxTimer(TimerPanel)
TimerPanel:Connect(wx.wxEVT_TIMER,
function (event)
    -- send something to bot
-- process any returns from bot
BotTimer:Start(10000, true) --restart BotTimer if required
end)

BotTimer:Start(10000, true) -- start BotTimer on a RunOnce

DazTheGas