Yep, I agree! Thanx for looking out. We could do this a couple ways like always...lol. Like using a global flag set = true in the RefAllAxis button script.
Screen load up script...
flagSoftLimits = false --define and initialize global flag
function autoSoftLimitSet () --define auto soft limits axis set for PLC script to call if global flag is true
local inst = mc.mcGetInstance ()
for i=0, 11 do; if mc.mcAxisIsEnabled(inst, i) == 1 and mc.mcAxisIsHomed (inst, i) == 1 then; mc.mcSoftLimitSetState (inst, i, 1) end; end
end
Button script...
mc.AxisHomeAll(inst); flagSoftLimits = true
PLC....
if flagSoftLimits == true then autoSoftLimitsSet(); flagSoftLimits = false; end --call function if global flag is true, execute, reset flag
....something like that I guess
am I close? Better? I'm all about using the correct order of operations, process efficiencies, and safety. Thanx again!
--josh