PLC设置:
2号架的程序设置
机器人程序分析 :
14: i31 ( EIN ) = binin20
15: bin20 ( EIN ) = i31
i50 ( E62 ) = 1 1号架
i51 ( E58 ) = 10 2号架
22: F901 = E216 & M2
23: F902 = E212 & M2
24: F903 = i31 >= 1
25: F904 = i31 <= 9
26: F905 = i31 >= 10
27: F906 = i31 <= 18
28: F907 = i31 = i50
29: F908 = i31 = i51
30: WARTE BIS F901 & F903 & F904 & F907 + F902 & F905& F906 & F908 + M23
32: WARTE BIS E23
33: A23 = EIN
34: FB PSPS = M30
UP1 = F901 & F903 & F904 & F907 往1号架放
UP2 = F902 & F905 & F906 & F908 往2号架放
放件机器人的轨迹程序
31: Tech_ T_Speicher Platz=Base+i31 FRG S-Platz = 65 EIN
VW_USR_R (#USR_ADV,107,2,1,1,1,65,1,TRUE)
LIN VB=600[mm/s] VE=100% ACC=100% RobWzg=1 Base=2 SPSTrig=0[1/100s] P
1: FB PSPS = EIN
3: M28 = E601 & E603
4: TECH2_ Koll_Ueb Betriebsart = Aktivieren Start Bereich = i31 Offset = 7EIN -控制机器人各轴的力矩开启
6: FB PSPS = M2 & M22 & M28 & M30 & F903 & F904
VW_USR_R (#USR_ADV,204,2,1,$COUNT_I[31],7,1,1,TRUE)
LINP5 C_VEL
VW_USER (#USR_MAIN,204,2,1,$COUNT_I[31],7,1,1,TRUE)
TECH2_ Koll_Ueb Betriebsart = AktivierenStop Bereich = i31 Offset = 7 EIN -控制机器人各轴的力矩关闭
VW_USR_R (#USR_ADV,204,2,2,$COUNT_I[31],7,1,1,TRUE)
C_VEL
速度参数:轨迹逼近最早开始于朝向目标点的减速
阶段中速度低于$APO.CVEL 的值时
---------------------------------------------------------------------------------------------------
Tech_ T_Speicher Platz=Base+i31FRG S-Platz = 65 EIN
-设置笼内每个零件的位置-
VW_USR_R (#USR_ADV,107,2,1,1,1,65,1,TRUE)
CASE107
IF(PAR7==TRUE)THEN
CONTINUE
IF(PAR5>0)THEN-PAR5=65
IFNOT $IN[PAR5] THEN 没有E65
CONTINUE
$OUT[PAR5] =TRUE
nRintMsgNr[10] =0
WHILENOT $IN[PAR5]
IF(exists_krlMsg(nRintMsgNr[10])==FALSE)THEN
-函数Exists_KrlMsg(...) 检查是否用户已确认了信息提示-这段的意思是没有需要确认的故障信息-
MLD(40,#StateMsg)发出信息
ENDIF
ENDWHILE
MSG_DEL =Clear_KrlMsg (nRintMsgNr[10]) –删除信息-
-函数Clear_KrlMsg( ) 可重又删除等待信息-
ENDIF
ENDIF
CONTINUE
$COUNT_I[i_T_Speicher]=$B_IN[Binin_T_Sp]-I31使用PLC给的数-
CONTINUE
WHILE($COUNT_I[i_T_Speicher]<1)OR ($COUNT_I[i_T_Speicher]>254)
MLD(14,#QuitMsg)-I13计数器的范围不能超差1-254-
$COUNT_I[i_T_Speicher]=$B_IN[Binin_T_Sp]-超差了使用PLC给的数-
ENDWHILE
$B_OUT[Binout_T_Sp]=$B_IN[Binin_T_Sp]
BIN20由PLC输入BIN20来控制
CONTINUE
IF(BASE_TYPE[VW_MPARA_ACT.BASE_NO]==#BASE)THEN
- 使用BASE坐标-
CONTINUE
WHILE(T_Speicher[$COUNT_I[i_T_Speicher]].Z==0.0)
-如果给入的坐标值Z轴=0将发出报警信息-
MLD(15,#QuitMsg)
ENDWHILE
SWITCH Par1 Par1=2
CASE 1
CONTINUE -直接更改BASE值
BASE_DATA[31]=T_Speicher[$COUNT_I[i_T_Speicher]]
CASE 2
CONTINUE –通过计算改变BASE 值
BASE_DATA[31]=BASE_DATA[VW_MPARA_ACT.BASE_NO]:T_Speicher[$COUNT_I[i_T_Speicher]]
-通过计数器I31改变BASE值,不同的BASE值对应不同的放件位置,因此可以进行9个件的联放
DEFAULT
当编号不等于1 或2 或3 时, 则直接跳入DEFAULT,以执行其指令。
MLD(20,#QuitMsg)-提出报警信息-
ENDSWITCH
ELSE
MLD(31,#QuitMsg)-提出报警信息-
ENDIF
ENDIF
对应不同的位置
T_Speicher[1]={X 5.0,Y 0.0,Z-21.0,A -0.200000003,B -0.899999976,C -0.400000006}
T_Speicher[2]={X -174.0,Y2.0,Z -21.5,A -0.200000003,B -0.899999976,C -0.400000006}
T_Speicher[3]={X -354.0,Y1.0,Z -22.0,A -0.200000003,B -0.899999976,C -0.400000006}
T_Speicher[4]={X -534.0,Y2.0,Z -23.0,A -0.200000003,B -0.899999976,C -0.400000006}
T_Speicher[5]={X -715.0,Y5.0,Z -24.0,A -0.200000003,B -0.899999976,C -0.400000006}
T_Speicher[6]={X -895.0,Y6.0,Z -25.0,A -0.200000003,B -0.899999976,C -0.400000006}
T_Speicher[7]={X -1076.0,Y8.0,Z -26.0,A -0.200000003,B -0.899999976,C -0.400000006}
T_Speicher[8]={X -1256.0,Y10.0,Z -28.0,A -0.200000003,B -0.899999976,C -0.400000006}
T_Speicher[9]={X -1436.0,Y12.0,Z -29.0,A -0.200000003,B -0.899999976,C -0.400000006}
T_Speicher[10]={X 24.0,Y1890.0,Z -35.0,A -0.400000006,B -0.600000024,C -0.5}
T_Speicher[11]={X -155.0,Y1891.0,Z -35.0,A -0.400000006,B -0.600000024,C -0.5}
T_Speicher[12]={X -335.0,Y1892.0,Z -34.5,A -0.400000006,B -0.600000024,C -0.5}
T_Speicher[13]={X -517.0,Y1896.0,Z -36.0,A -0.400000006,B -0.600000024,C -0.5}
T_Speicher[14]={X -696.0,Y1897.0,Z -36.5,A -0.400000006,B -0.600000024,C -0.5}
T_Speicher[15]={X -877.0,Y1900.0,Z -37.0,A -0.400000006,B -0.600000024,C -0.5}
T_Speicher[16]={X -1057.5,Y1901.0,Z -37.5,A -0.400000006,B -0.600000024,C -0.5}
T_Speicher[17]={X -1236.0,Y1901.0,Z -38.5,A -0.400000006,B -0.600000024,C -0.5}
T_Speicher[18]={X -1417.0,Y1904.0,Z -39.0,A -0.400000006,B -0.600000024,C -0.5}
更多新信息请搜索,关注(微信公共号:智能生产线)
发表评论
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。