Initialization And Execution Time For Modbus Protocol - Siemens SIMATIC S7 System Manual

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

Libraries
9.3 Modbus RTU library
Modbus RTU slave protocol
Modbus slave protocol instructions use the following resources from the CPU:
● The MBUS_INIT instruction (Page 491) initializes the Modbus slave protocol and
dedicates the assigned CPU port (0 or 1) for Modbus slave communication.
When you use a CPU port for Modbus communication, you cannot use it for any other
purpose, including communications with an HMI.
● Modbus slave instructions affect all of the SM locations associated with a Freeport
communications on the port assigned by the MBUS_INIT instruction.
● Modbus slave instructions program size:
– 3 subroutines and 2 interrupts.
– 2113 bytes of program space for the two slave instructions and support routines.
– The variables for the Modbus slave instructions require a 786 byte block of V memory.
9.3.1.3

Initialization and execution time for Modbus protocol

● Modbus RTU master protocol: The master protocol requires a small amount of time every
scan to execute the MBUS_CTRL and MB_CTRL2 instruction, if present. The time is
about 0.2 milliseconds when MBUS_CTRL / MB_CTRL2 is initializing the Modbus master
(first scan), and about 0.1 milliseconds on subsequent scans.
Execution of the MBUS_MSG / MB_MSG2 instruction extends the scan time, especially in
calculating the Modbus CRC for the request and response. The CRC (Cyclic Redundancy
Check) ensures the integrity of the communications message. Each word in request and
in the response extends the PLC scan time by about 86 microseconds. A maximum
request/response (read or write of 120 words) extends the scan time to approximately
10.3 milliseconds. A read request extends the scan mainly when the program is receiving
a response from a slave, and to a lesser extent when sending the request. A write
request extends the scan mainly when sending data to a slave, and to a lesser extent
when receiving a response.
478
You must assign the starting address for this block using the Library Memory
command in STEP 7-Micro/WIN SMART. This command is available from the shortcut
memory of the Library node under the Program Block node in the project tree, or from
the Libraries section of the File menu ribbon strip.
Note
To change the CPU communication port from Modbus back to PPI so that you can
communicate with an HMI device, set the mode parameter of the MBUS_INIT
instruction to a zero (0).
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