三菱机器人程序.doc

上传人:ng****60 文档编号:2291687 上传时间:2019-05-05 格式:DOC 页数:31 大小:212.50KB
下载 相关 举报
三菱机器人程序.doc_第1页
第1页 / 共31页
三菱机器人程序.doc_第2页
第2页 / 共31页
三菱机器人程序.doc_第3页
第3页 / 共31页
三菱机器人程序.doc_第4页
第4页 / 共31页
三菱机器人程序.doc_第5页
第5页 / 共31页
点击查看更多>>
资源描述

1、/定义输入 /Def Io in0=Bit,0Def Io in1=Bit,1Def Io in3=Bit,3Def Io in4=Bit,4Def Io in5=Bit,5Def Io in6=Bit,6Def Io in7=Bit,7Def Io in8=Bit,8Def Io in9=Bit,9Def Io in10=Bit,10Def Io in11=Bit,11Def Io in12=Bit,12Def Io in13=Bit,13Def Io in14=Bit,14Def Io in15=Bit,15/定义/输出/Def Io out0=Bit,0Def Io out1=Bit,1

2、Def Io out3=Bit,3Def Io out4=Bit,4Def Io out5=Bit,5Def Io out6=Bit,6Def Io out7=Bit,7Def Io out8=Bit,8Def Io out9=Bit,9Def Io out10=Bit,10Def Io out11=Bit,11Def Io out12=Bit,12Def Io out13=Bit,13Def Io out14=Bit,14Def Io out15=Bit,15/定义变量 /Def Jnt jyd 定义安全点Def Plt 1,p11,p17,p71,p77,4,4,1 定义托盘点j1=(+1

3、.11,-60.00,+145.00,+0.00,+0.00,+86.61)jyd=(+0.00,-60.00,+145.00,+0.00,+0.00,-90.00)p0=(+0.00,+0.00,+20.00,+0.00,+0.00,+0.00)(0,0)p200=(+0.00,+0.00,+5.00,+0.00,+0.00,+0.00)(0,0)p201=(+0.00,+0.00,+150.00,+0.00,+0.00,+0.00)(0,0)p202=(+0.00,+135.00 ,+0.00,+0.00,+0.00,+0.00)(0,0)p203=(+0.00,+0.00,+60.00,

4、+0.00,+0.00,+0.00)(0,0)p204=(+0.00,+20.00,+0.00,+0.00,+0.00,+0.00)(0,0)/托盘点/p12=p11p21=p11p22=p11p12.Y=p11.Y+12p21.X=p11.X+12p22.X=p11.X+12p22.Y=p11.Y+12p15=(Plt 1,3)p16=p15p25=p15p26=p15p16.Y=p15.Y+12p25.X=p15.X+12p26.X=p15.X+12p26.Y=p15.Y+12p31=(Plt 1,8)p32=p31p41=p31p42=p31p32.Y=p31.Y+12p41.X=p31

5、.X+12p42.X=p31.X+12p42.Y=p31.Y+12p35=(Plt 1,6)p36=p35p45=p35p46=p35p36.Y=p35.Y+12p45.X=p35.X+12p46.X=p35.X+12p46.Y=p35.Y+12p51=(Plt 1,9)p52=p51p61=p51p62=p51p52.Y=p51.Y+12p61.X=p51.X+12p62.X=p51.X+12p62.Y=p51.Y+12p55=(Plt 1,11)p56=p55p65=p55p66=p55p56.Y=p55.Y+12p65.X=p55.X+12p66.X=p55.X+12p66.Y=p55.

6、Y+12p75=(Plt 1,14)p76=p75p85=p75p86=p75p76.Y=p75.Y+12p85.X=p75.X+12p86.X=p75.X+12p86.Y=p75.Y+12p72=p71p81=p71p82=p71p72.Y=p71.Y+12p81.X=p71.X+12p82.X=p71.X+12p81.Y=p71.Y+12/判断/If M_In(9)=1 And M_In(10)=0 Then 判断3 个夹具是否在原位If M_In(11)=0 And M_In(13)=0 Then GoSub *fw 程序fwEndIfEndIfIf M_In(9)=1 And M_In

7、(10)=1 Then 判断1 夹具是否在原位If M_In(11)=0 And M_In(13)=0 ThenGoSub *fw1 夹具1 复位EndIfEndIfIf M_In(9)=1 And M_In(10)=0 Then 判断夹具2 是否在原位If M_In(11)=1 And M_In(13)=0 ThenGoSub *fw2 夹具2 复位EndIfEndIfIf M_In(9)=1 And M_In(10)=0 Then 判断夹具3 是否在原位If M_In(11)=0 And M_In(13)=1 ThenGoSub *fw3 夹具3 复位EndIfEndIfIf M_05#3

8、 Thenout14=1M_05#=0EndIfIf M_In(6)=1 And M_05#=0 ThenGoSub *ks1 一次装机EndIfIf M_In(6)=1 And M_05#=1 ThenGoSub *ks2 二次装机EndIfIf M_In(6)=1 And M_05#=2 ThenGoSub *ks3 三次装机EndIfIf M_In(6)=1 And M_05#=3 ThenGoSub *ks4 四次装机EndIfEnd/复位程序/*fw 程序复位Ovrd 80j1=J_Currj1.J2=jyd.J2j1.J3=jyd.J3j1.J4=jyd.J4j1.J5=jyd.J

9、5Mov j1Mov jydout5=1m_outb(6)=0 将输出信号6-13的8 个位关闭M_00#=0M_05#=0M_01#=0Return /复位1/*fw1Ovrd 70j1=J_Currj1.J2=jyd.J2j1.J3=jyd.J3j1.J4=jyd.J4j1.J5=jyd.J5Mov j1Mov jydout12=0out13=0Mov p1Mov p23ovrd 50Spd 400Mvs p20-p204Mvs p20Dly 0.2out11=1Dly 0.2Mvs p20+p203out11=0GoSub *fw4Return / 复位2/*fw2Ovrd 70j1=J

10、_Currj1.J2=jyd.J2j1.J3=jyd.J3j1.J4=jyd.J4j1.J5=jyd.J5Mov j1Mov jydout12=0out13=0ovrd 50Mov p40+p201Spd 400Mvs p40Dly 0.2out11=1Dly 0.2Mvs p40+p203out11=0GoSub *fw4Return /复位3/*fw3Ovrd 70j1=J_Currj1.J2=jyd.J2j1.J3=jyd.J3j1.J4=jyd.J4j1.J5=jyd.J5Mov j1Mov jydout12=1out13=0Mov p5out12=0ovrd 51Mov p2Spd

11、600Mvs p33Mvs p30+p200Mvs p30Dly 0.2out11=1Dly 0.2Mvs p30+p203out11=0M_05#=M_05#+1If M_In(6)=0 Then GoTo *fw4Return /正常复位/*fw4Ovrd 50j1=J_Currj1.J2=jyd.J2j1.J3=jyd.J3j1.J4=jyd.J4j1.J5=jyd.J5Mov j1Mov jydout11=0out12=0out13=0out15=0out7=0out6=0out14=0Return/取夹具1/*jj1Wait M_In(10)=0Wait M_In(11)=0Wait

12、 M_In(13)=0Ovrd 50Mov p20+p201Spd 700Mov p20+p203Spd 300out11=1Mvs p20Dly 0.2out11=0Dly 0.2Mvs p20+p200p23=P_CurrMvs p23-p204p23=P_CurrMvs p23+p201p23=P_CurrReturn/取夹具2/*jj2Spd 400Wait M_In(10)=0Wait M_In(11)=0Wait M_In(13)=0Mvs p40+p203out11=1Mvs p40Dly 0.2out11=0Dly 0.2Spd 600Mvs p40+p201Mvs p210+

13、p203Spd 400Mvs p210out13=1Mvs p221Mvr p221,p220,p219Mvs p218Mvr p218,p217,p216Mvs p215Mvr p215,p214,p213Mvs p212Mvr p212,p211,p210out13=0out6=1Spd 600Mvs p210+p201out6=0Mvs p40+p201Spd 400Mvs p40Dly 0.2out11=1Dly 0.2Mvs p40+p203out6=1Dly 0.2out6=0Return/取夹具3/*jj3Wait M_In(10)=0Wait M_In(11)=0Wait M_

14、In(13)=0Spd 400Mvs p30+p203out11=1Spd 300Mvs p30Dly 0.2out11=0Dly 0.2Spd 400Mvs p30+p200p33=P_CurrMvs p33-p202p33=P_CurrMvs p33+p201Return/去取盖/*qgOvrd 50Mov p5Mov p5Mov p7Wait M_In(7)=1out12=1out13=0Mov p8+p0out12=0Spd 200Mvs p8Dly 0.2out13=1Dly 0.2out15=1Dly 0.5/入仓库/If M_In(8)=1 Then GoTo *ck2 Else

15、 GoTo *ck1 判断颜色Return*ck2 /白色盖GoSub *jgOvrd 40Mov p231+p201Spd 200If M_In(15)=1 And M_00#3 Thenout10=1Wait M_Out(10)=0M_00#=0EndIfIf M_00#=0 Then 第一层If M_In(15)=1 ThenMov p6EndIfWait M_In(15)=0Mov p231+p201Spd 200Mvs p231EndIfIf M_In(15)=1 And M_00#=1 Then 第二层Mvs p231+p0EndIfIf M_In(15)=1 And M_00#=

16、2 Then 第三层Mvs p231+p203EndIfIf M_In(15)=1 And M_00#=3 Then 第四层Mvs p231+p203+p0EndIfDly 0.2out13=0out12=1Mvs p231+p201out8=1 入库完成GoSub *fw3out8=0M_00#=M_00#+1Return*ck1 /黑色盖GoSub *jgOvrd 40Mov p240+p201Spd 200If M_In(14)=1 And M_01#3 Thenout9=1Wait M_Out(9)=0M_01#=0EndIfIf M_01#=0 Then 第一层If M_In(14)

17、=1 ThenMov p6EndIfWait M_In(14)=0Mov p240+p201Spd 200Mvs p240EndIfIf M_In(14)=1 And M_01#=1 Then 第二层Mvs p240+p0EndIfIf M_In(14)=1 And M_01#=2 Then 第三层Mvs p240+p203EndIfIf M_In(14)=1 And M_01#=3 Then 第四层Mvs p240+p203+p0EndIfDly 0.2out13=0out12=1Mvs p240+p201out8=1 入库完成GoSub *fw3out8=0M_01#=M_01#+1Return/去加盖/*jgMvs p8+p203Ovrd 50Mov p7Mov p6Mov p9Mov p10+p0Spd 200Mvs p10Dly 0.2out7=1Dly 0.2out7=0Mvs p10+p0Ovrd 50Mov p9Mov p6Return/一次装机/*ks1out5=0out6=0out7=0out8=0out14=0

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育教学资料库 > 精品笔记

Copyright © 2018-2021 Wenke99.com All rights reserved

工信部备案号浙ICP备20026746号-2  

公安局备案号:浙公网安备33038302330469号

本站为C2C交文档易平台,即用户上传的文档直接卖给下载用户,本站只是网络服务中间平台,所有原创文档下载所得归上传人所有,若您发现上传作品侵犯了您的权利,请立刻联系网站客服并提供证据,平台将在3个工作日内予以改正。