Sie sind auf Seite 1von 50

Module 5

ActiveFactory Workbook
Section 1 Introduction 5-3
Lab 11 Use ActiveFactory Workbook Basic Functions 5-21
Lab 12 Use Other ActiveFactory Workbook Functions 5-31
Lab 13 Use the Tag Analysis Wizard 5-37
Lab 14 Create an Hourly-Average Shift Report 5-43
5-2 Module 5 ActiveFactory Workbook

Module Objectives
z Explain Workbook GUI elements and functionality.
z Successfully use the Workbook application to create a variety of reports using the Excel
spreadsheet format.

Wonderware Training
Section 1 Introduction 5-3

Section 1 Introduction

Section Objective
z Understand ActiveFactory Workbook uses and operation.

This section explains the ActiveFactory Workbook uses and operation.

Introduction
ActiveFactory Workbook is an add-in to Microsoft Excel that displays Historian data in Excel
spreadsheet format in order to perform data analysis and to develop standard reports. The reports
that you create with ActiveFactory Workbook can be saved, allowing you to run a report again at
any time.
Workbook is used to embed your SQL statements directly into the Microsoft Excel worksheets to
facilitate the repeated retrieval of data from the Historian.
When the add-in is loaded, the ActiveFactory menu and toolbar appear. Use these menu
commands and toolbar buttons to create Workbook functions. When the functions are executed,
SQL queries are sent to the server, and the requested data is then returned to the worksheet.

Start ActiveFactory Workbook


a. Click Start / All Programs / Wonderware / ActiveFactory / Workbook.
The ActiveFactory toolbar displays:

Tag Search: Search for tag(s) to place on the Sheet.


Live Values: Show live (current) values for a tag.
History Values: Return historical values for a tag or tag range.
Aggregate Values: Retrieve historical values and calculate aggregation for selected tags.
Direct Query: Insert a query.
Convert Function: Convert formula array to values. The formula will no longer update.
Convert Sheet: Convert entire worksheet to values. The values will no longer update.
Edit Function: Edit the function in the current cell using the wizard.
Refresh Function: Execute the function associated with the selected cells.
Refresh Sheet: Refresh the entire worksheet.

b. Click ActiveFactory / Connection Management to establish a connection to a Historian.


c. Use the toolbar buttons to create your report.
The toolbar buttons are described in detail next.

Fundamentals of the Wonderware Historian 9.0 and ActiveFactory Software 9.2 Course
5-4 Module 5 ActiveFactory Workbook

Tag Search
Use the Tag Search button to search the Historian for the tags you want in your report, and place
them on the Sheet. Once you have located the tags you are looking for, this function can insert the
Tagnames into the highlighted cell in the spreadsheet. By using the Tag Search function, you
reduce the possibility of error comparing to entering the tagname manually.
a. Click the Tag Search button.
The Tag Selection window displays.
b. Use the Filter criteria to search for the tags you wish to display in your report.
c. Holding the Control key, select each tag you wish to display in your report.

d. Click the underscore button to the right of the Select cell range to insert tags field.
e. Select the first cell where you want the tag label(s) to show. The tag names will cascade down
the cells in the column.

Note: It is best to start the tag label list on or after row 2 because row 1 will be used for column
headers later.

f. Click the button to close the cell range selector.


g. Click OK to place the selected tags in the report.

Wonderware Training
Section 1 Introduction 5-5

Live Values
The Live Values button launches a function that brings the latest value of selected tags from the
Historian and inserts them into the selected cells. Note that because Excel does not automatically
refresh the data in the sheet, once the values are inserted, the function will not execute again until
the sheet is refreshed.
a. Click the Live Values button.
b. Select the desired Server in the Step 1 of 3 dialog box.
c. Select the Support multiple data types check box to allow for the selection of dissimilar data
types for the same query. That is, a mix of analog, discrete, string, and/or event tags.

d. Click the underscore button to the right of the Select cell range to insert tags field.

e. Select the cell(s) containing the tag names for your report, and click the button to close the
cell range selector.
f. If you want to use a named tag range variable instead, click Binding Options and then
configure the range. See the Help topic: Using Binding Options for more information.
g. Click Next.
h. In the Step 2 of 3 dialog box, specify the location of the worksheet cell(s) that will contain the
output.
i. Select the Enter the results as an array-formula check box to insert the results as an array
formula. An array formula can perform one or more calculations and then return either a single
result or multiple results. An array formula allows for the resending of the query, since the
query parameters are included in the cells that contain the query results.
j. Select the Select cells to specify format options check box to specify a range of cells that
contain formatting information. Click Next.
k. In the Live Values - Step 3 of 3 window, select the values you wish to display in your report.
z Tag name: The unique name of the tag within the IndustrialSQL Server system.
z Date time: The timestamp for the returned value. For delta retrieval, this is typically
the time at which the value was acquired by the IndustrialSQL Server. For cyclic
retrieval, this is the specific time requested or calculated (using a SQL function).
z Include milliseconds: Used to include milliseconds in the timestamp.
z Quality: The basic data quality indicator associated with the data value.
z Replace poor quality values: The text string of "poor" will replace the current value if
the value has a quality <> 0 or 133.
z Detect date time: Only applicable to event tags. The timestamp reflecting when the
event was detected by the event system.
z OPC Quality: The quality value received from the data source. Only available if you
selected the Support multiple data types check box in the Step 1 of 3 dialog box.
l. Click Finish.
The report displays:

Fundamentals of the Wonderware Historian 9.0 and ActiveFactory Software 9.2 Course
5-6 Module 5 ActiveFactory Workbook

History Values

The History Values button launches a function that brings the historical values of selected tags
from the Historian and inserts them into the selected cells. The method of retrieval can be
configured through the interface of the function. Note that because Excel does not automatically
refresh the data in the sheet, once the values are inserted, the function will not execute again until
the sheet is refreshed.
You can retrieve history data for specified analog, discrete, string, and/or event tags. However, you
cant retrieve data for event tags and other types of tags in the same query. To retrieve data for
event tags, create a separate query that only includes event tags.
a. Use the Tag Search button to enter one or more tagnames in the sheet.
b. Click the History Values button.
c. In the Servers list, click the name of the server to use in the Step 1 of 4 dialog box.
d. In the Select cell(s) containing tag name(s) list, specify the location of the worksheet cell(s)
that contains the tag name(s).
e. If you want to use a named tag range variable instead, click Binding Options and then
configure the range.
f. Click Next. The Step 2 of 4 dialog box appears.
g. In the Select cell for output list, specify the location of the worksheet cell(s) that will contain the
output.
h. Select the Enter the results as an array-formula check box to insert the results as an array
formula. An array formula can perform one or more calculations and then return either a single
result or multiple results. An array formula allows for the resending of the query, since the
query parameters are included in the cells that contain the query results.
i. Select the Select cells to specify format options check box to specify a range of cells that
contain formatting information.Click Next.
j. Click Next. The History Values - Step 3 of 4 dialog box appears.

Wonderware Training
Section 1 Introduction 5-7

k. Configure the criteria for the query:


z Display Options Tab
Select the information to be displayed for each tag.

z Format Tab
Value based criteria (narrow tables)
There is one row for each value returned by each tag
Each row shows the timestamp and value for one tag
Tag based criteria (wide tables)
There is one row for each timestamp in the combined result sets of all the tags
Each row shows the values for all the tags at that time

Fundamentals of the Wonderware Historian 9.0 and ActiveFactory Software 9.2 Course
5-8 Module 5 ActiveFactory Workbook

z Retrieval Tab, Main options sub-tab


Retrieval mode: Select the desired retrieval mode. Retrieval modes are discussed in
detail in Module 3, Storage Independent Retrieval Mode, page 3-13.
Query row limit: set the number of rows to retrieve in the query results
Cyclic attributes: Set the Interpolation type to Stairstep, Linear, or to the default Tag
setting
Delta retrieval deadbands: Set the time and Value % for delta retrieval deadbands

Wonderware Training
Section 1 Introduction 5-9

z Retrieval Tab, Other sub-tab


History Version: The Historian supports versioning on the data in its extension tables. It
supports 2 versions for each data point:
z Latest: The Latest value is the most recent update made to that data point.
z Original: The Original value is the first value entered for a given data point (typically
the value acquired from an I/O Server).
Rules: Set the Time stamp and Quality rules for retrieval
State retrieval: Set the state calculation to Min, Max, Average, Total or Percent. This
option becomes enabled if Retrieval mode is set to ValueState.

z Order Tab: Define the order for the results by selecting items on the left and clicking the >
arrow to move them to the list on the right.

Fundamentals of the Wonderware Historian 9.0 and ActiveFactory Software 9.2 Course
5-10 Module 5 ActiveFactory Workbook

z Criteria Tab
Limit the results based upon selection criteria in the Criteria tab.
z To configure criteria for a discrete tag select the first Value check box and set the
criteria to be either a 1 or a 0.
z To configure criteria for an analog tag select the first Value check box and set the
criteria for the data value. For example, the value must be greater than ( > ) 1500.
z (Optional) Select the second Value check box and set another criteria for the data
value. For example, the value must be less than ( < ) 2000.
z (Optional) Select the Value not null check box to filter out NULL values from the
results.
z (Optional) In the Quality list, click the quality criteria for the data. Only data values that
match the quality you specify (Good, Bad, Doubtful) are returned.
l. Click Next.

Wonderware Training
Section 1 Introduction 5-11

The History Values - Step 4 of 4 dialog box appears.


m. Configure the time for the report.
n. Click Finish.

The report displays.

Fundamentals of the Wonderware Historian 9.0 and ActiveFactory Software 9.2 Course
5-12 Module 5 ActiveFactory Workbook

Aggregate Values
You can view aggregated values for specified tags. Aggregations supported are count, minimum,
maximum, sum, average, and standard deviation. Aggregations are calculated using the standard
SQL Server aggregation functions.
a. Click the Aggregate Values button.
Format Tab
b. Select the desired format.
z Narrow query format: In this format, there is one row for a single tag's value for a
particular timestamp.
z Wide query format: In this format, there is one row for one or more tag values for a single
timestamp, thus providing a "wide" view of the data. To use the wide query format, you
must specify the timestamp and one or more tagnames as the column names in the query
syntax. The results will contain a column for the timestamp and columns for the value of
each specified tag at that timestamp.
Time Tab
c. In the Time area, use the time picker to select the start and end times for the query.
d. To return the data with a timestamp that reflects the time zone setting of the Historian, select
the Use time zone of the server check box.
e. To return the data with a timestamp that reflects a time zone setting, different than that of the
local client computer, click the name of the appropriate time zone to use in the Time Zone list.
Criteria Tab
f. To configure criteria for a discrete tag select the first Value check box and set the criteria to be
either a 1 or a 0.
g. To configure criteria for an analog tag select the first Value check box and set the criteria for
the data value. For example, the value must be greater than ( > ) 1500.
h. (Optional) Select the second Value check box and set another criteria for the data value. For
example, the value must be less than ( < ) 2000.
i. (Optional) Select the Value not null check box to filter out NULL values from the results.
j. (Optional) In the Quality list, click the quality criteria for the data. Only data values that match
the quality you specify (Good, Bad, Doubtful) are returned.

Wonderware Training
Section 1 Introduction 5-13

k. (Optional) In the Criteria applicability list, select the moment at which the edge detection
criteria is met.
z None: true: Returns all rows that successfully meet the criteria; no edge detection is
implemented at the specified resolution.
z Leading: first true: Returns only rows that are the first to successfully meet the criteria
(return true) after a row did not successfully meet the criteria (returned false). This is also
known as leading edge detection.
z Trailing: no longer true: Returns only rows that are the first to fail the criteria (return
false) after a row successfully met the criteria (returned true). This is also known as
trailing edge detection.
z Both: first true or no longer true: All rows satisfying both the leading and trailing
conditions are returned.
Calculations Tab
Use the Calculations tab to configure the aggregations to perform on the values for the selected
tag(s).
l. Display calculated values for each tag separately: If selected, one row of calculated values
is returned for each tag. If this check box is not selected, then all values for all specified tags
are included for a single aggregation.
m. Count: The total number of values for the tag.
n. Minimum: The minimum value for the tag.
o. Maximum: The maximum value for the tag.
p. Average: The average value for the tag.
q. Sum: The sum of all values for the tag.
r. Standard deviation: The statistical standard deviation of all values for the tag.
s. Decimal places: The number of decimal places to display for the data value. This applies only
to analog tags.
Retrieval Tab
Use the Retrieval tab to specify the granularity of the data to be returned.
t. In the Mode area, select the retrieval mode.
z Cyclic: Cyclic based retrieval is the retrieval of stored data for the given time period based
on a specified cyclic retrieval resolution, regardless of whether or not the value of the
tag(s) has changed.
z Delta: Delta retrieval, or retrieval based on exception, is the retrieval of only the changed
tag values for a tag(s) for the given time interval. That is, duplicate values are not returned.
If you selected the cyclic retrieval mode, configure additional options in the Cyclic area.
z XX values over equal time intervals: The number of rows to be returned for a specified
time period. For cyclic retrieval, the rows are spaced evenly across the time period, and
the default row count is 100 rows. For cyclic retrieval, the row count is applied for each tag
in a query.
z Values spaced every XX ms: The sampling rate, in milliseconds, for retrieving the data in
cyclic mode. The system will return values stored over the requested time period at the
interval specified by the resolution. For example, if you specify a 5000 ms resolution, the
system will query for all data during the time period and then only return those values that
occur at each 5000 ms interval, starting with the start date and ending with the end date.

Fundamentals of the Wonderware Historian 9.0 and ActiveFactory Software 9.2 Course
5-14 Module 5 ActiveFactory Workbook

If you selected the delta retrieval mode, configure additional options in the Delta area.
z Limit to: The total number of consecutive rows to be returned, starting from the first row in
the record set.
z Time deadband: The minimum time, in milliseconds, between returned values for a single
tag. Applies only to delta retrieval.
z Value deadband: The percentage of full scale (range), in engineering units. Any value
changes that are less than this percentage will not be returned. Applies only to delta
retrieval. The default is 0.
Source Tab
Use the Source tab to specify the data version and type of table for the query.
u. In the Source area, specify the Historian tables from which data will be retrieved.
z Manual history tables: Normal SQL Server tables that are used to store data. These are
the ManualAnalogHistory and ManualDiscreteHistory tables.
z Extension tables: Logical tables that are populated from the IndustrialSQL Server data
files. These tables support the IndustrialSQL Server time domain extensions for handling
data.
z Both: Select this option to retrieve data from both the manual and extension tables.
v. In the Version area, specify what version of data should be retrieved.
z Original value: The original value as it was received from the data source (for example,
the I/O Server) to the IndustrialSQL Server.
z Latest value: The latest value that is stored in the IndustrialSQL Server with the same
timestamp as the original value. Multiple versions are created as the result of data inserts
and updates.

Direct Query
You can use the Query client to build a query, which is inserted into the Query window. The Query
tool is discussed in greater detail in Module 6, ActiveFactory Query.
a. Click the Query button to start the Query client tool.
b. In the Servers list, click the name of the server to use.
c. In the Query window, type the SQL query to execute against the database.
d. Select the Enter the results as an array-formula check box to insert the results as an array
formula. An array formula can perform one or more calculations and then return either a single
result or multiple results. An array formula allows for the resending of the query, since the
query parameters are included in the cells that contain the query results.
e. Select the Specify format options (select cells) check box to specify a range of cells that
contain formatting information. The formatting information in the cells will be applied to the
query results. For more information, see Selecting Cells.
f. In the Select cell for output list, specify the location of the worksheet cell(s) that will contain
the output. Click on the button to select the cell(s) using your mouse. For more information,
see Selecting Cells.
g. Click OK.
To edit the query, click in the cell that contains the red triangle.

Wonderware Training
Section 1 Introduction 5-15

Convert Function
Convert Function changes selected cells that contain functions to the results of the functions.
This converts an executable cell to a static value. Refreshing the function or the sheet after using
the Convert Function will not update the value of the cell.
a. Select the function to convert. If you want to convert an array formula, select any cell in the
array.
b. Click the Convert Function toolbar button.

Convert Sheet
Convert Sheet changes all the functions on the active sheet to the results of the functions. This
converts an executable worksheet to a static worksheet. Refreshing the function or the sheet after
using the Convert Sheet function will not update the value of the cell.
a. Select the sheet to convert.
b. Click the Convert Sheet to Values toolbar button.

Edit Function
The Edit Function button allows you to edit the function in the highlighted cell. If the function in
the cell was entered using one of the wizards (for example, History Values), then the dialog box for
that function will appear and allow you to modify the options that were entered.
a. Select the function to edit. If you want to edit an array formula, select any cell in the array.
b. Click the Edit Function toolbar button.
c. If applicable, the appropriate wizard opens, allowing you to edit the query.

Refresh Function
The Refresh Function button executes the function associated with the selected cells. You can
refresh any function or array formula in the worksheet.
a. Select the function to refresh. If you want to refresh an array formula, select any cell in the
array.
b. Click the Refresh Function toolbar button.
c. The function is executed and the results are returned.

Refresh Sheet
The Refresh Sheet button refreshes the active worksheet, and re-executes all the functions on
the worksheet.
a. Select any cell in the sheet.
b. Click the Refresh Sheet toolbar button.
c. The query is executed and the worksheet is updated with the returned results.

Fundamentals of the Wonderware Historian 9.0 and ActiveFactory Software 9.2 Course
5-16 Module 5 ActiveFactory Workbook

Tag Analysis
In addition to creating valuable reports, you can use ActiveFactory Workbook to generate
statistics, charts, and graphics that are useful for analyses. Wizards are provided to guide you
through selecting the required options.
a. Click ActiveFactory / Tag Analysis. The Tag Analysis Step 1 of 5 dialog box appears.
b. Select the tag analysis you want to run:
z Analog Tag analysis: Analog Tag analysis (graph, statistics, etc.)
z Batch analysis: Graph - analog tag over two time periods
z Scatter analysis: Scatter plot - two analog tags
z Discrete tag analysis: Discrete Tag analysis (graph, statistics, etc.)
z Analog values at discrete transition analysis: Graph - analog tag values at discrete tag
transitions
z Analog/Discrete: Graph - analog vs. discrete tags

Note: Selection of the Analog Tag analysis or the Batch analysis will result in a total of five
dialog boxes. Selection of any of the remaining analysis types will result in a total of four dialog
boxes. The following figures display the dialog boxes presented with the Analog tag analysis.
Differences in the dialog boxes are noted.

c. Click Next.

The Tag Analysis - Step 2 of 5 dialog box appears. The dialog box options will differ depending
upon what type of Analysis you selected.
d. In the Servers list, click the name of the Server to use.
e. In the tag field(s), specify the name of the tag(s) to analyze. Click the ellipsis button to open
the Tag Picker and browse for the tag.

Wonderware Training
Section 1 Introduction 5-17

f. Click Next.

The Tag Analysis - Step 3 of 5 dialog box appears.


g. In the Starting time, enter the starting time for the query. Click the down arrow to select a date
from a calendar. The Batch Analysis and Scatter Analysis will also include a second starting
time for a second time period to perform a an analysis over two time periods.
h. In the Duration lists, specify the duration and the duration unit. For example, 10 minutes.
The duration is used to calculate the end date for the query.
i. Click Next.

Fundamentals of the Wonderware Historian 9.0 and ActiveFactory Software 9.2 Course
5-18 Module 5 ActiveFactory Workbook

The Tag Analysis - Step 4 of 5 dialog box appears.


j. Configure the resolution for the data to be returned.
z Number of rows: The number of rows to be returned for a specified time period using
cyclic retrieval. The rows are spaced evenly across the time period, and the default row
count is 50 rows. The row count is applied for each tag in a query.
z Values spaced every: The sampling rate, in milliseconds, for retrieving the data in cyclic
mode. The system will return values stored over the requested time period at the interval
specified by the resolution. For example, if you specify a 5000 ms resolution, the system
will query for all data during the time period and then only return those values that occur at
each 5000 ms interval, starting with the start date and ending with the end date.
z Number of rows: A second Number of rows field will display if the Analog-Discrete pair
analysis is selected.
k. Click Next. The Tag Analysis - Step 5 of 5 dialog box appears for the Analog Tag Analysis
and the Discrete tag Analysis only. If any of the remaining four analyses were selected, click
Finish.
l. Click Finish.

Wonderware Training
Section 1 Introduction 5-19

Information that you specified using the wizard are assigned to cells in the worksheet. The
following values will be returned based upon the type of Analysis you chose.

Analog values
Analog Tag Batch Scatter Discrete tag at discrete Analog/
analysis Analysis Analysis Analysis transition Discrete
Analysis
Server Server Server Server Server Server
Tag Tag Tag 1 Tag Discrete Tag Discrete Tag
Row or Start Time 1 Tag 2 Row or Analog Tag Analog Tag
Resolution Chart Legend Resolution
Start Time Row or Row or Start Time Row or Row or
Resolution Resolution Resolution Resolution
Duration Start Time Start Time 1 Duration Start Time Start Time
Low Limit Duration Duration Duration Duration
High Limit Start Time 2 Start Time 2 Row or
Chart Legend resolution to
use for the
discrete tag
Start Time 2

m. Click in the workbook to view the functions that are inserted to create the analysis report.

Fundamentals of the Wonderware Historian 9.0 and ActiveFactory Software 9.2 Course
5-20 Module 5 ActiveFactory Workbook

Intentionally left blank

Wonderware Training
Lab 11 Use ActiveFactory Workbook Basic Functions 5-21

Lab 11 Use ActiveFactory Workbook Basic


Functions

Introduction
The following lab will demonstrate the basic functionality of ActiveFactory Workbook.

Objective
At the end of this lab, you should have a thorough understanding of how to report Historian
process data within the Excel spreadsheet environment.
To complete this lab, the following tasks must be completed successfully:
z Connect to the Server
z Insert a Live Value Function
z Insert a History Value Function
z Format Title and Date

Fundamentals of the Wonderware Historian 9.0 and ActiveFactory Software 9.2 Course
5-22 Module 5 ActiveFactory Workbook

Create a new ActiveFactory Workbook


1. From the Start button on the Windows Taskbar, select All Programs/Microsoft Office/
Microsoft Office Excel.
2. Enter a report heading in cell A1. For this lab, Reactors is the heading.
3. Change the font face and size to Arial 14 Bold.
4. Enter =NOW() in cell A2. This cell will display the current date and time.
5. Press the Enter key.
6. Right-click cell A2 and select Format Cells from the submenu.
7. On the number tab, configure the format options as shown in the next figure.
8. Click OK.

The report should now look like the following figure:

9. Select cell A4.

Wonderware Training
Lab 11 Use ActiveFactory Workbook Basic Functions 5-23

10. Select ActiveFactory/Tag Selection/Tag Selection from the main menu.


The Tag Selection dialog box appears:

Fundamentals of the Wonderware Historian 9.0 and ActiveFactory Software 9.2 Course
5-24 Module 5 ActiveFactory Workbook

Insert a Live Value Function


11. Select the Historian icon.
12. In the Tag name: field of the Filter pane, enter React%.
13. Click the Exact match checkbox.
The Apply button becomes enabled.
14. Click Apply. All tags starting with React are displayed.
15. Pressing the Control key, select ReactLevel and ReactTemp tags.
16. Ensure that the Select cell range to insert tags: field reads $A$4.
17. Click OK.

The tags appear from cells A4 through A5:

18. Select cell B3.

19. Select the Live Values button on the Workbook toolbar .

Wonderware Training
Lab 11 Use ActiveFactory Workbook Basic Functions 5-25

20. Insert your cursor into the Select cell(s) containing tag name(s): field in the Live Values
Step 1 of 3 dialog box.
21. Click on cell A4.
22. Press the left mouse button and drag the cursor over the remaining tagname cells.
23. Click Next.

24. Ensure the output location is cell B3 (using the previous steps).
25. Click Next.

26. Leave the default settings in the Live Values - Step 3 of 3 dialog box.

Fundamentals of the Wonderware Historian 9.0 and ActiveFactory Software 9.2 Course
5-26 Module 5 ActiveFactory Workbook

27. Click Finish.

The data is displayed in the spreadsheet:

Note: To view the function that was created, click in any cell containing results (this does not
include the headings). The function appears in the formula bar.

{=wwAnalogLive("[server name]",Sheet1!$A$4:$A$6,TRUE,TRUE,FALSE,TRUE,
FALSE)}

28. Click the Refresh Sheet button in the Workbook toolbar to see the tag values change within
the cell fields.
29. Save the report to C:/Program Files/Wonderware/ActiveFactory/Labs folder as
MyReport.xls.

Wonderware Training
Lab 11 Use ActiveFactory Workbook Basic Functions 5-27

Insert a History Value Function


30. Select the Sheet 2 tab.

31. Click the History Values button in the Workbook toolbar.


Step 1 of the History Values function wizard appears. The Tag reference field should
reference the two tags used in the previous task (if not, use the previous steps to reference
ReactLevel and ReactTemp.
32. Click Next.

33. Ensure the output cell is A1 on Sheet 2 in the History Values - Step 2 of 4 dialog box, using the
previous steps, and click Next.

Fundamentals of the Wonderware Historian 9.0 and ActiveFactory Software 9.2 Course
5-28 Module 5 ActiveFactory Workbook

34. Click the More>> button to see all of the display options.
35. Select the wwRetrievalMode, wwCycleCount, and wwTimeZone options.
36. Click the Format tab.

37. In the Format tab, select the Tag based Criteria (wide tables) option.
38. Click the Retrieval tab.
39. Change the Retrieval mode to BestFit.
40. In the Cyclic attributes pane of the Retrieval/Main options tab change the Values over equal
time intervals to 100.
41. Click the Order tab.

Wonderware Training
Lab 11 Use ActiveFactory Workbook Basic Functions 5-29

42. Order by DateTime by selecting the DateTime field and clicking the > button.
43. Click Next.

44. Accept the (default) last 10 minutes. This defines the relative time period of the query
function.
45. Click Finish.

Fundamentals of the Wonderware Historian 9.0 and ActiveFactory Software 9.2 Course
5-30 Module 5 ActiveFactory Workbook

The query returns 100 values for the specified time period using the BestFit retrieval mode.

46. Save and close MyReport.xls.

Wonderware Training
Lab 12 Use Other ActiveFactory Workbook Functions 5-31

Lab 12 Use Other ActiveFactory Workbook


Functions

Introduction
The following lab will demonstrate the functionality of the ActiveFactory Workbook Aggregate,
Named Ranges, Query Functions, and Tag Analysis functions.

Objective
At the end of this lab, you should have a thorough understanding of how to report Historian
process data within the Excel spreadsheet environment.
To complete this lab, the following tasks must be completed successfully:
z Insert an Aggregate Value Function
z Configure Named Ranges

Fundamentals of the Wonderware Historian 9.0 and ActiveFactory Software 9.2 Course
5-32 Module 5 ActiveFactory Workbook

Insert an Aggregate Value Function


Aggregate values are calculated from Historical values of selected Analog or Discrete Tags. For
Analog tags, five functions are available (minimum, maximum, average, sum, or count); for
Discrete tags, one (count).
Summary calculations are available only for Analog tags. The values are calculated by the
Historian Event/Summary System for that tag only.
In this section, we will return the average value of the SysTimeSec tag for the past 5 minutes. This
is useful because it is a known value that can easily be verified.
1. Press the Ctrl+N keys. This creates a new document.
2. Enter SysTimeSec in cell A1.
3. Enter the words Start Time and End Time in cells A3 and A4, respectively.
4. Insert a start time value in cell B3. An example of the format for the time value is 1/12/2007
12:00.
Your instructor will assist you with definition of a time range.
Be sure to press the Enter key after inputting the date value.
5. Place an End time value (5 minutes after the previous time value) in cell B4.
6. Press the Enter key.
7. Reformat the cells if necessary using the steps on page 5-22.
The worksheet should now appear similar to the following figure:

8. Click the Aggregate Values button within the ActiveFactory toolbar. Notice the Aggregate
Values icon in the ActiveFactory toolbar is identical to the AutoSum icon in the Excel toolbar.
Be sure to select the correct icon.

Wonderware Training
Lab 12 Use Other ActiveFactory Workbook Functions 5-33

9. Select cell A1 to define the SysTimeSec tag.


10. Click Next.

Ensure the output cell is Sheet1!$A$7.


11. Click Next.

Fundamentals of the Wonderware Historian 9.0 and ActiveFactory Software 9.2 Course
5-34 Module 5 ActiveFactory Workbook

12. Select the Calculations tab in the Aggregate Values Step 3 of 4 dialog box.
13. Select Average Calculation Type.
14. Click Next.
15. Select the Absolute Time option.
16. Click the first radio button after Absolute Time (upper field).
17. Insert your cursor into the left-hand Absolute Time (start) field.
18. Select cell B3 in the Excel worksheet. The cell animates and its address should appear in the
field.
19. Repeat the above steps to insert the End Time value into the second field. The end time is
contained in cell B4.
20. Click Finish.

The aggregate value appears in the worksheet:

21. Alter the times in cells B3 and B4. The tag Average should change accordingly.

Configure Named Ranges


Excel includes a useful feature called Named Range. You can assign a name to a group of cells,
and then refer to the name rather than the cell addresses. In this task we will reference a named
range containing several tagnames.

Wonderware Training
Lab 12 Use Other ActiveFactory Workbook Functions 5-35

22. Click Sheet 2 of the Workbook.


23. Select cell A1 on Sheet 2 of the Workbook.
24. Select ActiveFactory/Tag Selection/Tag Selection from the main menu.
Click Clear if the filter information is still applied.
25. Select the following tags using the Ctrl key:
BatchNumber
ProdLevel
ReactLevel
ReactTemp
26. Click OK.

27. Select the first cell of the series (A1).


28. Press the Ctrl+Shift+Down Arrow keys. The entire column of tagnames will be selected.
29. Insert your cursor into the Excel name box and enter AnalogTags (no spaces).

30. Press the Enter key to ensure the entire range has been named.
31. Click Sheet 3 of the Workbook.

Fundamentals of the Wonderware Historian 9.0 and ActiveFactory Software 9.2 Course
5-36 Module 5 ActiveFactory Workbook

32. Highlight cell A1 on Sheet 3 of the Workbook.


33. Select ActiveFactory/Tag Values/Live Values from the main menu.
The Live Values - Step 1 of 3 dialog box appears.
34. Enter AnalogTags in the Select cell(s) containing tag name(s): field.
35. Click Next.

36. Ensure the output cell location is correct ($A$1) in the Live Values - Step 2 of 3 dialog box.
37. Click Next.
38. Accept the default display options in the Step 3 of 3 dialog box: Click Finish.
The tag range is inserted into the worksheet.

You can also name cells containing the start and end times, and then reference them by name in
history and aggregate functions.

Wonderware Training
Lab 13 Use the Tag Analysis Wizard 5-37

Lab 13 Use the Tag Analysis Wizard

Introduction
The following lab demonstrates the functionality of ActiveFactory Workbooks Tag Analysis Wizard
in order to display various chart analyses.

Objective
At the end of this lab, you should have a thorough understanding of how to use the Tag Analysis
Wizard to add Process Data charts to your Excel report.
To complete this lab, the following task must be completed successfully:
z Use the Tag Analysis Wizard
z Create applied data representations within Excel

Fundamentals of the Wonderware Historian 9.0 and ActiveFactory Software 9.2 Course
5-38 Module 5 ActiveFactory Workbook

Use the Tag Analysis Wizard


This task demonstrates configuration of a Scatter Analysis.
1. Click File / New to create a new Workbook.
2. Select ActiveFactory/Tag Analysis from the Excel main menu.
3. Select Scatter Analysis from the list in the Wizard.
4. Click Next.

5. Ensure that the server name displays your Historian within the Select Tags area.
6. Select the ReactLevel and ReactTemp tags using the Ellipsis buttons in the dialog box to
open the Tag Selection control.
7. Click Next.

Wonderware Training
Lab 13 Use the Tag Analysis Wizard 5-39

8. Configure the time period as shown, using yesterdays date.


9. Click Next.

From this dialog box you can specify the resolution (number of rows and spacing).
10. For this lab, accept the default settings in the wizard.
11. Click Finish.

Fundamentals of the Wonderware Historian 9.0 and ActiveFactory Software 9.2 Course
5-40 Module 5 ActiveFactory Workbook

At the completion of the wizard steps, a new sheet is created and the input tags are inserted
into column A. This is true for each type of analysis.

12. Change one of the tags in the analysis by changing the text in Cell A2 from ReactLevel to
SysTimeSec. Notice that the data in column B changes as well as the scatter plot. Cell B1
continues to read ReactLevel.
13. Change cell B1 to read SysTimeSec.
14. Create a new Tag Analysis using the Analog tag analysis type. Excel will create a new sheet
automatically. Use the ReactLevel tag.
15. Accept all the defaults in steps 3, 4 and 5 and click Finish.

Wonderware Training
Lab 13 Use the Tag Analysis Wizard 5-41

The Tag Analysis will appear similar to the following figure:

16. To preserve the results of this tag analysis, use the Convert Sheet button on the Workbook
toolbar.
17. Save the report to C:/Program Files/Wonderware/ActiveFactory/Labs folder as
TagAnalysis.xls.

Fundamentals of the Wonderware Historian 9.0 and ActiveFactory Software 9.2 Course
5-42 Module 5 ActiveFactory Workbook

Intentionally left blank

Wonderware Training
Lab 14 Create an Hourly-Average Shift Report 5-43

Lab 14 Create an Hourly-Average Shift


Report

Introduction
The following lab demonstrates use of formatting, aggregate functions, and time ranges within
Excel.

Objective
At the end of this lab, you should have a thorough understanding of how to create a report based
on a specific time range (Shift).
To complete this lab, the following tasks must be completed successfully:
z Create and Format a New Report
z Create Shift Time Range
z Insert Aggregate Value Function
z Modify Cell Formulas

Fundamentals of the Wonderware Historian 9.0 and ActiveFactory Software 9.2 Course
5-44 Module 5 ActiveFactory Workbook

Create and Format a New Report


1. From Excels main menu, select File/New.
2. Select Blank Workbook.
3. In the upper left-hand area or within cell A1, enter a report name of your choice and select a
large font size for legibility.
This example is titled Hourly Average Data Acquisition IPS.
4. Highlight all the cells in which the name appears.
5. Right-click the cells and select Format Cells from the sub-menu.
6. Select the Alignment tab.
7. Select the Merge cells option.
8. Click OK.
9. Select cell A3.
10. Select the ActiveFactory menu and click Tag Selection/Tag Selection.
11. Locate the SysDataAcqOverallItemsPerSec tag and click OK.

Create Shift Time Range


12. Locate cell A5 and enter a start date and time.
Ensure the server is logging data for the specified time.
In this example, the datetime string 3/22/07 10:00 is the date time value at which the shift
report begins.
13. Select a range that includes 8 rows. The range will end with cell A12 (incl. A5-A12).
14. Right-click the cell range and select Format Cells from the sub-menu.
15. Select the Number tab.
16. Select Date from the Category: pane.
17. Select the 3/14/01 1:30 PM option string from the Type: pane.

Wonderware Training
Lab 14 Create an Hourly-Average Shift Report 5-45

18. Click OK.

The date and time now appear in cell A5.


The format will be the same in cells A6-A12.
19. Locate cell A6 and enter the formula =A5+1/24.
20. Press the Enter key. The cells should now appear similar to the following figure:

21. Select cell A6 and position the cursor over the lower right-hand corner of the cell. The cursor
should turn into a + icon, indicating a handle.
22. Drag the handle downwards to cell A12. This will increment each of the highlighted cells by
one hour.

Fundamentals of the Wonderware Historian 9.0 and ActiveFactory Software 9.2 Course
5-46 Module 5 ActiveFactory Workbook

The date and time should now appear in each of the cells. Your instructor will indicate what
time span to use.

Note: If cells need to be resized, a series of #s will appear in the cell fields. The cells can be
resized by double-clicking the column border at the top of the worksheet.

23. Click an adjacent cell to exit the column.

Insert Aggregate Value Function


24. Click the Aggregate Values button in the ActiveFactory toolbar.
The Aggregate Values Step 1 of 4 wizard appears.
25. Change the cell containing the Tag Name to Sheet1!$A$3.
26. Click Next.

Wonderware Training
Lab 14 Create an Hourly-Average Shift Report 5-47

27. Change the Select cell for output field to Sheet1!$C$5.


28. Click Next.

Note: (C5) is selected because the output will contain 2 cells: (C4) contains the tagname,
(C5) contains the aggregate value for that time (last hour of data).

Fundamentals of the Wonderware Historian 9.0 and ActiveFactory Software 9.2 Course
5-48 Module 5 ActiveFactory Workbook

The Step 3 of 4 dialog box appears.


29. Select the Calculations tab.
30. Change the Calculation Type to Average.
31. Select the Resolution tab.
32. Select the Values spaced every option (we want average values).
33. Set the number to 60000 ms. This value sets the data retrieval mode to Cyclic, at 1-minute
intervals.
34. Click Next.

35. Select the Absolute Time option.


36. Click the first radio button (not the checkbox) under Absolute time.
37. Insert your cursor into the top-left field just below the Single value checkbox.
38. In the main worksheet field, select cell A5. This is the cell containing the time at the beginning
of the aggregate time span.
39. Insert your cursor into the right-hand field below the Absolute Time option.
This is the cell that contains the ending time of the average period.
40. In the main worksheet field, select cell A6. This is the cell containing the time at the end of the
aggregate time span.

Wonderware Training
Lab 14 Create an Hourly-Average Shift Report 5-49

The dialog box should now look like the following figure.
41. Click Finish.

The average value for the hour appears along side the date/time cell:

Note: The value is calculated against the previous hour, so the first one appears at 9:00, the
second at 10:00, etc.

Fundamentals of the Wonderware Historian 9.0 and ActiveFactory Software 9.2 Course
5-50 Module 5 ActiveFactory Workbook

Modify Cell Formulas


42. Select cell C6.
The wwAggregate function string appears in the formula bar.

43. Modify the following time cell reference:


z $A$5 to $A5
z $A$6 to $A6

Change $A$5 to $A5 Change $A$6 to $A6

Changing the cell reference creates relative cell referencing and enables the average values
to be cascaded down the column.
44. Press the Enter key to save the changes.
45. Highlight cell C6 and drag it down to row 12.

The cell values are refreshed during the drag-down. This is because the wwAggregate formula
is being dynamically copied into each cell.
You can now change the tagname reference or the date/time from within the worksheet field
and Workbook will calculate the new values.

Note: If aggregate values are required for standardized reports, it will be worth configuring the
Historian Event/Summary system to automatically calculate these values.

46. Save the report (to the same folder as the Trend files) as ShiftAvg_DataAcq.xls.

Wonderware Training

Das könnte Ihnen auch gefallen