技術(shù)文章
發(fā)那科加工中心半自動(dòng)分中宏程序
閱讀:464 發(fā)布時(shí)間:2020-8-11Faunc加工中心半自動(dòng)分中宏程序
%
O9006(1/4NEW ALL-COORDINATE SYSTEM AUTO SET)
N1(PLEASE INPUT #1 AND #2)
#1 =#999(CHOOSE COORDINATE SYSTEM G54-G59)
#2 =0.1(THICKNESS OF FILLER GAUGE)
IF [#2 LE 0 ]GOTO2
IF [#2 GT 1 ]GOTO2
IF [#1 EQ 54 ]GOTO10
IF [#1 EQ 55 ]GOTO10
IF [#1 EQ 56 ]GOTO10
IF [#1 EQ 57 ]GOTO10
IF [#1 EQ 58 ]GOTO10
IF [#1 EQ 59 ]GOTO10
#3000 =1(YOU INPUT ERR,INPUT 54-59)
N2
#3000 =2(YOU INPUT ERR,INPUT 0.01-1.0)
N10
(X POS AUTO SET)
#991 =#5021(READ CURRENT X POS X1)
M99
%
%
O9007(2/4NEW ALL-COORDINATE SYSTEM AUTO SET)
N1(PLEASE INPUT #1 AND #2)
#1 =#999(CHOOSE COORDINATE SYSTEM G54-G59)
#2 =0.1(THICKNESS OF FILLER GAUGE)
IF [#2 LE 0 ]GOTO2
IF [#2 GT 1 ]GOTO2
IF [#1 EQ 54 ]GOTO10
IF [#1 EQ 55 ]GOTO10
IF [#1 EQ 56 ]GOTO10
IF [#1 EQ 57 ]GOTO10
IF [#1 EQ 58 ]GOTO10
IF [#1 EQ 59 ]GOTO10
#3000 =1(YOU INPUT ERR,INPUT 54-59)
N2
#3000 =2(YOU INPUT ERR,INPUT 0.01-1.0)
N10
#992 =#5021(READ CURRENT X POS X2)
#993 =[#991+#992]/2(CALCULATION X COORDINATE)
#[801+10*[#1-54]]=#[5221+20*[#1-54]](CURRENT COORDINATE PROTECTION)
#[5221+20*[#1-54]] =#993(SET X POS)
M99
%
%
O9008(3/4NEW ALL-COORDINATE SYSTEM AUTO SET)
N1(PLEASE INPUT #1 AND #2)
#1 =#999(CHOOSE COORDINATE SYSTEM G54-G59)
#2 =0.1(THICKNESS OF FILLER GAUGE)
IF [#2 LE 0 ]GOTO2
IF [#2 GT 1 ]GOTO2
IF [#1 EQ 54 ]GOTO10
IF [#1 EQ 55 ]GOTO10
IF [#1 EQ 56 ]GOTO10
IF [#1 EQ 57 ]GOTO10
IF [#1 EQ 58 ]GOTO10
IF [#1 EQ 59 ]GOTO10
#3000 =1(YOU INPUT ERR,INPUT 54-59)
N2
#3000 =2(YOU INPUT ERR,INPUT 0.01-1.0)
N10
(Y POS AUTO SET)
#994 =#5022(READ CURRENT Y POS Y1)
M99
%
%
O9009(NEW ALL-COORDINATE SYSTEM AUTO SET)
N1(PLEASE INPUT #1 AND #2)
#1 =#999(CHOOSE COORDINATE SYSTEM G54-G59)
#2 =0.1(THICKNESS OF FILLER GAUGE)
IF [#2 LE 0 ]GOTO2
IF [#2 GT 1 ]GOTO2
IF [#1 EQ 54 ]GOTO10
IF [#1 EQ 55 ]GOTO10
IF [#1 EQ 56 ]GOTO10
IF [#1 EQ 57 ]GOTO10
IF [#1 EQ 58 ]GOTO10
IF [#1 EQ 59 ]GOTO10
#3000 =1(YOU INPUT ERR,INPUT 54-59)
N2
#3000 =2(YOU INPUT ERR,INPUT 0.01-1.0)
N10
#995 =#5022(READ CURRENT Y POS Y2)
#996 =[#994+#995]/2(CALCULATION Y COORDINATE))
#[802+10*[#1-54]] =#[5222+20*[#1-54]](CURRENT COORDINATE PROTECTION)
#[5222+20*[#1-54]] =#996(SET Y POS)
M99
%
使用方法
1、把宏程序傳進(jìn)系統(tǒng)
2、定義6076,6077,6078,6079參數(shù),分別輸入66,77,88,96(之所以輸入96是因?yàn)?/span>M99被系統(tǒng)占用,所以我們用M96)
3、分中時(shí)先移動(dòng)到X軸一側(cè)執(zhí)行M66,再移到另一側(cè)執(zhí)行M77(先執(zhí)行M66,再排行M77,順序不能搞錯(cuò))
4、分中Y是也一樣,先執(zhí)行M88,再執(zhí)行M96。