LM Modbus profile description Back

Profile fields

manufacturer String Required

Manufacturer name, example: Embedded Systems

description String Required

Device description, example: Universal 16+4 I/O module

timeout Number

Overrides default response timeout of 0.5 seconds for RTU or 3 seconds for TCP

product_code String

Product code which can be used for automatic profile mapping after scan description, obtained from the device via read device identification object id 1 request

read_swap Boolean/String

Sets global byte/word swap order during conversion (endianness). Same as read_swap field for mapping

read_delay Number

Adds a delay in seconds (max 1 second) between consecutive read requests from the slave, should not be used for most slaves

Mapping fields

name String Required

Object name, example: Output 2

bus_datatype String/Number Required

Object data type, key from dt table, example: float32

type String Required

Modbus register type, possible values: coil discreteinput register inputregister

address Number Required

Register address (0-based)

writable Boolean

Set to true to enable writing to coil or register

write_only Boolean

Set to true to disable reading coil or register value when writable is enabled

write_multiple Boolean

Set to true to force writing using multiple coil/register write function even when writing to a single coil or register

datatype String

Modbus value data type. Read length is chosen based on data type, data conversion is done automatically.
Possible values: uint16 int16 float16 uint32 int32 float32 uint64 int64 quad10k s10k

value_delta Number

New value is sent when the difference between previously sent value and current value is larger than delta. Defaults to unset, send on any value changed

value_base Number

Add specified number to the resulting value

value_multiplier Number

Multiply resulting value by the specified number value = value_base + value * value_multiplier

value_bitmask Number

Bit mask to apply, shifting is done automatically using Count Trailing Zeros (CTZ) function

value = 0xABCD
mask = 0x0F00
result = (value & mask) >> CTZ(mask) = (0xABCD & 0x0F00) >> 8 = 0xB

write_bitmask Boolean FW 2020.10 and newer

Set to true to enable writing shifted value to the register using value_bitmask. Only uint16 datatype is supported

value_nan Array

Array of 16-bit integers. If specified and read operation returns the same array no further processing of value is done

value_conv String Internal

Apply one of built-in convertion functions

value_custom String/Object

Name of a built-in enumeration or a list of key -> value mapping, resulting value will be 0 if key is not found

value_default Boolean/Number

Default value that is sent when coil/register cannot be read

internal Boolean

Not visible to user when set to true, should be used for scale registers

units String

Object units/suffix

address_scale Number

Address of register containing value scale value = value * 10 ^ scale

read_count Number

Number of registers to be read at once (for devices that only support reading of a specific block of registers; up to 125 registers can read at once)

read_swap Boolean/String

Swap byte/word order during conversion (endianness). Default value is word (2-byte) swap.
Possible string values: n (no swap), w (word swap), b (byte swap), bw (byte and word swap)

no swap: 0xABCD
word swap: 0xCDAB
byte swap: 0xBADC
byte and word swap: 0xDCBA

read_offset Number

Position of first register of data from the block of registers (0-based)

bus_address String (Group address)

Group address of mapped object. Recommended to use only during development