Siemens SIMATIC S7 System Manual page 497

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

Inter-character timeout
Modbus master execution aborts a response from a slave device if the time between
characters in the response exceeds an assigned time limit. The default time is set to 100
milliseconds which should allow the Modbus master instructions to work with most slave
devices over wire or telephone modems. If the CPU detects this error, the MBUS CTRL /
MB_CTRL2 instruction returns error code 3 in the Error parameter.
Communication might possibly require a longer time between characters, either because of
the transmission medium (for example, telephone modem) or because the slave device itself
requires more time. You can lengthen this timeout by finding the symbol
mModbusCharTimeout
MBUS_CTRL / MB_CTRL2 has been executed. The mModbusCharTimeout value is an INT
with a range of 1 to 30000 milliseconds.
Single vs. multiple bit / word write functions
Some Modbus slave devices do not support the Modbus functions to write a single discrete
output bit (Modbus function 5) or to write a single holding register (Modbus function 6).
These devices only support the multiple bit write (Modbus function 15) or multiple register
write (Modbus function 16) instead. The MBUS_MSG / MB_MSG2 instruction returns an
error code 101 if the slave device does not support the single bit/word Modbus functions.
The Modbus master protocol allows you to force the MBUS_MSG / MB_MSG2 instruction to
use the multiple bit/word Modbus functions instead of the single bit/word Modbus functions.
You can force the multiple bit/word instructions by finding the symbol
the Modbus master symbol table and changing this value after the program executes
MBUS_CTRL / MB_CTRL2. Set mModbusForceMulti to TRUE to force the use of the
multiple bit/word functions when writing a single bit or register.
Accumulator usage
The Modbus master instructions use accumulators (AC0, AC1, AC2, AC3), which appear in
the Cross Reference listing. The Modbus master instructions save and restore the values in
the accumulators. All CPU preserves all user data in the accumulators while executing the
instructions.
Holding register addresses greater than 49999
Modbus holding addresses are within the range of 40001 to 49999. This range is adequate
for most applications but there are some Modbus slave devices with data mapped into
holding registers at a higher address range.
The MBUS_MSG / MB_MSG2 instruction allows an additional range for the parameter Addr
to support an extended range of holding register addresses at addresses 400001 to 465536.
For example: to access holding register 16768, the Addr parameter of MBUS_MSG /
MB_MSG2 should be set to 416768.
The extended addressing allows access to the full range of 65536 possible addresses
supported by the Modbus protocol. This extended addressing is only applicable for holding
registers.
S7-200 SMART
System Manual, V2.3, 07/2017, A5E03822230-AF
in the Modbus master symbol table and changing this value after
Libraries
9.3 Modbus RTU library
mModbusForceMulti
in
497

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-200 smart

Table of Contents