Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
<component_template config_version="1.0" schema_version="1.0">
  <description>template_AY1020</description> 											# This is the general description respectivly the name of the Template.
  <vendor>azeti</vendor> 
  <version>2</version> 
  <class>multi-sensor</class>
    <sensors>
        <sensor sensor_id="AY1020-Port1-Bit0"> 															# This is the name of the sensor as it will be shown in the Dashboard.
        .
		.
		.
		 </sensor>
		.
		.
		.
	<devices>
		<device device_id="AY1020-IOLink-Master">											# Name of the device.
    		<modbus_device pdu_addressing="true">
      			<modbus_tcp>																# Definition of the ModBus typ we are using.
        			<address>192.168.118.64</address>										# IP address of the ModBus device.
          			<port>502</port>														# Port of the device (default ist 502).
          			<slave_address>1</slave_address>										# Slave address of the device.
        		</modbus_tcp>
      		</modbus_device>
      	<sensor_gateways>
      		<sensor_gateway publish_strategy="always" sensor_gateway_id="gw_AY1020-Port1">	# Here we define the name of the gateway, so the sensor knows which one to use.
        		<modbus>
          			<modbus_register>
            			<register_address>1000</register_address>							# This is the the first register address of the device.
              			<register_count>3</register_count>									# Here we tell the system, how many registers the device has.
              			<block_type>holding_registers</block_type>							# Here we define what kind of type these registers are (Ex. coils, holding registers, input registers).
              			<timeout>1000.0</timeout>											# Timeout value (1000 equals 1 second).
            		</modbus_register>
            		<scheduling>
            			<polling_interval>1000</polling_interval>							# Here we define how often the registers should be polled. The value 1000, is equal to 1 second.
              			<error_handling>
              			<retry retry_algorithm="linear"/>
                			<fixed_timeout>1000</fixed_timeout>
              			</error_handling>
            		</scheduling>
          		</modbus>
        	</sensor_gateway>
        <sensor_gateway publish_strategy="always" sensor_gateway_id="gw_AY1020-Port2">
        		<modbus>
          			<modbus_register>
            			<register_address>1000</register_address>
              			<register_count>3</register_count>
              			<block_type>holding_registers</block_type>
              			<timeout>1000.0</timeout>
            		</modbus_register>
            		<scheduling>
            			<polling_interval>1000</polling_interval>
              			<error_handling>
              			<retry retry_algorithm="linear"/>
                			<fixed_timeout>1000</fixed_timeout>
              			</error_handling>
            		</scheduling>
          		</modbus>
        	</sensor_gateway>
        	.
			.
        	.
            </sensor_gateways>	
		</device> 
    </devices>
</component_template>

Example of a ModBusTCP configuration

Here we have an example of a ModBusTCP configuration, using a B&R X20BC0087 ModBusTCP device.

Next Steps

Info