261
Mach4 General Discussion / Re: mcMasterModule question
« on: June 29, 2018, 04:01:15 PM »
you don't need to create a mcp variable as mc is defined and available at load to macros as well as buttons etc. If you were to add the line wx.wxMessageBox(tostring(mc)) at the beginning of your m6 macro you will see that it is defined as a table, the one created at Mach4 load. I don't think the mcp table that is returned links to your running version of Mach4 but rather creates another lua chunk.
You can access the the register values by requesting a handle to it an then requesting the value using the mc variable and the core API's:
hReg, rc = mc.mcRegGetHandle(mInst, 'gRegs0/SafeZ')
mVal, rc = mcRegGetValue(hReg)
Assuming you have created a gReg0 value named SafeZ through Configure->Plugins->Regfile
I can't help with with the scr problem since I get the same result as you do with the version I listed. maybe there is a development version that allows direct access to the scr variable loaded at screenload. My workaround shown in the link I provided does work but it would be better if someone (SMURPH) would respond on this one.
HTH
RT
You can access the the register values by requesting a handle to it an then requesting the value using the mc variable and the core API's:
hReg, rc = mc.mcRegGetHandle(mInst, 'gRegs0/SafeZ')
mVal, rc = mcRegGetValue(hReg)
Assuming you have created a gReg0 value named SafeZ through Configure->Plugins->Regfile
I can't help with with the scr problem since I get the same result as you do with the version I listed. maybe there is a development version that allows direct access to the scr variable loaded at screenload. My workaround shown in the link I provided does work but it would be better if someone (SMURPH) would respond on this one.
HTH
RT