840D常用编程实例Word格式文档下载.docx
- 文档编号:21549558
- 上传时间:2023-01-31
- 格式:DOCX
- 页数:16
- 大小:169.22KB
840D常用编程实例Word格式文档下载.docx
《840D常用编程实例Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《840D常用编程实例Word格式文档下载.docx(16页珍藏版)》请在冰豆网上搜索。
N115X0
N120Y810
N125X2000
N130G00Z100M05
N135M02
图17
利用无限循环,使用Φ200铣刀加工900×
XPM1
N20Z4
N25AAA:
G01X2000
N30Y=IC(180)
N35X0
N40Y=IC(180)
N45GOTOBAAA
N50M02
图18
(2)条件转向
条件语句形式为:
“IF条件表达式GOTOB/GOTOF跳转标记名”。
当条件满足,程序将会跳转到指定的目标。
条件表达式所用的条件运算符包括:
==(等于)、<
>
(不等于)、>
(大于)、>
=(大于等于)、<
(小于)、<
=(小于等于)、AND与、OR或、NOT非、XOR异或。
例如:
使用变量编程加工抛物线Y=0.5X
图19
PWX
R1=10
G00G54G90Z100
X10Y50
M3S1000F200
AA:
R1=R1-0.1
G01X=R1Y=POT(R1)/2
IFR1>
-10GOTOBAA
G00Z100M5
M02
左下角为:
X0、Y0
上面为:
Φ20铣刀加工
螺旋铣孔
XK
N05T1
N10G00G54G90Z200
N15M03S2000F500
;
1
N20TRANSX100Y100
N25R1=35
N30XK1
N35TRANS
2
N40TRANSX100Y900
N45R1=35
N50XK1
N55TRANS
3
N60TRANSX750Y900
N65R1=30
N65XK1
N70TRANS
4
N75TRANSX750Y100
N80R1=30
N85XK1
N90TRANS
5
TRANSX1400Y100
N100R1=25
N105XK1
N110TRANS
6
TRANSX1400Y900
N120R1=25
N125XK1
N130TRANS
G00Z200M05
子程序
XK1
X0Y0
Z5
G01G41X19D1
G03X19Y0Z-20I-19J0TURN=9
G03I-19
G01G40X0
G00Z5
G01G41X=R1D1
G03X=R1Y0Z-20I=-R1J0TURN=9
G03I=-R1
G00Z200
M17
ZK(钻孔)
N05G00G54G90Z100
N10X0Y0
N15M03S500F100
N20MCALLCYCLE83(100,0,5,-55,,-8,,2,,,1)
N25HOLES2(0,0,300,100,10,35)
N30MCALL
N35G00Z100M05
GS(攻丝)
N15M03S50F125
N20MCALLCYCLE840(100,0,5,-55,,,4,3,1)
椭圆参数方程:
X=30×
COS(Θ)Y=20×
SIN(Θ)
程序如下
O0001
R1=0
N005G00G54G90Z100
N010X60Y0
N015M03S600F500
N020Z-5
N025G42X45Y-15
N030G02X30Y0CR=15
R1=R1+1
N035G01X=30*COS(R1)Y=20*SIN(R1)
N040IFR1<360GOTOBAA
N045G02X45Y15CR=15
N050G00G40X60Y0
N055Z200M05
M30
G54X0Y0孔中心,Z0上表面。
R4:
角度变量(0°
~90°
)
X=17-COS(R4)*6
Z=6*(SIN(R4)-1)
程序
DYJ(倒圆角)
N05R4=0
N10G00G54G90Z100
N15X0Y0
N20Z3M03S4000F1000
AA:
R4=R4+2
N25G01Z=6*(SIN(R4)-1)
N30X=17-COS(R4)*6
N35G02I=COS(R4)*6-17
N40IFR4<90GOTOBAA
N45G00Z100M05
程序(使用变量)
R1=倒角孔直径
R2=倒角圆半径
R3=刀半径
R4=角度变量
N05G00G54G90Z200
N10X0Y0
N15Z3M03S4000F2000
N20G01Z=(SIN(R4)-1)*(R2+R3)
N25X=R1/2+R2-COS(R4)*(R2+R3)
N30G02I=COS(R4)*(R2+R3)-R1/2-R2
N35IFR4<90GOTOBAA
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
N50IFR1<25GOTOBAA
N55G00Z100M5
设定;
Φ20中心为X0、Y0。
25尺寸右端为Z0。
使用Φ20、R0.8平面铣刀加工。
程序:
AAA
N20M03S3000F500
N25Z5
N30G01G41X10Y0D1
N35Z0
N40G02X10Y0Z-15I-10J0TURN=14
N45I-10
N50G01G40X40
N55Y5
N60R1=0
BB:
R1=R1+0.5
N65Z=-15-COS(R1)×
10
N70G01G41X=10+SIN(R1)×
10D1
N75Y0
N80G02I=-10-SIN(R1)×
N85G01Y-5
N90G40X40
N95Y5
N100IFR1<90GOTOBBB
N105G00Z100M05
SR
N05R1=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
N10R1=30R2=2R3=4R4=0
N20G00G54G90Z200
N25X=R1+R3+3Y5
N30M03S3000F2000
N35Z2
R4=R4+1.5
N40$TC_DP6[1,1]=(R3+R2)×
COS(R4)-R2
N45G01Z=(R2+R3)×
(SIN(R4)-1)
N50G42X=R1D1
N55Y20
N60G03X20Y30CR=10
N65G01X0
N70Y0
N75X30
N80Y5
N85X=R1+$TC_DP6[1,1]
N90IFR4<=90GOTOBAA
N95G00Z200M05
QQQ
N05CFTCP
N10R1=0
N15G00G54G90G64Z100
N20X60Y-60
N25M03S3000F2000
AB:
R1=R1+3
N30R2=SIN(R1)×
6
N35R3=COS(R1)×
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
N95IFR1<90GOTOBAB
N100G90G0Z150M05
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 840 常用 编程 实例
![提示](https://static.bdocx.com/images/bang_tan.gif)