Private Sub tmrTime_Timer()
On Error Resume Next
'tmrTime.Enabled = False
Dim S7_flag As Long
Timer_Counter = Timer_Counter + 1
PLC_mnl
If (Timer_Counter = 1) Then
If (Read1_Power = True) Then
staMessage.Panels(1).Text = "功率表1读成功!"
Else
staMessage.Panels(1).Text = "功率表1读失败!"
End If
End If
If (Timer_Counter = 2) Then
If (Read2_Power = True) Then
staMessage.Panels(1).Text = "功率表2读成功!"
Else
staMessage.Panels(1).Text = "功率表2读失败!"
End If
End If
If (Timer_Counter = 3) Then
If (Read3_Power = True) Then
staMessage.Panels(1).Text = "功率表3读成功!"
Else
staMessage.Panels(1).Text = "功率表3读失败!"
End If
End If
If (Timer_Counter = 4) Then
If (Read4_Power = True) Then
staMessage.Panels(1).Text = "功率表4读成功!"
Else
staMessage.Panels(1).Text = "功率表4读失败!"
End If
End If
If (Timer_Counter = 5) Then
If (Read5_Power = True) Then
staMessage.Panels(1).Text = "功率表5读成功!"
Else
staMessage.Panels(1).Text = "功率表5读失败!"
End If
Timer_Counter = 0
End If
tmrTime.Interval = 500
'tmrTime.Enabled = True
ReadAll
End Sub
运行时第一行Private Sub tmrTime_Timer()总是黄色的。。