为什么这个脚本不能翻转变量
112.95.251.214
发布于2014-04-24 10:27
215
0
标签:
一个鼠标动作
subonclick(byvalitem)
ifhmiruntime.tags("变量1").value=vbtruethen
hmiruntime.tags("变量1").writevbfalse
else
hmiruntime.tags("变量1").writevbtrue
endif
endsub
上面那个脚本只能置位变量,不能复位变量是为什么?
佳答案
建议:
dimmytag
setmytag=hmiruntime.tags("testbit")
mytag.read
ifmytag.value=0then
hmiruntime.tags("testbit")write1
else
hmiruntime.tags("testbit")write0
endif
或者c脚本:
settagbit("testbit",!gettagbit("testbit"));
*******
关于vbtrue和vbfalse的说明,可以在wincc的帮助里可以搜索到。
vbtrue-1
vbfalse0