You can access the registers by name starting with HiCON. You can view the names of registers in Mach4 file menu Diagnostics->Regfile
The registers are read only
local inst = mc.mcGetInstance()
local regHandle = mc.mcRegGetHandle(inst, 'HiCON/Encoder0')
local val = mc.mcRegGetValue(regHandle)