How-To Guides

Set Up the DeviceHub Agent

13min

The DeviceHub agent acts as a proxy between OPC DA and the Manufacturing Connect Edge system. It allows you to search for available OPC DA Servers and provides a list of tags for the selected server. Multiple servers can be selected.

Review the following use case for connecting and configuring the DeviceHub Agent in Manufacturing Connect Edge.

Important

  • To install DeviceHub Agent, your machine must support the following software versions:
    • Windows 10.0.14393
    • Windows SDK version 10.0.18362.0
    • Visual Studio 16 2019
  • The DeviceHub Agent must be run on the same host as the OPC DA Server, and DCOM must be configured. For more information, see Configure DCOM for OPC DA Connections.
  • The DeviceHub Agent supports reading up to 5000 tags from the OPC DA server. It does not support parallel write.
  • The DeviceHub Agent does not support OPC Classic Historical Data Access (HDA) or OPC Classic Alarms and Events (AE).
  • It is possible to configure multiple connections to several DeviceHub Agent instances inside a Manufacturing Connect Edge or multiple Manufacturing Connect Edge instances using only one DeviceHub Agent application. You can create each connection using the Add (+) icon.
  • The DeviceHub agent includes options to export tags to a CSV file. The CSV file can then be used to import the tags to Manufacturing Connect Edge. The status of the tags are checked periodically. Sending tags to DeviceHub is the preferred method.

Before You Begin

Download the DeviceHub Agent EXE file from Manufacturing Connect Edge by navigating to System > Support in the File Downloads section.



Setting up the DeviceHub Agent includes the following tasks:

  • Step 1: Add DeviceHub Agent Device to DeviceHub
  • Step 2: Create API Token
  • Step 3: Install Matrikon OPC Explorer and Simulation and Testing Tool
  • Step 4: Set up DeviceHub Agent
  • Step 5: Connect the OPC DA Explorer
  • Step 6: Send Tags to DeviceHub
  • Step 7: View Tag Data

Step 1: Add DeviceHub Agent Device to DeviceHub

To add the DeviceHub Agent device to DeviceHub:

  1. In Manufacturing Connect Edge, navigate to DeviceHub > Devices.
  2. Click Add New Device. The Connect Device dialog box appears.

    Add new device icon
    Add new device icon
    
  3. In the Device Type drop-down list, select OPCUA.
  4. In the Driver Name drop-down list, select DeviceHub Agent.
  5. Enter a name for the device. The device name you configure is used for the Device name parameter in the DeviceHub Agent configuration.
  6. (Optional) Select the Enable alias topics check box. This allows you to name the Topic ID when creating a Tag.
    • If you enable alias topics during device creation or modification, DeviceHub stops publishing to raw topics and publishes only to alias topics.
    • Manufacturing Connect Edge substitutes "." (period) in aliases with "/" (forward slash).
  7. Click Add Device. The device appears in the Devices pane.

Step 2: Create API Token

Follow the steps to Create API Credentials. Copy the token and store it for later use.

Step 3: Install Matrikon OPC Explorer and Simulation and Testing Tool

Note: To install these files, you may have to enable the .NET Framework 3.5. See Microsoft documentation on this topic to learn more.

In this use case, Matrikon Server is used. You can also use Kepware Server or Prosys Server.

To download Matrikon OPC Explorer and Simulation and Testing Tool:

  1. Visit the Matrikon website.
  2. From the Matrikon search bar, enter OPC Simulation Server Download, and click Search.
  3. Click the OPC Simulation Server Download link.
  4. From the download page, enter your first name, last name, and email address, and then click Download Now.
  5. From the registration form, enter your account information, and then click Download Now. An activation email is sent from Matrikon.
  6. Click the link provided in the email. Use your email address as your user name, and the password you provided in the form as your password for the http://www.matrikonopc.com/portal URL.
  7. Click Download Now. The MatrikonOPCSimulation.exe file downloads to your hard drive.
  8. Install the MatrikonOPCSimulation file.
  9. From the Matrikon search bar, enter MatrikonOPC Explorer Download, and click Search.
  10. Click the MatrikonOPC Explorer Download link.
  11. From the download page, click Download Now.
  12. Install the MatrikonOPCExplorer filie.

The server configuration is by default. You can add an alias configuration. Explorer is used to connect to the OPC DA server and browse the tags.

Step 4: Set Up DeviceHub Agent

You can now set up the DeviceHub Agent by connecting to the OPCDA server and DeviceHub in Manufacturing Connect Edge.

To set up the DeviceHub Agent:

  1. Open the DeviceHub Agent EXE file you downloaded.
  2. From the Main tab, click the Add box. The Add connection dialog box appears.

    Add connection dialog box
    Add connection dialog box
    
  3. Click the Detect icon. The servers are detected and appear in the OPCDA server drop-down list. The OPCDA host is localhost because the OPC DA server is installed on the same machine as Manufacturing Connect Edge.

    Detect icon
    Detect icon
    
  4. Select an option from the OPCDA server drop-down list.
  5. Configure the Server settings section.
    • Host: Enter the IP address for your Manufacturing Connect Edge instance.
    • Port: The port value should be the same one configured for the DeviceHub Agent device in Manufacturing Connect Edge.
    • Device name: Enter the device name you configured for the DeviceHub Agent device in Manufacturing Connect Edge.
    • API key: Paste the API key created in Step 2.
  6. Click OK. The OPC DA driver is added in the DeviceHub Agent in another tab, and the tags for the selected server are viewable in the tags box.
  7. Click the Connect icon. The DeviceHub Agent connects to DeviceHub in Manufacturing Connect Edge.

    Document image
    
  8. Return to the Manufacturing Connect Edge instance and navigate to DeviceHub.
  9. Confirm that the DeviceHub Agent tile shows a Connected status.

If you need to remove a connection in the DeviceHub Agent application, select the tab for the connection you want to remove and go to Connections > Remove connection.

Step 5: Connect the OPC DA Explorer

To connect the OPC DA Explorer:

  1. Open the MatrikonOPC Explorer.
  2. Under the Localhost entry in the hierarchy, click the Matrikon.OPC.Simulation.1 entry.
  3. Click the Connect button. Connection information appears in the Server Status panel.

You will need to connect the OPC Explorer to the Simulation and Testing Tool.

To connect the OPC DA Explorer:

  1. Open the MatrikonOPC Explorer.
  2. Under the Localhost entry in the hierarchy, click the Matrikon.OPC.Simulation.1 entry. If you get the error message "Matrikon OPC explorer machine is not browsed", go to View > Options > General and select the Registry check box in the OPC Server Browsing section.
  3. Click the Connect button. Connection information appears in the Server Status section.
Server Status section
Server Status section


Step 6: Send Tags to DeviceHub

You can send tags from the DeviceHub Agent applicaiton directly to DeviceHub in Manufacturing Connect Edge. This is the recommended method to add tags to the DeviceHub device.

To send tags to DeviceHub:

  1. Make sure the DeviceHub agent is disconnected from DeviceHub.

    Document image
    
  2. Select the check box for tags you want to send. Alternatively, you can use the Select all tags and Unselect all tags icons.

    Document image
    
  3. Click the Connect icon to connect to DeviceHub in Manufacturing Connect Edge.

    The Connect icon
    The Connect icon
    
  4. Click the CSV icon and select Send Tags. A message displays that the tags were successfully sent.

    The Send tags option
    The Send tags option
    

You can also add tags to the DeviceHub device in the following ways:

Step 7: View Tag Data

You can use the Flows Manager or Analytics in Manufacturing Connect Edge to view the tag data.

To view tag data in the Flows Manager:

  1. In Manufacturing Connect Edge, navigate to DeviceHub > Tags.
  2. Select the DeviceHub Agent device.
  3. Click the Copy icon for the tag you want to view.
  4. Navigate to the Flows Manager and create a new flow. See Create a Flow to learn more.
  5. Drag the DataHub Subscribe and Debug nodes to the canvas and wire them together.

    The DataHub Subscribe and Debug nodes
    The DataHub Subscribe and Debug nodes
    
  6. Double-click the DataHub Subscribe node.
    • In the Topic field, paste the tag ID you copied earlier.
    • If needed, configure the Datahub Subscribe connection. See the "Step 3: Configure Connector Nodes" section in Create a Flow to learn more.
    • Click Done, and then Deploy.
  7. Click the Debug icon.

    The Debug icon
    The Debug icon
    
  8. Drag the message window up and review the messages. A "success": true message confirms the connections is successful.

    Document image
    

To view tag data in Analytics:

  1. In Manufacturing Connect Edge, navigate to Analytics.
  2. Click Add processor and select DataHub Subscribe.
  3. In the Topic field, paste the tag ID you copied earlier.
  4. Click Save.
  5. Click the View icon.

    The View icon
    The View icon
    
  6. Review the messages. A "success": true message confirms the connections is successful.

    Instance Messages
    Instance Messages