A key feature of any HMI package is the ability to not only show the current state of your control system, but to then store that information for historic purposes. But what good is historical data when you can’t easily access it? How can historical data result in process improvements, financial returns, or increases in efficiency if you’re not accessing it?
With Wonderware InTouch LGH files, this data can now not only be accessed easily, but can be automated such that report generation is setup once, and then you’re finished. In this blog, I will show you how you can easily automate your report generation - in less time than it will probably take you to read the rest of this blog.
- The first time you open the LGH File Inspector you will need to specify the directory that holds the LGH Files you would like to query.
The LGH File Inspector will automatically query the latest LGH File to determine all tags that were stored in the file.
- We are going to ignore the “Set Query Time” box for now, and jump right down to “STEP 2: Select Tags to Query”. From the list of available tags, select any tags that should be included in this automated query – click and drag them to the “Tags in this Query” box.
Multiple tags can be selected at once by using CTRL + Select or SHIFT + Select, and the Search Box can be used to narrow down the number of tags that are displayed.
- Use the Advanced button at the top of your Window to configure the behavior when this query is called by another application.
Specify an Initial Date and Time offset. As an example – running an hourly report that should export all values for the last hour could be set up with an initial Date of “This Hour” and subtracting an Hour:
This will also be where we can specify the destination of our export file, and whether a new report should be generated every time, or if the data should be added to an existing report. In this case, I want to save each report to a new CSV File and append the time to my base file name:
- Let’s Save and Close these settings. We can now set the Query Duration and Query Interval. For my hourly report, I will set the Query Duration to 1 Hour (any higher, and we would be attempting to report on future data such that these fields would be expected to show blank values in our report), and I want my report to show the value in 10 second increments.
The Query Begin Time and Date can be ignored on this screen, since we have already set these in the Advanced settings.
- Use the Save As Dialog to give your report a descriptive name, and save it to your Computer.
This creates an .lghq file, that can be run to generate the report that was just configured, but manually having to double click the file is not very automated, and isn’t very efficient at all. So our next step is to create a Scheduled task, using the Windows Task Scheduler, to run our query at a regular interval automatically.
- Open the Windows Task Scheduler and create a new task.
- Give the task a descriptive name.
- On the Triggers tab, use the New button to create a new trigger condition for our report, and set the start time, interval, and end time (if there is one).
- Use the New button to create a new action for the Scheduled task and configure it to launch the LGH File inspector, and pass the lghq query file that was created earlier as an argument.
At this point we’re done; we have configured a query that will generate a report from our LGH files, and we have configured the Scheduled Task that will be driving our report generation.
Being able to quickly and cost-effectively access historical process data can generate substantial benefits for an enterprise. If you’re InTouch history data is just sitting there and you’d like a quick and easy method of accessing it, I encourage you to download a free trial of LGH File Inspector and try for yourself.