Skip to content
  • There are no suggestions because the search field is empty.

Importing DDE Items into DataHub

How can I easily add all my DDE items to the DataHub?

We have written a script that imports all your DDE items from a CSV file and adds them to a DDE Connection in DataHub. To use this script, you MUST have already created a DDE Connection Name in the DDE Client section of the DataHub. If you do not already have a connection you MUST configure one to proceed.

There are two files in the zip file:
  • AddDDEItemsCSV.g - This is the DataHub script that reads from the CSV file and creates the DDE items for you.
  • DDETagList.csv - This file contains all the tag names we will be adding to the DDE connection.

Both these files should be placed in the "C:\Program Files (x86)\Cogent\Cogent DataHub\scripts" directory. (Change "Program Files (x86)" to "Program Files" if you are on an x86 machine)

Configuring the CSV File

The first step is to add all your tag names to the CSV file. The CSV file has 4 columns.

  • Column 1: the DDE Connection name. This is same name as you have configured in the DDE section of the DataHub.
  • Column 2: the DDE Item name. This must match the Item Name in the DDE Server.
  • Column 3: the DataHub Item name. This will be how the item appears in the DataHub View Data window.
  • Column 4: the Data Domain. This is basically a way to group tags in the DataHub. This can be anything you like.

Running the Script

Once you have filled out the CSV file with all the info it is time to run the script.

To add the script to the DataHub, you need to open the DataHub properties page and go to the Scripting section. At the very top, you will see "Load these Gamma script files when starting:". Click the Add button in this section and browse to the "C:\Program Files (x86)\Cogent\Cogent DataHub\scripts" directory. Highlight AddDDEItemsCSV.g and click Open. This will add the script to your list.

Before you run the script, you will want to launch the Script Log. Click the Script Log button in the DataHub Properties. We want to have the Script Log open before we run the script because all errors will be logged here. You only need to run this script a single time. Highlight the script in the list and click Load Now. If nothing appears in the Script Log, then it was successful. If you get an error, then please copy and paste it into an email and reach out to support@softwaretoolbox.com.

You do not want to check the box next to this script or it will be ran every time DataHub starts.

Verifying the Tags Exist and are Working

Now you should be able to click the View Data button. Browse to the Domain or Domains you added the items to and you should see your data with a Good quality.  If you see Good quality then you have a connection.