Modbus Slave serial
The Modbus Slave driver provides datapoint/registers as Modbus slave devices. Four different register type can be used:
1.Holding register | 16Bit register with read-/write access |
2.Input register | 16Bit register with read access |
3.Coil register | 1Bit register with read-/write access |
4.Status register | 1Bit register with read access |
Registers are using differen read and write functions.
read register | write register | write multiple linked registers (MultiWrite, default) | |
---|---|---|---|
Holding | 03 | 06 | 16 |
Input | 04 | – | – |
Coil | 01 | 05 | 15 |
Status | 02 | – | – |
The name of the Modbus driver is: mod
Routing-address of the first Modbus driver is 90
The datapoint file fo rthe first Modbus driver is named: modslave1.txt
The configuration file for global setting of the first Modbus driver is: modslave1.cfg
For the Modbus driver as well as all other gateway drivers the following definitions are valid:
Type | Description |
---|---|
M | Integer value (binary data points, counters) which can/shall only be read by the gateway |
S | Integer value which can be either read or written by the gateway. (to M-BUS writing is not possible) |
X | Floating point value (with decimal place) which can/shall only be read by the gateway |
Y | Floating point value (with decimal place) which can be either read or written by the gateway. (to M-BUS writing is not possible) |
A | String, is used e.g. with BACnet Trends and ESPA4.4.4 data points |
Addresses are structured as follows:
„<slave> <register> <no>[.<bit>]“
state of communication with master device: „failure“
Which is defined as follows:
Parameter | Range of value | Description |
---|---|---|
<slave> | 0 - 247 | Address of the addresses Slave-device |
<register> | holding, input, coil, status | Type of register |
<no> | 0 - 65535 | register address |
<bit> | 1-16 | single bit within a register |
The address of a coil register 120 of slave „2“ will be defined in the file modslaveX.txt:
[M 2 coil 120]
In order to inform the driver how to evaluate the data in a certain address a specified format for each data point is defined. Please see see the following format definitions:
format = <format>
While <format> can be:
This is how to define the format:
format = <format>
With <format> as:
<format> | Description |
---|---|
u | 16bit unsigned |
ut | 16bit unsigned / 10 (gain one decimal place) |
uh | 16bit unsigned / 100 (gain two decimal places) |
um | 16bit unsigned / 1000 (gain three decimal places) |
u32 | 32bit unsigned |
u32s | 32bit unsigned (word order inverted) |
s | 16bit signed |
st | 16bit signed / 10 (gain one decimal place) |
sh | 16bit signed / 100 (gain two decimal places) |
sm | 16bit signed / 1000 (gain three decimal places) |
c | 32bit signed |
ci | 32bit signed (byte order switched) |
ct | 32bit signed / 10 (gain one decimal place) |
ch | 32bit signed / 100 (gain two decimal places) |
cm | 32bit signed / 1000 (gain three decimal place) |
f | 32bit IEEE754 floating point |
fi | 32bit IEEE754 floating point (byte order inverted) |
bcd | 16bit BCD |
sbit06 | 1bit single bit from holding or input register. Requires <bit> in the address. For writing 06 resp. 05 is used. |
sbit16 | 1bit single bit from holding or input register. Requires <bit> in the address. For writing 15 resp. 16 is used. |
Further specialized formats upon request.
For Coil- and Status-registers no format information is required.
32Bit-formats require more than one register. Missing registers are taken from succeeding registers. Those registers are unavailable for other data points!
Typical data point definitions are:
[S 2 status 5] name = digitale mode query = pe
[M 2 coil 10] name = digitaler given value query = pe writecache = yes
[S 2 input 10.3] name = digitale mode query = pe format = sbit06
[M 2 holding 11.5] name = digitaler given value query = pe format = sbit06 writecache = yes
[S 2 holding 15] name = multistate value e.g. 0,1,2 for Offs, On , Auto query = pe format = u
[S 2 holding 16] name = multistate given value e.g. level switch 0, 1, 2 for Off, On, Auto query = pe format = u writecache = yes
[Y 2 input 17] name = Temperature (register 17+18) query = pe format = f
[X 2 holding 17] name = Temperature, one decimal place query = pe format = st writecache = yes