您当前的位置: 首页 > 

光怪陆离的节日

暂无认证

  • 2浏览

    0关注

    1003博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

倍福TwinCAT 3 气缸动作程序编写

光怪陆离的节日 发布时间:2022-06-21 11:00:56 ,浏览量:2

倍福TwinCAT 3 气缸动作程序编写 //干涉 bStateAllow:=TRUE; CylinderStatus.bInterferenceError:=FALSE; FOR i:=1 TO 4 BY 1 DO IF CylinderSignal.bInterference[i] THEN bStateAllow:=FALSE; CylinderStatus.bInterferenceError:=TRUE; END_IF END_FOR

//气缸控制 IF bStateAllow THEN IF CylinderControl.nControl=nCylinderReset THEN CylinderStatus.bOpen:=FALSE; CylinderStatus.bClose:=FALSE; ELSIF CylinderControl.nControl=nCylinderClose THEN CylinderStatus.bOpen:=FALSE; CylinderStatus.bClose:=TRUE; ELSIF CylinderControl.nControl=nCylinderOpen THEN CylinderStatus.bOpen:=TRUE; CylinderStatus.bClose:=FALSE; END_IF //ELSE //CylinderStatus.bOpen:=FALSE; //CylinderStatus.bClose:=FALSE; END_IF

//气缸动作延时 tonCylinderOpen(IN:=(CylinderStatus.bOpen) , PT:=tDelay , Q=> , ET=> ); tonCylinderClose(IN:=(CylinderStatus.bClose) , PT:=tDelay , Q=> , ET=> );

//气缸动作错误 IF tonCylinderOpen.Q AND NOT CylinderSignal.bOpenSensor AND NOT CylinderOther.bOpenShield THEN CylinderStatus.bOpenError:=TRUE; ELSE CylinderStatus.bOpenError:=FALSE; END_IF

IF tonCylinderClose.Q AND NOT CylinderSignal.bCloseSensor AND NOT CylinderOther.bCloseShield THEN CylinderStatus.bCloseError:=TRUE; ELSE CylinderStatus.bCloseError:=FALSE; END_IF 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 //描述信息 ACT_comment();

//干涉(若有则添加)

//气缸功能块控制 FOR i:=1 TO nCylinderMaxNum BY 1 DO cylinder[i].FB( CylinderControl:=cylinder[i].control , CylinderSignal:=cylinder[i].signal , CylinderOther:=cylinder[i].other , CylinderStatus=>cylinder[i].status ); END_FOR

关注
打赏
1665731445
查看更多评论
立即登录/注册

微信扫码登录

0.0382s