function m100()
--local inst2 = mc.mcGetInstance()
--local hsig2 = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT0)
local inst2, hSig2, rc2
inst2 = mc.mcGetInstance()
local inst = mc.mcGetInstance()
local hsig = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT0)
local spinstate = mc.mcSignalGetState(hsig)
hSig2, rc2 = mc.mcSignalGetHandle(inst2, mc.OSIG_OUTPUT23) -- Get handle for output 1
rc2 = mc.mcSignalSetState(hSig2, 1) --turn on output 1
if (rc2~= 0) then --Check our return call
mc.mcCntlSetLastError(inst, "There was an error")
end
if (spinstate == 0 ) then
mc.mcCntlSetLastError(inst, "5555566")
--mc.mcSignalSetState(hsig, 0)
else
mc.mcCntlSetLastError(inst, "123")
--mc.mcSignalSetState(hsig, 1)
end
end
if (mc.mcInEditor() == 1) then
m100()
end
this is my code.
now I can
- use OutputSignal23 for active
- Use If (spinstate == 0 ) then....
it'sworking.
I want change If (spinstate == 0 ) then to while signal Input0 active then Stop signal output23 how to code for while loop ?
Thank you.