31
Mach4 General Discussion / Re: Help with first easy script or macro (which term?) for automatic oiler
« on: July 31, 2019, 08:45:55 PM »
hello I had the same problem with the machines i rebuild and received some help
-------------------------------------------------------
-- Run Lube
-------------------------------------------------------
local inst = mc.mcGetInstance()
local hsig,rc = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT0)
if (machState == 0)then
mc.mcSignalSetState(hsig,0)
else
mc.mcSignalSetState(hsig,1)
end
This program is placed in the plc script and runs when any axis moves. I don't know what type of oiler you have
or how its meant to work. a relay or timer motor should have no problem turning on and off repeatedly. It comes to duty cycle and if a relay fails from that then it was defective or a poor specimen to begin with.
-------------------------------------------------------
-- Run Lube
-------------------------------------------------------
local inst = mc.mcGetInstance()
local hsig,rc = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT0)
if (machState == 0)then
mc.mcSignalSetState(hsig,0)
else
mc.mcSignalSetState(hsig,1)
end
This program is placed in the plc script and runs when any axis moves. I don't know what type of oiler you have
or how its meant to work. a relay or timer motor should have no problem turning on and off repeatedly. It comes to duty cycle and if a relay fails from that then it was defective or a poor specimen to begin with.