Modbus/RTU Master
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 |
INTERFRAME_DELAY | float | 0.0 | Interframe delay (0 = 3.5x character-time) [s] |
RESPONSE_TIMEOUT | float | 0.5 | Receive timeout [s] |
T_AWAKE | float | 5.0 | How long slave devices stays awake [s] |
T_SETTLE | float | 0.1 | How long it takes slave device to settle after waking up [s] |
WAKE_PACKET_LENGTH | int | 50 | Wake packet length [B] |
N_SCAN_RETRIES | int | 2 | Number of scan retries |
Measurements
This stack supports measurements.
Measurement address
Type: regex
Description:
<unit-address>/[datatype@]<address-space>:<reference>, where:
- unit-address is a modbus slave address
- 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/3:1000 - input register 1000 on slave 3 with default datatype (16-bit unsigned)
7/1:550 - discrete input 550 on slave 7
10/fb4@4:1310 - holding registers 1310,1311,1312,1313 on slave 10 mapped as 64-bit big-endian floating-point value
11/dl2@0:35 - coils 35,36 on slave 11 mapped as 2-bit (quaternary) in little-endian (LSB, MSB) order
Commands
This stack supports commands.
Command address
Type: regex
Description:
<unit-address>/[datatype@]<address-space>:<reference>, where:
- unit-address is a modbus slave address
- 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:
3/4:1000 - holding register 1000 on slave 3 with default datatype (16-bit unsigned)
7/0:550 - coil 550 on slave 7
10/fb4@4:1310 - holding registers 1310,1311,1312,1313 on slave 10 mapped as 64-bit big-endian floating-point value
11/dl2@0:35 - coils 35,36 on slave 11 mapped as 2-bit (quaternary) in little-endian (LSB, MSB) order