> For the complete documentation index, see [llms.txt](https://help.qtech.co.nz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.qtech.co.nz/datran/datran-vi-scada/datran-opc-da/opc-server.md).

# Set up the DATRAN OPC Server

Turn on DATRAN's XML service, install the DATRAN OPC Server, register it with iFIX or InTouch, and move tags from DDE to OPC.

The DATRAN OPC Server (DATRAN OPC I/O Driver Server, OPC server name `Intellution.DVIOPC`) is used as an interface for 3rd party applications using OPC clients to communicate with Datran. The OPC Server communicates with DATRAN using named pipes to the XDI service (XML Data Interface).

{% hint style="info" %}
**Applies to:** the DATRAN OPC Server Interface, user manual v1.07. The [DATRAN OPC-UA Server](https://help.qtech.co.nz/datran/datran-vi-scada/datran-opc-ua-server.md) replaces OPC Data Access (DA).
{% endhint %}

## Turn on the XML service

1. Get security key for the XML Service. The hard disk drive (HDD) serial number must be provided to QTech Data Systems Limited to obtain this.
2. Run the DATRAN VI installation program via Start menu > Settings > Control Panel > Add/Remove Programs > DATRAN VI. Select the **XML Data Interface** option in the DATRAN VI installation program.
3. In DATRAN Browser, double click on the **XML Data Interface** application node to open the XDI dialog box and go to the **License** tab.
4. Enter the security key of the XML Service into the **XML Service: Security Key** text box. Change the value in the **XML Service: Active** combo box to **True**.
5. Go to the **Network info** tab. Change the value in the **Named Pipe** combo box to **True**. Leave the other parameters unchanged.
6. Restart the XML Data Interface application.
7. Check:
   * Check that the XML Service is not displaying any errors. This can be verified via DATRAN Diagnostics: press F2 and select the XML Module & XML Service diagnostics.
   * Refresh (press F2) the node **Named Pipe Server** under the application node (**XML Data Interface\Server\Named Pipes**). It should display the success string "The Named pipe server is running".
   * Under the XML Service node (**XML Data Interface\XML Service**), check that the **Active** node has a value of 1 and that the **Security Expiry** time value is after now.

For XDI licence keys, also see [Licensing](https://help.qtech.co.nz/datran/datran-vi-scada/datran-vi/licensing.md).

## Install the OPC Server

1. Double click on the `Setup.exe` file. Click the **Next** button at the initial welcome screen.
2. Click the **Next** button at the License Agreement screen if you agree with the license. If not, click **Cancel**.
3. Click the **Next** button at the installation directory screen if you are satisfied with the default directory. If not, click the **Browse** button to choose another directory. It is recommended that the server be installed in `C:\Dynamics` so that the FIX can see the server as one of its drivers in the SCADA Configuration Dialog Box.
4. Leave the selection as **Server** in the **Node Type** screen and click the **Next** button.
5. Click the **Next** button at the FIX node name screen if you are satisfied with the default node name. If not, change the node name. Click the **Next** button at the program folder screen if you are satisfied with the default program folder. If not, specify which other program folder you want your short cuts to be.
6. When you are done, click the **Finish** button. Once the installation is complete, the Installation Successful screen will display. Click on the **Done** button.

## Register it with your HMI

### iFIX

1. Use the Intellution iFIX **Data Server Installer** to register the server with iFIX. This application (`DataServerInstaller.exe`) can be found in the directory where iFIX is usually installed by default e.g. `C:\Dynamics`.
2. Click the **Add** button.
3. Provide a name for the data server in the **Data Server** text box e.g. `DVIOPC`. This is equivalent to giving a name to an ODBC connection.
4. In the **OPC Server** combo box, choose `Intellution.DVIOPC`.
5. Ensure that the name of the computer in **Machine Name** text box is where the server is installed. Click **OK**.

Start the OPC client and it should start up the server, as it is set for auto run by default. To unregister it, using the Data Server Installer, choose the server from the Data Servers list and click the **Remove** button.

### InTouch

1. Start the DATRAN OPC I/O Driver Server and connect it to a DATRAN system that has been started.
2. Use the Wonderware **System Management Console** to register the server with InTouch. Right click on the **…\DAServer Manager\Default Group** node and select **New > Node…** Click on the **Browse…** button and select the computer where the DATRAN OPC I/O Driver Server is installed.
3. Expand the computer's node. Right click on the **ArchestrA.FSGateway.1** node and select **Activate Server**.
4. Expand the **ArchestrA.FSGateway.1** node. Right click on the **Configuration** node. Select **Add OPC Object**. Rename the OPC object to "DATRANOverOPC". In the **Server Name** combo box, click on the "…" button. Select "Intellution.DVIOPC".
5. Right click on the "DATRANOverOPC" node and select **Add OPCGroup Object**. Rename the OPCGroup object to "Group1".
6. Click on the **Browse OPC Items** button. Click and drag the Comms Fail item into the Basket. Click the **OK** button. Save your configuration by clicking on the save button.
7. Start InTouch WindowMaker. In the main menu select **Special > Access Names…** Click the **Add...** button. The Topic Name is a concatenation of the OPCObject and OPCGroup names as defined in FSGateway. The Application Name must be FSGateway. In the main menu select **Special > Tagname Dictionary…** Click **New**.
8. Click on the **Runtime!** button. Change the value of the …\Back Beach\Comms Fail node inside the TBD file. Ensure that the value changes accordingly inside InTouch. Try to change the value in the TBD file via InTouch.

If this does not work, check that you have entered the **Write Username** and **Write Password** inside the DATRAN OPC I/O Driver Server.

## Migrate from DDE

The XDI application should be installed before proceeding.

1. Select the node in the TBD file, which is the parent node for most of the `_DDE_Server_Topic_` nodes.
2. Right click on the node selected and select **Replace Key** or press Ctrl + K.
3. In the **Search for Key** text box, type in this string `_DDE_Server_Topic_`. In the **Replace with Key** text box, type in this string `_XMLData_Topic_`.
4. Click on the **OK** button. A message box should appear stating how many nodes have been renamed.
5. Repeat steps 1 to 4 to rename other `_DDE_Server_Topic_` nodes located elsewhere.

Select the node you want to expose to the OPC server and place an `_xmldata_topic_` node under it. See [Sites, channels and RTUs](https://help.qtech.co.nz/datran/datran-vi-scada/datran-vi/sites-and-rtus.md).

## Limits

* Any item with a string value of more than 256 characters will be truncated after the 256th character.
* Because each item is automatically allocated a 256-byte data block regardless of its data type, the maximum number of items per topic is limited to 524287. When new items are added in the TBD file after this limit has been exceeded, these items will not be added into the server.

## Uninstall

Open the Windows Add/Remove Programs window from the Control Panel. Click on the **Change/Remove** button. Click the **Yes** button at the prompt.
