Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: mark4 on June 29, 2019, 11:53:39 PM

Title: Enable momentary on reset
Post by: mark4 on June 29, 2019, 11:53:39 PM
Hello
I am upgrading a Cincinnati Millicron with kollmorgen motors and added a dspmc controller. It is starting to come together with some help from vital systems. Anyway here is my problem for the spindle upon startup I need to turn on a reset for a few seconds on startup to start the spindle. The catch is the input cannot stay on it has to turn off. I tried using an enable but by not turning off it doesnt start. the spindle is actually quit sophisticated glad I have drawings.

How to accomplish this in mach4 ? I have an idea of how to program the script. Only an idea. But where to put the script and have the reset call it up and execute I am unsure how to do. And I am fuzzy as to where to program this script. The plc script comes to mind but maybe screen load will be better.
Thank you for any advice
Mark
Title: Re: Enable momentary on reset
Post by: joeaverage on July 01, 2019, 07:37:33 AM
Hi,
how about something simple like waiting for a second or two after Mach fires up, turn on an output pin for 2 seconds
then off again. This could go in the PLC script, it waits until tescount (the number of times the script has run since the beginning
of the session) is 50:

Code: [Select]
if (testcount==50)then
local outHandle=mc.mcSignalGetHandle(inst,mc.OSIG_OUTPUT5)
mc.mcSignalSetState(outHandle,1)
wx.wxTimer(2000)
mc.mcSignalSetState(outHandle,0)
end

Craig

Title: Re: Enable momentary on reset
Post by: mark4 on July 01, 2019, 10:14:58 PM
Thank you for the reply I will give that a shot. Looks like its exactly what I need. Never had one so far that needed the reset turned on then off just for start before. Quite the suprise. This machine a Cincinati Milicron. Nice steel but the computer was trashed with no hope. So I have never heard or seen any of this run. Silver lining 3 axis's and a spindle test run was good.
Mark