1
General Mach Discussion / Plasma Torch Start Macro
« on: July 07, 2015, 06:40:03 PM »
Hello everyone. I have been working on a M4 macro to start the torch on a plasma table running Mach3. I think I've finally worked out all of the problems with it and would like to know how well you think it is written.
I look forward to hear what everyone has to say.
------------------------------------
'Macro to start plasma torch
'Checks dry run status
If GetOEMLED(52)Then
Message "Dry Run"
Else
'Define
Const PierceDlyDro = 177
Dim PierceDly
'Read the PierceDlyDro
PierceDly = (GETOEMDRO(PierceDlyDro)* 1000)
Message "Using Pierce Delay of: " & (GETOEMDRO(PierceDlyDro)) & " Seconds"
'Main
DeActivateSignal(Output2) 'Turns off Rotary Cutter
ActivateSignal(Output3) 'Lowers head
Sleep (1000) 'Wait 1 second for the Torch Head to lower
StartTHC()
ActivateSignal (Output1) 'Turns on Torch
Sleep(GETOEMDRO(PierceDlyDro)* 1000) 'Pauses for pierce delay interval
'Wait for Arc OK signal
i = 0
While (Not GetOEMLED(36)) And (i < 400) 'Wait for Arc OK or 4 seconds
sleep 10
i = i + 1
Wend
'Arc OK/ No Arc routine
If GetOEMLED(36) Then
Message "Arc Started"
Else
Message "Arc Failed"
DeActivateSignal(Output1) 'Turn off torch
DeActivateSignal(Output3) 'Raise head
Code ("M30")
END IF
end if
I look forward to hear what everyone has to say.
------------------------------------
'Macro to start plasma torch
'Checks dry run status
If GetOEMLED(52)Then
Message "Dry Run"
Else
'Define
Const PierceDlyDro = 177
Dim PierceDly
'Read the PierceDlyDro
PierceDly = (GETOEMDRO(PierceDlyDro)* 1000)
Message "Using Pierce Delay of: " & (GETOEMDRO(PierceDlyDro)) & " Seconds"
'Main
DeActivateSignal(Output2) 'Turns off Rotary Cutter
ActivateSignal(Output3) 'Lowers head
Sleep (1000) 'Wait 1 second for the Torch Head to lower
StartTHC()
ActivateSignal (Output1) 'Turns on Torch
Sleep(GETOEMDRO(PierceDlyDro)* 1000) 'Pauses for pierce delay interval
'Wait for Arc OK signal
i = 0
While (Not GetOEMLED(36)) And (i < 400) 'Wait for Arc OK or 4 seconds
sleep 10
i = i + 1
Wend
'Arc OK/ No Arc routine
If GetOEMLED(36) Then
Message "Arc Started"
Else
Message "Arc Failed"
DeActivateSignal(Output1) 'Turn off torch
DeActivateSignal(Output3) 'Raise head
Code ("M30")
END IF
end if