|
<< Click to Display Table of Contents >> Setting up an automatic Log Report |
![]() ![]()
|
How can I setup a Log File Conversion to occur, automatically on a regular basis, for example, every day at Midnight?
For a detailed example of setting up the Strategy Controller to do an automatic Log Report at the end of a process run, please read: Example: Automatic Log Report.
Below is an abbreviated example, specifically for doing a Log Report at midnight:
For any automatic report generation you will need two SpecView 'DateTime' User Variables, one for the start time of the report (called: ReportStart), and one for the stop time (called: ReportStop).
Put both of these DateTime User Variables on a GDW.
NOTE: The Date/Time variables used for the start and stop times of the report MUST be on an open GDW in runtime for the report generation to work. They can be small or even behind an object like a trend chart, but they must be on an open GDW.
In this example a SpecView Text User Variable is going to be used (called: BatchRef) for the Report's file name. Create this variable and put it onto the GDW.
Also set the BatchTag property on this variable, so that it can also be used for Historical Replay purposes.
Ensure the Instrument and User Variables which are needed to be in the Log File Report are marked for logging. To do this check the 'Logged' attribute for the variables shown in the Variable Properties box, or by selecting Show Logging In Variables List on the Setup menu
In Runtime Mode, click the current value of BatchRef and enter a name, such as a batch number.
Setup the Report Format:
- Save all GDW's and go into Runtime Mode
- Select the Convert Log File menu command from the Logging menu
- Click the Create button on the Log Report Setup Box
- Edit the fields as follow
| o | Give the format a name, such as 'MidnightReport' |
| o | Add the variables required in the report, for example, by clicking 'Add All->' |
| o | Check the 'From SpecView String' checkbox and choose BatchRef from the options |
| o | Check the 'Start Time from Var' checkbox and choose ReportStart from the options |
| o | Check the 'Stop Time from Var' checkbox and choose ReportStop from the options |
Then click 'Add to Format List'
- Click 'Cancel' to exit the Log Report Setup box
- Select the Edit Mode menu command from the File menu
The actual Log File Conversion can be done automatically using the Strategy Controller
Select the Strategy Controller menu command from the Setup menu
| • | Add a Time Based Event called 'At midnight generate Log Report', and set Hour=00, Minute=00, Second=00, the others leave set to 'Any' |
| • | Add the Action: 'Time stamp ReportStop' to do: 'Parameters: Download Specific Value' using the variable ReportStop, setting it to 'Current Time' by checking the box |
| • | Add the Action: 'Generate Log Report' to do: 'Logging: Convert Specific Log File Format' using the format just created |
| • | Add the Action: 'Time stamp ReportStart' to do: 'Parameters: Download Specific Value' using the variable ReportStart, setting it to 'Current Time' by checking the box |
Click OK
Enter Runtime Mode and enter a name for tonight's converted log file report into BatchRef.
For the first day that this is run ReportStart will need to be set manually, so this value will need to be put on a screen in a convenient place so it can be manually set on the first day.