+ All Categories
Home > Documents > Excel Add In

Excel Add In

Date post: 18-Apr-2015
Category:
Upload: arhlboy
View: 428 times
Download: 1 times
Share this document with a friend
83
Proficy TM Historian EXCEL ADD - IN Version 3.1 Jan. 2006 i
Transcript
Page 1: Excel Add In

ProficyTM Historian E X C E L A D D - I N

V e r s i o n 3 . 1

J a n . 2 0 0 6

i

Page 2: Excel Add In

Proficy Historian Excel Add-In

All rights reserved. No part of this publication may be reproduced in any form or by any electronic or mechanical means, including photocopying and recording, without permission in writing from GE Fanuc Automation.

Disclaimer of Warranties and Liability

The information contained in this manual is believed to be accurate and reliable. However, GE Fanuc Automation assumes no responsibilities for any errors, omissions or inaccuracies whatsoever. Without limiting the foregoing, GE Fanuc Automation disclaims any and all warranties, expressed or implied, including the warranty of merchantability and fitness for a particular purpose, with respect to the information contained in this manual and the equipment or software described herein. The entire risk as to the quality and performance of such information, equipment and software, is upon the buyer or user. GE Fanuc Automation shall not be liable for any damages, including special or consequential damages, arising out of the user of such information, equipment and software, even if GE Fanuc Automation has been advised in advance of the possibility of such damages. The user of the information contained in the manual and the software described herein is subject to the GE Fanuc Automation standard license agreement, which must be executed by the buyer or user before the use of such information, equipment or software.

Notice

GE Fanuc Automation reserves the right to make improvements to the products described in this publication at any time and without notice.

© 2006 GE Fanuc Automation. All rights reserved. Microsoft is a registered trademark of Microsoft Corporation. Any other trademarks herein are used solely for purposes of identifying compatibility with the products of GE Fanuc Automation.

CIMPLICITY is a registered trademark of GE Fanuc Automation.

Portions of this software are copyrighted by DataDirect Technologies, 1991-2006

We want to hear from you. If you have comments, questions, or suggestions about our documentation, send them to the following email address:

[email protected]

ii

Page 3: Excel Add In

iii

Table Of Contents excel add-in......................................................................................................... i Version 3.1.......................................................................................................... i

Using the Historian Excel Add-In.......................................................................... 1 Reference Documents .................................................................................... 1

Understanding the Historian Excel Add-In........................................................ 2 Understanding Excel Add-In Conventions .................................................... 3 Installing The Excel Add-in with Historian ................................................... 6

Using the Historian Excel Add-In...................................................................... 8 Selecting Options ......................................................................................... 10 Searching Tags............................................................................................. 14 Querying Alarm and Event Data.................................................................. 17 Querying Current Values ............................................................................. 17 Querying Raw Data...................................................................................... 19 Querying Filtered Data ................................................................................ 22 Querying Calculated Data............................................................................ 30 Exporting Tags............................................................................................. 34 Importing Tags............................................................................................. 37

Page 4: Excel Add In

Proficy Historian Excel Add-In

Adding New Tags or Modifying Tag Parameters ........................................ 38 Deleting Tags ............................................................................................... 40 Exporting Data ............................................................................................. 40 Importing Data ............................................................................................. 42 Searching Messages ..................................................................................... 43 Exporting Messages ..................................................................................... 45 Importing Messages ..................................................................................... 46 Listing Archives........................................................................................... 47 Listing Collectors......................................................................................... 49 Working with Alarm and Event Data .......................................................... 51

Defining Reports.............................................................................................. 51 Building Dynamic Reports........................................................................... 52 Sharing Excel Reports.................................................................................. 52 Using the Sample Reports............................................................................ 53 Troubleshooting the Excel Add-In Sample Reports .................................... 63 Running a Report Using Visual Basic ......................................................... 63 Array Formulas for the Historian Excel Add-In .......................................... 65

Troubleshooting the Excel Add-In................................................................... 74 Troubleshooting General Imports ................................................................ 74

iv

Page 5: Excel Add In

Table Of Contents

Troubleshooting Tag Imports....................................................................... 75 Troubleshooting Data Imports ..................................................................... 76 Troubleshooting Data or Tag Exports.......................................................... 76

Index .................................................................................................................... 77

v

Page 6: Excel Add In

1

Using the Historian Excel Add-In

The Using the Historian Excel Add-In manual is intended for process control engineers, integrators, and developers responsible for creating and maintaining Historian reports in Excel.

This manual provides descriptive material and specific operating procedures for performing all common tasks.

Reference Documents

For related information about Historian, refer to the following documents:

• Getting Started with Historian

• Using the Historian Administrator

• Historian Data Collectors

• Historian Alarms and Events

• Migrating Advanced and Classic Historian Data

• Using the Historian OLE DB Provider

• Historian Software Development Kit (SDK) Online Help System

Page 7: Excel Add In

Proficy Historian Excel Add-In

Understanding the Historian Excel Add-In The Historian Excel Add-In greatly expands the power and benefits of using the Historian data archiving and retrieval system. Using the Add-In, you can:

• Retrieve selected data from any archive file.

• Display it in a customized report.

• Present the data in any of 12 standard chart formats.

• Calculate derived variables from raw data values.

• Perform mathematical functions to smooth or characterize data.

• Import, export, and modify tags, data, and messages — all with familiar Excel commands, macros, and computational techniques.

• Create dynamic reports that you can share among users.

A major benefit of using the Excel Add-In is the ability to add tags to Historian by generating a tag worksheet using the standard Excel tools, editing the parameters, and then bulk importing the information directly into Historian. Using similar techniques, you can export tag parameters to Excel, make bulk changes, and then import the changes back into Historian in a simple, straightforward procedure.

2

Page 8: Excel Add In

Using the Historian Excel Add-In

Understanding Excel Add-In Conventions

The Excel Add-In uses several conventions in its dialog boxes. These conventions are important to take full advantage of the features of the Historian Excel Add-In.

• The selection of tags, times, and events should always be via cell references. Try not to type these items directly into dialog boxes. Rather, select them in the worksheet.

• Many dialog boxes support selecting multiple statistics or attributes. You can select multiple items in a list using one of the following methods:

o Dragging the mouse over multiple items.

o Pressing the Shift key and clicking the ends of a contiguous range.

o Pressing the Control key and clicking multiple individual items.

• Specifying an Output Cell is always optional. If you do not specify an output cell, the active cell is used as the starting point for output. When you specify an output cell, that cell is used as the starting point for output. If you select a range for an output cell, the top left cell in the range is used as the starting point for output.

• Specifying an Output Range determines how many data points are

3

Page 9: Excel Add In

Proficy Historian Excel Add-In

retrieved from a given query. It is important for these functions to specify whether data points should be sorted in ascending or descending order by selecting the appropriate option.

• Ensure when you are specifying an Output Range or an Output Cell that the active cells are not the same cells that you specified with tag name cell references. This will lead to circular cell referencing and incorrect values.

• Specifying data retrieval into Rows or Cols determines how multiple attributes or statistics are displayed in the worksheet.

• Specifying data retrieval into Rows or Cols only applies when the dialog box inserts a single function into the worksheet. When you select a multi-cell output range, the orientation of that range determines whether the requested data is returned into rows or columns.

• Microsoft Excel imposes a 255 character limit on their formulas. If you attempt to create a formula with more than 255 characters, you will receive an error message.

• Excel does not support the use of the right and left arrow keys of the keyboard to move between characters in text boxes and fields in the dialog boxes.

• The maximum number of columns allowed in an Excel worksheet is 255. For example, if you are trying to display a recordset returned from the Search Tags query that returns more than 255 records, the query will not return any data.

4

Page 10: Excel Add In

Using the Historian Excel Add-In

• The maximum number of rows returned by the Excel Add-In is 32,767.

• If no parameters in an Excel formula change, the formula does not recalculate unless you edit (press F2) the formula and force a change. For example, if you change a Hi Scale value from 100 to 50 and then import a tag, the Hi Scale field will display 100 when looking at the tag information.

• When retrieving data in the Excel Add-In, be sure to leave at least one blank line at the top of the output display for the column header labels. If you do not, the header labels will not show.

• In several of the fields, an underscore appears at the right side of the field. If you click the underscore, the dialog box instantly changes to a minimized display. You can return to the original display by clicking the box again. The purpose of this feature is to permit you immediately to see an unobstructed view of your worksheet or other windows as you work your way through the dialog box and to allow you to select a cell or range of cells in the worksheet.

5

Page 11: Excel Add In

Proficy Historian Excel Add-In

Installing The Excel Add-in with Historian

Before you install the Excel Add-In with Historian, verify that Microsoft Excel is already installed on your computer. Microsoft Excel is a prerequisite for the Add-In – the Add-In will not function without it.

You install the Excel Add-In package as one of the standard installation options from the Historian Install CD. Run the Install CD on the computer on which you want to use the Excel Add-In and select the Excel Add-In option at the prompt. Refer to the Getting Started with Historian for the complete installation procedure. You can also install the Excel Add-In by installing the Client tools on a machine that doesn't have the Historian Administrator or archive installed.

After you install the Excel Add-In, use the following procedure to activate the Add-In:

1. Open a new worksheet, select Add-Ins from the Tools menu. The Add-Ins dialog box, shown in the following figure, appears.

6

Page 12: Excel Add In

Using the Historian Excel Add-In

Excel Add-Ins Dialog Box

2. Select Historian Add-In and click OK.

The Add-In is now ready to use and the Historian menu is now available in the Excel Toolbar.

TIP: If the Historian Add-In is not listed, click the Browse button to locate the Historian.xla file.

NOTE: If you install the Excel Add-In prior to installing Excel, the install program copies the Historian.xla file to your Historian folder (typically

7

Page 13: Excel Add In

Proficy Historian Excel Add-In

C:\Program Files\Historian). If you decide to add the Excel Add-In after installing Excel, open Excel, select Add-Ins from the Tools menu, and click Browse to locate the Historian.xla file.

If you uninstall Historian after installing the Excel Add-In as described, ensure that you clear the Historian check box in the Excel Add-Ins dialog. If you do not clear this option, you will receive an error each time you open Excel.

Using the Historian Excel Add-In This chapter describes recommended procedures for setting up the Excel Add-In and using the various options and commands. Refer to the following for more information:

• Selecting Options

• Searching Tags

• Querying Current Values

• Querying Raw Data

• Querying Calculated Data

• Querying Filtered Data

• Exporting Tags

8

Page 14: Excel Add In

Using the Historian Excel Add-In

• Importing Tags

• Adding New Tags or Modifying Tag Parameters

• Deleting Tags

• Exporting Data

• Importing Data

• Searching Messages

• Exporting Messages

• Importing Messages

• Listing Archives

• Listing Collectors

• Working with Alarm and Event Data

9

Page 15: Excel Add In

Proficy Historian Excel Add-In

Selecting Options

To select options for running the Excel Add-In, select Options from the Historian menu. The Historian Excel Add-In dialog box appears. This dialog box allows you to select several options for running the Add-In. The choices and the effects of each are listed in the following table.

Field Description

Internal vs. External References

Choosing Use External References allows your application to reference cells in other worksheets and workbooks in addition to the current one. If you choose Use Internal References instead, you can only access cells in the current worksheet. The default setting is Use External References.

Automatically Update Links to Add-In (Yes/No)

Add-In functions are maintained as worksheet links. If users who share worksheets do not have Microsoft Office installed the same way, it is necessary to turn this feature on. When on, this feature automatically re-establishes any formula links that may be broken due to

10

Page 16: Excel Add In

Using the Historian Excel Add-In

differences among users in Microsoft Office installation. The default setting enables this feature.

The Auto Update feature allows sharing of worksheets. You must, however, install the Excel Add-In in the exact same Microsoft Office Library Path as the other worksheets if you want to use the sharing feature.

When opening a worksheet with links to another worksheet, you may receive a message prompting you to update all linked information in the workbook (Yes) or keep the existing information (No). It is recommended that you select No and keep the existing information. The links will be automatically updated for your worksheet. Save your worksheet after the links have been updated.

Show/Hide Header Labels

This option lets you display or suppress the column header labels that are automatically placed in the worksheet when entering formulas throughout the Historian Dialogs. The default setting is Show Labels.

11

Page 17: Excel Add In

Proficy Historian Excel Add-In

Color Allows you to select the header name color from the drop-down list: black, blue, red, green, magenta, cyan, or yellow.

Assign Default Server This dialog box shows the current server assignment. You can modify the setting by clicking the Edit button and accessing the Historian Server Managers dialog box. This dialog box allows you to save user connection information, add or connect to a new server, delete a server, and modify the default server.

Adjust Column Widths This option lets you automatically adjust the width of columns in your worksheet as formulas are inserted by Historian dialogs. Click Adjust Header Column Width to modify the width of header labels; click Adjust Data Column Width to modify the data column widths to accommodate the data values. Enabling these options usually makes the worksheet much more readable. However, doing so can sometimes make the worksheet calculate too much when building a large report. In such cases, disable the automatic feature and adjust individual columns manually.

12

Page 18: Excel Add In

Using the Historian Excel Add-In

Save/Default/Cancel These action buttons let you apply your choices of options. Click Save to apply the settings you entered, click Default to select default settings for all options, and click Cancel to close the dialog box.

13

Page 19: Excel Add In

Proficy Historian Excel Add-In

Searching Tags

The Search Tags command lets you scan the tags on a specified server and then to perform actions on one or more tags you select from that group. When you select the Search Tags command in the Historian menu, the Historian Tag Search dialog box appears.

To search for tags:

1. Select Search Tags from the Historian menu. The Historian Tag Search dialog box appears.

2. In the Server field, select a server from the drop-down list. To add or connect to a new server click the Browse button (...). If you do not specify a server, the Add-In searches the default server. To set the selected server as default, ensure the Set Server to Default option is enabled.

3. Click the Search button. The Historian Tag Search dialog box is populated with a tag list.

4. Select Tags from the Search List:

1. Click a specific tagname to select it in the populated Historian Search Tags dialog box. To select multiple individual tags, press the Control key and click the tagnames. To select a sequence of tags, press the Shift key

14

Page 20: Excel Add In

Using the Historian Excel Add-In

and click the first and last tagname of the sequence.

2. When you have selected the tags you want, click the right arrow (>) button in the center of the screen. This moves the selected tags to the right hand window. The selected tags are the tags for which the query obtains and displays data. If you click the double right (>>) arrow instead of the single right arrow, you select and move all tags to the right hand window.

3. If you change your mind about a tag, you can deselect it by clicking on the tagname to highlight it and then clicking the left arrow (<) button. This moves the tag back to the left hand window, removing it from the list of selected tags. Similarly, you can deselect all tags, by clicking the double left (<<) arrow.

4. The Search Display section lets you choose whether you want to display tagnames or tag description. It also displays the number of tags returned. Select the display option you prefer.

5. The Output With section lets you choose whether the output presentation shows the names of the selected tags or the cell computation formulas. Select the option you prefer.

NOTE: Using Output with Formula places a dynamic formula in the worksheet, versus just a copy of the tagnames currently selected. Having a dynamic formula allows the list of tags returned to be dynamic based on the “tag mask” criteria supplied. This is particularly useful when selecting a

15

Page 21: Excel Add In

Proficy Historian Excel Add-In

cell reference for the tag mask as opposed to typing in a tag mask directly in the dialog.

f. The Output Range field determines where in the worksheet the output data displays. Click in the Output Range field and select a range of cells in a single row or column in the worksheet. In most cases, you should choose Columns for a typical report. Selecting the Rows option rotates the report presentation 90 degrees.

g. The Output Display section lets you select the type of data to be displayed. Select a name to choose a single parameter for display. To select multiple individual parameters, press the Control key and click the parameters. To select a sequence of parameters, press the Shift key and click the first and last parameter of the sequence.

h. When you have selected all desired options, click OK to apply your choices and initiate the query. Click Cancel to close the dialog box.

16

Page 22: Excel Add In

Using the Historian Excel Add-In

i.

Querying Alarm and Event Data

For more information about querying alarm and event data in the Historian Excel Add-In, refer to the following topics:

• Alarms and Events and the Excel Add-in

• Creating Alarms and Events Queries in the Excel Add-In

Querying Current Values

Querying Current Values retrieves the most recently updated value of one or more Tags or process variables.

NOTE: If you attempt to perform a Query Current Value with two worksheets open, the Excel Add-In may become unstable and lock up. This is a known Microsoft Excel issue. To avoid locking up Excel while performing queries with the Excel Add-In, work with only one Excel document at a time.

17

Page 23: Excel Add In

Proficy Historian Excel Add-In

To perform a Query Current Values operation:

1. Select Query Current Values from the Historian menu. The Historian Current Value Query dialog box appears.

2. Select a server from the drop-down list. If you do not specify a server, the Add-In queries the default server. To set the selected server as default, ensure the Set Server to Default option is enabled.

3. Select a tag on your worksheet and, while it is selected, click in the Tag Name field of the dialog box. This enters the tagname for you automatically.

NOTE: Do not use wildcards in this field. The Query Current Value feature returns a single value for a single tag at each query. If you attempt to use a wildcard in the Tag Name field, you will only get a return value for the first tag.

4. In the Output Display field, select one or more parameters for the output. To select multiple individual tags, press the Control key and click the tagnames. To select a sequence of tags, press the Shift key and click the first and last tagname of the sequence.

5. Click in the Output Cell field and then click a cell in the worksheet to define the upper left corner of the display. Be sure to leave at least one blank line at the top of the output display for the column header labels. If you do not, the header labels will not show.

6. Select either Columns or Rows for the output display. Selecting Columns displays a table of values with parameters arranged in columns with header labels at the top. Selecting Rows rotates the

18

Page 24: Excel Add In

Using the Historian Excel Add-In

table 90 degrees.

NOTE: When selecting multiple tags, the orientation of the return data is based on the orientation of the selected tags and the Row/Col selection is ignored.

7. Click OK to initiate the query. Click Cancel to abort the operation and close the dialog.

Querying Raw Data

Raw data values are the values actually stored in the archive, after applying collector and archive compression, but before applying any interpolation, smoothing, or other signal processing calculations. Querying Raw Data retrieves these values for selected tags.

The Raw Data Query returns a number of data points based on the number of rows or columns specified in the output range. If you are not viewing all your data points, select enough rows or columns to display all the data.

To perform a raw data query:

1. Select Query Raw Data from the Historian menu. The Historian Raw Data Query dialog box appears.

19

Page 25: Excel Add In

Proficy Historian Excel Add-In

2. Select a server from the drop-down list. If you do not specify a server, the Add-In queries the default server. To set the selected server as default, ensure the Set Server to Default option is enabled.

3. Select a tag on your worksheet and, while it is selected, click in the Tag Name field of the dialog box. This enters the tagname for you automatically.

4. In the Query Type section, select the type of data search from three options:

o By Time – Selecting the By Time option means that you search for data values between a start time and an end time. You must enter values for starting and ending times in the fields displayed at the right of the option.

o By Number Forward – Selecting the By Number Forward means searching for a number of values after a specified time. Enter values into the After Time and Number of Values fields.

o By Number Backward – Selecting the By Number Backward means searching for a number of values before a specified time. The display changes from start and end times to Values Before Time and Number of Values. Enter appropriate parameters in these fields.

5. In the Output Display field, select one or more parameters for the output. To select multiple individual tags, press the Control key and click the tagnames. To select a sequence of tags, press the Shift key

20

Page 26: Excel Add In

Using the Historian Excel Add-In

and click the first and last tagname of the sequence.

6. Click in the Output Range field and select a range of cells in a single row or column to determine where the returned data is placed.

7. Select either Columns or Rows for the output display. Selecting Columns displays a table of values with parameters arranged in columns with header labels at the top. Selecting Rows rotates the table 90 degrees.

NOTE: When selecting multiple tags, the orientation of the return data is based on the orientation of the selected tags and the Row/Col selection is ignored.

8. Select either Ascending or Descending to set the order of the retrieved data in either ascending or descending order.

9. Click OK to initiate the query. Click Cancel to abort the operation and close the dialog.

NOTE: The Raw Data Query returns a number of data points based on the number of rows or columns specified in the output range. If you are not viewing all your data points, select enough rows or columns to display all the data.

21

Page 27: Excel Add In

Proficy Historian Excel Add-In

Querying Filtered Data

The Query Filtered Data function is similar to the calculated data query, with the addition of a search filter on the data. The Search Filter allows you to filter the actual data retrieved with a filter condition. This is useful when trying to retrieve all data for a specific Batch ID, Lot Number, or Product Code and for filtering data where certain limits were exceeded, such as all data where this temperature exceeded a certain value.

NOTE: Do not use the Desc option for the Output Range in the Filtered Data Query dialog box. Using this option may cause the Excel Add-In to become unstable. If you use this option and find that Excel is unstable, try minimizing the Excel application window, expose the Filtered Data Query dialog box, and close the dialog box. Excel should then function normally.

To perform a filtered data query:

1. Select Query Filtered Data from the Historian menu. The Historian Filtered Data Query dialog box appears.

2. Select a server from the drop-down list. If you do not specify a server, the Add-In automatically uses the default server. To set the selected server as default, ensure the Set Server to Default option is enabled.

3. Select a tag or group of tags on your worksheet and, while they are selected, click in the Tag Name field of the dialog box. This enters the tagnames for you automatically.

22

Page 28: Excel Add In

Using the Historian Excel Add-In

NOTE: Do not use wildcards in this field. If you use a tag mask instead of a tagname, Historian only returns the first possible match.

4. In the Query Time section enter values of time in the Start Time and End Time fields.

5. In the Sampling Type section, select a type from the drop-down list. The following types are available:

• Interpolated Sampling – calculates values between two data points using a linear interpolation algorithm.

• Calculated Sampling – computes values using an algorithm selected in the Calculation field.

• Lab Sampling – computes intermediate values between two data points by using the last actual value. This type of sampling displays as a stair step type of curve.

• Trend Sampling – determines the raw minimum and raw maximum value for each specified interval. Use the Trend sampling mode to maximize performance when retrieving data points for plotting.

6. The Calculation Field is active only after you select Calculated Sampling as the Sample Type. Select a Calculation Algorithm type from the drop-down list. The following types are available:

• Average – a time weighted arithmetic mean.

• Minimum – the lowest value in the group.

23

Page 29: Excel Add In

Proficy Historian Excel Add-In

• Maximum – the highest value in the group.

• Standard Deviation – the square root of the arithmetic mean of deviations from the time-weighted arithmetic mean of all values in the group.

• Total – the time-weighted total of all values in the group. Note that Engineering Units are assumed to be in Units/Day. If your Engineering Units were not measured in Units/Day, you must scale your total to the actual time units of the measurement. For example, if the measurement were in Units/Minute (such as GPM), you would multiply the total number by 1440 (minutes in a day) to scale the value into the correct time units.

• Count – the total number of values in the group.

• Raw Average – the unweighted arithmetic mean of all values in the group.

• Raw Standard Deviation – the square root of the arithmetic mean of deviations from the unweighted arithmetic mean of all values in the group.

• Raw Total – the unweighted total of all values in the group.

• Time of Minimum Value – the time at which the minimum value occurred.

• Time of Maximum Value – the time at which the maximum value occurred.

24

Page 30: Excel Add In

Using the Historian Excel Add-In

• TimeGood – the amount of time (in milliseconds) during the interval when the data quality is good.

7. In the Sampling Interval section, select either the By Interval or By Samples option.

• The By Interval option displays two entry fields, Interval and Time Unit. Enter values in both. For example, to sample at 10 minute intervals, enter 10 in the interval field and select Minutes in the Time Unit field.

• The By Samples option displays a Number of Samples field. To specify a number of samples for the data query, enter a number in this field. For example, to query 100 samples, enter 100 in this field.

8. In the Output Display field, select one or more parameters for the output. Click a name to select it. To select multiple individual tags, press the Control key and click the tagnames. To select a sequence of tags, press the Shift key and click the first and last tagname of the sequence.

9. In the Filter Definition section, enter filter parameters in the fields for Filter Tag, Filter Comparison, Include Date Where Value Is Equal To, and Include Times. These fields are optional. If you do not enter any values, the query returns all values without filtering. See the following table for more information.

1. Select a tag on your worksheet and, while it is selected, click in the Tag Name field of the dialog box. This enters the

25

Page 31: Excel Add In

Proficy Historian Excel Add-In

tagname for you automatically.

2. In the optional Filter Comparison field, select a comparison operator from the drop-down list (equal to, equalfirst, equallast, greater than, greater than or equal to, less than, less than or equal to, not equal to, alarm condition, alarm subcondition).

3. In the optional Include Data Where Value Is Equal To field, enter a target reference value.

4. In the optional Include Times After field, select one of the time options (Time After, Time Before, Time Before and After, Exact Time) from the drop-down list.

10. Click in the Output Range field and select a range of cells in a single row or column to determine where the returned data is placed.

11. Select either Columns or Rows for the output display. Selecting Columns displays a table of values with parameters arranged in columns with header labels at the top. Selecting Rows rotates the table 90 degrees.

NOTE: When selecting multiple tags, the orientation of the return data is based on the orientation of the selected tags and the Row/Col selection is ignored.

12. Select either Ascending or Descending to set the order of the retrieved data in either ascending or descending order.

13. Click OK to initiate the query. Click Cancel to abort the operation

26

Page 32: Excel Add In

Using the Historian Excel Add-In

and close the dialog.

Filter Parameters for Data Queries

Parameter Description

Filter Tag The single tag name used when applying the filter criteria. Entering a tag for this parameter indicates that you want to perform a filtered data query. The other filter fields are disregarded unless you specify a filter tag.

Filter Mode The type of time filter:

ExactTime – Retrieves data for the exact times that the filter condition is True (only True)

BeforeTime – Retrieves data from the time of the last False filter condition up until the time of the True condition (False until True).

AfterTime – Retrieves data from the time of the True filter condition up until the time of next False condition (True until False).

BeforeAndAfterTime – Retrieves data from the time of the last False filter condition up until the time of next False condition (While True).

27

Page 33: Excel Add In

Proficy Historian Excel Add-In

The Filter Mode defines how time periods before and after transitions in the filter condition should be handled.

For example, AfterTime indicates that the filter condition should be True starting at the timestamp of the archive value that triggered the True condition and leading up to the timestamp of the archive value that triggered the False condition.

Filter Comparison Mode

The type of comparison to be made on the filter comparison value:

Equal – Filter condition is True when the Filter Tag is equal to the comparison value.

EqualFirst – Filter condition is True when the Filter Tag is equal to the first comparison value.

EqualLast – Filter condition is True when the Filter Tag is equal to the last comparison value.

NotEqual – Filter condition is True when the Filter Tag is NOT equal to the comparison value.

LessThan – Filter condition is True when the Filter Tag is less than the comparison value.

GreaterThan – Filter condition is True when the Filter Tag is greater than the comparison value.

LessThanEqual – Filter condition is True when the Filter Tag is less than or equal to the comparison

28

Page 34: Excel Add In

Using the Historian Excel Add-In

value.

GreaterThanEqual – Filter condition is True when the Filter Tag is greater than or equal to the comparison value.

Alarm Condition – Specifies an alarm condition to filter data by. For example, Level.

Alarm SubCondition – Specifies an alarm sub-condition to filter data by. For example, HIHI.

The Filter Comparison Mode defines how archive values for the Filter Tag should be compared to the Filter Value to establish the state of the filter condition. If a Filter Tag and Filter Comparison Value are supplied, time periods are filtered from the results where the filter condition is False.

Filter Comparison Value

The value to compare the filter tag with when applying the appropriate filter to teh data record set query (to dtermine the appropriate filter times).

Examples

If you had a BatchID going into an Historian tag, that BatchID will either have a timestamp at the beginning of the batch or at the end of the batch. Different batch systems report the BatchID as the batch is started, and other systems do not report the BatchID until the batch is finished.

29

Page 35: Excel Add In

Proficy Historian Excel Add-In

If your BatchID is reported at the beginning of a batch, you would need to use the AfterTime option because you would want to include all data for a particular BatchID after the time the BatchID was reported up until the next BatchID was reported.

If your BatchID was being reported at the end of the batch, you would want to use the BeforeTime option because you would want to include all data for a particular Batch ID before the time the Batch ID was reported back to the previous BatchID being reported.

Querying Calculated Data

Querying Calculated Data retrieves data that is the result of performing specified calculations on raw data values in the archive.

NOTE: If you attempt to perform a calculated data query with two worksheets open, the Excel Add-In may become unstable and lock up. This is a known Microsoft Excel issue. To avoid locking up Excel while performing queries with the Excel Add-In, work with only one Excel document at a time.

To perform a query for calculated data:

1. Select Query Calculated Data from the Historian menu. The Historian Calculated Data Query dialog box appears.

30

Page 36: Excel Add In

Using the Historian Excel Add-In

2. Select a server from the drop-down list. If you do not specify a server, the Add-In queries the default server. To set the selected server as default, ensure the Set Server to Default option is enabled.

3. Select a tag or group of tags on your worksheet and, while they are selected, click in the Tag Name field of the dialog box. This enters the tagnames for you automatically.

4. In the Query Time section, enter values of time in the Start Time and End Time fields.

5. In the Sampling Type section, select a type from the drop-down list. The following types are available:

• Interpolated Sampling – calculates values between two data points using a linear interpolation algorithm.

• Calculated Sampling – computes values using an algorithm selected in the Calculation field.

• Lab Sampling – computes intermediate values between two data points by using the last actual value. This type of sampling displays as a stair step type of curve.

• Trend Sampling – determines the raw minimum and raw maximum value for each specified interval. Use the Trend sampling mode to maximize performance when retrieving data points for plotting.

6. The Calculation Field is active only after you select Calculated Sampling as the Sample Type. Select a Calculation Algorithm type

31

Page 37: Excel Add In

Proficy Historian Excel Add-In

from the drop-down list. The following types are available:

• Average – a time weighted arithmetic mean.

• Minimum – the lowest value in the group.

• Maximum – the highest value in the group.

• Standard Deviation – the square root of the arithmetic mean of deviations from the time-weighted arithmetic mean of all values in the group.

• Total – the time-weighted total of all values in the group. Note that Engineering Units are assumed to be in Units/Day. If your Engineering Units were not measured in Units/Day, you must scale your total to the actual time units of the measurement. For example, if the measurement were in Units/Minute (such as GPM), you would multiply the total number by 1440 (minutes in a day) to scale the value into the correct time units.

• Count – the total number of values in the group.

• Raw Average – the unweighted arithmetic mean of all values in the group.

• Raw Standard Deviation – the square root of the arithmetic mean of deviations from the unweighted arithmetic mean of all values in the group.

• Raw Total – the unweighted total of all values in the group.

32

Page 38: Excel Add In

Using the Historian Excel Add-In

• Time of Minimum Value – the time at which the minimum value occurred.

• Time of Maximum Value – the time at which the maximum value occurred.

• TimeGood – the amount of time (in milliseconds) during the interval when the data quality is good.

7. In the Sampling Interval section, select either the By Interval or By Samples option.

• The By Interval option displays two entry fields, Interval and Time Unit. Enter values in both. For example, to sample at 10 minute intervals, enter 10 in the interval field and select Minutes in the Time Unit field.

• The By Samples option displays a Number of Samples field. To specify a number of samples for the data query, enter a number in this field. For example, to query 100 samples, enter 100 in this field.

8. In the Output Display field, select one or more parameters for the output. Click a name to select it. To select multiple individual tags, press the Control key and click the tagnames. To select a sequence of tags, press the Shift key and click the first and last tagname of the sequence.

9. Click in the Output Range field and select a range of cells in a single row or column to determine where the returned data is placed.

33

Page 39: Excel Add In

Proficy Historian Excel Add-In

10. Select either Columns or Rows for the output display. Selecting Columns displays a table of values with parameters arranged in columns with header labels at the top. Selecting Rows rotates the table 90 degrees.

NOTE: When selecting multiple tags, the orientation of the return data is based on the orientation of the selected tags and the Row/Col selection is ignored.

11. Select either Ascending or Descending to set the order of the retrieved data in either ascending or descending time order.

12. Click OK to initiate the query. Click Cancel to abort the operation and close the dialog.

Exporting Tags

The Export Tags function permits you to send tag information from the Historian Server to an Excel worksheet or to another system, which may be either local or remote.

NOTE: Before importing or exporting tags, data, or messages, you should be aware of a convention used with the Historian application. The Server is the reference point for all import and export functions, as illustrated in the following figure. If you want to move tag information from the Server into your worksheet, you must use the Export Tags command. Conversely, if you

34

Page 40: Excel Add In

Using the Historian Excel Add-In

want to move data from your worksheet to the server, you must use the Import Data command.

It is recommended that you first export a tag and then import it, to become familiar with the procedure and what the data looks like.

Import/Export Reference Convention

To export a tag or tags from the Historian:

1. Select Administration and then select Export Tags from the Historian menu. The Export Tags from Historian dialog box appears.

2. Select a server from the drop-down list. If you do not select a server, the Add-In uses the default server.

3. In the Filter Criteria section, enter the name of the tag you want to

35

Page 41: Excel Add In

Proficy Historian Excel Add-In

export or, as an alternative, enter a mask for selecting a group of tags. If you do not enter a tagname, the filter uses other criteria for selecting tags. If you do not enter any criteria, the filter returns all tags.

If you prefer, you can enter a tag description and/or a description mask instead of a tagname or tag mask.

NOTE: You cannot export multiple tags when tagnames are read from multiple cells. If you specify a range of tagnames to read from multiple cells in the Tag Mask or Tag Name(s) fields, only the first tag in the range will be exported.

4. Enter a collector name in the Collector field. This entry is optional.

5. Select a data type from the drop-down list in the Data Type field. If you do not select a data type, or if you select a data type that does not match the other entries you have made, the filter uses other criteria.

6. Select one or more field names from the list in the right hand window. To select a single item, click the name of the field. To select multiple individual tags, press the Control key and click the tagnames. To select a sequence of tags, press the Shift key and click the first and last tagname of the sequence.

NOTE: Always include Tagnames in the list of fields to export.

7. In the Export Options section, select either the To New Worksheet, To CSV File, or To XML option. If you select either the CSV or XML option, you must also enter a path and filename for the destination file.

36

Page 42: Excel Add In

Using the Historian Excel Add-In

8. Click OK to execute the Export Tag function. Click Cancel to cancel and close the dialog box.

When the export function finishes, a dialog box appears within a display of the worksheet containing the exported tags. Click OK to acknowledge the operation and close the dialog box.

Importing Tags

The Import Tags function permits you to move tag information into the Historian Server from an Excel Worksheet or from another system, which may be either local or remote.

When used with the Excel Add-In, the Import Tags function moves selected information from your current worksheet into the specified Historian Server.

There is no error checking when you import tags through the Excel Add-In. For example, with the Excel Add-In you can successfully import unsolicited tags without a calculation dependency (trigger). The Historian Administrator prevents you from performing this import, however. As another example, the Excel Add-In allows you to import circular references, while the Historian Administrator does not.

37

Page 43: Excel Add In

Proficy Historian Excel Add-In

To import a tag or tags:

1. Select Administration and then select Import Tags from the Historian menu. A message box appears.

2. Click Yes to initiate the operation.

If successful, a dialog box appears confirming completion of the import function. Click OK to close the dialog box. If errors on the import occur, a dialog box appears detailing the issues encountered during the import. If any error occurred with any line of the import, the whole import is aborted.

NOTE: If you export all fields and attempt to import the read-only fields LastModified and LastModifiedUser, you may receive an Import failed, Error with Import Header message. Try exporting the tags again (not selecting the read-only fields) and importing.

Adding New Tags or Modifying Tag Parameters

You can use the Excel Add-In to add tags to your Historian system or to modify parameters for existing tags. For example, you can generate and define new tags either automatically or manually in an Excel worksheet and then import them in bulk to the Historian system. This can be a very convenient mechanism when you are working with large numbers of tags.

38

Page 44: Excel Add In

Using the Historian Excel Add-In

If any conflicting names or parameters occur, the system displays a warning message to alert you to the problem. You can then eliminate the conflict and try again.

You can also modify tag parameters by editing them in the worksheet and then bulk importing them into Historian.

To add tags using the Historian Excel Add-In:

1. Build a tag worksheet in Excel using macros or any other tools you are familiar with. Since Historian requires information about each tag that varies with the type of tag selected, verify that you have included all required information in the worksheet before attempting to import it into Historian. To determine what specific tag information is required, refer to the documentation provided with your SCADA application.

2. Use the Import Tags command to bulk import this information into your Historian application.

NOTE: If any errors on the import occur, a dialog appears detailing the issues encountered during the import. If any error occurred with any line of the import, the whole import is aborted.

39

Page 45: Excel Add In

Proficy Historian Excel Add-In

Deleting Tags

You cannot use the Excel Add-In to delete tags from your Historian system. For more information on deleting tags, refer to the Deleting a Tag section of the Using the Historian Administrator manual.

Exporting Data

The Export Data function allows you to move values from the Historian Server to your Excel worksheet or to another system in the same way you move tag information with Export Tags.

NOTE: Before importing or exporting tags, data, or messages, you should be aware of a convention used with the Historian application. The Server is the reference point for all import and export functions. If you want to move tag information from the Server into your worksheet, you must use the Export Tags command. Conversely, if you want to move data from your worksheet to the server, you must use the Import Data command.

To export data from the Server into your Worksheet:

1. Select Administration and then select Export Raw Data from the Historian menu. The Export Data from Historian dialog box appears.

2. If you want to specify a server, select a server from the drop down

40

Page 46: Excel Add In

Using the Historian Excel Add-In

list. If you do not specify a server, the Add-In uses the default server.

3. Select a tag or group of tags on your worksheet and, while they are selected, click in the Tag Name field of the dialog box. This enters the tagnames for you automatically.

4. In the Query Time section enter values of time in the Start Time and End Time fields.

5. In the Sampling Type section, select a type from the drop-down list.

6. The Calculation field is active only after you select Calculated Sampling as the Sample Type. Select a Calculation Algorithm type from the drop-down list.

7. In the Sampling Interval section, select either the By Interval or By Samples option.

The By Interval option displays two entry fields, Interval and Time Unit. Enter values in both. For example, to sample at 10 minute intervals, enter 10 in the interval field and select Minutes in the Time Unit field.

The By Samples option displays a Number of Samples field. To specify a number of samples for the data query, enter a number in this field. For example, to query 100 samples, enter 100 in this field.

8. In the Filter Definition section, enter filter parameters in the fields for Filter Tag, Filter Comparison, Include Date Where Value Is Equal To, and Include Times. These fields are optional. If you do

41

Page 47: Excel Add In

Proficy Historian Excel Add-In

not enter any values, the query returns all values without filtering.

9. In the Fields To Export section, select one or more fields. To select multiple individual tags, press the Control key and click the tagnames. To select a sequence of tags, press the Shift key and click the first and last tagname of the sequence.

10. In the Export Options section, select one of three options: To New Worksheet, To CSV File, or To XML File.

11. If you select To CSV File or To XML File, you must enter a file name and path for the new file in the File Name field.

12. Click OK to initiate the export. Click Cancel to abort the operation and close the dialog.

Importing Data

The Import Data command is the converse of the Export Data command. It moves selected information from your current worksheet into the specified Server in the same way the Import Tags command functions.

NOTE: If you use the Active Hours setting while importing data using the Excel Add-In, note that if the first tags imported are not within the Active Hours settings, no subsequent tags will be returned on that import (even if they are within the set active hours).

42

Page 48: Excel Add In

Using the Historian Excel Add-In

To import data to the Server from your worksheet:

1. Select Administration and then select Import Data from the Historian menu. A message box appears.

2. Click Yes to initiate the operation. If successful, a dialog box appears confirming the completion of the import function. Click OK to close the dialog box.

If errors occur on the import, a dialog box appears detailing the issues encountered in the import. If an error occurs in any line of the import, the whole import is aborted.

Searching Messages

The Search Messages function lets you search the archives for selected types of messages generated during a specific time period and to display selected fields from those messages. This puts a dynamic formula in the worksheet. Dynamic formulas allow you to build a dynamic message report that you can build, save, and re-use.

To search for messages:

1. Select Administration and then select Search Messages from the Historian menu. The Historian Message Search dialog appears.

43

Page 49: Excel Add In

Proficy Historian Excel Add-In

2. Select a server from the drop-down list. If you do not specify a server, the Add-In uses the default server.

3. In the Topic field, select one of six types of messages from the drop-down list.

4. In the Query Times fields, enter values for start time and end time.

5. In the Search String section, enter a search string for scanning the text of messages. You do not need to enter *’s for wildcards.

6. In the Output Display section, select one or more parameters for the output display. Click a name to select it. To select multiple individual tags, press the Control key and click the tagnames. To select a sequence of tags, press the Shift key and click the first and last tagname of the sequence.

7. Click in the Output Range field and select a range of cells in a single row or column to determine where the returned data is placed.

8. Select Asc or Desc to sort the messages in ascending or descending order.

9. Select either Columns or Rows for the output display. Selecting Columns displays a table of values with parameters arranged in columns with header labels at the top. Selecting Rows rotates the table 90 degrees.

NOTE: When selecting multiple tags, the orientation of the return data is based on the orientation of the selected tags and the Row/Col selection is ignored.

44

Page 50: Excel Add In

Using the Historian Excel Add-In

1. Click OK to execute the search. Click Cancel to close the dialog box.

Exporting Messages

The Exporting Messages function lets you find messages and export them from the server to your worksheet or to a CSV or XML file. You can specify the server and select the messages to be exported by specifying a start time, an end time, or a text string, using standard wildcards, where applicable. You can also select which fields of the messages are exported, such as time stamp, topic, message string, message number, substitutions, or username.

To export a message:

1. Select Administration and then select Export Messages from the Historian menu. The Export Messages From Historian dialog box appears.

2. Select a server from the drop-down list. If you do not specify a server, the Add-In uses the default server.

3. In the Topic field, select one of six types of messages from the drop-down list.

4. In the optional Filter Criteria fields, enter values for start time, end

45

Page 51: Excel Add In

Proficy Historian Excel Add-In

time, and search text string in the appropriate fields.

5. In the Fields to Export section, select one or more field names from the displayed list. To select multiple individual tags, press the Control key and click the tagnames. To select a sequence of tags, press the Shift key and click the first and last tagname of the sequence.

6. In the Export Options section, select one of three options:

o To New Worksheet

o To CSV File

o To XML File.

If you select To CSV File or To XML File, you must enter a file name and path for the new file in the File Name field.

7. Click OK to initiate the export. Click Cancel to abort the operation.

Importing Messages

The Importing Messages command writes all messages from the worksheet into the server. When you initiate the import function, a dialog box asks if you want to import messages from your worksheet into a specified server. If you reply Yes, it scans your worksheet for messages, writes them to the server, and notifies you that the operation succeeded or failed.

46

Page 52: Excel Add In

Using the Historian Excel Add-In

If you choose to export messages from Historian into Excel and then import the messages back into the Historian, note that the Importing Messages function only allows you to add messages to the Historian Server. It does not allow you to modify or remove any existing messages.

To import a message into the server from your worksheet:

1. Select Administration and then select Import Messages from the Historian menu. A message box appears.

2. Click Yes to execute the import. A dialog box appears when the operation is complete. Click OK to close the dialog box.

If errors occur in the import, a dialog box appears detailing the issues encountered in the import. If an error occurs in any line of the import, the whole import is aborted.

Listing Archives

The List Archive function returns a list of selected statistics about an archive file. You can specify the server, the archive file name, and the type of information displayed, such as start time, end time, file name, target file size, current file size, current or read-only status, last backup time, and last backup users. You can also specify a range of cells for the display.

47

Page 53: Excel Add In

Proficy Historian Excel Add-In

To display a list of archives:

1. Select Administration and then select List Archives from the Historian menu. The Historian Archive List dialog box appears.

2. Select a server from the drop-down list. If you do not specify a server, the Add-In uses the default server.

3. In the Archive name field, enter an archive name. Do not use wild cards in this field.

4. In the Output Display section, select one or more parameters for the output display. To select multiple individual tags, press the Control key and click the tagnames. To select a sequence of tags, press the Shift key and click the first and last tagname of the sequence.

NOTE: The List Archives Query sorts by archive start time. The archive list will be sorted based on start time whether this field is selected or not.

5. Click in the Output Range field and select a range of cells in a single row or column to determine where the returned data is placed.

6. Select Asc or Desc to sort the archives in ascending or descending order.

7. Select either Columns or Rows for the output display. Selecting Columns displays a table of values with parameters arranged in columns with header labels at the top. Selecting Rows rotates the table 90 degrees.

NOTE: When selecting multiple tags, the orientation of the return data is based on the orientation of the selected tags and the Row/Col selection is

48

Page 54: Excel Add In

Using the Historian Excel Add-In

ignored.

8. Click OK to execute the search. Click Cancel to close the dialog box.

TIP: To return details for more than one item, specify a substring in the Archive Name field that exists in each archive you want listed. For example, if you had archives Hero5_Archive0001 -010, you could specify the substring Hero5_Archive to return the details for all those archives. Ensure that your selected output range allows for all the archives to be listed or only the number rows/columns specified in the output range will be filled in.

Listing Collectors

The List Collectors function returns a list of selected statistics about a collector. You can specify the server, the collector name, and select the type of information displayed. You can also specify the range of cells for the display.

To display a list of Collectors:

1. Select Administration and then select List Collectors from the Historian menu. The Historian Collector List dialog box appears.

2. Select a server from the drop-down list. If you do not specify a

49

Page 55: Excel Add In

Proficy Historian Excel Add-In

server, the Add-In uses the default server.

3. In the Collector name field, enter a Collector name. Do not use wild cards in this field.

4. In the Output Display section, select one or more parameters for the output display. To select multiple individual tags, press the Control key and click the tagnames. To select a sequence of tags, press the Shift key and click the first and last tagname of the sequence.

5. Click in the Output Range field and select a range of cells in a single row or column to determine where the returned data is placed.

6. Select Asc or Desc to sort the messages in ascending or descending order.

7. Select either Columns or Rows for the output display. Selecting Columns displays a table of values with parameters arranged in columns with header labels at the top. Selecting Rows rotates the table 90 degrees.

NOTE: When selecting multiple tags, the orientation of the return data is based on the orientation of the selected tags and the Row/Col selection is ignored.

8. Click OK to execute the search. Click Cancel to close the dialog box.

TIP: To return details for more than one item, specify a substring in the Collector Name field that exists in each collector you want listed. For example, if you had collectors Hero5_Collector0001 -010, you could specify

50

Page 56: Excel Add In

Using the Historian Excel Add-In

the substring "Hero5_Collector" to return the details for all those collectors. Ensure that your selected output range allows for all the collectors to be listed or only the number rows/columns specified in the output range will be filled in.

Working with Alarm and Event Data

For more information on working with alarm and event data in the Excel Add-In, refer to the Excel Add-In and Historian Alarms and Events

Defining Reports

The ability to generate a wide range of custom reports is a major benefit of using the Historian Excel Add-In. Using this versatile tool, you can use all the standard, familiar Excel tools and techniques to access the Historian archives and build reports and charts of all types to fit your specific needs.

If you want, you can use the sample reports included with Historian almost as is — just change the tags to fit your application. As an alternative, use the setup worksheets as a starting point and adapt them to your particular situation.

51

Page 57: Excel Add In

Proficy Historian Excel Add-In

Building Dynamic Reports

You can define a report so that Excel recalculates the worksheet whenever the contents of specific cells, such as start times or dates, change. In this way, the report generates a dynamic snapshot of process performance, updated regularly in real time. You can also, of course, manually initiate recalculation at any time.

The primary rule to follow in building a dynamic report is to use formulas with cell references that contain variable information rather than fixed data, so that recalculation produces new data each time it occurs. You then initiate recalculation by changing certain inputs manually or automatically.

Sharing Excel Reports

You can share any Excel reports you develop with the Historian Excel Add-In as you would any other Excel workbook. Each client using the worksheets, however, must have the Historian Excel Add-In installed and enabled inside Excel.

52

Page 58: Excel Add In

Using the Historian Excel Add-In

Using the Sample Reports

Using the Sample Reports

The Historian application includes three typical sample reports. These reports clearly demonstrate the power and ease-of-use of the Excel Add-In. Use them directly in your application or modify them to fit your requirements.

NOTE: This manual contains hypertext links that open the provided Historian Sample Reports directly in Excel. If you did not install the Excel Add-In, moved the Sample Reports from the Sample directory, or moved the Historian.chm file from its installed location, you will receive an error when you click on these links and will be unable to take advantage of this functionality.

The three sample Excel reports are built using tags from the Simulation Collector. You must have the Simulation Collector installed on a machine and collecting data to the Historian Server in order for these reports to work. The Historian Batch Report Sample.xls file also uses Batch ID and Product ID tags from the Simulation Collector. These are Simulation Collector points that are configured to store string data types. To ensure that the sample reports work correctly, you must add the string tags. These are the last 5 tags in the tag collector list. Add the string tags in the Historian Administrator by browsing the Simulation Collector and adding all of the tags by selecting the Add All Tags check box. Alternatively, you can run the Add Tags to Simulation Collector.bat batch file in the Historian\Server directory of the

53

Page 59: Excel Add In

Proficy Historian Excel Add-In

machine that has the Simulation Collector.

In addition, when you first install the Simulation Collector it prompts you for the number of simulation tags it should create (but you must still add the tags for collection using one of the two methods above). The default is 1000. Do not make this value less than 30.

When opening a Sample Excel report, you may receive a message prompting you to update all linked information in the workbook (Yes) or keep the existing information (No). It is recommended that you select No and keep the existing information. The links will be automatically updated for your worksheet. Save your worksheet after the links have been updated.

Sample Report 1 — Historian Statistical Analysis

This report, illustrated in the following figure, calculates, for a specified time period, a number of statistical properties of a tag, such as average, maximum, minimum, standard deviation, 2 sigma and 3 sigma control limits, and correlation coefficients for other tags. It displays charts of various types for several of these variables.

Click to Open the Historian Statistical Analysis Sample Report in Excel.

54

Page 60: Excel Add In

Using the Historian Excel Add-In

Sample Report 1 — Historian Statistical Analysis

The chart at the lower left is a plot of the main variable vs. time with sigma control limits indicated by the straight lines. The two charts to the right are scatter diagrams that show the correlation between the main variable and two other variables. The chart at the top right is a histogram of data values of the main variable that shows how the data points are distributed.

55

Page 61: Excel Add In

Proficy Historian Excel Add-In

The following figure shows the worksheet associated with the sample report that contains the data used to generate the report.

Sample Report 1 — Data Values

56

Page 62: Excel Add In

Using the Historian Excel Add-In

Sample Report 2 — Daily Report

This sample report, shown in the following figure, shows how the measured values and selected statistical properties of specified tags have varied during the previous 24-hour period. This sample is an example of a typical daily performance report in an industrial plant.

Click to Open the Historian Daily Report Values Sample Report in Excel.

57

Page 63: Excel Add In

Proficy Historian Excel Add-In

Sample Report 2 — Daily Report Values

The report shown in the following figure is a collection of chart plots of the data displayed in the report of the previous figure.

58

Page 64: Excel Add In

Using the Historian Excel Add-In

Sample Report 2 — Daily Report Charts

The following figure shows the worksheet used to set up the Daily Sample Report. Edit the worksheet to adapt this report to your application.

59

Page 65: Excel Add In

Proficy Historian Excel Add-In

Sample Report 2 — Daily Report Setup Worksheet

Sample Report 3 — Batch Report

The sample report shown in the following figure is an example of a report that might be used with a batch type of industrial process. The table at the top

60

Page 66: Excel Add In

Using the Historian Excel Add-In

of the report shows the batch identification, the start and end times, product name, and computed statistics for several process variables. The charts show how selected process parameters varied during the batch cycle.

Click to Open the Historian Batch Report Sample in Excel.

Sample Report 3 — Batch Report

61

Page 67: Excel Add In

Proficy Historian Excel Add-In

The following figure shows the configuration worksheet used to generate the report shown in the previous figure. Edit this worksheet to adapt it to your requirements.

Sample Report 3 — Batch Report Setup Worksheet

62

Page 68: Excel Add In

Using the Historian Excel Add-In

Troubleshooting the Excel Add-In Sample Reports

If you follow the recommended installation procedures, you should not have any difficulty in running the Sample Reports. If you do encounter any problems, they are likely to relate to the locations of files and the links to those files.

When opening a Sample Excel report, you may receive a message prompting you to update all linked information in the workbook (Yes) or keep the existing information (No). Intellution recommends that you select No and keep the existing information. The links will be automatically updated for your worksheet. Save your worksheet after the links have been updated.

For problems in the worksheets themselves, refer to Excel online Help for assistance.

Running a Report Using Visual Basic

The following Visual Basic example shows you how to create a hidden instance of Microsoft Excel, open a preconfigured Historian report in that instance, and then print the report to the default printer. If you want to use the following example, you need to modify the path of the .XLA and .XLS files. The paths that you need to edit are bolded in the following example.

To use this example, a user must have the privileges to run the collector as a Windows service in Windows and a default printer must be installed. If

63

Page 69: Excel Add In

Proficy Historian Excel Add-In

Historian security is enabled, the user must have iH Readers membership. Tag level security can override this privilege.

You can trigger this example to run on an event basis or on a polled basis. Most likely, you would run this example on an event basis. However, you could run it on a polled basis through the Windows Task Scheduler. Sub CreateExcelObjects()

Dim xlApp As Excel.Application

Dim wkbNewBook As Excel.Workbook

Dim wksSheet As Excel.Worksheet

Dim strBookName As String

' Create new hidden instance of Excel.

Set xlApp = New Excel.Application

' Open the preconfigured Historian Excel Add-in report.

Workbooks.Open "C:\Program Files\Microsoft Office\Office10\Library\iHistorian.xla"

Set wkbNewBook = Workbooks.Open("c:\testih.xls", 0, False)

'xlApp.Visible = True

With wkbNewBook

For Each wksSheet In .Worksheets

Select Case wksSheet.Name

Case "tag1"

wksSheet.Select

.RefreshAll

.PrintOut

64

Page 70: Excel Add In

Using the Historian Excel Add-In

End Select

Next wksSheet

.Close False

End With

Set wkbNewBook = Nothing

xlApp.Quit

Set xlApp = Nothing

End Sub

Array Formulas for the Historian Excel Add-In

In Microsoft Excel, an array formula is a data request that inputs a set of parameters and returns a result or list of results. The Historian Excel Add-In uses the following array formulas: ihSearchTags(pServer,pTagMask,pDescriptionMask,pCollector,pArraySize,

pSort,pRowCol,Parameters())

ihQueryData(pServer,pTagName,pStartTime,pEndTime,pSamplingMode,pCalculationMode,pSamplingInterval,pNumberOfSamples,pDirection,pFilterTag,pFilterMode,pFilterComparisonMode,pFilterComparisonValue,pArraySize,pSort,pRowCol,Parameters())

ihQueryMessages(pServer,pTopic,pStartTime,pEndTime,pSearchText,pArraySize,pSort,pRowCol,Parameters())

ihListArchives(pServer,pArchiveNameMask,pArraySize,pSort,pRowCol,Parameters())

65

Page 71: Excel Add In

Proficy Historian Excel Add-In

ihListCollectors(pServer,pCollectorNameMask,pArraySize,pSort,pRowCol,Parameters())

When inserting an array formula, you cannot overwrite part of the range of another array formula in your worksheet. The range includes cells without data displayed. An error message appears if you try to do so. Reselect a different output range to insert the formula.

Description of Array Formula Parameters

The following table describes the parameters for the array formulas for the Historian Excel Add-In.

Descriptions of Array Formula Parameters

Parameter Description

pArchiveNameMask A search mask you can use to browse the archivers. Use standard Windows wildcard characters.

pArraySize The number of cells that the array spans.

pCalculationMode The type of calculation mode. See the Calculation Modes section in the Getting Started with Historian guide for a complete

66

Page 72: Excel Add In

Using the Historian Excel Add-In

list.

pCollector The collector or collector mask that you want to query.

pCollectorNameMask A search mask for browsing collectors. Use standard Windows wildcard characters.

pDescriptionMask A search mask for browsing tag descriptions. Use standard Windows wildcard characters.

pDirection The direction (forward or backward from the start time) of data sampling from the archive.

pEndTime The end time used to refine your query.

pFilterComparisonMode The type of comparison to be made on the filter comparison value:

• Equal – Filter condition is True when the FilterTag is equal to the comparison value.

• EqualFirst – Filter condition is True when the FilterTag is equal to the first

67

Page 73: Excel Add In

Proficy Historian Excel Add-In

comparison value.

• EqualLast – Filter condition is True when the FilterTag is equal to the last comparison value.

• NotEqual – Filter condition is True when the FilterTag is NOT equal to the comparison value.

• LessThan – Filter condition is True when the FilterTag is less than the comparison value.

• GreaterThan – Filter condition is True when the FilterTag is greater than the comparison value.

• LessThanEqual – Filter condition is True when the FilterTag is less than or equal to the comparison value.

• GreaterThanEqual – Filter condition is True when the FilterTag is greater than or equal to the comparison value.

The FilterComparisonMode defines how archive values for the FilterTag should be compared to the FilterValue to establish the state of the filter condition. If a FilterTag and FilterComparisonValue are supplied, time

68

Page 74: Excel Add In

Using the Historian Excel Add-In

periods are filtered from the results where the filter condition is False.

pFilterComparisonValue The value to compare the filter tag with when applying the appropriate filter to the DataRecordset query (to determine the appropriate filter times).

pFilterMode The type of time filter:

• ExactTime – Retrieves data for the exact times that the filter condition is True (only True).

• BeforeTime – Retrieves data from the time of the last False filter condition up until the time of the True condition (False until True).

• AfterTime – Retrieves data from the time of the True filter condition up until the time of next False condition (True until False).

• BeforeAndAfterTime – Retrieves data from the time of the last False filter condition up until the time of next False condition (While True).

69

Page 75: Excel Add In

Proficy Historian Excel Add-In

The FilterMode defines how time periods before and after transitions in the filter condition should be handled.

For example, AfterTime indicates that the filter condition should be True starting at the timestamp of the archive value that triggered the True condition and leading up to the timestamp of the archive value that triggered the False condition.

pFilterTag The single tagname used when applying the filter criteria. Entering a tag for this parameter indicates that you want to perform a filtered data query. The other filter fields are disregarded unless you specify a filter tag.

pNumberOfSamples Number of samples from the archive to retrieve.

Samples will be evenly spaced within the time range defined by start time and end time for most sampling modes. For the RawByNumber sampling mode, the NumberOfSamples column determines the maximum number of values to retrieve. For the RawByTime sampling mode, the NumberOfSamples is ignored.

70

Page 76: Excel Add In

Using the Historian Excel Add-In

pRowCol The sorting criteria used: 0 for Columns and 1 for Rows.

pSamplingInterval For non-raw sampled data, this column represents a positive integer for the time interval (in milliseconds) between returned samples.

pSamplingMode The type of sampling mode used by the query. See the Sampling Modes section in the Getting Started with Historian guide for a complete list.

pSearchText The text or mask that you want to search for in the message.

pServer Name of the server on which you are retrieving data. If you are running Excel on the same server that you are retrieving data from, you do not have to enter a string, as the default server is used.

pSort The sorting criteria used for the rows or columns: 0 for Descending and 1 for Ascending.

71

Page 77: Excel Add In

Proficy Historian Excel Add-In

pStartTime The start time used to refine your query.

pTagMask A search mask for browsing tagnames. Use standard Windows wildcard characters.

pTagName The tagname or tagname mask that you want to query.

pTopic The message topic:

• Connections

• Configuration

• General

• Services

• Performance

• Security

Parameters() Output display of the array formula. This field can include be one or more parameters.

72

Page 78: Excel Add In

Using the Historian Excel Add-In

Editing an Array Formula in Microsoft Excel

To edit an array formula in Microsoft Excel:

1. Click on the cell in the spreadsheet that contains the array formula.

2. Click in the formula bar at the top of the screen.

3. Edit the formula that appears in this bar.

4. Press Ctrl+Shift+Enter.

5. Select Save from the File menu.

NOTE: To exit a formula array without editing it, press the Esc key.

73

Page 79: Excel Add In

Proficy Historian Excel Add-In

Troubleshooting the Excel Add-In This chapter contains troubleshooting information for using the Excel Add-In with Historian. In particular, it describes what to do if an error occurs with any of the following:

• General imports

• Tag imports

• Data imports

• Data or tag exports

Troubleshooting General Imports

If you experience problems with general imports and want to resolve them, check the following:

• Review the HistorianSDKErrors.log in Notepad or another text editor. This file is usually located in the LogFiles folder in your Historian program folder. Historian records additional information for some errors in this file. Sometimes, by reviewing this file you can determine the cause of the error.

• If using Historian security, verify that the user has the appropriate security rights. If the rights are incorrect, log in as a user with the

74

Page 80: Excel Add In

Using the Historian Excel Add-In

correct privileges or change the rights for the current user.

• Verify that no empty rows appear between valid rows in your spreadsheet. These empty rows can cause issues.

• Note if any errors occur. If an error occurs with any line of the import, Historian aborts the whole import.

Troubleshooting Tag Imports

If you experience problems with tag imports and want to resolve them, check the following:

• If you remove or add Historian Servers and attempt to Search for tags, the Historian Excel Add-In may not recognize the default server and may display a message stating that the default server has not been set. To correct this, close and reopen the Search Tags dialog box.

• Make sure that you are not trying to import the Calculation Execution Time, Last Modified, or Last Modified User fields for each tag. These fields are read-only. As such, you can export them but can not import them.

• Check that your collector does not contain any duplicate tagnames. Duplicate tagnames will cause errors to occur.

• Verify that the number of tags that you want to import does not exceed the maximum licensed tag count. If it does, you will not be

75

Page 81: Excel Add In

Proficy Historian Excel Add-In

able to import the tags.

Troubleshooting Data Imports

If you experience problems with a data import and want to resolve them, try the following steps:

• Ensure that the time stamps of any online archives are not prior to the start time of the oldest online archive.

• Ensure that the time stamps are within the active hours setting in the Archive Maintenance screen of the Historian Administrator.

• Ensure that the time stamps are not for a time greater than 15 minutes ahead of the system time on the Historian Server.

• Ensure that the tags are valid Historian tags. To do this, import your tags before importing their associated data.

Troubleshooting Data or Tag Exports

You cannot export data or tags to a remote path using the Historian Excel Add-In.

76

Page 82: Excel Add In

Index

77

Index

adding new tags 38

conventions

255 character limit 3

256 maximum number of columns 3

avoiding circular references 3

no right and left arrow keys 3

recalculation 3

rows or columns 3

selecting multiple attributes 3

selection of tags, times, and events 3

specifying an output cell 3

specifying an output range 3

understanding 3

conventions 3

deleting tags 39

Excel Add-In

troubleshooting 63

Excel Add-In 63

exporting data 40

exporting messages 45

exporting tags 34

importing

data 42

messages 46

tags 37

importing 37

installing the Excel add-in 6

listing archives 47

Page 83: Excel Add In

Proficy Historian Excel Add-In

listing collectors 49

modifying tag parameters 38

options

adjust column widths 10

assign default server 10

automatically update links 10

internal vs. external references 10

selecting 10

show/don' t show header labels 10

options 10

querying calculated data 30

querying current values 17

querying filtered data 21

querying raw data 19

reference documents 1

Reports

building dynamic reports 52

defining 51

sharing reports 52

using the sample reports 53

Reports 53

Sample reports

daily report 56

statistical analysis 54

Sample reports 54

searching messages 43

searching tags 14

tags

searching for 14

troubleshooting

Excel Add-In 63

troubleshooting 63

understanding Excel add-in conventions 3

78


Recommended