The ButtonEnable function is defined upon loading and is not related to a specific button but rather checks the 'AxisTable' table for pairs. I would think that because the function is nil that there is a problem with your install of Mach4 Lua files. You could copy your current Profile to another directory and reinstall, then copy the profile back and see if you get the same error code.
Did you make any changes to the screen you are working with?
I assume you have created and are using a new profile based on the mill profile and done the same with the screen set you are using. If not then installing over the existing ones will negate all changes you have made.
HTH
RT
---------------------------------------------------------------
-- Button Enable function Updated 11-8-2015
---------------------------------------------------------------
function ButtonEnable() --This function enables or disables buttons associated with an axis if the axis is enabled or disabled.
AxisTable = {
- = 'X',
[1] = 'Y',
[2] = 'Z',
[3] = 'A',
[4] = 'B',
[5] = 'C'}
for Num, Axis in pairs (AxisTable) do -- for each paired Num (key) and Axis (value) in the Axis table
local rc = mc.mcAxisIsEnabled(inst,(Num)) -- find out if the axis is enabled, returns a 1 or 0
scr.SetProperty((string.format ('btnPos' .. Axis)), 'Enabled', tostring(rc)); --Turn the jog positive button on or off
scr.SetProperty((string.format ('btnNeg' .. Axis)), 'Enabled', tostring(rc)); --Turn the jog negative button on or off
scr.SetProperty((string.format ('btnZero' .. Axis)), 'Enabled', tostring(rc)); --Turn the zero axis button on or off
scr.SetProperty((string.format ('btnRef' .. Axis)), 'Enabled', tostring(rc)); --Turn the reference button on or off
end
end