Time format
Time format is defined as follows: YYYY-MM-DD hh:mm:ss, where YYYY represents the year,
MM
the month, DD the day, hh the hour, mm the minute and ss the second. For example, the
time of 2 minutes and one second past 11 o'clock on July 26, 2004 is displayed as follows:
2004-07-26 11:02:01.
For parameters "TimeFrom" and "TimeTo" the statement of data and time is also possible in
short form. Not all format fields must be filled in this case. The short form means that the
information on date and time may be lacking one or several parameters, beginning with the
value for seconds. For example, the statement may be in the form of "YYYY-MM" or "YYYY-
MM-DD hh". Using the statement "TimeFrom" = "2004-09" and "TimeTo" = "2004-10-04" all
archive segments between September 2004 up to and including October 4th are to be
swapped.
Example
In the following example, all archive segments since the specified time period are re-swapped,
and the return value is output as Trace.
'VBS184
HMIRuntime.Trace "Ret: " & HMIRuntime.Logging.Restore("D:\Folder","2004-09-14","",-1) &
vbNewLine
In the following example, all Tag Logging Slow archive segments since the specified time
period are re-swapped, and the return value is output as Trace.
'VBS185
HMIRuntime.Trace "Ret: " & HMIRuntime.Logging.DataLogs.Restore("D:\Folder","2004-09-14
12:30:05","2004-09-20 18:30",-1,2) & vbNewLine
In the following example, all Alarm Logging archive segments up to the specified time period
are re-swapped, and the return value is output as Trace.
'VBS186
HMIRuntime.Trace "Ret: " & HMIRuntime.Logging.AlarmLogs.Restore("","2004-09-20",-1) &
vbNewLine
See also
Error Messages from Database Area (Page 732)
Example: How to Start an Action on the Server (Logging Object) (Page 746)
Logging Object (Page 130)
DataLogs Object (Page 121)
AlarmLogs Object (Page 118)
VBS for Creating Procedures and Actions
1.14 VBS Reference
MDM - WinCC: Scripting (VBS, ANSI-C, VBA)
System Manual, 11/2008,
711