当前位置: 主页 > PLC控制

wincc内部变量用一个按钮切换

想用一个按钮切换内部变量
dimtag
settag=HMIRUNtime.tags("tag1")
Iftag.vaLUe=1then
Tag.write1
Else
Tag.write0
Endif
但是没有实现想要的功能,哪里出了问题?

最佳答案

dimtag
tag=hmiruntime.tags("tag1").Read
Iftagthen
hmiruntime.tags("tag1").write0
Else
hmiruntime.tags("tag1").write1
Endif
你说的是取反功能,以上是正确的VBS脚本


c脚本:
SetTagBit("tag1",!GetTagBit("tag1"));

提问者对于答案的评价:
xiexie

  • 关注微信

猜你喜欢

微信公众号