Modbus Rtu Advanced User Information - Siemens SIMATIC S7 System Manual

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

Libraries
9.3 Modbus RTU library
LAD
9.3.5

Modbus RTU advanced user information

Overview
This topic contains information for advanced users of the Modbus RTU master library. Most
users do not need this information and will not need to modify the default operation of the
Modbus RTU master library.
Retries
The Modbus master instructions automatically resend the request to the slave device if one
of the following errors is detected:
● There is no response within the response timeout time (parameter Timeout on the
MBUS_CTRL / MB_CTRL2) instruction (Error code 3).
● The time between characters of the response exceeded the allowed value (Error code 3).
● There is a parity error in the response from the slave (Error code 1).
● There is a CRC error in the response from the slave (Error code 8).
● The returned function did not match the request (Error code 7).
The Modbus Master resends the request two additional times before setting the Done and
Error output parameters.
You can change the number of retries by finding the symbol mModbusRetries in the Modbus
master symbol table and changing this value after the program executes MBUS_CTRL /
MB_CTRL2. The mModbusRetries value is a BYTE with a range of 0 to 255 retries.
496
Description
Network 6
Call the second MBUS_MSG instruction when the second
enable flag (M2.1) is ON. The First parameter must be set
for only the first scan that the instruction is enabled.
This instruction reads (RW = 0) 4 holding registers from
slave 2. The data is read from address 40010 - 40013 in the
Modbus slave and copied to VB200 - VB207 (4 words) in
the CPU.
Network 7
When the second MBUS_MSG instruction is complete
(Done goes from 0 to 1), clear the enable for the second
MBUS_MSG instruction.
If Error (MB1) is not zero, then set Q0.2 to show the error.
System Manual, V2.3, 07/2017, A5E03822230-AF
S7-200 SMART

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-200 smart

Table of Contents