Skip to content

Use the Example Code

The Xrt examples for Azure Sphere can be cloned from IOTech's public GitHub repository.

To use the examples, you must have installed Xrt on your development host, as described in this guide.

To clone the xrt-examples repository, enter the following command:

git clone --branch v2.1-branch

The Azure Sphere examples are located under the xrt-examples folder. Each example has a file, which describes the example and how to build and run it.

Provided Examples

A number of examples are provided that show how to build connected IoT applications using Edge Xrt deployed on an Azure Sphere module.

The examples show how an Xrt application can be used to communicate with OT devices (either physical or simulated) using the following industrial protocols:

  • BACnet
  • Ethernet/IP
  • Modbus

Virtual Device Service is also supported on Azure Sphere. Please contact IOTech support if you require assistance with these device services.

Each example reads data values from the OT device, which are sent to a digital twin running on Azure IoT Hub. You can also use the digital twin to send commands back to the device connected to the Azure Sphere module.