首页 > 代码库 > Mach3寻边和对刀代码

Mach3寻边和对刀代码

Mach3汉化版

 

技术分享

 

对刀代码 :

Rem    Probe Down by PEU (Based on Erniebro Work)
FeedCurrent = GetOemDRO(818)     读取F值
SafeZ                 = GetOemDRO(54)      读取安全Z数值
ZCurrent = GetDro(2)
Code "G4 P1"            Pause 1 second to give time to position probe plate
Code "F100"            slow feed rate to 100 MM/MIN
GageH = GetOEMDRO (1002)
Rem    Probe Down by PEU (Based on Erniebro Work)
FeedCurrent = GetOemDRO(818)     Get the current settings
ZCurrent = GetOemDro(802)
Code "G4 P1"            Pause 1 second to give time to position probe plate
Code "F100"            slow feed rate to 100 MM/MIN
GageH = GetUserDRO(1152)
ZNew = ZCurrent - 30        对刀时,Z最多下降30mm 
Code "G31 Z" &ZNew
While IsMoving()
Wend
Call SetDro (2,GageH)
FinalMove = GageH + Safez    Z轴: 对刀块高度+安全高度

If SafeZ<FinalMove Then 
Code  "G0 Z" &FinalMove
Else        
Code  "G0 Z" &SafeZ        退回到安全z
End if
Code "F" &FeedCurrent          restore starting feed rate         

 

寻边代码:

Rem    Probe Down by PEU (Based On Erniebro Work)
FeedCurrent = GetOemDRO(818)     Get the current settings
XCurrent = GetOemDro(802)
Code "G4 P1"            Pause 1 second to give time to position probe plate
Code "F100"            slow feed rate to 100 MM/MIN
GageH = GetUserDRO(1152) ‘读出对刀块厚度
XNew =XCurrent +20        probe down 20 mm 
Code "G31 X" &XNew
While IsMoving()
Wend
Call SetDro (0,GageH * -1)
FinalMove = (GageH * -1)-3    对刀块负数,再退刀 -3
Code  "G0 X" &FinalMove
Code "F" &FeedCurrent          restore starting feed rate          

 

Mach3寻边和对刀代码