Overview

Skill Level: Intermediate

This recipe explains how to configure the MQTT publisher module of the Softing dataFEED OPC Suite to send data to the IBM Cloud.

Ingredients

To get startet you need

  • Softing dataFEED OPC Suite already installed on your PC or Server
  • At least one data source (e.g. OPC Server, OPC ua Server or PLC), already connected to the dataFEED OPC Suite  

Notes:
     For more information regarding what PLC's are supported, please click on the link below
     
If you haven't got a licensed version of the dataFEED OPC Suite, you can dowload, after seeting up an account, a free trail version from the
     Softing webpage under the following link.

     https://data-intelligence.softing.com/products/opc-software-platform/datafeed-opc-suite/#tx-dftabs-tabContent2

Step-by-step

  1. Login at IBM Cloud

    At https://console.bluemix.net/ login at IBM Clound using your IBMid and password.

  2. Create Internet of Things Resource

    An Internet of Things resource is required for connecting dataFEED OPC Suite to IBM Cloud.

    1_Create-resource

    • Press Create resource button

    3_Selection-resource
    • Select Internet of Things
    • Click on Internet of Things Platform tile
         • At Internet of Things Platform page:
         • Define Service name
         • Choose an organization
         • Select Pricing Plan
         • Press Create button for completing resource creation

  3. Add Softing dataFEED OPC Suite as Service

    • Click IBM Cloud for display of Cloud Foundry Services
    • Click on service to be used for dataFEED OPC Suite connection

    4_Launch

    • Press Launch button
    • Select “Devices” in menu bar on left side

    5_Device-Overview

    • Press + Add Device button

    Add Device page is shown

    6_Add-Device

    • Enter Device Type and Device ID
    NOTES:
         • There is no restriction to Device Type and Device ID
         • Device ID has to be unique
         • For IBM Cloud Client ID is built by “d:”+<Organization ID>+”:”+<Device Type>+”:”+<Device ID>
         • Client ID is limited to 23 characters
    • Click Next button
    • Add additional optional device information at following pages
    • Click Next button until verification page is shown

    7_Add-Device-Done

    • Verify entries
    • Click Done button

    Device Credentials page is shown after completion of IBM Cloud configuration

    8_Device-guide

     

    NOTE:
         Authentication Token is created automatically.
         It is only displayed once at this moment.
         Thus, it is highly recommended to copy shown device details for later use during dataFEED OPC Suite configuration.
         

  4. Softing dataFEED OPC Suite Conifguration Steps

    Create new dataFEED OPC Suite configuration 

    • Start dataFEED OPC Suite Configurator,
       e.g. by clicking on dataFEED OPC Suite Configurator icon in Desktop
    • Navigate to Configuration/New page

    12_Config_Name

    • Enter Configuration name
    • Click New button

  5. Define MQTT Broker Connection

    • Navigate to Data Connection/MQTT Broker page

    13_MQTT

    • Click Add New Connection button

    14_Connection_Name_MQTT

    • Define MQTT Broker Connection Name
    NOTE:
           There is no restriction to Connection Name
    • Enter Client ID
    NOTES:
         • For Client ID use information shown at final page of IBM Cloud configuration
           (see section „Device Credentials page is shown after completion of IBM Cloud configuration“)
         • For IBM Cloud Client ID is built by “d:”+<Organization ID>+”:”+<Device Type>+”:”+<Device ID>
    • Click Next > button

    17.0_User_Password

    • Enter MQTT Broker URI of IBM Cloud
    NOTE:
            For SSL/TLS MQTT Broker URI, choose option ssl://
            and enter IP address <Organization ID>+”messaging.internetofthings.ibmcloud.com:8883”
    • Define Authentication Settings
    NOTES:
          • Select User name and password as User Identity
          • Enter “use-token-auth” as User Name
          • Enter authentication token shown at final page of IBM Cloud configuration as Password
            (see section „Device Credentials page is shown after completion of IBM Cloud configuration“)
    • Click Connection Test button
    • Click OK button
    • Click Next > button, if connection has been tested successfully

  6. Define MQTT Topic

    NOTES:
         • Within the scope of this manual the hierarchical MQTT topic
            “iot-2/evt/”+<Event ID>+”/fmt/”+<Format> is used by dataFEED OPC Suite for publishing values.
         • Each level of the hierarchical MQTT topic has to be defined separately.
         • There is no restriction to <Event ID>
         • <Format> has to be set to “json“
    • Select Topic definition page18_MQTT_Topics

    • Click Add Item button

    19_Topic_Properties

    • Enter “iot-2” as top level Name of hierarchical MQTT topic
    • Select Bluemix JSON string with value, timestamp and quality as Publish Format
    • Define Retain setting as required
    • Select QoS Setting as required
    • Click OK button
    • Click Add Item button and repeat step above for definition of each additional level of hierarchical
    MQTT topic:
         • “evt”
         • <Event ID>
    NOTE:
         Within the scope of this manual “heartbeat“ is used as <Event ID>
    • ”fmt”
    • Define “json” as <Format> and select “Tag” (not Node) under Topic Class

    21_MQTT_Topics_overview

    • Click Finish button

  7. Define Data Exchange between Softing dataFEED OPC Suite and IBM Cloud

    NOTE:
         For an easy demonstration of the data exchange a dataFEED OPC Suite system data item with a constantly
         changing value is used as data source.
    • Navigate to Data Processing/Exchange page

    7_Add-Device-Done

    • Select System.General.Heartbeat item as data source
    • Select json level of hierarchical IBM Cloud MQTT topic as data destination
    • Click Connect button to create exchange action by connecting data source with data destination
    • Generated connection is displayed in Exchange Data List
    25_Exchange_finished

    • This step completes dataFEED OPC Suite configuration within scope of this manual.
    • Select Configuration/Save menu item to save configuration

    26_Save_Config

     

  8. Activate Softing dataFEED OPC Suite Run Mode

    • In dataFEED OPC Suite select Local Application/Start menu item

    27_Start_Application

  9. Monitor Data in IBM Cloud

    • Restart IBM Cloud dashboard and select Devices in menu bar on left side

    9_Browsing-Data

    Green dot near guide Device ID indicates active data source

    • Select Recent Events for seeing live stream of data coming from dataFEED OPC Suite

    NOTE:
         For data visualization select Boards in menu bar on left side.
         Afterwards connect data items with cards created for an individual board.

Join The Discussion