WinCC 15.1 Pro VB Script save uncorrect data

ProTool, WinCC flexible, WinCC, PP/OP/TP/TD/MP
Post Reply
Lexiy
Posts: 9
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.
Show
Image
In the message saved tags before alarm event. But why VB script save it data?
Show
Image
This is values in alarm time. All corrent. Voltage > Limit value. But where are corr…
Show
Image
May be any body have idea How did this happen? and How it fix?

xflash
Posts: 195
Joined: Sat May 21, 2011 3:28 am

Re: WinCC 15.1 Pro VB Script save uncorrect data

Post by xflash » Tue Nov 16, 2021 2:26 am

I think you could try create a SR for siemens:
https://support.industry.siemens.com/cs/my/srm?lc=en-ww

I do not know whether free for script or not, sometimes they are nice.

As we do not have the project and create test project is not so easy.

Post Reply