After configuring the Azure IoTHub on the cloud, in this section you will see how to connect Niagara devices/points to the cloud.
Set up the connector
- Open the btibIotHub palette.
- Drag and drop the IoTHubConnector to Services > Btib Service > External Connectors > Realtime Connectors folder.
- Double click on the connector and paste your connection string that you copied earlier in the IoT Hub Connection String text field. Enable the connector, then hit save.
Set up a Device
- From the btibIoTHub palette, drag and drop an IoTHubDeviceExt to a device or to any other component (a folder, a node...). It will be represented as an IoTHub device.
- If you have only one connector in your station the extension will initialize itself automatically.
- If you have multiple connectors you have to select the one and hit save.
Set up a Point
- From the btibIoTHub palette, drag and drop a IoTHubPointExt to a point.
- A point is represented as a module of a device in IoTHub. So you have to indicate in Niagara which device the point belongs to. By default, it looks for the parent device (for a point in a Modbus device for example) by using the relation n:parentDevice. But you may be in a different scenario where your point is not a direct child of the device or even if the point belongs to a folder etc. So you can set a different query to retrieve the parent device which contains the device extension. It can be a relative query, an absolute query, a neql or a bql. Example: slot:..|neql:traverse n:parent->
Setup References
A Reference is a component that represents a remote resource (SharePoint document, ticket …).
- Go to the palette and drag&drop a reference extension to your reference component.
Verification
Now everything is set up correctly in Niagara, go to the azure portal, in the IoTHub service you just created:
Registration
- Click on IoT devices. On the left you will see your device name with the InfoSource id appended to its name.
- To see the device tags Click the Device Twin button.
- And you should see the device tags.
- To see the child points, click on the device id. They are represented as modules.
- To see the points tag. click on the point id then Module Identity Twin
- You should see all associated tags
Next Step
Step 3 Send messages to IoTHub from Niagara