组态软件实验报告(5)

时间:2025-07-14

distrube5=1;

distrube6=0;

//桶的水平、竖直位置

bottlemoveh=0;

bottlemovev=0;

//灌装容量变量

depth=0;

//灌装速度

valve=0.2;

2 在“程序运行周期执行”脚本编辑区域输入脚本:

//如果处在初始位置上,则刚开始地1 步,同时信号灯1变绿If bottlemoveh==0 then

nsTtep=1;

flag1=0;

endif

//如果是第1步,则桶向前移动

If nStep==1 then

Bottlemoveh=bottlemoveh +1*mover/35;

Endif

//如果是到达灌装位置,则开始第2步,信号灯1变红

If nStep==1&&bottlemoveh>=45 then

nStep=2;

bottlemoveh =45;

flag1=1;

endif

//桶上升

If nStep==2 then

raise1=raise1+5*mover/35;

bottlemovev=bottlemovev+5*mover/35;

endif

//上升到顶部时,进入第3步,生成随机容量

If nStep==2&&raise1>=35 then

Riase=35;

nStep=3;

randweight = 19.7+rand(12001)/20000

endif

//开始灌装制剂

If nStep==3 then

Depth=depth+mover*valve/7;

Endif

//灌装达到指定容量时,停止加料,进入第4步

//并且加上分布图

If nStep==3&&depth>=randweight then

Dep0th=randweight;

组态软件实验报告(5).doc 将本文的Word文档下载到电脑

精彩图片

热门精选

大家正在看

× 游客快捷下载通道(下载后可以自由复制和排版)

限时特价:7 元/份 原价:20元

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219