faunc加工中心半自动分中宏程序
%
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、把宏程序传进系统
2、定义6076,6077,6078,6079参数,分别输入66,77,88,96(之所以输入96是因为m99被系统占用,所以我们用m96)
3、分中时先移动到x轴一侧执行m66,再移到另一侧执行m77(先执行m66,再排行m77,顺序不能搞错)
4、分中y是也一样,先执行m88,再执行m96。