MODBUS SLAVE

MODBUS SLAVE

This Datastream module enable to register ODA as a Modbus Slave to receive Modbus requests.

To access source code click here.

Dependencies

This module have no dependencies

Configuration

To configure ModBus Datastream Slave module, a file named es.amplia.oda.datastreams.modbusslave.cfg must be created with the next parameters:

For each connection:

  • deviceId: Required parameter. The device identifier name that identifies the connection.
  • type: Required parameter. Indicates the type of connection used. At the moment only TCP type is supported.
  • ip: Required parameter. Ip Address where we are going to listen for modbus requests.
  • port: Required parameter. Port where we are going to listen for modbus requests.
  • slaveAddress: Required parameter. Direction of the device in modbus.

For each received modbus request that we want to translate to events:

  • dataAddress: Required parameter. Modbus direction of the signal received.

  • deviceId: Required parameter. The identifier of the device the signals comes from.

  • datastream: Required parameter. Identifier that will be asigned to the modbus value received.

  • feed: Optional parameter. Feed that will be assigned to the modbus value received. Null if not set.

  • dataType: Required parameter. Java type of the data recollected from the modbus direction.

    Allowed values are: Boolean, Short, Int, Long, Float, Double

es.amplia.oda.datastreams.modbusslave.cfg will have a similar format to:

# connections
deviceId1=type:TCP,ip:127.0.0.1,port:5020,slaveAddress:1
# translations
500,deviceId1=datastream:shortValue,feed:feed1,dataType:Short
27,deviceId1=datastream:booleanValue,feed:feed1,dataType:Boolean
257,deviceId1=datastream:registerValue1,feed:feed1,dataType:Short
258,deviceId1=datastream:registerValue2,feed:feed1,dataType:Short
259,deviceId1=datastream:registerValue3,feed:feed1,dataType:Short
165,deviceId1=datastream:booleanValues,feed:feed1,dataType:Boolean
364,deviceId1=datastream:floatValue,feed:feed1,dataType:Float
384,deviceId1=datastream:doubleValue,feed:feed1,dataType:Double
415,deviceId1=datastream:longValue,feed:feed1,dataType:Long
634,deviceId1=datastream:intValue,feed:feed1,dataType:Int