Mach3 macro: How to create a dialogue form?

preview_player
Показать описание
'Assume that cutter position is at XYZ(0,0,25)
'Probe position is at XY(100, 20)

'Move cutter to probe position

'Code "G0 X100 Y20" 'We will replace this line
'using mach3 predefined AskTestQuestion() to receive data from
'user when macro is running

Probe_X = AskTextQuestion("Enter Probe position X: ")
Probe_Y = AskTextQuestion("Enter Probe position Y: ")

Code "G0 X"& Probe_X &" Y" & Probe_Y

'We need to enter these lines
While IsMoving() 'ensure previous command is completed
Wend

answer = MachMsg("Press enter to continue", "M779: User enter data", 0)

'G31 fast moving
Code "G31 Z-10 F200"
While IsMoving()
Wend
answer = MachMsg("End of G31 fast moving", "M779 Auto Tool Zero", 0)
'G31 slow moving
z = GetOEMDRO(802) 'get current Z coordinate value
Code "G0 Z" &(z+1) 'move back 1mm
Code "G31 Z-10 F25"
While IsMoving()
Wend
answer = MachMsg("End of G31 slow moving", "M779 Auto Tool Zero", 0)
'Set zero
SetOEMDRO(802, 0) '802 hold Z coordinate value
'End
Рекомендации по теме
Комментарии
Автор

Hi sir am Vijay from India. I have mach3 controlled CNC Lathe.But mach3 software doesn't support # G71-Turning cycle. I need #G71 or custom macros for that code function.Can you arrange that marco i will ready to purchase that.. Kindly give me the positive response.

vijaymecheng