Oracle by Example brandingCreate and Manage the OPC UA Connector in Oracle IoT Production Monitoring Cloud Service

section 0Before You Begin

This 15-minute tutorial shows you how to create and use the Open Platform Communications (OPC) Unified Architecture (UA) Connector in Oracle IoT Production Monitoring Cloud Service.

Background

If your machines are managed by an OPC UA server that is cloud accessible, then you can on-board those machines to Oracle IoT Production Monitoring Cloud Service by creating an OPC UA connector. The connector discovers the machines, their machine types, and then, receives their telemetry data. Oracle IoT Production Monitoring Cloud Service has 3 options for on-boarding such machines and machine types:

  1. Automatic: The option on-boards all machines and machine types when the connector is started.
  2. Manual: The option enables you to choose the machine types that need to be on-boarded.
  3. Comma separated values (CSV) mapping: The option enables you to provide specific machines that need to be on-boarded, in a CSV file.
Description of opc_ua_connector.png follows
Description of the illustration opc_ua_connector.png

What Do You Need?


section 1Create a Factory

Before you create a connector, at least one factory should exist in your Oracle IoT Production Monitoring Cloud Service instance.

  1. Sign in to your instance of Oracle IoT Production Monitoring Cloud Service.
  2. The Map view of the Operation Center is displayed. Click Menu main menu icon.
  3. On the left navigation bar, click Configuration.
  4. On the Configuration: Factories page, verify that the details of a factory exists, note the Factory ID, and move to the next section. If no factories exist, then proceed to the next step.
    Description of factory_id.png follows
    Description of the illustration factory_id.png
  5. If a factory does not exist, click Add create new icon.
  6. On the Factory page, enter the following details:
    • ID: SF Factory
    • Name: San Francisco factory
  7. Note the Factory ID for later use. Click Save and then click Back.

section 2Create an OPC UA Connector

You create an OPC UA connector and review the notifications received from the OPC UA server.

  1. Click the Connectors main menu icon tab.
  2. On the Configuration: Connectors page, click Add create new icon.
  3. On the Create New Connector page, enter or select the following details:
    • Name: opcua_connector
    • Description: connector for the opc ua server
    • Type: opcua
    • Onboarding mode: Automatic
    • URL: opc.tcp://opcuaserver.com:48010
    • Security Settings: None

      Note: If you set the Security Settings as Encrypted then you need to set a Security Policy which is a name for a set of security algorithms and key length. You also need to set a Message Security Mode which defines the security level of the messages being exchanged.

    • User name: joe
    • Password: god
    • Factory ID: SF Factory
    • Note: opc.tcp://opcuaserver.com:48010 is a publicly available OPC UA server

  4. Click Save and then click Back.
  5. On the Connectors page, verify that opcua_connector is listed. Review the status of the connector and click Refresh till the status changes from Starting to Started.

    Note: Once the certificate is accepted by the OPC UA server, the connector's status changes to Started in a few minutes. If the security policy is not provided, then the connector will not start.

  6. For the connector, click Notifications main menu icon. Review the content about creating machine types and machines.
    Description of notifications2.png follows
    Description of the illustration notifications2.png
  7. To go back to the Connectors page, click Back.

section 3Verify On-boarding of Machines

You verify that the connector has created machine types and machines in Oracle IoT Production Monitoring Cloud Service.

  1. Click Machine Type main menu icon.
  2. Verify that a few machine types are displayed that are new and their names match with the names displayed on the Notifications page of opcua_connector.
    Description of machine_types.png follows
    Description of the illustration machine_types.png
  3. On the top navigation bar, click Machine main menu icon.
  4. Notice that the connector has created a set of machines whose machine types are the similar to those created by the connector.
    Description of machines.png follows
    Description of the illustration machines.png

section 4Review Device Messages

Verify that the device messages are received by your Oracle IoT Production Monitoring Cloud Service instance from the machines managed by the OPC UA server.

  1. Click Menu main menu icon and then click Operation Center. The Map view appears.
  2. On the map, locate and zoom in to the area where SF_Factory is located.
  3. Click the Factory factory icon icon. On the floor plan of the factory click an air-conditioner machine icon.
  4. The dashboard of the air-conditioner machine appears. On the navigation bar, click Machine Sensors sensor icon.
  5. On the sensor data graph, select Time Period as Live. Notice that the live values of the Humidity and Temperature attributes are displayed on the graph.
Description of messages.png follows
Description of the illustration device_messages.png


section 5Perform Manual On-boarding of Machine Types

If you wish to selectively on-board specific machines types from the OPC UA server, you can configure the connector to manually on-board the machines. During manual on-boarding, you need to opt for the machine types from the list of discovered machine types. You can also choose the machine type attributes that you wish to include from the list of available attributes of a machine type.

  1. Complete the Steps of Section 2, Create an OPC UA Connector. Ensure that in Step 3, you enter opcua_connector_manual for the Name field, and select Manual for the Onboarding Mode field.
  2. On the Connectors page, verify that opcua_connector_manual is listed. Review the status of the connector and wait until the status changes from Starting to Started.
  3. For the connector, click Notifications main menu icon.
  4. In the list of notifications, notice that in the Actions column, a check mark and a cross mark appears for each machine type. This allows you to accept or reject the discovered machine type. For a machine type, in the Actions column, click the check mark main menu icon.
    Description of manual_notifications.png follows
    Description of the illustration manual_notifications.png
  5. On the Attributes page, enable or disable the attributes, click Accept and then Close. Repeat the step for all the device types that has been discovered and notified by the connector.
    Description of attributes.png follows
    Description of the illustration attributes.png
  6. To verify that the machines are on-boarded successfully, complete the steps of Section 3 and 4.


section 6Upload CSV Files of Machine Types

While creating a connector, you can upload a CSV file to add specific machines of a machine type in Oracle IoT Production Monitoring Cloud Service. For each machine type, you need to create and upload a separate CSV file. In this section, you review a sample Airconditioner.csv that is used when the machine types does not exist in your Oracle IoT Production Monitoring Cloud Service instance.

  1. To review the structure of a CSV file, save and open AirConditioner.csv.
  2. Notice the following format used in AirConditioner.csv:
    • First column heading is the ID of the machine type, and second column heading is the name of the machine type, which is AirConditioner in the example. For AirConditioner.csv, the first column heading is left blank. If machine types already exist in your Oracle IoT Production Monitoring Cloud Service instance or imported from Oracle Manufacturing Cloud, then add the machine type ID field name in the first row first column of the mapping file.
    • Remaining column headings are the sensor attribute names attached to the machine type. Humidity and Temperature are examples.
    • First column from second row are the machine IDs that should be unique in the Oracle IoT Production Monitoring Cloud Service instance. AirConditioner1 is an example.
    • Second column from second row are the machine names. AirConditioner1 is an example.
    • Remaining columns from second row have Node IDs of the sensor attributes, which are as follows, in the example:
      "ns=3;s=AirConditioner_1.Humidity","ns=3;s=AirConditioner_1.Temperature"
    • Node IDs are specially formatted strings of text that identify a unique OPC UA node. Each Node ID contains a namespace index and an identifier separated by a semicolon. In the example, ns=3 is the namespace of the Node ID 3 and s=AirConditioner_1.Humidity is an identifier of type String and value AirConditioner_1.Humidity.

    Note: If you use the demo OPC UA server at opc.tcp://opcuaserver.com:48010, then the CSV file maps the incoming sensor data from the air-conditioners to machines AirConditioner1, AirConditioner2, etc. in the Oracle IoT Production Monitoring Cloud Service instance.

  3. If you do not use the demo OPC UA server, refer to the sample CSV file and create a new mapping file for each machine type.
  4. To upload the CSV file, create a connector by completing Steps 1-10 of Section 2, Create an OPC UA Connector.
  5. In the Specifications section, click upload, browse to the folder where you have extracted the CSV files, select AirConditioner.csv, and click Open.
    Description of upload_csv.png follows
    Description of the illustration upload_csv.png
  6. Click Save and then click Back.
  7. The machine type and the machines from the OPC UA server that correlate to those defined in the CSV file gets added to your instance. Perform the steps of Section 3, Verify On-boarding of Machines to review the machine type and machines added to your Oracle IoT Production Monitoring Cloud Service instance.

more informationWant to Learn More?