wincc脚本动作不执行。大约有30段这个程序放在一个动作中1s的定时器。每次重新激活后需要第一段程序触发后过个3三分钟才能触发第二段,一个小时后才能整个脚本才能正常运行
Dim RUND1,RUNTIMED1,RUNTIMR_ZD1
Dim n1D1
For n1D1=101 To 112
RUND1="D0" & n1D1 & ".FB"
RUNTIMED1="D0" & n1D1 & "RUNTIME"
If HMIRuntime.Tags(RUND1).Read > 0 And HMIRuntime.Tags(RUND1).Read < 6 Then
HMIRuntime.Tags(RUNTIMED1).Write HMIRuntime.Tags(RUNTIMED1).Read+1
End If
Next
Dim data1D1,data2D1
If HMIRuntime.Tags("时").Read = 23 And HMIRuntime.Tags("分").Read = 59 Then
HMIRuntime.Tags("D01上一日电量").Write HMIRuntime.Tags("3D1").Read
For n1D1=101 To 112
data1D1="D0" & n1D1 & "RUNTIME"
HMIRuntime.Tags(data1D1).Write 0
Next
End If
For n1D1=101 To 112
data1D1="D0" & n1D1 & "RUNTIME"
If n1D1=101 Then
RUNTIMR_ZD1 = HMIRuntime.Tags(data1D1).Read
Else
RUNTIMR_ZD1 = RUNTIMR_ZD1 + HMIRuntime.Tags(data1D1).Read
End If
Next
HMIRuntime.Tags("D01总运行时间").Write RUNTIMR_ZD1
For n1D1=101 To 112
data1D1="D0" & n1D1 & "RUNTIME"
data2D1="D0" & n1D1 & "DL"
HMIRuntime.Tags(data2D1).Write ((HMIRuntime.Tags("3D1").Read - HMIRuntime.Tags("D01上一日电量").Read) / HMIRuntime.Tags("D01总运行时间").Read * HMIRuntime.Tags(data1D1).Read)
Next