WinCC 15.1 Pro VB Script save uncorrect data

ProTool, WinCC flexible, WinCC, PP/OP/TP/TD/MP
Post Reply
Lexiy
Posts: 5
Joined: Tue May 25, 2010 3:47 am

WinCC 15.1 Pro VB Script save uncorrect data

Post by Lexiy » Thu Sep 09, 2021 10:59 am

Hi All.
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 
Tag "Alarms_300_VoltageHi" is a triger for Discrete alarm with Mode: Rising edge. I save Voltage tags in additional text of alarm.
"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.
Image

In the message saved tags before alarm event. But why VB script save it data?
Image

This is values in alarm time. All corrent. Voltage > Limit value. But where are correct value?
Image

May be any body have idea How did this happen? and How it fix?

Post Reply