Code:
' Fisnar Soldering ToolChange Macro
' --------------------------------
'
'The tool number is used to select the soldering cycle that the head is to
'perform. There are 31 different soldering cycles that can be chosen. The
'parameters for each cycle needs to be programmed into the head by a separate
'pendant that comes with the head. The Toolchange macro then just selects which 'cycle is selected.
'Mach3 outs used to select the 5 bits defining the cycle number. Block1 is the LSB
const BLOCK1 = OUTPUT2
const BLOCK2 = OUTPUT3
const BLOCK3 = OUTPUT4
const BLOCK4 = OUTPUT5
const BLOCK5 = OUTPUT6
'Get the new tool number
tool = GetSelectedTool()
'Deativate all outputs
DeActivateSignal(BLOCK1)
DeActivateSignal(BLOCK2)
DeActivateSignal(BLOCK3)
DeActivateSignal(BLOCK4)
DeActivateSignal(BLOCK5)
'Turn on outputs as required for the selected tool
select case tool
case 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31
ActivateSignal(BLOCK1)
end select
select case tool
case 2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31
ActivateSignal(BLOCK2)
end select
select case tool
case 4,5,6,7,12,13,14,15,20,21,22,23,28,29,30,31
ActivateSignal(BLOCK3)
end select
select case tool
case 8,9,10,11,12,13,14,15,24,25,26,27,28,29,30,31
ActivateSignal(BLOCK4)
end select
select case tool
case 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
ActivateSignal(BLOCK5)
end select
'Set the current tool to the new one
SetCurrentTool( tool )