组态软件实验报告(6)
时间:2025-07-14
时间:2025-07-14
Nsep=4;
If randweight>=19.7&&randweight<19.8 then
Distrube1= Distrube1+1;
endif
If randweight>=19.8&&randweight<19.9 then
Distrube1= Distrube2+1;
endif
If randweight>=19.9&&randweight<20 then
Distrube1= Distrube3+1;
endif
If randweight>=20&&randweight<20.1 then
Distrube1= Distrube4+1;
endif
If randweight>=20.1&&randweight<20.2 then
Distrube1= Distrube5+1;
endif
If randweight>=20.2&&randweight<20 .3then
Distrube1= Distrube6+1;
Endif
//如果有一个超过100,则全部清0
If
distrube1==100||distrube2==100||distrube3==100||distrnbe4==100||distrube5==100||distrube6==1 00 then
Distrube1=0;
Distrube2=0;
Distrube3=0;
Distrube4=0;
Distrube5=0;
Distrube6=0;
Endif
endif
//平台下降
if nStep = =4 then
raise1= raise1—mover/15;
bottlemovev= bottlemovev—mover/15;
endif
//如果到达底部,则进入第5步,同时信号灯2变绿
if nStep = =4&&raise1< =0 then
flag2=0;
raise1=0;
bottlemovev=0;
nStep =5;