Before 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:
- Automatic: The option on-boards all machines and machine types when the connector is started.
- Manual: The option enables you to choose the machine types that need to be on-boarded.
- 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](img/opc_ua_connector.png)
What Do You Need?
- A desktop or a laptop running a Windows environment with JDK 8
- Access to an Oracle IoT Production Monitoring Cloud Service instance
- Access to an OPC UA server (
opc.tcp://opcuaserver.com:48010
from Unified Automation is a public demo OPC UA server)
Create a Factory
Before you create a connector, at least one factory should exist in your Oracle IoT Production Monitoring Cloud Service instance.
- Sign in to your instance of Oracle IoT Production Monitoring Cloud Service.
- The Map view of the Operation Center is displayed. Click Menu
.
- On the left navigation bar, click Design Center and then Factories.
- On the 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 the illustration factory_id.png - If a factory does not exist, click Add
.
- On the Factory page, enter the following details:
- ID:
SF Factory
- Name:
San Francisco factory
- ID:
- Note the Factory ID for later use. Click Save and then click Close X.
Create an OPC UA Connector
You create an OPC UA connector and review the notifications received from the OPC UA server.
- From the Design Center menu options, click Organization.
- On the Organization page, click Device Connections
.
- On the Connectors
tab, click Create Connector
.
- On the Create Connector page, for the Type field, select OPC UA and click Create.
- 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 name: SF Factory
Note:
opc.tcp://opcuaserver.com:48010
is a publicly available OPC UA server - Name:
- Click Save and then click Close (X).
- 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.
- For the connector, click Notifications
. Review the content about creating machine types and machines.
Description of the illustration notifications2.png - To go back to the Connectors page, click Back.
Verify On-boarding of Machines
You verify that the connector has created machine types and machines in Oracle IoT Production Monitoring Cloud Service.
- From the Design Center menu options, click Machine Type
.
- 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 the illustration machine_types.png - From the Design Center menu options, click Machine
.
- Notice that the connector has created a set of machines whose machine types are the similar to those created by the connector.
Description of the illustration machines.png
Review 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.
- Click Menu
and then click Operation Center. The Map view appears.
- On the map, locate and zoom in to the area where SF_Factory is located.
- Click the Factory
icon. On the floor plan of the factory click an air-conditioner machine icon.
- The dashboard of the air-conditioner machine appears. On the navigation bar, click Machine Sensors
.
- 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](img/device_messages.png)
Perform 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.
- 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. - 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. - For the connector, click Notifications
.
- 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
.
Description of the illustration manual_notifications.png - 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 the illustration attributes.png - To verify that the machines are on-boarded successfully, complete the steps of Section 3 and 4.
Upload 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.
- To review the structure of a CSV file, save and open
AirConditioner.csv
. - 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. ForAirConditioner.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
andTemperature
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 ID3
ands=AirConditioner_1.Humidity
is an identifier of type String and valueAirConditioner_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 machinesAirConditioner1
,AirConditioner2
, etc. in the Oracle IoT Production Monitoring Cloud Service instance. - First column heading is the ID of the machine type, and second column heading is the name of the machine type, which is
- 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.
- To upload the CSV file, create a connector by completing Steps 1-5 of Section 2, Create an OPC UA Connector.
- 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 the illustration upload_csv.png - Click Save and then click Close (X).
- 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.