Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
ActiveFactory Query
Section 1 – Introduction 6-3
Lab 12 – Use ActiveFactory Query 6-9
Lab 13 – Use ActiveFactory Query in Excel 6-23
6-2 Module 6 – ActiveFactory Query
Module Objectives
z Introduce ActiveFactory Query.
z Introduce, explain, and use Query to retrieve specific tag information.
Wonderware Training
Section 1 – Introduction 6-3
Section 1 – Introduction
Section Objective
z Understand ActiveFactory Query uses and operation.
Introduction
ActiveFactory Query provides a point and click interface to construct and analyze the execution
of the queries specifically designed for the Historian.
Query provides an efficient and simple method to develop simple and complex queries for
reporting and custom application requirements. It is also an excellent way to learn the proper
syntax for developing queries for the Historian.
Query provides a “point-and-click” interface to build Structured Query Language (SQL) queries for
your reporting and custom application requirements. The query results are immediately available.
Query dynamically reconstructs and tests queries as the user makes changes. Query has easy
access to Historian data and thus provides easy construction of the SQL queries to perform tag
searches, obtain tag details, server information, and values (current, history, aggregate, summary,
and event snapshots).
This application supports construction of queries for use against the Historian version7.1 and later.
Query also utilizes and understands Historian custom extensions.
You can save queries to run at a later time, and you can also save results.
Query Operation
Numerous distinct query types can be selected from the query tool bar. These include custom
queries, and the Favorite Folder queries.
Each query selection results in a different workspace panel selection. The tag picker is present for
most query types. However, the selection panel for columns changes with the query type.
The Server dialog box contains all the servers that are configured in the Servers’ list configuration.
Changing the selected server in the server list will cause a corresponding change in the selected
server in the tag picker, and vice-versa.
The Database selection field is only enabled for the Custom query type. For all other queries, the
selected database is fixed to be the Runtime database.
Start Query
From the Start button on the Windows Taskbar, select All Programs / Wonderware /
ActiveFactory / Query. Before this client application can be used to query tag information from
the database, the server must be running and you must have access to the server.
Note: Running any of the ActiveFactory applications for the first time will start the Server Setup
Wizard in order to connect to a server. The Wizard needs to run only once per server. Enter your
sa password to connect to your selected Historian. The Server Setup routine installs essential
server-side components as well as a promotional (45 day) license if there is no license already
installed.
Query Interface
The Query application consists of the following:
z The main Toolbar
z Query Type panel
z The TagPicker
z Columns panel (dynamic)
z Results panel
Wonderware Training
Section 1 – Introduction 6-5
Building Queries
The ActiveFactory Query Column Panel displays different tabs dependent upon the type of query
selected. Each tab provides various relevant configuration options to build your query.
The query is displayed in the SQL tab field. The query content is updated when each option is
selected.
The query results are displayed in the Data tab field. The results change dynamically whenever
the query itself is re-defined. To refresh your results use the Refresh button in the main toolbar.
The following table lists the available query types and the tag types available within the TagPicker
pane:
Wonderware Training
Section 1 – Introduction 6-7
Building Queries
The ActiveFactory Query interface displays different tabs dependent upon the type of query
chosen. Each tab provides various options from which to select in order to build your query.
As each of these options are chosen, the query being constructed can be viewed in the window
when the Query tab is selected. The query will change as each option is selected.
The query results are viewed in the Data tab. The results change dynamically whenever the query
itself is re-defined. To refresh your results use the Refresh button in the main toolbar.
You can also keep a record of all the queries constructed. Choose the Options / Show All
Queries selection from the main menu, and a third tab named All Queries appears. Once this
option is enabled, all queries constructed can be viewed in the window of this tab.
Configuration Options
You can refresh the query results by clicking the Data tab, then clicking the Refresh query button
on the main toolbar.
ActiveFactory Query includes an option that records all of the queries. To assist in creating a
report, any query can be saved and referred to at a later time.
Click Options / All Queries from the ActiveFactory main menu. The All Queries tab field will
display all subsequent queries and make them available to be copied/pasted into other
applications, or saved to a Queries folder. If you click the All Queries tab, the results may take a
long time to display.
Wonderware Training
Lab 12 – Use ActiveFactory Query 6-9
Introduction
In this lab, ActiveFactory Query is used to demonstrate the ease of constructing SQL queries to
return Historian process data.
Objective
To complete this lab, the following tasks must be completed successfully:
z Start Query
z Create SQL Queries and View the Results
Start Query
Use ActiveFactory Query to create SQL Queries and View the Results
1. From the Start button on the Windows Taskbar, select All Programs / Wonderware /
ActiveFactory / Query.
Your Historian should use the last or current active Server connection. If not, select Options /
Servers from the main menu and reconfigure a connection to your Historian.
Query 1 – Simple Query
2. Click your Historian in the Servers pane of the Tag Picker.
Wonderware Training