有多个PLC与wincc通讯,一个plc控制的设备运行时,另一个plc的联动设备也要开。这样子用wincc写脚本,读取一个PLC的变量状态,条件满足时去触发另一个PLC的变量,脚本怎样写??用VB试了几次全局动作脚本.read,if满足,then触发变量,但是都不成功。
问题补充:
天天向上涨:我是用的周期触发,标准周期500ms,1s都用了也没反应。
zhangli0:我之前的脚本dima,b
seta=HMIRUNtime.tags("tag_plc1")
seta=hmiruntime.tags("tag_plc1")
a.read
ifa=1then
b.write1
else
b.write0
endif
现在按你的去掉了set,写进去周期性触发,也没有反应。不知道哪里的问题
最佳答案
VBS:
dimtag
tag=hmiruntime.tags("tag_plc1").read
iftag=1then
hmiruntime.tags(tag_plc2).write1
else
hmiruntime.tags(tag_plc2).write0
endif
提问者对于答案的评价:
谢谢两位解答,zhang的脚本可以,是我在写脚本的时候代码写错一个字母