首页/文章/ 详情

分享两个已上机验证FANUC宏程序:分中自动抄数、斜件分钟找正!

2年前浏览4077

也许这是为行内做的最后贡献了    真正干数控的大概三年了吧   途中的遭遇一言难尽  虽日常多有抱怨   最终还是感谢     个人原因  身体经不起夜班的“负载”了    各种问题的出现   至使于6.1离开当前公司   或许是离行了

受韦奕东  韦神启示  解出此宏

懂的自然懂   不懂的就看着我装逼

斜件5点找中心宏  利用的是数学中的几何特性  和直线关系  解出直线方程所得


宏1:斜件分钟找正

%
O5555
#501=54(G54);
#502=#501-53;
M00;
#601=#5021(A);
#602=#5022(A);
M00;
#611=#5021(B);
#612=#5022(B);
M00;
#621=#5021(C);
#622=#5022(C);
M00;
#631=#5021(D);
#632=#5022(D);
M00;
#641=#5021(E);
#642=#5022(E);
M00;
#551=#612-#602(B-A   Y);
#552=#611-#601(B-A   X);
#553=#551/#552(K1  Kab);
#554=-1/#553(K2);
#561=ATAN#553 (G68 R#561)
#701=#631 #601;
#702=#632 #602;
#703=#701/2(D1 X);
#704=#702/2(D1 Y);
#555=#553*#703;
#705=#704-#555(BL2   AD);
#801=#622 #642;
#802=#621 #641;
#803=#802/2(C1 X);
#804=#801/2(C1 Y);
#805=#554*#803;
#806=#804-#805(BL1   CE);
#807=#806-#705(BL1-BL2);
#808=#553-#554;
#809=#807/#808;
#810=#553*#809;
#811=#810 #705;
M00;
G90G10L2P#502X#809;
G90G10L2P#502Y#811;
M00;
GOTO 10
#501=55(G55);
#502=#501-53;
M00;
#601=#5021(A);
#602=#5022(A);
M00;
#611=#5021(B);
#612=#5022(B);
M00;
#621=#5021(C);
#622=#5022(C);
M00;
#631=#5021(D);
#632=#5022(D);
M00;
#641=#5021(E);
#642=#5022(E);
M00;
#551=#612-#602(B-A   Y);
#552=#611-#601(B-A   X);
#553=#551/#552(K1  Kab);
#554=-1/#553(K2);
#561=ATAN#553 (G68 R#561)
#701=#631 #601;
#702=#632 #602;
#703=#701/2(D1 X);
#704=#702/2(D1 Y);
#555=#553*#703;
#705=#704-#555(BL2   AD);
#801=#622 #642;
#802=#621 #641;
#803=#802/2(C1 X);
#804=#801/2(C1 Y);
#805=#554*#803;
#806=#804-#805(BL1   CE);
#807=#806-#705(BL1-BL2);
#808=#553-#554;
#809=#807/#808;
#810=#553*#809;
#811=#810 #705;
M00;
G90G10L2P#502X#809;
G90G10L2P#502Y#811;
M00;
GOTO 10;
#501=56(G56);
#502=#501-53;
M00;
#601=#5021(A);
#602=#5022(A);
M00;
#611=#5021(B);
#612=#5022(B);
M00;
#621=#5021(C);
#622=#5022(C);
M00;
#631=#5021(D);
#632=#5022(D);
M00;
#641=#5021(E);
#642=#5022(E);
M00;
#551=#612-#602(B-A   Y);
#552=#611-#601(B-A   X);
#553=#551/#552(K1  Kab);
#554=-1/#553(K2);
#561=ATAN#553 (G68 R#561)
#701=#631 #601;
#702=#632 #602;
#703=#701/2(D1 X);
#704=#702/2(D1 Y);
#555=#553*#703;
#705=#704-#555(BL2   AD);
#801=#622 #642;
#802=#621 #641;
#803=#802/2(C1 X);
#804=#801/2(C1 Y);
#805=#554*#803;
#806=#804-#805(BL1   CE);
#807=#806-#705(BL1-BL2);
#808=#553-#554;
#809=#807/#808;
#810=#553*#809;
#811=#810 #705;
M00;
G90G10L2P#502X#809;
G90G10L2P#502Y#811;
M00;
GOT0 10;

#501=57(G57);
#502=#501-53;
M00;
#601=#5021(A);
#602=#5022(A);
M00;
#611=#5021(B);
#612=#5022(B);
M00;
#621=#5021(C);
#622=#5022(C);
M00;
#631=#5021(D);
#632=#5022(D);
M00;
#641=#5021(E);
#642=#5022(E);
M00;
#551=#612-#602(B-A   Y);
#552=#611-#601(B-A   X);
#553=#551/#552(K1  Kab);
#554=-1/#553(K2);
#561=ATAN#553 (G68 R#561)
#701=#631 #601;
#702=#632 #602;
#703=#701/2(D1 X);
#704=#702/2(D1 Y);
#555=#553*#703;
#705=#704-#555(BL2   AD);
#801=#622 #642;
#802=#621 #641;
#803=#802/2(C1 X);
#804=#801/2(C1 Y);
#805=#554*#803;
#806=#804-#805(BL1   CE);
#807=#806-#705(BL1-BL2);
#808=#553-#554;
#809=#807/#808;
#810=#553*#809;
#811=#810 #705;
M00;
G90G10L2P#502X#809;
G90G10L2P#502Y#811;
M00;
GOTO 10;

#501=58(G58);
#502=#501-53;
M00;
#601=#5021(A);
#602=#5022(A);
M00;
#611=#5021(B);
#612=#5022(B);
M00;
#621=#5021(C);
#622=#5022(C);
M00;
#631=#5021(D);
#632=#5022(D);
M00;
#641=#5021(E);
#642=#5022(E);
M00;
#551=#612-#602(B-A   Y);
#552=#611-#601(B-A   X);
#553=#551/#552(K1  Kab);
#554=-1/#553(K2);
#561=ATAN#553 (G68 R#561)
#701=#631 #601;
#702=#632 #602;
#703=#701/2(D1 X);
#704=#702/2(D1 Y);
#555=#553*#703;
#705=#704-#555(BL2   AD);
#801=#622 #642;
#802=#621 #641;
#803=#802/2(C1 X);
#804=#801/2(C1 Y);
#805=#554*#803;
#806=#804-#805(BL1   CE);
#807=#806-#705(BL1-BL2);
#808=#553-#554;
#809=#807/#808;
#810=#553*#809;
#811=#810 #705;
M00;
G90G10L2P#502X#809;
G90G10L2P#502Y#811;
M00;
GOTO 10;

#501=59(G59);
#502=#501-53;
M00;
#601=#5021(A);
#602=#5022(A);
M00;
#611=#5021(B);
#612=#5022(B);
M00;
#621=#5021(C);
#622=#5022(C);
M00;
#631=#5021(D);
#632=#5022(D);
M00;
#641=#5021(E);
#642=#5022(E);
M00;
#551=#612-#602(B-A   Y);
#552=#611-#601(B-A   X);
#553=#551/#552(K1  Kab);
#554=-1/#553(K2);
#561=ATAN#553 (G68 R#561)
#701=#631 #601;
#702=#632 #602;
#703=#701/2(D1 X);
#704=#702/2(D1 Y);
#555=#553*#703;
#705=#704-#555(BL2   AD);
#801=#622 #642;
#802=#621 #641;
#803=#802/2(C1 X);
#804=#801/2(C1 Y);
#805=#554*#803;
#806=#804-#805(BL1   CE);
#807=#806-#705(BL1-BL2);
#808=#553-#554;
#809=#807/#808;
#810=#553*#809;
#811=#810 #705;
M00;
G90G10L2P#502X#809;
G90G10L2P#502Y#811;
M00;
N10;
M30;

宏2:FANUC分中自动抄数,用于G54~G59坐标

%
O0000
(Power Well)
(THE MACRO ONLY USRE X Y 1/2);
#755=54(G54);
#756=[#755-53];
IF[#756 LE 0] GOTO 10;
IF[#756 GE 7] GOTO 10;
M00;
#701=#5021(X 1VAL);
M00;
#702=#5021(X 2VAL);
#703=[#701 #702]/2;
G90 G10 L2 P#756 X#703(INPUT X);
#704=ABS[#701-#702]
IF[#704 LE 4] GOTO 10
M00;

#711=#5022(Y 1VAL);
M00;
#712=#5022(Y 2VAL);
#713=[#711 #712]/2;
G90 G10 L2 P#756 Y#713(INPUT Y);
#714=ABS[#711-#712]
IF[#714 LE 4] GOTO 10
M00;
GOTO 20


#755=55(G55);
#756=[#755-53];
IF[#756 LE 0] GOTO 10;
IF[#756 GE 7] GOTO 10;
M00;
#701=#5021(X 1VAL);
M00;
#702=#5021(X 2VAL);
#703=[#701 #702]/2;
G90 G10 L2 P#756 X#703(INPUT X);
#704=ABS[#701-#702]
IF[#704 LE 4] GOTO 10
M00;

#711=#5022(Y 1VAL);
M00;
#712=#5022(Y 2VAL);
#713=[#711 #712]/2;
G90 G10 L2 P#756 Y#713(INPUT Y);
#714=ABS[#711-#712]
IF[#714 LE 4] GOTO 10
M00;
GOTO 20

#755=56(G56);
#756=[#755-53];
IF[#756 LE 0] GOTO 10;
IF[#756 GE 7] GOTO 10;
M00;
#701=#5021(X 1VAL);
M00;
#702=#5021(X 2VAL);
#703=[#701 #702]/2;
G90 G10 L2 P#756 X#703(INPUT X);
#704=ABS[#701-#702]
IF[#704 LE 4] GOTO 10
M00;

#711=#5022(Y 1VAL);
M00;
#712=#5022(Y 2VAL);
#713=[#711 #712]/2;
G90 G10 L2 P#756 Y#713(INPUT Y);
#714=ABS[#711-#712]
IF[#714 LE 4] GOTO 10
M00;
GOTO 20


#755=57(G57);
#756=[#755-53];
IF[#756 LE 0] GOTO 10;
IF[#756 GE 7] GOTO 10;
M00;
#701=#5021(X 1VAL);
M00;
#702=#5021(X 2VAL);
#703=[#701 #702]/2;
G90 G10 L2 P#756 X#703(INPUT X);
#704=ABS[#701-#702]
IF[#704 LE 4] GOTO 10
M00;

#711=#5022(Y 1VAL);
M00;
#712=#5022(Y 2VAL);
#713=[#711 #712]/2;
G90 G10 L2 P#756 Y#713(INPUT Y);
#714=ABS[#711-#712]
IF[#714 LE 4] GOTO 10
M00;
GOTO 20


#755=58(G58);
#756=[#755-53];
IF[#756 LE 0] GOTO 10;
IF[#756 GE 7] GOTO 10;
M00;
#701=#5021(X 1VAL);
M00;
#702=#5021(X 2VAL);
#703=[#701 #702]/2;
G90 G10 L2 P#756 X#703(INPUT X);
#704=ABS[#701-#702]
IF[#704 LE 4] GOTO 10
M00;

#711=#5022(Y 1VAL);
M00;
#712=#5022(Y 2VAL);
#713=[#711 #712]/2;
G90 G10 L2 P#756 Y#713(INPUT Y);
#714=ABS[#711-#712]
IF[#714 LE 4] GOTO 10
M00;
GOTO 20


#755=59(G59);
#756=[#755-53];
IF[#756 LE 0] GOTO 10;
IF[#756 GE 7] GOTO 10;
M00;
#701=#5021(X 1VAL);
M00;
#702=#5021(X 2VAL);
#703=[#701 #702]/2;
G90 G10 L2 P#756 X#703(INPUT X);
#704=ABS[#701-#702]
IF[#704 LE 4] GOTO 10
M00;

#711=#5022(Y 1VAL);
M00;
#712=#5022(Y 2VAL);
#713=[#711 #712]/2;
G90 G10 L2 P#756 Y#713(INPUT Y);
#714=ABS[#711-#712]
IF[#714 LE 4] GOTO 10
M00;
GOTO 20
N10
#3000=31(THE MACRO ONLY USRE X Y 1/2);
N20
M00
M30;
%

好了  接下来的东西  很高很装逼也很实用    特别声明   此两个宏的分享   仅供个人学习使用    禁止任何人和任何机构经营获利或作引流广告宣传(此属侵权行为)

1.前言https://v.youku.com/v_show/id_XNTg2NzkzMTQ0MA==.html

2.用于FANUC系统斜件分中找正 (验证)  记得配合G68使用  不会G68就不要浪费时间了

https://v.youku.com/v_show/id_XNTg2Nzg1NDQ2NA==.html

3.宏下载链接:

FANUC系统分中自动抄数和方块5点找中心宏程序.zip

请电脑上打开以下NX网下载链接,或者到手机浏览器上打开。

下载地址https://www.ugnx.net/fx/1042


来源:NX网
UGPLMFANUC数控
著作权归作者所有,欢迎分享,未经许可,不得转载
首次发布时间:2022-09-22
最近编辑:2年前
老叶
本科 签名征集中
获赞 196粉丝 228文章 568课程 0
点赞
收藏
未登录
还没有评论
课程
培训
服务
行家
VIP会员 学习 福利任务 兑换礼品
下载APP
联系我们
帮助与反馈