Connect to a Wonderware Historian database
Configure a connection to a Wonderware Historian database in order to save historical data.
Before you begin this task, you should have the address or host name of the Wonderware Historian database server, as well as appropriate credentials (i.e., user name and password) to access that database. You must also have a task worksheet (e.g., a Trend worksheet) open for editing.
To configure the connection to a Wonderware Historian database:
- In the header of the task worksheet, make sure Wonderware Historian is selected as the history format, and then click Historian Configuration. The Wonderware Historian dialog box is displayed.
Figure 1. Wonderware Historian dialog box
- In the Server box, type the host name or IP address and port number of the Historian database server. For example, HistorianDBServer:123. The port number is optional. If you did not change the port number in the Historian database settings, you can omit it here and the default (port 32568) will be used. Otherwise, the port number must match the one that is specified in the Historian database settings.
Also, you can configure a tag name in curly brackets (e.g., {MyServer}) in order to change this setting during run time. See “Reload” below.
- In the User and Password boxes, type your credentials to access the Historian database. You can configure a tag name in curly brackets for User (e.g., {MyUser}) in order to change this setting during run time. See “Reload” below.
- In the Prefix box, type a prefix that will be added to the tags saved in the Historian database in order to keep them grouped together. For example, if you are configuring the connection for Trend worksheet TREND001, you could make that the prefix as well. This setting is optional, but if you do not specify a prefix, the tags will be not be grouped together in the database and therefore might be difficult to find. Also, you can configure a tag name in curly brackets (e.g., {MyPrefix}) in order to change this setting during run time. See “Reload” below.
- Select the Enable store and forward check box if you want to store historical data when the connection is unavailable and then forward the stored data when the connection is restored. The historical data are saved in your project folder (on the project runtime server). Please note that this can consume a large amount of drive space if the connection is unavailable for a long time.
- In the Run-time group, in the Status box, type the name of a project tag (Integer type) that will receive codes describing the status of the connection during run time. This setting is optional.
- In the Run-time group, in the Reload box, type the name of a project tag that will trigger reloads of the connection settings. When the value of this tag changes, the connection settings above will be reloaded. For those settings, you can configure tag names in curly brackets (e.g., {MyServer}) in order to change the settings during run time. The connection to the Historian database is updated only when the settings are reloaded, and the settings are reloaded only when the value of the specified tag changes. This is to make sure that all of the settings are changed together rather than one at a time.
- In the Gateway group, in the Host and Port boxes, type the host name or IP address and port number of the ADO.NET database gateway (StADOSvr). The default value for Host is 127.0.0.1 (a.k.a. localhost), because the project runtime server and the database gateway are typically hosted on the same computer.
- Click OK to save the settings and close the dialog box.
- Download and install the framework (www.microsoft.com/download/details.aspx?id=17718); or
- Install and run the database gateway on another computer — perhaps the computer that hosts the Historian database server itself — and then change the Gateway settings above to specify that computer.
The first option might not be feasible if the computer is a Windows Embedded device; depending on how the device is configured and what version of Windows Embedded it runs, it might not be possible to install the framework separately. In many cases, the device’s OS image must be configured to include the framework, and that is typically done by the manufacturer of the device. Please consult the manufacturer’s documentation.
If you choose the second option, you must include the Historian client library (aahClientManaged.dll) in the same folder with the other database gateway files. For more information about how to install and run the database gateway on another computer, see Studio Database Gateway.