Professional Documents
Culture Documents
1. Realisation
The realisation of a Modbus RTU slave – protocol part is made with the elements
• MIB (Multi-Interface-Board)
• C7000AT
These elements act in Modbus-BMS connections as gateway for Stulz controllers downstream. The gateway
currently gathers the necessary data point information of the controllers to be visualized. For the realised
Modbus read commands
• 1, Read Coil Status
• 2, Read Input Status
• 3, Read Holding Register
• 4, Read Input Register
the gateway sends the requested data point information, resp. with the write commands
• 5, Force Single Coil
• 16, Write Multiple Register
data point modifications are possible, where a write access is permitted. The function
• 8, Loopback Test
allows a simple connection and configuration test.
1.1 Restrictions
C7000AT:
Caused by the cache memory size, 50 data points per C7000IOC can maximally be provided.
2. Function description
Here follows a description of the realisation of selected Modbus functions. Only the Modbus variant RTU, as
Modbus slave is put into practice.
The data point information of the addressed Stulz controllers is provided in the MIB/C7000AT which act as
a gateway. Whereas the MIB provides constantly all data point values of the available Modbus data point
lists, the C7000AT takes into account which data points are requested in order to not currently update un-
necessarily many data points.
For this the C7000AT must pass a learning cycle, when Modbus-BMS requests occur for the first time and im-
mediate responses will not yet be sent. Repeated Modbus-BMS requests may then be answered at once.
By the global unit address of the Stulz controllers, the global address of C7000IOCs resp. the CPU address
of former generations of Stulz controllers is meant.
EN/03.2010/Modbus/1
2.1.1 Read Coil Status (0x01) / Read Input Status (0x02)
Function 1 is historically determined to binary outputs, whereas function 2 is used for binary inputs. Block
requests are possible.
The character strings for these commands only differ by the transmitted function code and therefore they
are explained together.
Master Slave
Byte Nr. 0 1 2 3 4 5 6 7
unit adr. cmd 11.stDP-
dp addr.
Adr. count crc
The number count of Bit data points will be read blockwise from the 1st dp addr. .
Slave Master
The number count of the read data points is transmitted in bytes = (count + 7) / 8 Bytes. The order of the
Bit data points to be transmitted within the 1st data Byte is as follows:
This Bit order repeats itself in every further necessary Byte in the same way. For this, the Bit counting order
begins by 9 at the LSB in the 2nd data Byte.
EN/03.2010/Modbus/2
Example 1:
Reception: -> 01r 01r 00r 02r 00r 02r 1Cr 0Br r = receive
0x01: Global address of the controller
0x01: Function „Read Coil Status“
0x0002: 1st data point address (block beginning)
0x0002: 2 consecutive Bit data points requested blockwise
0x1C0B: Checksum
Example 2:
Reception: -> 01r 02r 00r 00r 00r 03r 38r 0Br r = receive
0x01: Global address of the controller
0x02: Function „Read Input Status“
0x0000: 1st data point address (block beginning)
0x0003: 3 consecutive Bit data points requested blockwise
0x380B: Checksum
EN/03.2010/Modbus/3
2.1.2 Read Holding Register (0x03) / Read input Register (0x04)
Function 3 is used for analogous outputs and internal variables, whereas function 4 is historically determined
to analogous inputs. Block requests are possible.
The character strings for these commands only differ by the transmitted function code and therefore they
are explained together.
These functions have in common that the read data points are exclusively of the type Real/Float, encoded as
IEEE754 (32Bit , 4Byte, 2 words). The order of the two Words of each data point can be generally adjusted
(chapter 3).
A conversion of IEEE754 encoded values can be found with the following link:
http://babbage.cs.qc.edu/IEEE-754/32bit.html
Master Slave
Byte Nr. 0 1 2 3 4 5 6 7
unit adr. cmd 1st1.dp addr.
DP- Adr. count crc
The number n = (count / 2) of analogous real data points out of 2 Words each (4 Bytes) are read as data
point block beginning from 1st dp addr. .
Slave Master
The number n = (count / 2) of the read real data points in the format IEEE754 are transmitted by bytes =
2 * count Bytes.
EN/03.2010/Modbus/4
Example 1:
Reception: -> 01r 03r 00r 00r 00r 02r C4r 0Br r = receive
0x01: Global address of the controller
0x03: Function „Read Input Register“
0x0000: 1st data point address
0x0002: 1 data point (2 Words) requested
0xC40B: Checksum
Response: <- 01t 03t 04t 41t B4t 00t 00t AEt 29t t = transmit
0x01: Global address of the controller
0x03: Function „Read Input Register“
0x04: 4 data Bytes follow
0x41B4 0000 1st requested data point = 22,5 (conversion)
0xAE29: Checksum
Example 2:
Reception: -> 01r 04r 00r 00r 00r 04r F1r C9r r = receive
0x01: Global address of the controller
0x04: Function „Read Input Register“
0x0000: 1st data point address (block beginning)
0x0004: 2 consecutive data points (4 Words) requested blockwise
0xF1C9: Checksum
Response: <- 01t 04t 08t 41t D0t 00t 00t 42t 45t 99t 9At DFt AAt t = transmit
0x01: Global address of the controller
0x04: Function „Read Input Register“
0x08: 8 data Bytes follow
0x41D0 0000 1st requested data point = 26 (conversion)
0x4245 999A 2nd requested data point = 49,4 (conversion)
0xDFAA: Checksum
EN/03.2010/Modbus/5
2.1.3 Force Single Coil (0x05)
Slave Master
Byte Nr. 0 1 2 3 4 5 6 7
unit adr. cmd dpDP-
addr.
Adr. value crc
The acknowledgement resonse of the Stulz unit is identical with the write command.
Example 1:
Reception: -> 01r 05r 00r 00r FFr 00r 8Cr 3Ar r = receive
0x01: Global address of the controller
0x05: Function “Force Single Coil“
0x0000: Data point address
⌆≘≙
0xFF00: Write value; 0xFF00 ≙ 1
0x8C3A: Checksum
Response: <- 01t 05t 00t 00t FFt 00t 8Ct 3At t = transmit
0x01: Global address of the controller
0x05: Function “Force Single Coil“
0x0000: Data point address
0xFF00: Write value; 0xFF00 ≙ 1
0x8C3A: Checksum
Example 2:
Reception: -> 01r 05r 00r 00r 00r 00r CDr CAr r = receive
0x01: Global address of the controller
0x05: Function “Force Single Coil“
0x0000: Data point address
0x0000: Write value; 0x0000 ≙ 0
0xCDCA: Checksum
Response: <- 01t 05t 00t 00t 00t 00t CDt CAt t = transmit
0x01: Global address of the controller
0x05: Function “Force Single Coil“
0x0000: Data point address
0x0000: Write value; 0x0000 ≙ 0
0xCDCA: Checksum
EN/03.2010/Modbus/6
2.1.4 Write Multiple Register (0x10)
Function 16 (hexadecimal 0x10) is used to write analogous Stulz data points, which are encoded as IEEE754
values (32Bit , 4Byte, 2 Words) .
As a Modbus Register consists generally of a Word, a Stulz – data point access is already a multiple access
(2 Words) at an even Modbus address (0, 2, 4, …). The order of the two Words of each data point can be
generally adjusted (chapter 3).
The realisation with the Stulz gateway only allows the writing of exactly 2 Words, i.e. 1 Stulz data point.
Master Slave
Byte Nr. 0 1 2 3 4 5 6 7..11 12 13
unit adr. cmd dp addr.
DP- Adr. words bytes data crc
The analogous date data (2 Words) is written to the even address dp addr..
Slave Master
Byte Nr. 0 1 2 3 4 5 6 7..11 12 13
unit adr. cmd dp addr.
DP- Adr. words bytes data crc
The first part of the write command is returned with a new checksum as acknowledgement of the writing
process.
Example 1:
Reception: -> 01r 10r 00r 00r 00r 02r 04r 41r B0r 00r 00r E6r 74r r = receive
0x01: Global address of the controller
0x10: Function „Read Input Register“
0x0000: Data point address
0x0002: 1 data point (2 Words) will be written
0x04: 4 data Bytes follow
0x41B0 0000 datapoint to be written = 22,0 (conversion)
0xE674: Checksum
Response: <- 01t 10t 00t 00t 00t 02t 41t C8t t = transmit
0x01: Global address of the controller
0x10: Function „Read Input Register“
0x0000: Data point address
0x0002: 1 data point (2 Words) is written
0x41C8: Checksum
EN/03.2010/Modbus/7
2.1.5 Loopback Test (0x08)
Master Slave
Byte Nr. 0 1 2 3 4 5 6 7
unit adr. cmd diag code value crc
unit addr.: global address of the addressed stulz controller, 1 Byte
cmd: test function (0x08), 1 Byte
diag code: any, 2 Bytes
value: any, 2 Bytes
crc: checksum serves for the data safety, 2 Bytes
Slave Master
Byte Nr. 0 1 2 3 4 5 6 7
unit adr. cmd diag code value crc
With this connection test the test command is returned unmodified as an echo.
Example:
Reception: -> 01r 08r 00r 00r 00r 02r A1r A6r r = receive
0x01: Global address of the controller
0x08: Function “Loopback Test“
0x0000: Diag code
0x0203: Diag value
0xA16A: Checksum
Response: <--> 01r 08r 00r 00r 00r 02r A1r A6r t = transmit
0x01: Global address of the controller
0x08: Function “Loopback Test“
0x0000: Diag code
0x0203: Diag value
0xA16A: Checksum
EN/03.2010/Modbus/8
2.1.6 Modbus error messages
If an error occurs at a data point access, the error telegram consists for all Modbus functions of the following
elements:
Slave Master
Byte Nr. 0 1 2 3 4 5
unit adr. err id err code crc
unit adr.: global address of the Stulz controller, which indicates the error, 1 Byte
err id: the cmd from the Master->Slave command + 0x80, 1 Byte
err code: indicates the cause of malfunction, 1 Byte
crc: checksum serves for the data safety, 2 Bytes
An exception is formed by the "Loopback Test". In case of error no response will be returned for this function.
The error recognition err id in the 2nd Byte of an error telegram can look like this:
EN/03.2010/Modbus/9
3. Settings for activation
To enable the Modbus protocol the following command is available at the service interface.
• protocol modbus
Concerning the protocol modbus selected above, you can choose among three data point lists in the
C7000AT:
• dplist classic
• dplist full
• dplist custom
• port rs232
• port rs485
Under certain circumstances the setting of the data word order for ieee754 encoded analogous data points
may be important (see chap. 2.1.2, chap. 2.1.4). The data word order can begin either with the MSB or the
LSB. The standard setting is MSB.
• ieee msb
• ieee lsb
57600, 38400, 19200, 14400, 9600, 7200, 4800, 3600, 2400, 1200, 600, 300
We disadvise to modify further settings of the serial interface. The standard settings are:
• baudrate 9600
• flowcontrol off
• databits 8
• stopbits 1
• parity none
EN/03.2010/Modbus/10
4. Data point lists
The construction of the Modbus data point lists is explaned here in extracts.
For the data point access a combination of Modbus address and Modbus function is decisive.
Modbus data point addresses begin at 0.
The addresses for analogous data points are exclusively even addresses, as they always consists of 2 Words
and are of the type Real/Floating Point, IEEE754 encoded (32Bit, 4Byte).
The access possibilities on data points are indicated as follows:
• r = Read only
• w = Write only
• rw = Read and Write
Besides the data point description you find important information to the indicated valid range.
Whereas the C7000AT can only be used as gateway for the BMS connection of C7000IO controllers, with
the MIB board Stulz controllers of former generations can be used.
The following data point lists can actually be selected:
C7000AT:
On the basis of the concise number of datapoints of former controllers, this data point list has been created
with quite a similar scope. The rigid assignment of in- and outputs and functions has been omitted.
The data point list is arranged according to Modbus functions and data point addresses.
C7000AT:
This data point list allows the BMS access to many unit parameters of the C7000IOC.
EN/03.2010/Modbus/11
4.3.1 Function description
The customized data point list Modbus Custom obtains shorter update times in customer installations for
C7000 sytems consisting of C7000AT and C7000IOC. Only the data points which are important for the cus-
tomer are configured into a customized data point list and can be read out all in one block.
The data point list configured this way is safe in the C7000AT even at power failures.
Only in case of a software update resp. exchange of hardware of the corresponding C7000AT, the configu-
ration must be carried out again.
You can also save the complete configuration as a text file and have it automatically send by the C7000
service program, button „Configuration“ (, resp. the program C7000-Config.exe) to the C7000AT.
Protocol: MODBUS
Baudrate: 9600
(via service interface: baudrate 9600)
3. Deleting the existing customized data point list for a C7000IOC by means of the IO-bus address.
Using the IO-bus address 32, all 32 data point lists are deleted.
4. Data point configuration for a C7000IOC by means of the IO-bus address. Stulz data point addres-
ses (not Modbus data point addresses) are only configured, if the data point list "custom“ has been
adjusted.
EN/03.2010/Modbus/12
The Stulz data point addresses are in the first column of the newest data point list „STULZ_udpl_
141_modbus.pdf“.
The individually configured data points or data point blocks are attached in the customized data
point list. Notice, that Bit data points as any other data point types must be arranged blockwise.
The two data point blocks for Bits and register can be read out blockwise from address 0 by the
Modbus RTU BMS.
All register data point are of the type Real/Float (IEEE 754).
5. Final saving of the configuration in the permanent memory. The command below saves the con-
figuration. The process should not be delayed by further entries. You must wait 10 minutes, until
cutting the C7000AT from the power supply.
EN/03.2010/Modbus/13
4.3.2.4 Checking the configuration
6. The result of the previous configuration steps can be checked by the command „cache“.
Me 00:> cache
unit dps
---- -----
1 6
An overview of the unit data point lists arranged according to the IO-bus addresses of the C7000IOC
is edited.
The command also contains the possibilty to view each data point list in detail.
Me 00:> cache 1
EN/03.2010/Modbus/14
4.3.2.5 Test of the data point list
7. To test the configured customized data point list the BMS simulation program C7000-Service can
be used.
Now it is possible to update the complete data point list of a unit by 2 block requests in the Modbus
RTU – BMS.
additionally:
All Bit data points (number i) of all C7000IOCs (number n) connected at the C7000AT can be
read as one single Bit block. For this the BMS request must be directed to the unit with the lowest
IO-bus address and must have the size x = i*n.
The Bit data points must be identified by the BMS due to their position within the block and be
assigned the right controller.
This also works for register data points in principle, however the response of the destination unit
will then be very long. Per data point 4 Bytes are reserved in the response. The advantage is quickly
qualified this way as for smaller systems not too many requests will be necessary anyway.
If the admissible maximum size for a response is exceeded an error message is edited instead.
4.3.3 Result
The result is the possibility to update all data points of a C7000IO controller by 2 requests maximum (1 Bit
block and 1 register block).
A realistic eample:
i = 10 Bit data points/unit
j = 10 Register data points/unit
n=8 C7000IOC units in the IO bus
With this example, up to 18 requests per controller can be avoided (2 requests instead of 20, if previously
no block formation was possible).
In total, the refresh cycle for the complete IO bus (8 controllers) is reduced to 16 requests this way (instead
of up to 160).
Note:
If all Bit data points (number i) of all C7000IOC (number n) connected at the C7000AT are read out com-
monly as a single Bit block, the size of this Bit block is: x = i * n
The refresh cycle would be reduced this way to 9 requests for the whole IO bus (8 controllers).
EN/03.2010/Modbus/15
4.3.4 Restrictions
Caused by the cache memory size, 50 data points per C7000IOC can maximally be provided.
4.3.5 Appendix
Here you see the settings which have previously been made in this document as an example. This confi-
guration can be used as it is. The same configuration for another C7000IOC with the IO bus address 2 is
attached additionally.
e.g. Config1.txt
, which can automatically configure the C7000AT by means of the C7000 service program.
Contents of Config1.txt:
EN/03.2010/Modbus/16
cacheconf 1 1170 1
;
; Setpoint temperature according to control mode
cacheconf 1 1173 1
;
; Setpoint humidity according to control mode
cacheconf 1 1174 1
;
; ------------------------------------------------------------------
; Configuration for C7000IOC with IO bus address 2
; Bit block
cacheconf 2 1013 1
cacheconf 2 1010 1
cacheconf 2 1000 1
;
; --------------
; Register block
cacheconf 2 1170 1
cacheconf 2 1173 1
cacheconf 2 1174 1
;
; ------------------------------------------------------------------
; Overview of all configured data point lists
cache
;
; ------------------------------------------------------------------
; Saving the configuration in the permanent memory
cachesave
EN/03.2010/Modbus/17
5. Response times of the Stulz Gateway
EN/03.2010/Modbus/18
Response times of the Stulz Gateway
EN/03.2010/Modbus/19
Response times of the Stulz Gateway
EN/03.2010/Modbus/20