恭喜,你发布的帖子
发布于 2017-04-17 14:34:57
4楼
Option Explicit
Function action
Dim a,b,c
Set a = HMIRuntime.Tags("Tag1")
a.Read
Set b = HMIRuntime.Tags("Tag2")
b.read
Set c = HMIRuntime.Tags("Tag3")
c.Read
If a.Value =1 Then c.Value =c.Value +0.5 End If
If b.Value = 1 Then c.Value =0 End If
c.Write
End Function
改成这样就可以了不知道为什啊如果不读的话是不是每次都要执行从新声明变量并把c初始化为零呢
请填写推广理由:
分享
只看
楼主