欢迎来到天天文库
浏览记录
ID:51436487
大小:18.50 KB
页数:2页
时间:2020-03-24
《MCGS交通灯脚本程序.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、脚本行车信号(Q07Q06)为ON时行(信号由PLC提供)ifQ07=1thenmovex3=movex3+10ifQ07=1thenmovex4=movex4+10ifQ07=1thenmovex1=movex1+10ifQ07=1thenmovex2=movex2+10ifQ06=1thenmovey4=movey4+6IFQ06=1thenmovey3=movey3+6ifQ06=1thenmovey1=movey1+6ifQ06=1thenmovey2=movey2+6'车到路口时减速行ifQ07=1
2、and(movex3>160andmovex3<260)thenmovex3=movex3+7ifQ07=1and(movex4>170andmovex4<261)thenmovex4=movex4+7ifQ07=1and(movex1>-370andmovex1<-270)thenmovex1=movex1+7ifQ07=1and(movex2>-430andmovex2<-330)thenmovex2=movex2+7ifQ06=1and(movey4>73andmovey4<173)thenmovey4
3、=movey4+4ifQ06=1and(movey3>42andmovey3<142)thenmovey3=movey3+4ifQ06=1and(movey1>-210andmovey1<-110)thenmovey1=movey1+4ifQ06=1and(movey2>-256andmovey2<-156)thenmovey2=movey2+4'车在停车区外,继续行if(movex3<150ormovex3>=160)thenmovex3=movex3+10if(movex4<170ormovex4>=18
4、0)thenmovex4=movex4+10if(movey4<60ormovey4>=73)thenmovey4=movey4+6if(movey3<38ormovey3>=42)thenmovey3=movey3+6if(movex1<-381ormovex1>=-370)thenmovex1=movex1+10if(movex2<-430ormovex2>=-416)thenmovex2=movex2+10if(movey1<-229ormovey1>=-210)thenmovey1=movey1+6i
5、f(movey2<-264ormovey2>=-256)thenmovey2=movey2+6'黄灯亮,车在停车白线后,减速ifQ04=1andmovex3<150thenmovex3=movex3+4ifQ04=1andmovex4<170thenmovex4=movex4+4ifQ01=1andmovey4<65thenmovey4=movey4+3ifQ01=1andmovey3<38thenmovey3=movey3+3'车在停车区外,继续行if(movex3<150ormovex3>=160)the
6、nmovex3=movex3+10if(movex4<170ormovex4>=180)thenmovex4=movex4+10if(movey4<60ormovey4>=73)thenmovey4=movey4+6if(movey3<38ormovey3>=42)thenmovey3=movey3+6if(movex1<-381ormovex1>=-370)thenmovex1=movex1+10if(movex2<-430ormovex2>=-416)thenmovex2=movex2+10if(move
7、y1<-229ormovey1>=-210)thenmovey1=movey1+6if(movey2<-264ormovey2>=-256)thenmovey2=movey2+6'黄灯亮,车在停车白线后,减速ifQ04=1andmovex3<150thenmovex3=movex3+4ifQ04=1andmovex4<155thenmovex4=movex4+4ifQ01=1andmovey4<65thenmovey4=movey4+3ifQ01=1andmovey3<38thenmovey3=movey3+
8、3ifQ04=-1andmovex1<-381thenmovex1=movex1+4ifQ04=-1andmovex2<-430thenmovex2=movex2+4ifQ01=-1andmovey1<-226thenmovey1=movey1+3ifQ01=-1andmovey2<-262thenmovey2=movey2+3'车子循环出现ifmovex3>=735thenmovex3=-250i
此文档下载收益归作者所有