IHistorian Excel Add-In
IHistorian Excel Add-In
Excel Add-In
Proprietary Notice
The manual and software contain confidential information which represents trade secrets of GE Fanuc
International, Inc. and/or its suppliers, and may not be copied or disclosed except as provided in the license with
GE Fanuc International, Inc. The information in this manual is subject to change without notice and should not
be construed as a commitment by GE Fanuc International, Inc. GE Fanuc International, Inc. assumes no
responsibility for any errors that may be in this document.
2003 GE Fanuc International, Inc. ALL RIGHTS RESERVED.
Trademarks
2003 GE Fanuc International, Inc. All rights reserved. Microsoft is a registered trademark of Microsoft
Corporation. All other brands or names are property of their respective holders.
iHistorian Version 2.0 2.03
Contents
Why You Should Read This Manual ...................................................................................................v
1. Understanding the iHistorian Excel Add-In .................................................................................. 1
Understanding Excel Add-In Conventions ............................................................................... 2
Installing The Excel Add-in with iHistorian................................................................................ 3
2. Using the iHistorian Excel Add-In.................................................................................................. 5
Selecting Options ..................................................................................................................... 5
Searching Tags ........................................................................................................................ 7
Querying Current Values .......................................................................................................... 7
Querying Raw Data .................................................................................................................. 7
Querying Calculated Data ........................................................................................................ 8
Querying Filtered Data ........................................................................................................... 8
Exporting Tags ......................................................................................................................... 8
Importing Tags.......................................................................................................................... 9
Adding New Tags or Modifying Tag Parameters ...................................................................... 9
Deleting Tags ......................................................................................................................... 10
Exporting Data........................................................................................................................ 10
Importing Data ........................................................................................................................ 11
Searching Messages .............................................................................................................. 11
Exporting Messages ............................................................................................................... 11
Importing Messages ............................................................................................................... 11
Listing Archives ...................................................................................................................... 12
Listing Collectors .................................................................................................................... 12
Contents
iii
3. Defining Reports............................................................................................................................ 13
Building Dynamic Reports ...................................................................................................... 13
Sharing Excel Reports............................................................................................................ 13
Using the Sample Reports...................................................................................................... 13
Sample Report 1 iHistorian Statistical Analysis .................................................... 14
Sample Report 2 Daily Report .............................................................................. 16
Sample Report 3 Batch Report ............................................................................. 19
Troubleshooting the Excel Add-In Sample Reports .............................................................. 21
Running a Report Using Visual Basic..................................................................................... 22
Array Formulas for the iHistorian Excel Add-In ...................................................................... 23
Description of Array Formula Parameters ................................................................. 24
Editing an Array Formula in Microsoft Excel.............................................................. 28
4. Troubleshooting the Excel Add-In ............................................................................................... 29
Troubleshooting General Imports ........................................................................................... 29
Troubleshooting Tag Imports.................................................................................................. 30
Troubleshooting Data Imports ................................................................................................ 30
iv
Reference Documents
For related information about iHistorian, refer to the following documents:
vi
Import, export, and modify tags, data, and messages all with familiar Excel
commands, macros, and computational techniques.
A major benefit of using the Excel Add-In is the ability to add tags to iHistorian by
generating a tag worksheet using the standard Excel tools, editing the parameters, and
then bulk importing the information directly into iHistorian. Using similar
techniques, you can export tag parameters to Excel, make bulk changes, and then
import the changes back into iHistorian in a simple, straightforward procedure.
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:
Pressing the Shift key and clicking the ends of a contiguous range.
Specifying an Output Range determines how many data points are 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.
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.
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.
After you install the Excel Add-In, use the following procedure to activate the AddIn:
[1]
Open a new worksheet, select Add-Ins from the Tools menu. The Add-Ins
dialog box, shown in Figure 1-1, appears.
TIP: If the iHistorian Add-In is not listed, click the Browse button to locate the
iHistorian.xla file.
Selecting Options
To select options for running the Excel Add-In, select Options from the iHistorian
menu. The iHistorian Excel Add-In dialog box, shown in Figure 2-1, 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
This option lets you display or suppress the column header labels that
are automatically placed in the worksheet when entering formulas
throughout the iHistorian Dialogs. The default setting is Show Labels.
Color
Allows you to select the header name color from the drop-down list:
black, blue, red, green, magenta, cyan, or yellow.
This dialog box shows the current server assignment. You can modify
the setting by clicking the Edit button and accessing the iHistorian
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.
Field
Description
This option lets you automatically adjust the width of columns in your
worksheet as formulas are inserted by iHistorian 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.
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.
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 iHistorian menu, the iHistorian Tag Search dialog box
appears.
Once you have searched for tags, you need to select them to add them to the current
worksheet.
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.
Exporting Tags
The Export Tags function permits you to send tag information from the iHistorian
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 iHistorian application. The Server is the reference
point for all import and export functions, as illustrated in Figure 2-2. 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.
Intellution recommends that you first export a tag and then import it, to become
familiar with the procedure and what the data looks like.
Importing Tags
The Import Tags function permits you to move tag information into the iHistorian
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 iHistorian 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 iHistorian Administrator prevents you from
performing this import, however. As another example, the Excel Add-In allows you
to import circular references, while the iHistorian Administrator does not.
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 iHistorian.
To add tags using the iHistorian Excel Add-In:
[1]
Build a tag worksheet in Excel using macros or any other tools you are
familiar with. Since iHistorian 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 iHistorian. 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
iHistorian 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.
Deleting Tags
You cannot use the Excel Add-In to delete tags from your iHistorian system. For
more information on deleting tags, refer to the Deleting a Tag section of the Using the
iHistorian Administrator manual.
Exporting Data
The Export Data function allows you to move values from the iHistorian 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 iHistorian 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.
10
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.
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.
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.
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.
If you choose to export messages from iHistorian into Excel and then import the
messages back into the iHistorian, note that the Importing Messages function only
allows you to add messages to the iHistorian Server. It does not allow you to modify
or remove any existing messages.
11
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.
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 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 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.
12
3. Defining Reports
The ability to generate a wide range of custom reports is a major benefit of using the
iHistorian Excel Add-In. Using this versatile tool, you can use all the standard,
familiar Excel tools and techniques to access the iHistorian 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 iHistorian 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.
13
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 iHistorian Server in order for these reports to work. The iHistorian 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 iHistorian
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 iHistorian\Server directory of the 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). 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.
14
15
16
17
18
19
20
21
22
End With
Set wkbNewBook = Nothing
xlApp.Quit
Set xlApp = Nothing
End Sub
23
24
Parameter
Description
pArchiveNameMask
pArraySize
pCalculationMode
pCollector
pCollectorNameMask
pDescriptionMask
pDirection
pEndTime
Description
pFilterComparisonMode
25
Description
pFilterMode
26
Description
pNumberOfSamples
pRowCol
pSamplingInterval
pSamplingMode
pSearchText
pServer
pSort
pStartTime
pTagMask
pTagName
27
Description
pTopic
Parameters()
Connections
Configuration
General
Services
Performance
Security
Click on the cell in the spreadsheet that contains the array formula.
[2]
[3]
[4]
Press Ctrl+Shift+Enter.
[5]
NOTE: To exit a formula array without editing it, press the Esc key.
28
General imports
Tag imports
Data imports
If using iHistorian security, verify that the user has the appropriate security
rights. If the rights are incorrect, log in as user with the 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,
iHistorian aborts the whole import.
29
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 exceed the
maximum licensed tag count. If it does, you will not be able to import the
tags.
30
If any archives are online, ensure that the timestamps are not prior to the start
time of the oldest online archive.
Ensure that the timestamps are within the active hours setting in the Archive
Maintenance screen of the iHistorian Administrator.
Ensure that the timestamps are not for a time greater than 15 minutes ahead of
the system time on the iHistorian Server.
Ensure that the tags are valid iHistorian tags. To do this, import your tags
before importing their associated data.
Index
A
adding new tags
exporting data 10
exporting messages
exporting tags 8
11
C
conventions
255 character limit 3
256 maximum number of columns 3
avoiding circular references 2
no right and left arrow keys 3
recalculation 3
rows or columns 2
selecting multiple attributes 2
selection of tags, times, and events 2
specifying an output cell 2
specifying an output range 2
understanding 2
importing
data 11
messages 11
tags 9
installing the Excel add-in
L
listing archives 12
listing collectors 12
M
D
deleting tags
10
O
E
Excel Add-In
troubleshooting
21
options
adjust column widths 7
assign default server 6
automatically update links 6
internal vs. external references
selecting 5
show/don t show header labels
6
6
Index
31
Sample reports
daily report 16
statistical analysis 14
searching messages 11
searching tags 7
R
reference documents v
Reports
building dynamic reports
defining 13
sharing reports 13
using the sample reports
T
13
13
troubleshooting
Excel Add-In
21
U
understanding Excel add-in conventions
32