Try this:
function m1002()
local mInst = 0;
local inst = mc.mcGetInstance(mInst);
local NumValue = 0;
local hSig = 0;
local rc = 0;
local StringValue = "";
local state = 0;
--There is no rc error checking in this....
hSig, rc = mc.mcSignalGetHandle(inst,mc.ISIG_INPUT2);
state, rc = mc.mcSignalGetState(hSig);
if (state == 0) then --0 is Input2 NOT active, 1 is Active
--send error message to Machs error message box
mc.mcCntlSetLastError(inst, "CHECK ENERGY MONITOR!!");
--Optional send error message to a wx Message box
--wx.wxMessageBox("CHECK ENERGY MONITOR!!");
end
local StopDebugVar = 0;
end
if (mc.mcInEditor() == 1) then
m1002();
end
--have fun!
--Scott