Creating an Izot Device Class File

You can create an IzoT device class file to map the datapoints defined by an IzoT device application to datapoints that can be monitored and controlled by the IzoT Server. To create an IzoT device class file, follow these steps:

  1. Define a top-level <device> element as shown in the example below.
    Specify the program ID in the pid attribute.
    Specify a default name for any device with a matching program ID in the name attribute.  
    Specify a description of the type of device in the type attribute.  
    Specify the manufacturer name in the brand attribute.  

    <device pid="9FFFFF05006F0002" name="LED" type="color_lamp_controller" brand="Echelon">
    </device>
  2. Define a single <attributes> element followed by a single <nvs> element within the <device> element. Below is an example with the top-level <device> element containing an <attributes> element followed by an <nvs> element.

    <device pid="9FFFFF05006F0002" name="LED" type="color_lamp_controller" brand="Echelon">
      <attributes>
      </attributes>
      <nvs>
      </nvs>
    </device>
  3. Within the <attributes> element, define an <attribute> element for each IzoT Server datapoint. Each server datapoint may be an input to the server used to update an input datapoint on a device, an output from the server used to read the latest value of an input or output datapoint on a device, or an input/output datapoint used to update an input datapoint on a device and monitor a feedback output datapoint on a device.  

    Below is an example with a color-setting server input datapoint and a color server output datapoint.

    <device pid="9FFFFF05006F0002" name="LED" type="color_lamp_controller" brand="Echelon">
      <attributes>
        <attribute name="color-setting">
        </attribute>
        <attribute name="color">
        </attribute>
      </attributes>
      <nvs>
      </nvs>
    </device>
  4. Within each <attribute> element, define an <nvs> element to contain all the device datapoints to be mapped to the server datapoint defined by the attribute as shown below.

    <device pid="9FFFFF05006F0002" name="LED" type="color_lamp_controller" brand="Echelon">
      <attributes>
        <attribute name="color-setting">
          <nvs>
          </nvs>
        </attribute>
        <attribute name="color">
          <nvs>
          </nvs>
        </attribute>
      </attributes>
      <nvs>
      </nvs>
    </device>
  5. Within each <attribute><nvs> element, define an <nv> element for each device datapoint to be mapped to the server datapoint defined by the attribute as shown in the example below. For each <nv> element, define the index and direction attributes to identify the device datapoint and specify its direction on the device (input or output). For device applications developed in IzoT Python, you can use the list console command to get a list of all device datapoints and the index for each (see Adding a Console Menu). For device applications developed in Neuron C, you can open the device interface (XIF) file in a text editor to get a list of all device datapoints and the index for each.

    <device pid="9FFFFF05006F0002" name="LED" type="color_lamp_controller" brand="Echelon">   
    	<attributes>     
    		<attribute name="color-setting">       
    			<nvs>         
    				<nv index="16" direction="input" />       
    			</nvs>     
    		</attribute>     
    		<attribute name="color">       
    			<nvs>         
    				<nv index="19" direction="output" />       
    			</nvs>     
    		</attribute>   
    	</attributes>   
    	<nvs>   
    	</nvs> 
    </device>
  6. Within the top-level <nvs> element, define an <nv> element for each device datapoint that corresponds to a device datapoint identified in an <attribute> element. Specify the attributes of each datapoint. You must specify the index and size (in bytes) properties for each datapoint. The index property must match the index specified in the <nv> element specified in the corresponding <attribute> elements. You can also specify an optional type attribute that is used for documenting the device class file, and you can also specify scalar values or enumeration values. The device datapoints are defined by the IzoT device application.

  7. To map any enumeration values or numeric values to text strings, define <enum> elements for the attributes within an <nv> element (inside the <nvs> element) to define logical names for network variable or field values.