WinCC Flexible System Alarms

SIMATIC S7-200/300/400, Step7, PCS7, CFC, SFC, PDM, PLCSIM,
SCL, Graph, SPS-VISU S5/S7, IBHsoftec, LOGO ...
Post Reply
markyspicer
Posts: 4
Joined: Tue Dec 17, 2013 5:01 am

WinCC Flexible System Alarms

Post by markyspicer » Tue Oct 04, 2016 8:05 am

Hi Good day!

Can anyone help me regarding this error message, I am using this Data archiving sample project from siemens website. instead of logging/archiving single instrument. my goal is to create 17 individual logs/archive. the automatic archiving/logging to a specific folder is working. while when I'm going to load the archive file of the device it just shows this error messages.

_//Nr.//Time//Date//Status//Text//GR
$ // 80053 // 08:21:07 // 04/10/2016 // C // Error during read access to closed log file Data_LT1_Logs_Trend_View // 0

$ //20011 // 08:21:07 // 04/10/2016 // C // Error in line of the subscript <> of 0 script <>. File not found90File not found90


the automatic archiving and logging are on script program and I'm not that good using script. just a "very little bit".

hope anyone can help.

Thanks!

Marky

markyspicer
Posts: 4
Joined: Tue Dec 17, 2013 5:01 am

Re: WinCC Flexible System Alarms

Post by markyspicer » Tue Oct 04, 2016 10:41 am

Hi!

I have no trouble anymore to the 1st device. now this errors that is shown in my first post occurs. [Level Xmitter 1(device 1) and Level Xmitter 2(Device 2)]. anyone can help me regarding this issue. During runtime, loading archive from device 1 works, while doing this in device 2 shows the system errors.


see scripts below.

Load Archive Script

Code: Select all

Dim fso, FName, Variable_Date, Variable_Time 
Dim ValueYear, ValueMonth, ValueDay, ValueHour, FileName, DataFileName, ValueName

'Auxiliary variable to combined the storage path 
ValueYear = SmartTags("Selection_Year_LT_2")	
ValueMonth = SmartTags("Selection_Month_LT_2")	
ValueDay = SmartTags("Selection_Day_LT_2")	
ValueHour = SmartTags("Selection_Hour_LT_2")& "0.csv"	
ValueName = "Level_Transmitter_2"

'Selecting storage path
FName = StoragePath & "Year_" & ValueYear & "\" & ValueName  & "\" & "Month_" & ValueMonth & "\" & "Day_" & ValueDay & "\"

'Name of the data file, which should be load
FileName = "Press_01_" & ValueHour 

'File access
Set fso = CreateObject("Scripting.FileSystemObject") 


'Check if the predifined archiv exists 
DataFileName = FName & FileName

If Not fso.FileExists(DataFileName) Then

	'Data file not available -> show system alarm / show "Textbox" 
	
	'ShowSystemAlarm "Recheck the specific date of the Archive data file"
	SetBit SmartTags("TrendView_Visible_LT_2")	'In "Screen 2" there will be show a message text
	
Else
	
	'Start of the archive "Data_Logs_Trend_View"
	StartLogging hmiDataLog, "Data_LT2_Logs_Trend_View"
	
	'Waiting as long as the subsequent archives "Data_Logs_Trend_View1.csv" are not available
	While Not fso.FileExists (StoragePath & "Data_LT2_Logs_Trend_View1.csv") 

	Wend	
	
	'Copy the subsequent archives "Data_Logs_Trend_View1.csv" to the archive "Temp_Data_Logs_Trend_View.csv"
	fso.CopyFile StoragePath & "Data_LT2_Logs_Trend_View1.csv", StoragePath & "Temp_LT2_Data_Logs_Trend_View.csv"
	
	'Waiting as long as the archives "Temp_Data_Logs_Trend_View.csv" are not available!
	While Not fso.FileExists (StoragePath & "Temp_LT2_Data_Logs_Trend_View.csv")
	
	Wend

	'Stop logging from the archive "Data_Logs_Trend_View"
	StopLogging  hmiDataLog, "Data_LT2_Logs_Trend_View"
	
	'Close all logs
	CloseAllLogs 
	
	'A certain time is needed for the initialization of the archives. 
	'otherwise it could be come to a access error. -> Waiting time 
	Dim Counter1
	Counter1 = 0
	While Counter1 < 10000
		Counter1 = Counter1 + 1
	Wend
	
	
	
	'The archives "Data_Logs_Trend_View0.csv", "Data_Logs_Trend_View1.csv" and "Temp_Data_Logs_Trend_View.csv"
	'can be delete now
	fso.DeleteFile StoragePath & "Data_LT2_Logs_Trend_View0.csv"  
	fso.DeleteFile StoragePath & "Data_LT2_Logs_Trend_View1.csv"
	fso.DeleteFile StoragePath & "Temp_LT2_Data_Logs_Trend_View.csv"
	
	
	'Waiting time
	Dim Counter2
	Counter2 = 0
	While Counter2 < 10000
		Counter2 = Counter2 + 1
	Wend

	'Copy the data content from the selected archive to the archive for the trend view
	fso.CopyFile DataFileName , StoragePath & "Data_LT2_Logs_Trend_View0.csv", True 
	
	'Open all logs
	OpenAllLogs 
	

	'Start logging archive "Archive_01"
	StartLogging hmiDataLog, "Archive_02"
	
End If

'Set the "Trend view" to the selected time 
Variable_Date = SmartTags("Selection_Day_LT_2") & " " & SmartTags("Selection_Month_LT_2") & " " & SmartTags("Selection_Year_LT_2")
Variable_Time = SmartTags("Selection_Hour_LT_2") & ":30:00"
SmartTags("TrendView_ExternalTime_LT_2") = CDate(Variable_Date & " " & Variable_Time)

'Used storage will be freed
Set fso = Nothing
Request Load Archive (a button must be trigger in order to work)

Code: Select all

'If the "Screen 2" activ and the copy process from the script "Load_Archive" are running, 
'then it could be come to a system message.
'For this reason, at first the site "Screen 3" will be called and from this site the script "Load_Archive" executed.
'After then the "Screen 2" with the trend view will be automatically called. 


'Call from the archive "Load_Archive". Note the right specification of the Path! -> With "\" or without "\"  and so on
Load_Archive_LT2 "C:\Storage_Data\"

'Waiting time for update the archives
Dim Counter1
Counter1 = 0
While Counter1 < 10
	Counter1 = Counter1 + 1
Wend

'Activate the site "Screen 2" with the trend view 
ActivateScreen "Screen_2_LT_2", 0
This codes are almost the same in structure by the first device. I just change LT1 to LT2 in order to have unique id's.

hope some can help me.

Thanks.

Marky

Post Reply