Modbus Master visual mapper to KNX group addresses
Example: Modbus Master visual mapper to KNX group addresses
Intro
Starting from firmware from 14.11.2014 there is visual Modbus mapper included in LogicMachine3. It is used for mapping Modbus objects to KNX.
Modbus device profile
First thing you should do is to define Modbus device profile – it is a *.json file with the following structure e.g. a fragment from UIO20 device by Embedded Systems:
{
“manufacturer”: “Embedded Systems”,
“description”: “Universal 16+4 I/O module”,
“mapping”: [
{ “name”: “Output 1”, “bus_datatype”: “bool”, “type”: “coil”, “address”: 0, “writable”: 1 },
{ “name”: “Input 1”, “bus_datatype”: “float16”, “type”: “inputregister”, “address”: 0, “value_multiplier”: 0.001, “units”: “V” }
]
}
You can download full UIO20.json profile file here
Parameters:
- name – Object name, e.g. Output 2 (String, Required)
- nus_datatype – KNX object data type, key from dt table, e.g. float32 (String/Number, Required)
- type – Modbus register type, possible values: coil discreteinput register inputregister (String, Required)
- address – Register address (0-based) (Number, Required)
- writable – Set to true to enable writing to register if type is either coil or discreteinput (Boolean)
- datatype – Modbus value data type. If set, conversion will be done automatically. Possible values: uint16 int16 float16 uint32 int32 float32 uint64 int64 quad10k s10k (String)
- value_delta – New value is sent when the difference between previously sent value and current value is larger than delta. Defaults to 0 (send after each read) (Number)
- value_multiplier – Multiply resulting value by the specified number, value = value_base + value * value_multiplier (Number)
- value_bitmask – Bit mask to apply, shifting is done automatically based on least significant 1 found in the mask (Number)
- value_nan – Array of 16-bit integers. If specified and read operation returns the same array no further processing of value is done (Array)
- value_conv – Apply one of built-in conversion functions (String, Internal)
- value_custom – Name of a built-in enumeration or a list of key -> value mapping, resulting value will be 0 if key is not found (String/Object)
- internal – Not visible to user when set to true, should be used for scale registers (Boolean)
- units – KNX object units/suffix (String)
- address_scale – Address of register containing value scale, value = value * 10 ^ scale (Number)
- read_count – Number of register to read at once (for devices that only support reading of a specific block of registers) (Number)
- read_swap – Swap register order during conversion (endianness) (Boolean)
- read_offset – Position of first register of data from the block of registers (0-based) (Number)
When the Modbus device profile file is created, upload it by clicking on Profiles button.
Adding Modbus device
Once profiles are defined and RTU settings set, add Modbus device by clicking Add device button.
Once the device is added, you can do mapping to KNX addresses by clicking on icon. First, you see a list of all objects on the Modbus device.
Click on specific object to do mapping.