29
« on: December 25, 2021, 02:34:16 PM »
Winging it here. Just an approach.
Create a register: GateState, set it to 0
Add to your M3 macro
local mInst = 0;
if (mcRegGetHandle(mInst, "core/global/GateState", &hReg) == MERROR_NOERROR) {
rc = mcRegSetValue(hReg, 1);
}
Add to your M5 macro
local mInst = 0;
if (mcRegGetHandle(mInst, "core/global/GateState", &hReg) == MERROR_NOERROR) {
rc = mcRegSetValue(hReg, 0);
}
in the start script declare a variable LastGateState and set it to 0
In the signal library Check to see if the state has changed
mInst = 0;
if (mcRegGetHandle(mInst, "core/global/GateState", &hReg) == MERROR_NOERROR) {
local gatestate = mcRegGetValue(hReg, 0);
}
if LastGateState~=gatestate then{
send your pulse
lastGateState=gatestate
}
Syntax is probable wrong but you get the idea. Someone else may have a better method.
HTH
RT