Benutzer-Werkzeuge

Webseiten-Werkzeuge


modbus_master_serial_en

Modbus Master serial

The Modbus master driver can read and write registers/data points from devices working as Modbus slave.

Each Modbus slave provides up to 4 different types of registers.

1.Holding Register 16Bit Register Read/Write
2.Input Register 16Bit Register Read only
3.Coil Register 1Bit Register Read/Write
4.Status Register 1Bit Read only

For the registers different read- / write functions are used.

Register read Register write multiple linked registers (MultiWrite, default)
Holding 03 06 16
Input 04
Coil 01 05 15
Status 02

The name of the Mocbus driver is: mod
The routing address of the first driver is 80
The data points file of the first Modbus driver is: modmster1.txt
The configuration file for global settings of the first Modbus driver: modmster1.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 defined as follows:

„<slave> <register> <no>[.<bit>]“

Communication state with Modbus slave: „<slave> failure“

While following definition is valid:

Parameter Range of values Description
<slave> 0 - 247 Address of the slave device
<register> holding,
input,
coil,
status
Type of register
<no> 0 - 65535 Register address
<bit> 1-16 single bit within the register

Example: The address of a coil register 120 of slave 2 will be defined in the file modmsterX.txt as follows:

[M 2 coil 120]

In order to inform the driver how to handle the stored information the format for each data point must be defined.

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 special formats upon request.

For Coil- or status registers no format is required.

32bit-formats require more than one register, Missing registers are built from successing registers. Those registers are not available for following registers anymore!

Typical data point definitions are :

[M 2 failure]
 name  = Fail to communicate with MODBUS-Slave-2 (0=OK 1=fail)
 query = pe 
[M 2 status 5]
 name = digital operation mode statement
 query = pe
[S 2 coil 10]
 name = digital given value
 query = pe
 writecache = yes
[M 2 input 10.3]
 name = digital operation mode statement
 query = pe
 format = sbit06
[S 2 holding 11.5]
 name = digital given value
 query = pe
 format = sbit06
 writecache = yes
[M 2 holding 15]
 name = multistate message e.g. 0,1,2 for Off, 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
[X 2 input 17]
 name = temperature (Register 17+18)
 query = pe
 format = f
[Y 2 holding 17]
 name = given temperature value , one decimal place
 query = pe
 format = st
 writecache = yes
modbus_master_serial_en.txt · Zuletzt geändert: 19.01.2017 16:13 von fla