Libraries
9.3 Modbus RTU library
S7-200 SMART
System Manual, V2.3, 07/2017, A5E03822230-AF
497
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
in the Modbus master symbol table and changing this value after
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
mModbusForceMulti
in
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.
Содержание SIMATIC S7-200
Страница 30: ...Product overview 1 7 Programming software S7 200 SMART 30 System Manual V2 3 07 2017 A5E03822230 AF ...
Страница 267: ...Program instructions 7 6 Counters S7 200 SMART System Manual V2 3 07 2017 A5E03822230 AF 267 HSC modes 3 and 4 ...
Страница 394: ...Program instructions 7 18 Subroutine S7 200 SMART 394 System Manual V2 3 07 2017 A5E03822230 AF ...
Страница 425: ...Communication 8 5 PROFIBUS S7 200 SMART System Manual V2 3 07 2017 A5E03822230 AF 425 ...
Страница 786: ...Technical specifications A 11 S7 200 SMART cables S7 200 SMART 786 System Manual V2 3 07 2017 A5E03822230 AF ...
Страница 798: ...Error codes C 4 PLC fatal error codes S7 200 SMART 798 System Manual V2 3 07 2017 A5E03822230 AF ...
Страница 848: ...Ordering information F 6 Human Machine Interface devices S7 200 SMART 848 System Manual V2 3 07 2017 A5E03822230 AF ...