Hello Guest it is January 08, 2026, 02:10:18 PM

Author Topic: Registers from a Macro  (Read 280 times)

0 Members and 1 Guest are viewing this topic.

Registers from a Macro
« on: December 31, 2025, 12:47:52 PM »
local inst = mc.mcGetInstance()
local hreg, rc, ignoreDustBoot
hreg, rc = mc.mcRegGetHandle(inst, "iRegs0/nf/TRC/IgnoreDustBoot")
if (mc.mcInEditor() == 1) then
   mc.mcCntlSetLastError("crap")
end

This fails on Windows 10. One Windows 11, success. I've installed the latest VC++ package on windows 10 which fixed a machipc.dll error I was getting previously.
The register exists and has a value of 1. the rc code is 0, but hreg is 0 also. This should work. It's part of a larger script which has stored values for the dustboot location.

Colten.

Re: Registers from a Macro
« Reply #1 on: January 03, 2026, 04:19:45 AM »
Are you executing this inside ZeroBrane to test or from within Mach? Which build of Mach4 are you using?

This line: mc.mcCntlSetLastError("crap") is also missing "inst"
Re: Registers from a Macro
« Reply #2 on: January 03, 2026, 07:54:36 AM »
the missing inst is fine. it'll error for me in the log. Zerobrain studio. Which should have access to the registers or how can you debug a macro? Like I said though, this works on my windows 11 machine but not on my windows 10 where I have the controller. originally I was using my windows 11 machine which is 20ft away from the machine. I had the ESS setup on the local network of 192.168.1  instead of it's own separate net of 10.9.9.. I was debugging a script for removing a dust boot and putting it back on by single stepping through it. I was using registers with a screen of DRO's for modifying values and a couple of buttons (ignore remove, led for location of boot).

When I  first started using the win10 pc, I was missing the VC++ redistributabe packages and machipc.dll was failing. I installed the latest version of it, and that fixed the problem with the debugger not being able to run. Might be related.