0% found this document useful (0 votes)
185 views

CM PTP - Configurations For Point-To-Point Connections - Modbus - Comm - Load - Configure Communication Module For Modbus

The document describes the Modbus_Comm_Load instruction which configures a communication module for Modbus RTU communication. It allows configuration of parameters like baud rate, parity, flow control and response timeout. The instruction initializes the communication module and its configuration is saved on the module rather than in the CPU.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
185 views

CM PTP - Configurations For Point-To-Point Connections - Modbus - Comm - Load - Configure Communication Module For Modbus

The document describes the Modbus_Comm_Load instruction which configures a communication module for Modbus RTU communication. It allows configuration of parameters like baud rate, parity, flow control and response timeout. The instruction initializes the communication module and its configuration is saved on the module rather than in the CPU.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

CM PtP - Configurations for point-to-point connections

Modbus_Comm_Load: Configure communication module for Modbus

Modbus_Comm_Load: Configure communication module for Modbus

Note
Use with CM1241
The use of this instruction with a CM1241 is only possible from firmware version V2.1 of the
module.

Description
The Modbus_Comm_Load instruction configures a communication module for communication
by means of the Modbus RTU protocol. An instance data block is automatically assigned when
you add the Modbus_Comm_Load instruction in your program.
Configuration changes of Modbus_Comm_Load are saved on the CM and not in the CPU. With
voltage recovery and pulling/plugging, the CM is configured with the data saved in the device
configuration. The Modbus_Comm_Load instruction must be called in these scenarios.

Parameters

Parameter Declaration Data type Standard Description

S7- S7-
1200/1500 300/400/
WinAC

REQ IN Bool FALSE Starts the instruction upon a positive edge of this input.

PORT IN Port Laddr 0 Specifies the communication module which is used for the
communication:
• For S7-1500/S7-1200: "HW identifier" from the device
configuration.
The symbolic port name is assigned in the "System
constants" tab of the PLC tag table and can be applied
from there.
• For S7-300/S7-400: "Input address" from the device
configuration.
In the S7-300/400/WinAC systems the PORT
parameter is assigned the input address assigned in
HWCN.

BAUD IN UDInt DWord 9600 Selection of the data transmission rate


Valid values are: 300, 600, 1200, 2400, 4800, 9600, 19200,
38400, 57600, 76800, 115200 bit/s.

PARITY IN UInt Word 0 Selection of parity:


• 0 – None
• 1 – Odd
• 2 – Even

This document constitutes a free excerpt compiled by the user himself/herself from the documentation provided by Siemens for this product. Siemens disclaims
all liability for the completeness of this document. It shall only be used for the user's own internal purposes. It shall not be passed on to third parties.
6/13/2019

Antenna House XSL Formatter (Evaluation) http://www.antennahouse.com/


CM PtP - Configurations for point-to-point connections
Modbus_Comm_Load: Configure communication module for Modbus

Parameter Declaration Data type Standard Description

S7- S7-
1200/1500 300/400/
WinAC

FLOW_CTR IN UInt Word 0 Selection of flow control:


L
• 0 – (default) no flow control
• 1 – Hardware flow control with RTS always ON (not with
RS422/485 CMs)
• 2 – Hardware flow control with RTS switched (not with
RS422/485 CMs)

RTS_ON_DL IN UInt Word 0 Selection RTS ON delay:


Y
• 0 – No delay from "RTS active" until the first character
of the frame is sent.
• 1 to 65535 – Delay in milliseconds from "RTS active"
until the first character of the frame is sent (not with
RS422/485 CMs). RTS delays must be used
independent of the selection FLOW_CTRL.

RTS_OFF_D IN UInt Word 0 Selection RTS OFF delay:


LY
• 0 – No delay after transmission of last character until
"RTS inactive"
• 1 to 65535 – Delay in milliseconds after transmission of
last character until "RTS inactive" (not with RS422/485
ports). RTS delays must be used independent of the
selection FLOW_CTRL.

RESP_TO IN UInt Word 1000 Response timeout:


5 ms to 65535 ms - Time in milliseconds that Modbus_Master
waits for a response from the slave. If the slave does not
respond within this period, Modbus_Master repeats the
request or terminates the request with an error if the
specified number of repetitions (see below, RETRIES
parameter) has been sent.

MB_DB IN/OUT MB_BASE ‑ A reference to the instance data block of the Modbus_Master
or Modbus_Slave instructions.
The MB_DB parameter must be connected with the (static
and therefore not visible in the instruction) MB_DB
parameter of the Modbus_Master or Modbus_Slave
instruction.

COM_RST IN/OUT --- Bool FALSE Initialization of the Modbus_Comm_Load instruction


The instruction is initialized with TRUE. The instruction then
resets COM_RST to FALSE.
Note:
The parameter is only available for S7-300/400 instructions.

DONE OUT Bool FALSE The DONE bit is TRUE for one cycle after the last request
has been completed without errors.

This document constitutes a free excerpt compiled by the user himself/herself from the documentation provided by Siemens for this product. Siemens disclaims
all liability for the completeness of this document. It shall only be used for the user's own internal purposes. It shall not be passed on to third parties.
6/13/2019

Antenna House XSL Formatter (Evaluation) http://www.antennahouse.com/


CM PtP - Configurations for point-to-point connections
Modbus_Comm_Load: Configure communication module for Modbus

Parameter Declaration Data type Standard Description

S7- S7-
1200/1500 300/400/
WinAC

ERROR OUT Bool FALSE The ERROR bit is TRUE for one cycle after the last request
has been completed with errors. The error code in the
STATUS parameter is only valid in the cycle in which
ERROR = TRUE.

STATUS OUT Word 16#7000 Error code (see Error messages)

Modbus_Comm_Load is executed to configure a port for the Modbus RTU protocol. Once you
have configured the port for the Modbus RTU protocol, it can only be used by the
Modbus_Master or Modbus_Slave instructions.
You have to run Modbus_Comm_Load for the configuration of each communication port that
is to be used for Modbus communication. You must assign a unique Modbus_Comm_Load
instance DB to each port that you use. Only run Modbus_Comm_Load again if you need to
change communication parameters, such as data transmission rate or parity, or in case the
network has returned.
For example, an instance data block is assigned to the instruction if you add Modbus_Master
or Modbus_Slave to your program. You need to connect the MB_DB parameter of the
Modbus_Comm_Load instruction to the MB_DB parameter of the Modbus_Master or
Modbus_Slave instruction.

Modbus_Comm_Load data block tags


The table below shows the public static tags in the instance DB of Modbus_Comm_Load that
you can use in your program.

Table 1 Static tags in the instance DB


Tag Data type Standar Description
d

S7- S7-
1200/150 300/400/
0 WinAC

ICHAR_GAP Word 0 Maximum character delay time between characters. This parameter is
specified in milliseconds and increases the anticipated period between
the received characters. The corresponding number of bit times for this
parameter is added to the Modbus default value of 35 bit times (3.5
character times).

RETRIES Word 2 Number of retries that the master executes before the error code
0x80C8 for "No response" is returned.

EN_SUPPLY_VO Bool 0 Enable diagnostics for missing supply voltage L+


LT

This document constitutes a free excerpt compiled by the user himself/herself from the documentation provided by Siemens for this product. Siemens disclaims
all liability for the completeness of this document. It shall only be used for the user's own internal purposes. It shall not be passed on to third parties.
6/13/2019

Antenna House XSL Formatter (Evaluation) http://www.antennahouse.com/


CM PtP - Configurations for point-to-point connections
Modbus_Comm_Load: Configure communication module for Modbus

Tag Data type Standar Description


d

S7- S7-
1200/150 300/400/
0 WinAC

MODE USInt Byte 0 Operating mode


Valid operating modes are:
• 0 = Full duplex (RS232)
• 1 = Full duplex (RS422) four-wire mode (point-to-point)
• 2 = Full duplex (RS 422) four-wire mode (multipoint master, CM
PtP (ET 200SP))
• 3 = Full duplex (RS 422) four-wire mode (multipoint slave, CM PtP
(ET 200SP))
• 4 = Half duplex (RS485) two-wire mode 1)

LINE_PRE USInt Byte 0 Receive line initial state


Valid initial states are:
• 0 = "No" initial state 1)
• 1 = signal R(A)=5 V, signal R(B)=0 V (break detection):
Break detection is possible with this initial state.
Can only be selected with: "Full duplex (RS422) four-wire mode
(point-to-point connection)" and "Full duplex (RS422) four-wire
mode (multipoint slave)".
• 2 = signal R(A)=0 V, signal R(B)=5 V:
This default setting corresponds to the idle state (no active send
operation). No break detection is possible with this initial state.

BRK_DET USInt Byte 0 Break detection


The following are valid:
• 0 = break detection deactivated
• 1 = break detection activated

EN_DIAG_ALAR Bool 0 Activate diagnostics interrupt:


M
• 0 - not activated
• 1 - activated

STOP_BITS USINT Byte 1 Number of stop bits;


• 1 = 1 stop bit,
• 2 = 2 stop bits,
• 0, 3 to 255 = reserved
1) Required setting for the use of PROFIBUS cables with CM 1241 for RS485

Instruction versions
Version 3.1 is functionally identical to version 3.0 and its version number was only incremented
due to internal measures.

This document constitutes a free excerpt compiled by the user himself/herself from the documentation provided by Siemens for this product. Siemens disclaims
all liability for the completeness of this document. It shall only be used for the user's own internal purposes. It shall not be passed on to third parties.
6/13/2019

Antenna House XSL Formatter (Evaluation) http://www.antennahouse.com/


CM PtP - Configurations for point-to-point connections
Modbus_Comm_Load: Configure communication module for Modbus

See also
→ Error messages

This document constitutes a free excerpt compiled by the user himself/herself from the documentation provided by Siemens for this product. Siemens disclaims
all liability for the completeness of this document. It shall only be used for the user's own internal purposes. It shall not be passed on to third parties.
6/13/2019

Antenna House XSL Formatter (Evaluation) http://www.antennahouse.com/

You might also like