Mach3 macro: How to create a dialogue form?
Автор: Alpha-Go
Загружено: 2020-08-28
Просмотров: 6249
How to capture the user input data when a macro is running using mach3 predefined function AskTextQuestion(). Here is the code (see also • How to create a new user macro in Mach3 ):
'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
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: