工控编程吧

标题: wincc内部变量用VBS做循环的问题 [打印本页]

作者: baikhgmv    时间: 2016-9-9 21:39
标题: wincc内部变量用VBS做循环的问题
wincc内部变量用VBS做循环的问题之前问过,画面上用一个0到100的数字,从0开始,每秒增加一,到100后变为0,如此循环,要求使用内部变量,VBS代码!


给出的答案是:建一个内部变量A
然后建一个秒触发脚本
Dim temp
temp=HMIRuntime.Tags("变量A").Value
temp=temp+1
if temp>100 then
temp=0
end if
HMIRuntime.Tags("变量A").Write temp



但是实际上并没有实现功能,而是到1就不动了,怎么回事,求解答


--------Dim temp
temp=HMIRuntime.Tags("变量A").Value//这里应该用read不是用value
temp=temp+1
if temp>100 then
temp=0
end if
HMIRuntime.Tags("变量A").Write temp


------秒触发脚本在那里?从PLC来吗?


------全局脚本编辑页面右键选择触发器弹出窗口选择触发器的类型。





欢迎光临 工控编程吧 (https://www.gkbc8.com/) Powered by Discuz! X3.4