Hi,
my apologies, now that I am home and I have checked what I posted you are correct.
This is the syntax of the RegGetHandle() API:
hReg, rc = mc.mcRegGetHandle(
number mInst,
string path)
So the path is a string, not a number.
Try this instead:
value, rc = mc.mcCntlGetPoundVar(
number mInst,
number param)
the param here is a number and mc.VAL_CYCLE_TIME is an Enum of a number.
Have a look at:
https://www.machsupport.com/forum/index.php?topic=40051.msg271116#msg271116Try running this little bit of code:
function m301()
local inst=mc.mcGetInstance()
local num=mc.VAL_CYCLE_TIME
wx.wxMessageBox(tostring(num))
end
if (mc.mcInEditor()==1)then
m301()
end
It should result in the number 2007 being displayed being the value of VAL_CYCLE_TIME.
So it would be useful to have the register diagnostic window open (and pinned to the top) to
display pound variables in the range 2000 to 2020 for instance.
Craig