840D常用编程实例Word文件下载.docx
- 文档编号:15238614
- 上传时间:2022-10-28
- 格式:DOCX
- 页数:13
- 大小:90.93KB
840D常用编程实例Word文件下载.docx
《840D常用编程实例Word文件下载.docx》由会员分享,可在线阅读,更多相关《840D常用编程实例Word文件下载.docx(13页珍藏版)》请在冰豆网上搜索。
N50X2000
N55Y630
N60X0
N65Y810
N70X2000
图17
利用无限循环,使用①200铣刀加工900X2000平面
XPM1
N20Z4
N25AAA:
G01X2000
N30Y=IC(180)
N35X0
N40Y=IC(180)
N45GOTOBAAA
N50M02
(2)条件转向
条件语句形式为:
“IF条件表达式GOTOB/GOTO跳转标记名”〈当条件满足,程序将会跳转到指定的目标。
条件表达式所用的条件运算符包括:
==(等于)、<>(不等于)、>(大于)、>=(大于等于)、<(小于)、<=(小于等于)、AND与、OR或、NOT非、XOR异或。
2
例如:
使用变量编程加工抛物线Y=0.5X
图19
PWX
R1=10
G00G54G90Z100
X10Y50
M3S1000F200
AA:
R1=R1-0.1
G01X=R1Y二P0T(R1)/2
IFR1>
-10GOTOBAA
GOOZ100M5
M02
N45R仁35
TRANSX1400Y100
Z5
N50XK1
N100R仁25
G01G41X19D1
N55TRANS
N105XK1
;
3
N110TRANS
G03X19Y0Z-201-19JOTURN=9
N60TRANSX750Y900
6
G03I-19
N65R仁30
TRANSX1400Y900
G01G40X0
N120R仁25
G00Z5
N125XK1
G01G41X=R1D1
N65XK1
N130TRANS
N70TRANS
G00Z200M05
G03X=R1Y0Z-20I=-R1J0TURN=9
4
G03I=-R1
N75TRANSX750Y100
N80R仁30
G00Z200
N85XK1
子程序
M17
N90TRANS
XK1
5
X0Y0
ZK(钻孔)
N05GOOG54G90Z100
N10XOY0
N15M03S500F100
N20MCALLCYCLE83100,0,5,-55,,-8,,2,,,1)
N25HOLES2(0,0,300,100,10,35)
N30MCALL
N35G00Z100M05
GS(攻丝)
N10X0Y0
N15M03S50F125
N20MCALLCYCLE840100,0,5,-55,,,4,3,1)
椭圆参数方程:
X=30XCOS(@)Y=20XSIN(@)
程序如下
O0001
R1=0
N005G00G54G90Z100
N010X60Y0
N015M03S600F500
N020Z-5
N025G42X45Y-15
N030G02X30Y0CR=15
R仁R1+1
N035G01X=30*COS(R1)Y=20*SIN(R1)
N040IFR1v360GOTOBAA
N045G02X45Y15CR=15
N050G00G40X60Y0
N055Z200M05
M30
G54X0Y0孔中心,Z0上表面。
R4:
角度变量(0°
〜90°
)
X=17-COS(R4)*6
Z=6*(SIN(R4)-1)
N30X=17-COS(R4)*6
N35G02I=COS(R4)*6-17
N40IFR4v90GOTOBAA
N45G00Z100M05
程序
DYJ(倒圆角)
N05R4=0
N10G00G54G90Z100
N15X0Y0
N20Z3M03S4000F1000
AAR4=R4+2
程序(使用变量)
N25G01Z=6*(SIN(R4)-1)
R1=到角孔直径
只2=到角圆半径
R3=刀半径
R4=|度变量
N05GOOG54G90Z200
N15Z3M03S4000F2000
N20G01Z=(SIN(R4)-1)*(R2+R3N25X=R1/2+R2-CO(R4)*(R2+R3N30G02I=CO(R4)*(R2+R3-R1/2-R2N35IFR4v90GOTOBAA
N40G00Z100M05
XYZ
N05T1G17
N10R1=0.01R2=0
N15G00G54G90Z100
N20X40Y0
N25Z=R2
N30M3S2000F1000
G01G42X=R1D1
N35G03I-R1
N40R1=R1+0.5R2=R2-1
N45G40G01X=40Z=R2
N50IFR1v25GOTOBAA
N55G00Z100M5
50
设定;
①20中心为X0Y0。
25尺寸右端为Z0。
使用①20、R0.8平面铳刀加工。
程序:
AAA
N05T1
N20M03S3000F500
N25Z5
N30G01G41X10Y0D1
N35Z0
N40G02X10Y0Z-151-10J0TURN=14
N451-10
N50G01G40X40
N55Y5
N60R仁0
BB:
R仁R1+0.5
N65Z=-15-COS(R1)X10
N70G01G41X=10+SIN(R1)X10D1
N75Y0
N80G02I=-10-SIN(R1)x10
N85G01Y-5
N90G40X40
N95Y5
N100IFR1v90GOTOBBB
N105G00Z100M05
A-A
A
SR
N05R仁10(圆半径)
N10R2=4(刀半径)
N15R3=30(坐标旋转)
N20R10=0(变量)
N25G00G19G54G90Z200
N30ROTZ=R3
N35X101Y=-R1-R2
N40M3S2000F1500
N45Z=R1+5
N50G01Z=-R2
II:
R10=R10-0.2
N55G01X=101+R10
N60G02Y=R1+R2CR=R1+R2
N65R10=R10-0.2
N70G01X=101+R10
N75G03Y=-R1-R2CR=R1+R2
N80IFR10>
=0GOTOBII
N85ROT
N90G00G17Z200M05
DYJ
N10R仁30R2=2R3=4R4=0
N20G00G54G90Z200
N25X=R1+R3+3Y5
N30M03S3000F2000
N35Z2
AAR4=R4+1.5
N40$TC_DP6[1,1]=(R3+R2XCOS(R4)-R2
N45G01Z=(R2+R3X(SIN(R4)-1)
N50G42X=R1D1
N55Y20
N60G03X20Y30CR=10
N65G01X0
N70Y0
N75X30
N80Y5
N85X=R1+$TC_DP6,11]
N90IFR4v=90GOTOBAA
N95G00Z200M05
2010
QQQ
N05CFTCP
N10R仁0
N15G00G54G90G64Z100
N20X60Y-60
N25M03S3000F2000
AB:
R仁R1+3
N30R2=SIN(R1)X6
N35R3=CO(R1)X6
N40$TC_DP6[1,1]=(R2-2)
N45G01Z=R3-6
N50G42X34D1
N55Y0
N60G03X0Y34CR=34
N65X0Y26CR=4
N70G02X-26Y0CR=-26
N75G03X-34CR=4
N80G03X34Y0CR=34
N85G01G40X60
N90Y-60
N95IFR1v90GOTOBAB
N100G90G0Z150M05
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 840 常用 编程 实例
![提示](https://static.bdocx.com/images/bang_tan.gif)