Keyboard configuration in MACH4
Some of our customers met the problem of configuring keys for execution of the frequently used functions (e.g. Feed and Spindle speed override). There is difference between MACH 3 and MACH 4 to do this. In MACH 3 you can change shortcut in the screenset editor but in MACH 4 it will not work.
Here we describe some simple steps for configuration of the keyboard's keys.
STEP 1
Select menu item
Add desired keys
STEP 2
Restart MACH 4! It's important.
Select menu item
Bind keys to free Inputs
STEP 3
Select menu item
STEP 4
Click positions in order
Add this code for Feedrate Override to SigLib section
____________________
[mc.ISIG_INPUT62] = function (state)
if (state == 1) then --
local inst = mc.mcGetInstance()
FROPlus()
end
end,
[mc.ISIG_INPUT63] = function (state)
if (state == 1) then --
local inst = mc.mcGetInstance()
FROMinus()
end
end,
_______________________________
STEP 5
And this code just after SigLib section
_____________________________________
--FRO is read from 0 - 250
--FRO + 10%
function FROPlus()
local inst = mc.mcGetInstance()
local FRO = mc.mcCntlGetFRO(inst)
if FRO == 250 then
mc.mcCntlSetLastError(inst, "Can't increase FRO anymore.")
else
local NewFRO = (FRO + 10)
mc.mcCntlSetFRO(inst, NewFRO)
end
end
--FRO is read from 0 - 250
--FRO - 10%
function FROMinus()
local inst = mc.mcGetInstance()
local FRO = mc.mcCntlGetFRO(inst)
if FRO == 0 then
mc.mcCntlSetLastError(inst, "Can't decrease FRO anymore.")
else
local NewFRO = (FRO - 10)
mc.mcCntlSetFRO(inst, NewFRO)
end
end
____________________
Please note, that we bind Feedrate+ and Feedrate- keys to Input #62 and Input #63
STEP 6
Add this code to SigLib section for Spindle speed override
[mc.ISIG_INPUT60] = function (state)
if (state == 1) then --
local inst = mc.mcGetInstance()
SROPlus()
end
end,
[mc.ISIG_INPUT61] = function (state)
if (state == 1) then --
local inst = mc.mcGetInstance()
SROMinus()
end
end,
STEP 7
And this code after SigLib section
STEP 8
For correct operation don’t forget to switch on this feature.
That's all.
P.S. Thanks to Cbyrdtopper for help in this issue
All configurations were made for our waterproof keyboard (see link below) but they are actual for any keyboard as well.
Waterproof custom keyboards for MACH 3 / MACH 4 CNC
- Fully compatible with MACH 3 / MACH 4
- Waterproof
- Feed and Spindle Speed override encoders
- Programmable key combinations
- Custom labels and keys arrangement
Retrofit CNC – EMMEGI PHANTOMATIC T4A Machine
Retrofit CNC BIMA 310 Woodworking center with two tool magazines
Retrofit CNC IR-800PMF4 Metalworking center with ATC
Retrofit CNC Mill CORTINI BF-400
Retrofit CNC Mill 65A60F3
Retrofit CNC Router V.Alberti SUPER INDEX CN
CNC machine for figured cutting of the foam rubber modernization
Specification
- Dismantle of old CNC system
- Installation of new CNC system
- It is necessary to carry out turn of an edge of a saw tangent to a movement trajectory
- Correction of a software for performance of machine’s functions
- Control at the same time on 3 coordinates
- 10 input signals
- 12 output signals
- Completion of library of subprogrammes
- Adaptation of AlphaCAM program post-processor for writing of the operating CNC programs
- Writing of the program for the personal computer with calculation of an saw edge rotation angle
- Training of the personnel