WinCC 15.1 Pro.
I have 3 tags from Modbus (three voltage phases) and one tag Hi Limit. When any voltage tag exceeds the limit, an alarm is formed.
VB script run with period 1 sec.
Code: Select all
Dim U12, U23, U31, HiLim, LowLim
U12 = HMIRuntime.Tags("300_VoltageU12").Read
U23 = HMIRuntime.Tags("300_VoltageU23").Read
U31 = HMIRuntime.Tags("300_VoltageU31").Read
HiLim = HMIRuntime.Tags("Voltag_300_HiLimit").Read
LowLim = HMIRuntime.Tags("Voltag_300_LoLimit").Read
If (U12 > HiLim Or U23 > HiLim Or U31 > HiLim) Then
HMIRuntime.Tags("Report_P300_U12").Write U12
HMIRuntime.Tags("Report_P300_U23").Write U23
HMIRuntime.Tags("Report_P300_U31").Write U31
SetBit("Alarms_300_VoltageHi")
Else
HMIRuntime.Tags("Report_P300_U12").Write U12
HMIRuntime.Tags("Report_P300_U23").Write U23
HMIRuntime.Tags("Report_P300_U31").Write U31
ResetBit("Alarms_300_VoltageHi")
End If
"300_VoltageU12" --> U12 --> "Report_P300_U12"
Additional text:
U12: <Tag:5,Report_P300_U12> , U23: <Tag:5,Report_P300_U23>, U31: <Tag:5,Report_P300_U31>, HiLim: <Tag:5,Voltag_300_HiLimit>
But alarm message is very strange. Voltage tags is not correct.
Show
In the message saved tags before alarm event. But why VB script save it data?
Show
This is values in alarm time. All corrent. Voltage > Limit value. But where are corr…
Show