Skip to content

Device Profiles

A device profile describes a type of device within XRT. Each device managed by a Device Service has an association with a device profile, which defines that device in terms of the operations that it supports. A device profile is described in JSON format.

Note

More than one device can be configured to use the same device profile.

The device profile contains the following:

  • Some identification information, such as a name and a description, and a list of labels that can be used when searching device profiles
  • Device resources, which must have a name to allow them to be accessed. Values are also specified, so that they can be read from or written to

Note

When creating device resources, the XRT data type used must be equivalent to the device service data type of the object property to which you make a request. For further information on device service data types and the XRT equivalents, see the relevant device service component page.

The following diagram shows how the device profile is used, with the protocol-specific Device Service, to define a device:

Diagram of Device Profile Relations

The deviceResources section of the profile specifies individual values within a device that can be read from or written to.

The IOTech Device Configuration Tool provides a GUI for the management of device profiles for various protocols. This online tool allows you to create device profiles using the GUI instead of manually using a text editor.

Load Device Profiles

The Device Service must provide a list of the profile files required by the configured devices in a JSON file that is specified in the Profiles configuration parameter; by default profiles.json is used. The specified JSON file contains an array of the base names of the profile files.

Note

The base name is the name of the profile file is without the .json file extension.

For example, a profiles.json file containing the following array will load files named Damocles2-1208.json, Damocles2-404.json, Damocles2-Mini.json and DENT.Mod.PS6037.json from the directory specified by the ProfileDir configuration parameter:

["Damocles2-1208", "Damocles2-2404", "Damocles2-Mini", "DENT.Mod.PS6037"]

Example Device Profile

An example device profile for Modbus can be seen below:

{
  "name": "Network Power Meter",
  "manufacturer": "Dent Instruments",
  "model": "PS3037",
  "description": "Power Scout Meter",
  "labels": [
    "modbus",
    "powerscout"
  ],
  "deviceResources": [
    {
      "name": "Current",
      "description": "Average current of all phases",
      "attributes": {
        "primaryTable": "HOLDING_REGISTERS",
        "startingAddress": "9"
      },
      "properties": {
        "value": {
          "type": "UINT16",
          "scale": "1"
        }
      }
    }
  ...
  ]
}

Inside the profile, we can see that a name and other characteristics are assigned. These correspond to the characteristics of target devices that will utilise the profile.

Further down the profile, we can see the device resources, which serve to simplify reading from and writing to relevant addresses in the device.

Through the use of these resources, we can tie specific addresses and other configuration options to a label that can then be queried via XRT. Additionally, we can specify the type and scaling to be applied to the resource once fetched or set.

Further Information

For further information on the Device Service configuration parameters common to all Device Service components, see the Device Service Component Configuration

For further information on provisioning devices, see the Device Provisioning.

Back to top