wincc的vbs的按钮代码分析

wincc的vbs的按钮代码分析

ID:21463227

大小:24.50 KB

页数:4页

时间:2018-10-22

wincc的vbs的按钮代码分析_第1页
wincc的vbs的按钮代码分析_第2页
wincc的vbs的按钮代码分析_第3页
wincc的vbs的按钮代码分析_第4页
资源描述:

《wincc的vbs的按钮代码分析》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库

1、wincc的vbs的按钮代码分析编了2个按钮代码:第一个按钮按下去后出现小画面,再按第二个按钮,给b赋1;松开0;第一个按钮:dimmotor_command_reqsetmotor_command_req=hmiruntime.tags(“motor_command_req_1”)motor_command_req.write”b”第二个按钮按下去:subonlbuttondown(byvalitem,byvalflags,byvalx,byvaly)dimmotor_command_req_1

2、setmotor_command_req_1=hmiruntime.tags(“motor_command_req_1”)dimmotor_1setmotor_1=hmiruntime.tags(motor_command_req_1.read)motor_1.write1endsub第二个按钮松开:subonlbuttonup(byvalitem,byvalflags,byvalx,byvaly)dimmotor_command_req_1setmotor_command_req_1=hmiru

3、ntime.tags(“motor_command_req_1”)dimmotorsetmotor=hmiruntime.tags(motor_command_req_1.read)motor.write0endsub其中motor_command_req_1为wincc内部变量;b是写给plc的变量;按下第一个按钮后,再按第二个按钮实现给plc变量b赋值1;松开b赋值0;1.第一个按钮的代码起什么作用??最终的目的是给plc的b变量写值,为什么把b写给motor_command_req_1???

4、?在我看来应该是setmotor_command_req_1=hmiruntime.tags(“b”)motor_command_req_1.write”motor_command_req_1”2.dimmotor_command_req_1setmotor_command_req_1=hmiruntime.tags(“motor_command_req_1”)这2行起啥作用??dimmotorsetmotor=hmiruntime.tags(motor_command_req_1.read)mo

5、tor.write0这3行起啥作用???最佳答案1、实际按钮1的代码等同于:hmiruntime.tags(“motor_command_req_1”).write”b”2、这是定义一个脚本内的变量连接到motor_command_req_13、这个脚本是有问题的,应该是直接用dimmotorsetmotor=hmiruntime.tags(“motor_command_req_1”)motor.write0这个是给变量motor_command_req_1赋值0如果你怀疑我的分析你可以原来的这些

6、代码赋值到项目中运行一下看看。

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。