Skip to content

Modbus/RTU Slave

Parameters

Parameter Datatype Default Value Description
DEBUG enum 0 Enable debugging
DUMP enum 0 Enable communication dump
TTY tty Communication interface
BAUDRATE enum 115200 Baud rate
PARITY enum even Parity
ADDRESS int 1 Station address
READ_NO_ILLEGAL_ADDRESS enum 0 Do not return Illegal Data Address on invalid read, return zeroes instead

Measurements

This stack supports measurements.

Measurement address

Type: regex

Description:

[datatype@]<address-space>:<reference>, where:
    - datatype is used to define object layout if it spans multiple registers
        - format: <S|U|F|D><L|B><1|2|4>, where:
            - S - signed
            - U - unsigned
            - F - floating point
            - D - discrete
            - L - little-endian (LOW before HIGH)
            - B - big endian (HIGH before LOW)
            - 1 - size is 1 register/coil/discrete input
            - 2 - size is 2 registers/coils/discrete inputs
            - 4 - size is 4 registers/coils/discrete inputs
        - Unsupported datatypes: FL1, FB1, DL4, DB4
    - address-space is modbus address space number (0 - coils, 1 - discrete inputs, 3 - input registers, 4 - holding registers)
    - reference is 1-based register, coil or discrete input number in given address space

Examples:

3:1000 - measurement mapped onto input register 1000 with default datatype (16-bit unsigned)
1:550 - measurement mapped onto discrete input 550
fb4@4:1310 - measurement mapped onto 64-bit big-endian floating-point value on holding registers 1310,1311,1312,1313
dl2@0:35 - measurement mapped onto 2-bit (quaternary) in little-endian (LSB, MSB) order on coils 35,36

Commands

This stack supports commands.

Command address

Type: regex

Description:

[datatype@]<address-space>:<reference>, where:
    - datatype is used to define object layout if it spans multiple registers
        - format: <S|U|F|D><L|B><1|2|4>, where:
            - S - signed
            - U - unsigned
            - F - floating point
            - D - discrete
            - L - little-endian (LOW before HIGH)
            - B - big endian (HIGH before LOW)
            - 1 - size is 1 register/coil/discrete input
            - 2 - size is 2 registers/coils/discrete inputs
            - 4 - size is 4 registers/coils/discrete inputs
        - Unsupported datatypes: FL1, FB1, DL4, DB4
    - address-space is modbus address space number (0 - coils, 4 - holding registers)
    - reference is 1-based register, coil or discrete input number in given address space

Examples:

4:1000 - command mapped onto holding register 1000 with default datatype (16-bit unsigned)
0:550 - command mapped onto coil 550
fb4@4:1310 - command mapped onto 64-bit big-endian floating-point value on holding registers 1310,1311,1312,1313
dl2@0:35 - command mapped onto 2-bit (quaternary) in little-endian (LSB, MSB) order on coils 35,36