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



  1. Open the btibIotHub palette.




  2. Drag and drop the IoTHubConnector to Services > Btib Service > External Connectors > Realtime Connectors folder.




  3. 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



  1. 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.





  2. If you have only one connector in your station the extension will initialize itself automatically.


  3. If you have multiple connectors you have to select the one and hit save.

Set up a Point



  1. From the btibIoTHub palette, drag and drop a IoTHubPointExt to a point.



  2. 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 …).

  1. 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

  1. Click on IoT devices. On the left you will see your device name with the InfoSource id appended to its name.



  2. To see the device tags Click the Device Twin button.





  3. And you should see the device tags.




  4. To see the child points, click on the device id. They are represented as modules.




  5. To see the points tag. click on the point id then Module Identity Twin
  6. You should see all associated tags


Next Step


Step 3 Send messages to IoTHub from Niagara