三菱机器人程序
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
'//////////////定义输入////////////
Def Io in0=Bit,0
Def Io in1=Bit,1
Def Io in3=Bit,3
Def Io in4=Bit,4
Def Io in5=Bit,5
Def Io in6=Bit,6
Def Io in7=Bit,7
Def Io in8=Bit,8
Def Io in9=Bit,9
Def Io in10=Bit,10
Def Io in11=Bit,11
Def Io in12=Bit,12
Def Io in13=Bit,13
Def Io in14=Bit,14
Def Io in15=Bit,15
'///////////////定义/输出//////////
Def Io out0=Bit,0
Def Io out1=Bit,1
Def Io out3=Bit,3
Def Io out4=Bit,4
Def Io out5=Bit,5
Def Io out6=Bit,6
Def Io out7=Bit,7
Def Io out8=Bit,8
Def Io out9=Bit,9
Def Io out10=Bit,10
Def Io out11=Bit,11
Def Io out12=Bit,12
Def Io out13=Bit,13
Def Io out14=Bit,14
Def Io out15=Bit,15
'//////////////定义变量//////////////
Def Jnt jyd '定义安全点Def Plt1,p11,p17,p71,p77,4,4,1'定义托盘点
j1=(+1.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,+0.00,+0.00,+0.00)(0,0)
p204=(+0.00,+20.00,+0.00,+0.00,+0.00,+0.00)(0,0)
'////////////托盘点//////////////
p12=p11
p21=p11
p12.Y=p11.Y+12 p21.X=p11.X+12 p22.X=p11.X+12 p22.Y=p11.Y+12 p15=(Plt1,3)
p16=p15
p25=p15
p26=p15
p16.Y=p15.Y+12 p25.X=p15.X+12 p26.X=p15.X+12 p26.Y=p15.Y+12 p31=(Plt1,8)
p32=p31
p41=p31
p42=p31
p32.Y=p31.Y+12 p41.X=p31.X+12 p42.X=p31.X+12 p42.Y=p31.Y+12 p35=(Plt1,6)
p36=p35
p45=p35
p46=p35
p36.Y=p35.Y+12 p45.X=p35.X+12 p46.X=p35.X+12 p46.Y=p35.Y+12 p51=(Plt1,9)
p52=p51
p61=p51
p62=p51
p52.Y=p51.Y+12 p61.X=p51.X+12 p62.X=p51.X+12 p62.Y=p51.Y+12 p55=(Plt1,11) p56=p55
p65=p55
p66=p55
p56.Y=p55.Y+12 p65.X=p55.X+12 p66.X=p55.X+12 p66.Y=p55.Y+12 p75=(Plt1,14)
p85=p75
p86=p75
p76.Y=p75.Y+12
p85.X=p75.X+12
p86.X=p75.X+12
p86.Y=p75.Y+12
p72=p71
p81=p71
p82=p71
p72.Y=p71.Y+12
p81.X=p71.X+12
p82.X=p71.X+12
p81.Y=p71.Y+12
'///////////////判断/////////////
If M_In(9)=1 And M_In(10)=0Then'判断3个夹具是否在原位If M_In(11)=0 And M_In(13)=0Then
GoSub *fw '程序fw EndIf
EndIf
If M_In(9)=1 And M_In(10)=1Then'判断1夹具是否在原位
If M_In(11)=0 And M_In(13)=0Then
GoSub *fw1 '夹具1复位EndIf
EndIf
If M_In(9)=1 And M_In(10)=0Then'判断夹具2是否在原位
If M_In(11)=1 And M_In(13)=0Then
GoSub *fw2 '夹具2复位EndIf
EndIf
If M_In(9)=1 And M_In(10)=0Then'判断夹具3是否在原位
If M_In(11)=0 And M_In(13)=1Then
GoSub *fw3 '夹具3复位EndIf
EndIf
If M_05#>3Then
out14=1
M_05#=0
EndIf
If M_In(6)=1 And M_05#=0Then
GoSub *ks1 '一次装机EndIf
If M_In(6)=1 And M_05#=1Then
GoSub *ks2 '二次装机EndIf
If M_In(6)=1 And M_05#=2Then