Industrial Connections
Important! This topic assumes that you have followed the instructions in the Getting an Azure IoT Hub Connector Up and Running section of this help center, especially the instructions in Steps 3, 5, and 6 (minimal configuration).
ThingWorx modeling support for Azure IoT OPC UA enables a single application at the Edge, for example an OPC UA Server, that can map multiple Things in ThingWorx to a single address space. For example, a ThingWorx Kepware Server may have 10,000 tags defined in its address space. In ThingWorx Composer, you can take 15 tags and map them to one Thing, then take 100 to map to a totally different Thing, and so on. Under the covers, there is only one application at the Edge that manages this mapping.
Before you bring up the Connector, you must configure the AzureIotHubTemplate Thing for the Azure IoT Hub using ThingWorx Composer. Then, when you start it, the Connector will create Industrial Connections on the ThingWorx Platform. These connections represent OPC UA endpoints.
If you have previously connected ThingWorx Kepware Server (TKS) to ThingWorx, the user interface examples shown in this topic may look familiar. These pages from ThingWorx Composer are the same as those used for direct connections from TKS. For a procedure that shows how to use them for direct connections between TKS and the ThingWorx Platform, refer to the section, Industrial Connections in the ThingWorx Platform Help Center.
To set up the Industrial Connections for the ThingWorx Microsoft Azure IIoT OPC UA integration in ThingWorx Composer, follow these steps:
1. From the left navigation pane in ThingWorx Composer, select Browse > Industrial Connections. You should see your endpoints listed in the right panel. In the example below, the Industrial Connections listed represent two OPC UA endpoints.
2. In this page, click the name of an industrial connection to display its General page. Once you select the endpoint, a temporary Industrial Thing is created. To make this Thing permanent, click Save. This is your Industrial Gateway Thing.
3. Click Discover to display the Discover page for the industrial connection:
On the Discover page, you can expand the items listed for the endpoint. For example, the endpoint selected in the page above, shows the list of Objects, shown here:
4. Select Channel 1 to display the tags for this channel, as shown here:
5. Select the tags you want to bind and click Bind to New Entity, as shown here:
You could also select other tags and they will all show up in the list.
6. When you click Bind to New Entity, you are prompted to select a Thing Template. Select the AzureIotThing Thing Template, as show here:
7. When the General Information page for the new Industrial Thing appears, check the To Do list for actions you need to take on the new Thing. The first action is to give the Thing a name, as shown here:
8. Type a name for the Thing. For example, "conveyor", as shown here:
Note that the Thing Template you chose appears as the Base Thing Template for this Industrial Thing. An Industrial Thing created this way inherits the Thing Shape called IndustrialThingShape. Thing Shapes can add properties and services to a Thing. If you add a Thing Shape to a Thing Template, all of the Things inherit that Thing Shape and its properties and services.
9. Click Properties and Alerts to display the Properties page for the Industrial Thing, as shown here:
The Tags that are bound to this Industrial Thing contain characters that are invalid in ThingWorx property names. For example, the equals sign in the property highlighted in the preceding figure. A current limitation is that you must change the names of Tags to be valid ThingWorx property names.
10. To rename a property, click the name of the property. The following panel appears on the right side of your screen:
Industrial PLCs may have hundreds of thousands of tags with similar names. One goal of the Azure IIoT OPC UA integration with ThingWorx is to put context behind those tag names. In the instance above, you may want to reference the tag by a more user-friendly name such as RPM or Temperature. Type a description to further elaborate on the tag's meaning and/or expected values.
The characters in an endpoint name are the endpoint ID generated by the Microsoft OPC UA stack. This name is all ThingWorx has to identify an endpoint. Therefore, it is very important not to change the name of the endpoint. The name is the RegistrationId of the endpoint. Note that the RegistrationId does not have any of the invalid characters; it has only alphanumeric characters. When performing an action on an endpoint, you'll want to make sure it is performed on the correct RegistrationId, the one generated by the Microsoft stack. ThingWorx takes the registration id from the name of the endpoint.
In the screen above, there are several other settings. In ThingWorx, these are aspects of the property. For example, if you select the check box for Persistent, the property value is written to the ThingWorx database. For complete information on properties, binding, and aspects, refer to the topic, Thing Properties in the ThingWorx Platform Help Center.
11. After you have completed all the tasks in the To Do list, click Save. When you return to the Properties page, the new name of the property is shown. Any other changes you made to the property also are displayed in the Properties table.
As shown in the figure above, next to the name of the Thing is a Not Connected symbol that you can click to refresh the page and show that it is connected, as shown here:
12. Click Refresh to start seeing values come in. for the properties, as shown in the preceding figure.
You can write a value to the tag/property from this page. Click the icon and when prompted, type the value to write.
The Connected status indicates that the connection is successful, from the OPC UA Server end to the ThingWorx Platform end of the integration. Refer to the diagram, Figure 1, to see the ends and the intermediate connections.
The OPC UA Server must be connected to an Azure IoT Edge device, which must be connected to an Azure IoT Hub. The IoT Hub must be connected to the ThingWorx Azure IoT Hub Connector, which must be connected to ThingWorx. There is no way to have one indicator of "Connected" that has meaning. Essentially, the Connected icon next to the Thing Name means that the Azure IoT Hub has been able to map successfully that tag and request telemetry from the Azure Industrial IoT (IIoT) Microservices.
A number of different measurements are involved. One factor is that the RemoteThing must be bound to the Connector and able to communicate with the Connector primarily. The Connector has own determination of whether something is "connected". Even though the Connected icon is shown for the Industrial Thing, it does not necessarily mean that, for example, the OPC UA server is actually running right now. If someone shut down the OPC UA Server, the Connected icon would still be green.