Modbus Rtu - Vipa
Modbus Rtu - Vipa
Modbus Rtu - Vipa
Disclaimer of The contents of this manual were verified with respect to the hard- and
liability software.
However, we assume no responsibility for any discrepancies or errors. The
information in this manual is verified on a regular basis and any required
corrections will be included in subsequent editions.
Suggestions for improvement are always welcome.
Any other trademarks referred to in the text are the trademarks of the
respective owner and we acknowledge their registration.
This manual describes the CP 341 with RS422/485 interface of the System
300V from VIPA. Here you may find every information for commissioning
and operation.
Contents
User considerations
Objective and This manual describes the CP 341 with RS422/485 interface from the VIPA
contents System 300V. It contains a description of the construction, project imple-
mentation and usage.
Target audience The manual is targeted at users, who have a background in automation
technology.
Structure of the The manual consists of chapters. Every chapter provides a self-contained
manual description of a specific topic.
Icons Important passages in the text are highlighted by following icons and
Headings headings:
Danger!
Immediate or likely danger.
Personal injury is possible.
Attention!
Damages to property is likely if these warnings are not heeded.
Note!
Supplementary information and useful tips.
Safety information
Danger!
This device is not certified for applications in
• in explosive environments (EX-zone)
Disposal National rules and regulations apply to the disposal of the unit!
Chapter 1 Basics
Overview With this basics there are safety information for the usage of System 300
modules. Here general information concerning the modules like dimensions
and environment conditions will be found.
This chapter ends with the description of the ISO/OSI reference model.
Attention!
Personnel and instruments should be grounded when working on
electrostatic sensitive modules.
The System 300V The System 300V is a modular automation system for middle and high
performance needs, that you can use either distributed or non-distributed.
The single modules are directly clipped to a 530 mm backplane and are
connected together with the help of bus clips at the backside.
The single modules of the VIPA System 300V are design compatible to
Siemens. Due to the compatible backplane bus it is no problem to mix the
modules from VIPA and Siemens.
The CPUs of the System 300V are instruction set compatible to S7-300
from Siemens. The CPUs are programmed via the VIPA programming
software WinPLC7 or the SIMATIC manager from Siemens or other
available programming tools.
The following picture illustrates the performance range of the
System 300V:
System 300V
decentral central
Periphery
Dig. IN / Dig. OUT / Anal. IN / Anal. OUT / CP / PS
Components
Installation Please regard that the power supply and header modules like CPUs and
couplers may only plugged-in at the left side.
.0
X5 .1
X2 X3 X2 X3 .2
X1 X1 .3
DC 24V DC 24V .4
+ + .5
- - .6
+ + .7
- - X 2
3 4
X 2
VIPA 307-1EA00 3 4 VIPA 321-1BH01
Compatibility The digital in-/output modules of the System 300V from VIPA are pin and
function compatible to Siemens.
The project engineering happens in the SIMATIC manager from Siemens.
Overview The ISO/OSI reference model is based on a proposal that was developed
by the International Standards Organization (ISO). This represents the first
step towards an international standard for the different protocols. It is
referred to as the ISO-OSI layer model. OSI is the abbreviation for Open
System Interconnection, the communication between open systems. The
ISO/OSI reference model does not represent a network architecture, as it
does not define the services and protocols used by the different layers. The
model simply specifies the tasks that the different layers must perform.
All current communication systems are based on the ISO/OSI reference
model, which is defined by the ISO 7498 standard. The reference model
structures communication systems into 7 layers that cover different
communication tasks. In this manner the complexity of the communication
between different systems is divided amongst different layers to simplify
the task.
The following layers have been defined:
Layer Function
Layer 7 Application Layer
Layer 6 Presentation Layer
Layer 5 Session Layer
Layer 4 Transport Layer
Layer 3 Network Layer
Layer 2 Data Link Layer
Layer 1 Physical Layer
Overview In this chapter you will find all information, required for the installation and
the cabling of a PLC with the components of the System 300.
Overview
General The single modules are directly installed on a profile rail and connected via
the backplane bus coupler. Before installing the modules you have to clip
the backplane bus coupler to the module from the backside.
The backplane bus couplers are included in the delivery of the peripheral
modules.
Profile rail
122
G
Order number A B C
VIPA 390-1AB60 160mm 140mm 10mm
VIPA 390-1AE80 482mm 466mm 8.3mm
VIPA 390-1AF30 530mm 500mm 15mm
VIPA 390-1AJ30 830mm 800mm 15mm
VIPA 390-9BC00* 2000mm - 15mm
* Unit pack: 10 pieces
Bus connector For the communication between the modules the System 300V uses a
backplane bus connector. The backplane bus connectors are included in
the delivering of the peripheral modules and are clipped at the module from
behind before installing it to the profile rail.
Installation dimensions
Dimensions
65mm
122mm
40mm
Installation
dimensions 120mm
125 mm
175mm
Structure: You may install the System 300V as well horizontal as vertical. Please
regard the allowed environment temperatures:
• horizontal structure: from 0 up to 60°
• vertical structure: from 0 up to 40°
The horizontal structure always starts at the left side with the power supply
and the CPU, then you plug-in the peripheral modules beside to the right.
You may plug-in maximum 32 peripheral modules to the CPU.
.0
X5 .1
X2 X3 X2 X3 .2
X1 X1 .3
DC 24V DC 24V .4
+ + .5
- - .6
+ + .7
- - X 2
3 4
X 2
VIPA 307-1EA00 3 4 VIPA 321-1BH01
The vertical structure is turned for 90° against the clockwise direction.
SM321
.0
.1
.2
.3
.4
.5
.6
.7
.0
.1
.2
.3
.4
.5
.6
.7
I/O Periphery
VIPA 321-1BH01
DI 16xDC24V
X 2
3 4
MMC
RUN
X 2
3 4
ERR
PB-M
DE
IF
X3
VIPA 314-3DP01
MRES
STOP
RUN
STOP
FRCE
DESL
MMC
PWR
RUN
SF
PLC
X2
CPU
CPU314NET
X5
+
-
-
DC 24V
X1
PS307/5A
X 2
3 4
X3
Power Supply
X2
SELECTOR
VOLTAGE
DC24V
VIPA 307-1EA00
OFF
+
ON
-
230
DC 24V
X1
Approach
Danger!
• Before installing or overhauling the System 300V, the power supplies
must be disconnected from voltage (pull the plug or remove the fuse)!
Cabling
Overview The power supplies and CPUs are exclusively delivered with CageClamp
contacts. For the signal modules the front connectors are available from
VIPA with screw contacts. In the following all connecting types of the power
supplies, CPUs and input/output modules are described.
Danger!
• Before installation or overhauling, the power supplies must be
disconnected from voltage (pull the plug or remove the fuse)!
CageClamp For the cabling of power supplies, bus couplers and parts of the CPU, gray
technology (gray) connectors with CageClamp technology are used.
2 2
1 You may connect wires with a cross-section of 0.08mm to 2.5mm . You
can use flexible wires without end case as well as stiff wires.
You fix the conductors to the CageClamps like this:
1
2 2
The picture on the left side shows the cabling step by step from top view.
CageClamp For the cabling of e.g. the power supply of a CPU, green plugs with
technology (green) CageClamp technology are deployed.
1
2
2
3
The picture on the left side shows the cabling step by step from top view.
• For cabling you push the locking vertical to the inside with a suiting
screwdriver and hold the screwdriver in this position.
• Insert the de-isolated wire into the round opening. You may use wires
3 with a cross-section from 0.08mm2 to 2.5mm2.
• By removing the screwdriver the wire is connected safely with the plug
connector via a spring.
Note!
In opposite to the gray connection clamp from above, the green connection
clamp is realized as plug that can be clipped off carefully even if it is still
cabled.
Front connectors In the following the cabling of the three variants of the front-facing
of the in-/output connector is shown:
modules For the I/O modules the following plugs are available at VIPA:
If you want to lead out your cables from the bottom of the module, start with the cabling from
bottom to top, res. from top to bottom, if the cables should be led out at the top.
... continue
20pole screw connection 40pole screw connection
Push the release key at the front connector on Bolt the fixing screw of the front connector.
the upper side of the module and at the same
time push the front connector into the module
until it locks.
Fill out the labeling strip to mark the single channels and push the strip into the front flap.
Installation Guidelines
General The installation guidelines contain information about the interference free
deployment of System 300V systems. There is the description of the ways,
interference may occur in your control, how you can make sure the
electromagnetic digestibility (EMC), and how you manage the isolation.
Possible Electromagnetic interferences may interfere your control via different ways:
interference • Fields
causes
• I/O signal conductors
• Bus system
• Current supply
• Protected earth conductor
Depending on the spreading medium (lead bound or lead free) and the
distance to the interference cause, interferences to your control occur by
means of different coupling mechanisms.
One differs:
• galvanic coupling
• capacitive coupling
• inductive coupling
• radiant coupling
Basic rules for In the most times it is enough to take care of some elementary rules to
EMC guarantee the EMC. Please regard the following basic rules when installing
your PLC.
• Take care of a correct area-wide grounding of the inactive metal parts
when installing your components.
- Install a central connection between the ground and the protected
earth conductor system.
- Connect all inactive metal extensive and impedance-low.
- Please try not to use aluminum parts. Aluminum is easily oxidizing
and is therefore less suitable for grounding.
• When cabling, take care of the correct line routing.
- Organize your cabling in line groups (high voltage, current supply,
signal and data lines).
- Always lay your high voltage lines and signal res. data lines in
separate channels or bundles.
- Route the signal and data lines as near as possible beside ground
areas (e.g. suspension bars, metal rails, tin cabinet).
• Proof the correct fixing of the lead isolation.
- Data lines must be laid isolated.
- Analog lines must be laid isolated. When transmitting signals with
small amplitudes the one sided lying of the isolation may be
favorable.
- Lay the line isolation extensively on an isolation/protected earth con-
ductor rail directly after the cabinet entry and fix the isolation with
cable clamps.
- Make sure that the isolation/protected earth conductor rail is
connected impedance-low with the cabinet.
- Use metallic or metalized plug cases for isolated data lines.
• In special use cases you should appoint special EMC actions.
- Wire all inductivities with erase links that are not addressed by the
System 300V modules.
- For lightening cabinets you should prefer incandescent lamps and
avoid luminescent lamps.
• Create a homogeneous reference potential and ground all electrical
operating supplies when possible.
- Please take care for the targeted employment of the grounding
actions. The grounding of the PLC is a protection and functionality
activity.
- Connect installation parts and cabinets with the System 300V in star
topology with the isolation/protected earth conductor system. So you
avoid ground loops.
- If potential differences between installation parts and cabinets occur,
lay sufficiently dimensioned potential compensation lines.
Overview Here the hardware components of the CP 341 are more described. The
technical data are to be found at the end of the chapter.
Properties
CP341 RS422/485
AI 8x12Bit
SF
S/F1
PWR
SF S/F2
TxD
RxD S/F3
S/F4
SM331
X 2
VIPA 341-1CH01 3 4
S/F5
S/F6
S/F7
S/F8
X 2
3 4
VIPA 331-7KF00
Order data
Type Order number Description
CP 341 RS422/485 VIPA 341-1CH01 CP 341 with RS422/485 interface
Protocols: ASCII, 3964(R),
Modbus Master (ASCII / RTU), Modbus Slave (RTU)
Structure
S/F4
SM331
X 2
VIPA 341-1CH01 3 4
S/F5
S/F6
2 S/F7
S/F8
X 2
3 4
VIPA
RS331-7KF00
422/485
LEDs The communication processor is provided with 4 LEDs for the purpose of
displaying the operating status. The following table shows the description
and the color of these LEDs.
Name Color Description
PWR green Indicates that power is available
SF red Group alarm or re-parameterization in progress
Group alarm lights up at:
- Hardware fault
- Firmware error
- Parameterization error
- BREAK (receive cable between CP and
communication partner becomes disconnected)
TxD green Transmit data lights up when the CP is sending user data
via the interface.
RxD green Receive data lights up when the CP is receiving user data
via the interface.
At the corresponding CP the LEDs SF, TxD and RxD are on during
firmware update. The firmware update is ready when TxD and RxD get off.
Power supply The communication is power supplied via the back plane bus. The current
consumption is max. 160mA.
Note!
Never connect the shield of the cable with GND_ISO, as this could destroy
the interface!
GND_ISO must always be connected on both sides; otherwise the modules
could be destroyed!
Isolated voltages Pin 6 (P5V) of the isolated interfaces carries the isolated 5V supply with the
P5V, M5V respective ground GND on pin 5 (M5V). You may use this isolated voltage
to provide defined static voltage levels on the signaling lines by means of
resistors and ensure that reflections are reduced to a minimum.
7 T(A)-
2 T(B)+
Send Receive
8 R(A)-
1) 1)
3 R(B)+
Receive Send
5
GND_ISO (GND_ISO)
6
+5V_ISO (+5V_ISO)
Shield Shield
1)
In the case of cables >50m you have to solder in a terminating resistor of approx. 330Ω
on the receiver for data free traffic.
Note!
The protocol 3964(R) is not possible at two-wire operation.
7 T(A)- R(A)-
1)
2 T(B)+ R(B)+
Send Receive
8 R(A)- T(A)-
1)
3 R(B)+ T(B)+
Receive Send
5
GND_ISO (GND_ISO)
6
+5V_ISO (+5V_ISO)
Shield Shield
1)
In the case of cables >50m you have to solder in a terminating resistor of approx. 330Ω
on the receiver for data free traffic.
Defined static For a connection with minimum reflections and the wire-break recognition
voltage levels by at RS422/485 operation, the lines may be preset with defined static voltage
parameters levels.
At the CP interface the wiring of the receiver is realized as follows:
5V
Signal R(A) 0Volt This preassignment 5V
Technical data
CP 341 RS422/485
Module name VIPA 341-1CH01
Dimensions and Weight
Dimensions (W x H x D) in mm 40x125x120
Weight 170g
Electrical Data
Number of channels 1
Voltage supply 5V via back plane bus
Current consumption via back plane bus max. 160mA
Status monitor via LED at the front side
Power dissipation of the module 0.8W
Protocols ASCII, 3964(R)
loadable (no hardware dongle necessary) Modbus Master ASCII / RTU
Modbus Slave RTU
Plugs / Interfaces 9pin D-type plug for RS422/485
RS422 signals (four-wire) TxD(A), RxD(A), TxD(B), RxD(B), GND_ISO
RS485-Signale (two-wire) R/T(A), R/T(B), GND_ISO
Isolation to back plane bus
Transfer distance 1200m at 19.2kbit/s
500m at 38.4kbit/s
250m at 76.8kbit/s
Baud rate max. 76.8kbit/s
Alarms
Diagnostics alarm parameterizable
Diagnostic functions
Read-out diagnostic information yes
Environment conditions
Operating temperature 0...60°C
Transportation and storage temperature -40°C to +70°C
Relative humidity max. 95% at +25°C
Fast introduction
Overview The integration of the CP into your SPS system should take place with the
following proceeding:
• Assembly and commissioning
• Hardware configuration (integration CP in CPU)
• Protocol parameter via parameter plugin
• Communication with the user program
Assembly and • Install your system 300 with a CPU 31x and the CP 341.
commissioning • Wire the system by connecting cables for voltage supply, signals and
Ethernet. A detailed description is to be found in the chapter "Assembly
and installation guidelines".
• Switch power ON. → After a short boot time the CP is in the system
without any protocol.
• Start the Siemens SIMATIC manager with an online connection to the
CPU. More about this may be found in the manual of the CPU.
Hardware • For hardware configuration jump within your project to the hardware
configuration configurator of the Siemens SIMATIC manager.
• Place a profile rail with the corresponding CPU and its modules.
• Engineer in duty of the CP 341-1CH01 from VIPA the Siemens CP with
the order number 6ES7 341-1CH01-0AE0 to the corresponding slot.
• Adjust the address by the properties dialog and the protocol for
transmission and its parameters by means of the parameter plugin
"Point-to-Point-Communication, Parameter Assignment"
Note!
Please regard that the address for input and output is identically. By means
of this address you may access the CP from the user program.
Protocol parameter For parameterization of the protocol parameters the parameter plugin
"Point-to-Point-Communication, Parameter Assignment" is necessary.
This may be received by Siemens.
Loadable protocol There is the possibility to extend the number of protocols of the parameter
driver plugin by means of loadable protocol drivers.
More may be found at the description of the corresponding protocol.
Communication with With the standard protocols the communication happens by means of the
the user program handling blocks FB 7 and FB 8, which were installed together with the
parameter plugin.
By a cyclic call of these blocks data may be sent and received by the CP.
The conversion of the transfer protocols to the communication partner
happens at the CP.
For each of these FBs an instance DB is necessary. This is to be indicated
at the call of the corresponding FB. The data for communication are to be
stored in each case in a send respectively receive DB.
To control the communication the FBs have control bits. Here the
communication may be started, stopped or reset with the appropriate
programming for the corresponding CP. There are status bits within the
FBs for error evaluation.
Please note with the loadable protocol Modbus Slave the
FB 80 - MODB_341 is deployed for communication. Within this the FB 7
and FB 8 are called.
Hardware configuration
Overview The description here refers to modules that are at the same bus together
with the CPU. In order to address the installed modules individually,
specific addresses in the CPU have to be assigned to them.
The allocation of addresses and the configuration of the installed modules
is a function of the Siemens SIMATIC manager.
Here navigate within the hardware catalog to the according CP and place it
at the S7-300 station.
General
Short Description The short description with the information below is identical to the shown
Information in the "hardware catalog" window.
Order No. Here the order number of the Siemens CP 341 is displayed. For project
engineering of the VIPA CP 341-1CH01 the Siemens CP with order
number 6GK7 341-1CH01-0AE0 is to be used.
Name This displays the designation of the CP, which may be changed. If the
designation is changed, the new designation appears in your project in the
configuration table.
Addresses
Inputs / Outputs By presetting a start address for the input respectively output area the
beginning of the address area of the CPU may be determined, which is
mapped by the CP. Here the CP occupies for input and output 16byte
each.
This value is necessary for integration in the user program. Please note
with the CP that the base address for input and output are identical.
Process image With the process image a consistent image of the process signal may be
accessed during the program cycle.
If the field process image shows the entry "---" then the set address area is
outside the process image. The entry "OB1-PA" indicates that the set
address area is within the process image.
Basic Parameters
Interrupt generation / Here the interrupt behavior of the module may be adjusted. If "Yes" is set
Reaction to CPU at CPU STOP (fix) an interrupt is released and the outputs are switched off
STOP immediately.
Note!
Please regard as long as the plugin is open the properties dialog of the CP
is blocked. The parameters are only transmitted to your project if they were
stored.
Loadable protocol There is the possibility to extend the number of protocols of the parameter
driver plugin by means of loadable protocol drivers. More may be found at the
description of the corresponding protocol.
Save After adjusting the protocol specific parameters the parameters should be
stored with File > Save respectively with . The parameters are
transferred to your project only if you store these before.
The plugin is closed with file > exit and the CP properties dialog is again
released. Store your configuration with Station > Save and compile within
your project and transfer the configuration to your CPU.
Overview For the processing of the connecting jobs at PLC side a user program is
necessary in the CPU. Here the following blocks are used for
communication between CPU, CP and a communication partner:
Attention!
Calling of these blocks within process or diagnostics interrupt is not
allowed.
Please regard this FBs do not have a parameter check, which means that if
there are invalid parameters, the CPU may switch to STOP mode.
Installation The function blocks are online available from Siemens together with the
plugin "Point-to-Point-Communication, Parameter Assignment".
The installation of the function blocks happens together with the plugin.
Here insert the CD and follow the instructions.
The FBs may be found in the block library after installation.
The library may be opened in the Siemens SIMATIC manager by
File > Open > "Libraries" and here "CP PtP"
The blocks may be found at "Blocks" of the CP 341. For deployment of a
block this is to be copied into your project.
Data consistency The data consistency is limited by the block size of 32byte during
communication between CPU and CP.
For the consistent data communication of more than 32byte the following is
to be considered:
FB8 - P_SND_RK:
Access the send DB only again if the data were completely transferred
(DONE = 1).
FB7 - P_RCV_RK
Access the receive DB only again if the data were completely received
(NDR = 1). After that the receive DB should be blocked (EN_R = 0) as long
as the data were treated.
Communication By a cyclic call of these blocks data may be sent and received by the CP.
principle On the CP the transmission of the communication protocols to the
communication partner takes place, which may be configured by the
hardware configuration. In the following these blocks are described.
Send data The FB 8 - P_SND_RK transfers a data block of a DB to the CP, specified
FB 8 - P_SND_RK by the parameters DB_NO, DBB_NO and LEN. For data transfer the FB is
to be called either cyclically or statically by a timer-driven program.
Information about the parameters, which were necessary for the loadable
protocols may be found at the corresponding protocol description in the
chapter "Communication protocols".
Parameter
Parameter Declaration Data type Description
SF Input CHAR S = Send, F = Fetch. At ASCII and 3964R the default
value "S" for Send may be used
REQ Input BOOL Initiates request with positive edge
R Input BOOL Aborts request - current request is aborted and sending is
blocked.
LADDR Input INT Logical basic address of the CP - corresponds to the
address of the hardware configuration of the CP.
DB_NO Input INT Data block number - number of the send DB, zero is not
allowed.
DBB_NO Input INT Data byte number - transmitted data as of data byte
0 ≤ DBB_NO ≤ 8190
LEN Input INT Length of message frame to be sent in byte
1 ≤ LEN ≤ 1024
R_... Input - These parameters are not relevant for ASCII and 3964(R).
But they may be used by loadable protocols.
DONE1) Output BOOL Request complete without errors, data sent
Parameter STATUS = 00h
ERROR1) Output BOOL Request complete with error
Parameter STATUS contains error details
1)
STATUS Output WORD Specification of the error on ERROR = 1
1)
Parameter is available until the next call of the FB.
Release and The data transmission is initiated by a positive edge at the REQ input of
cancel a request FB 8 - P_SND_RK. A data transmission operation can run over several
program cycles, depending on the amount of data involved.
A running request may me canceled at any time with R = "1" then the FB is
reset to the basic state. Please regard that data, which the CP still has
received from the CPU, were sent to the communication partner.
If the R input is statically showing the signal state "1", this means that
sending is deactivated.
Mechanism for The FB 8 has a mechanism for startup-synchronization between CPU and
startup CP, which is automatically executed at the first call of the FB.
synchronization Before the CP can process an activated request after the CPU has
changed from STOP to RUN mode, the CP CPU start-up mechanism must
be completed.
Any requests initiated in the meantime are transmitted once the start-up
coordination with the CP is finished.
Note!
A minimum pulse time is necessary for a signal change to be identified.
Significant time periods are the CPU cycle time, the updating time on the
CP and the response time of the communication partner.
Error indication The DONE output shows ”request completed without errors”. If there was
an ERROR, the corresponding event number is displayed in the STATUS.
If no error occurs the value of STATUS is "0".
DONE and ERROR/STATUS are also output in response to a RESET of
the FB. In the event of an error, the binary result BR is reset. If the block is
terminated without errors, the binary result has the status ”1”.
Please regard the parameter DONE, ERROR and STATUS are only
available at one block call. For further evaluation these should be copied to
a free data area.
Addressing With LADDR the address of the corresponding CP is specified. This is the
address, which was specified by the hardware configuration of the CP.
Please regard that the base address for input and output of the CP are
identical.
Data area The FB 8 - P_SND_RK deals with an Instanz-DB I_SND_RK. This has a
length from 62byte. The DB no. is transmitted with the call.
It is not allowed to access the data of an instance DB.
Receive data The FB 7 P_RCV_RK transfers data from the CP to a data area of the CPU
FB 7 - P_RCV_RK specified by the parameter DB_NO, DBB_NO and LEN. For data transfer
the FB is to be called either cyclically or statically by a timer-driven
program.
Information about the parameters, which were necessary for the loadable
protocols may be found at the corresponding protocol description in the
chapter "Communication protocols".
Parameter
Parameter Declaration Data type Description
EN_R Input BOOL Enables data read
R Input BOOL Aborts request - current request is aborted and receiving is
blocked.
LADDR Input INT Logical basic address of the CP - corresponds to the
address of the hardware configuration of the CP.
DB_NO Input INT Data block number - number of the receive DB, zero is not
allowed.
DBB_NO Input INT Data byte number - received data as of data byte
0 ≤ DBB_NO ≤ 8190
L_... Output - These parameters are not relevant for ASCII and 3964(R).
But they may be used by loadable protocols.
NDR1) Output BOOL Request complete without errors, data received
Parameter STATUS = 00h
1)
ERROR Output BOOL Request complete with error
Parameter STATUS contains error details
LEN1) Output INT Length of the received telegram in byte
1 ≤ LEN ≤ 1024
STATUS1) Output WORD Specification of the error on ERROR = 1
1)
Parameter is available until the next call of the FB.
Release and With the signal state ”1” at parameter EN_R, the software checks whether
cancel a request data can be read by the CP. A data transmission operation can run over
several program cycles, depending on the amount of data involved.
An active transmission can be aborted with signal state ”0” at the EN_R
parameter. The aborted receive request is terminated with an error
message (STATUS).
Receiving is deactivated as long as the EN_R parameter shows the signal
state ”0”.
A running request may me canceled with R = "1" then the FB is reset to the
basic state. Receiving is deactivated as long as the R parameter shows the
signal state ”1”.
Mechanism for The FB 7 has a mechanism for startup-synchronization between CPU and
startup CP, which is automatically executed at the first call of the FB.
synchronization Before the CP can process an activated request after the CPU has
changed from STOP to RUN mode, the CP CPU start-up mechanism must
be completed.
Any requests initiated in the meantime are transmitted once the start-up
coordination with the CP is finished.
Note!
A minimum pulse time is necessary for a signal change to be identified.
Significant time periods are the CPU cycle time, the updating time on the
CP and the response time of the communication partner.
Error indication The NDR output shows ”request completed without errors/data accepted”.
If there was an ERROR, the corresponding event number is displayed in
the STATUS. If no error occurs the value of STATUS is "0". NDR and
ERROR/STATUS are also output in response to a RESET of the FB. In the
event of an error, the binary result BR is reset. If the block is terminated
without errors, the binary result has the status ”1”.
Please regard the parameter NDR, ERROR and STATUS are only
available at one block call. For further evaluation these should be copied to
a free data area.
Addressing With LADDR the address of the corresponding CP is specified. This is the
address, which was specified by the hardware configuration of the CP.
Please regard that the base address for input and output of the CP are
identical.
Data area The FB 7 - P_RCV_RK deals with an Instanz-DB I_RCV_RK. This has a
length from 60byte. The DB no. is transmitted with the call.
It is not allowed to access the data of an instance DB.
Firmware update
Overview For functional expansion and error recovery firmware updates can be
uploaded to the operating-system memory of the CP. Subsequent loading
of firmware updates with the parameterization interface "Point-to-Point
Communication, Parameter Assignment".
If you use a VIPA SPEED7 CPU of the System 300S starting with CPU
firmware version V340 a firmware update may be executed by means of an
accordingly prepared MMC.
Firmware update With deployment of the Siemens parameterization tool the following
with Siemens preconditions for firmware update are:
®
parameterization • Siemens STEP 7 V. 4.02 or higher is installed
tool • Parameterization tool "Point-to-Point Communication, Parameter
Assignment " V. 5.0 or higher is installed.
• The CP is to be configured in the CPU with a valid project.
• The CPU is online be connected to the configuring PC.
Firmware update By means of a MMC there is the opportunity to execute a firmware update
at deployment of at the CPU and its components. This functionality is available starting with
CPU firmware V340. For update an accordingly prepared MMC must be in
a SPEED7 CPU
the CPU during the start-up.
Thus a firmware file may be recognized and assigned with start-up, a pkg
file name is reserved for each updateable component and hardware
release, which begins with "px" and differs in a number with six digits. The
pkg file name of every updateable component may be found at a label right
down the front flap of the module.
As soon as with start-up a pkg file is on the MMC, all the components at
the bus and in the CPU, assigned to the pkg file, get the new firmware.
The latest 2 firmware versions may be found in the service area at
www.vipa.de.
Attention!
Please regard that the version of the update firmware is different from the
existing firmware otherwise no update is executed.
Display the The SPEED7 CPU has an integrated web page that monitors information
Firmware version about firmware version of the connected components. The Ethernet PG/OP
of the SPEED7 channel provides the access to this web page.
CPU via web page To activate the PG/OP channel you have to enter according IP parameters.
This can be made in Siemens SIMATIC manager either by a hardware
configuration, loaded by MMC respectively MPI or via Ethernet by means of
the MAC address with PLC > Assign Ethernet Address.
After that you may access the PG/OP channel with a web browser via the
IP address of the project engineering. More detailed information may be
found in the manual of the CPU at "Access to Ethernet PG/OP channel and
website".
Transfer firmware 1. Get the RUN-STOP lever of your CPU in position STOP. Turn off the
from MMC into voltage supply. Plug the MMC with the firmware files into the CPU.
CPU Please take care of the correct plug-in direction of the MMC. Turn on the
voltage supply.
2. After a short boot-up time, the alternate blinking of the LEDs SF and
FRCE shows that at least one firmware was found on the MMC, which
differs from the current version.
3. You start the transfer of the firmware as soon as you tip the RUN/STOP
lever downwards to MRES within 10s.
4. During the update process, the LEDs SF and FRCE are alternately
blinking and MMC LED is on. This may last several minutes.
5. The update is successful finished when the LEDs PWR, STOP, SF,
FRCE and MCC are on. If they are blinking fast, an error occurred.
6. Turn Power OFF and ON. Now it is checked by the CPU, whether
further current firmware versions are available at the MMC. If so, again
the LEDs SF and FRCE flash after a short start-up period. Continue with
point 3.
If the LEDs do not flash, the firmware update is ready.
1 2 3 4 5 6
Show the release There is the possibility to display the current release of hard- and software
of the CP of the CP by means of the module information of the Siemens SIMATIC
manager. Here go online to the corresponding CP in the hardware
firmware
configurator by Station > Open online.
If you use a SPEED7 CPU the current release of the firmware may be
displayed by the web page of the CPU as shown above.
Overview
Serial transfer of a The simplest type of information exchange between two stations is the
character point-to-point link. Here the CP serves as interface for the CPU and a
communication station.
The data are serially transferred. During the serial data transfer the
individual bits of one byte of an information are transferred after another in
a fixed order.
Character frame At bi-directional data transfer it is differentiated between full duplex and half
duplex operation. At half duplex operation at one time data may be sent or
received. A simultaneous data exchange is only possible at full duplex
operation.
Each character to be transferred is preceded by a synchronizing pulse as
start bit. The end of the transferred character is formed by the stop bit.
Beside the start and stop bit there are further parameterizable agreements
between the communication partners necessary for serial data transfer.
This character frame consists of the following elements:
• Speed (Baudrate)
• Character and acknowledgement delay time
• Parity
• Number of data bits
• Number of stop bits
Protocols The CP serves for an automatic serial data transfer. To do this the CP is
equipped with drivers for the following protocols:
• ASCII
• 3964(R)
Please regard the computer interface RK512 is not supported by the VIPA
CP.
Note!
With deployment of loadable drivers for software technical reason the
drivers from Siemens were transferred to the CP but not installed. Since in
the CP VIPA specific drivers are installed, the Siemens usual hardware
dongle are not necessary for operation.
ASCII
Mode of operation ASCII data communication is one of the simple forms of data exchange
that may be compared to a multicast/broadcast function.
Individual messages are separated by means of character delay time
(ZVZ).
Within this time the transmitter must have sent its telegram to the receiver.
A telegram is only passed on to the CPU if this was received completely.
Additionally to the character delay there is a further possibility to define an
end criterion by parameterization of the ASCII driver.
Since during ASCII transmission apart from the usage of the parity bit no
further step takes place for data protection, the data transfer is very
efficiently however not secured. With the parity the inversion of one bit
within a character may be secured. If two or more bits of a character are
inverted, this error may no longer be detected.
ASCII Here the parameters for the ASCII driver may be set. At ASCII the
parameter settings for the character frame and the baud rate must be
identical on every communication partner.
End code of a During ASCII transmission the end of the receive messages frame may be
message recognized in different ways:
• on expiry of character delay time
• on receipt of fixed number of characters
• on receipt of end character(s)
Depending upon the mode the corresponding parameters may be specified
here.
ZVZ
n n+1
1
Send with end Here end character(s) may be defined or the length set in the FB may be
character specified as soon as "End character" is activated at the end ID.
Speed Here the transfer speed may be selected from a selection list.
Character frames The data between the communication partners are transferred via the serial
interface by means of a character frame. This means that each character
may be recognized at the receiver and the transmission may be checked
for errors.
Please regard that all the following parameters must have the same
settings on every communication partner:
ASCII Data flow control synchronizes data transmission when one communication
transmission partner works faster than the other. Here the type of data flow control may
be set and its associated parameters.
Note!
At half-duplex parameterization with RS485 data flow control is not
possible.
Data flow control Data flow control is only possible at full-duplex operation with RS422.
parameters
Parameter Description Default value
XON code Code for XON at "XON/XOFF" 11(DC1)
Range of values: 0...7Fh/FFh (7/8 data bits)
XOFF code Code for XOFF at "XON/XOFF" 13(DC3)
Range of values: 0...7Fh/FFh (7/8 data bits)
Wait for XON after Time for the CP to wait for XON=ON from the 20 000ms
XOFF (Wait time for partner when sending data.
CTS=ON) Range of values: 20 ... 65535ms in 10ms steps
ASCII Receipt telegrams are buffered in the CP at a ring buffer. Here the oldest
Receiving data telegram is always transferred by the CP to the CPU.
Input buffer
of the CP
Parameter Description Default value
Buffered receive Number of message frames, which are to be 250
message frames buffered in the CP buffer.
Range of values: 1 ... 250
Prevent overwriting You can only deactivate this check box if the activated
parameter "Buffered receive message frames" is
set to "1". In this way a current telegram is always
transferred to the CPU.
Range of values: activated, deactivated
Initial state of the For a connection with minimum reflections and the break evaluation at
receive lines RS422/485 operation, the lines may be preset with defined static voltage
levels. At the CP interface the wiring of the receiver is realized as follows:
5V
Signal R(A) 0Volt This preassignment 5V
3964(R)
Mode of operation During data transfer with 3964(R) control characters are added to the
message. These control characters may be used by the communication
partner to verify the complete and error free receipt.
The following control characters are evaluated:
Here the designation 3964(R) is used when the descriptions and notes
refer to both data transmission procedures.
The high integrity on data line is achieved by means of a fixed message-
frame setup and clearance as well as the use of BCC at 3964R.
Note!
When a DLE is transferred as part of the information it is repeated to
distinguish between data characters and DLE control characters that are
used to establish and to terminate the connection (DLE duplication). The
DLE duplication is reversed in the receiving station.
3964(R) requires that a lower priority is assigned to the communication
partner. When communication partners issue simultaneous send
commands the station with the lower priority will delay its send command.
STX
Monitor delayed acknowledgment
DLE
Message-data
DLE
ETX
only 3964R
BCC
Monitor delayed acknowledgment
DLE
3964(R) Here the parameter for the 3964(R) protocol driver may be set.
Please regard that the parameters of block check, transmission rate and of
the character frame with exception of the priority have the same settings on
every communication partner.
Protocol parameter
Parameter Description Default value
Character delay time The character delay time defines the maximum 220ms
(ZVZ) amount of time permitted between two incoming
characters within a message frame.
ZVZ
n n+1
1
Speed Here the transfer speed may be selected from a selection list.
Character frames The data between the communication partners are transferred via the serial
interface by means of a character frame. This means that each character
may be recognized at the receiver and the transmission may be checked
for errors.
Please regard that all the following parameters must have the same
settings on every communication partner:
Parameter Description Default value
Data bits Number of bits onto which a character is mapped. 8
Range of values: 7, 8
Stop bits When data is transmitted, stop bits are appended 1
to each character to be sent in order to signal the
end of a character.
Range of values: 1, 2
Parity The addition of its value "0" or "1" brings the value even
of all the bits (data bits and parity bit) up to a
defined status.
Range of values: none, odd, even
Priority If both communication partners issue a sent high
request at the same time, the partner with the
lower priority temporarily withdraws its request.
For data transmission you must set a lower priority
at one communication partner and a higher one at
the other.
Initial state of the For a connection with minimum reflections and the break evaluation at
receive lines RS422 operation, the lines may be preset with defined static voltage levels.
At the CP interface the wiring of the receiver is realized as follows:
5V
Signal R(A) 0Volt Here wire break evaluation is 5V
0V
Modbus - Overview
Master-Slave- There are no bus conflicts for the master is only able to communicate with
Communication one slave at a time. After the master requested a message, it waits for an
answer until an adjustable wait period has expired. During waiting is no
other communication possible.
Telegram- The request telegrams of the master and the respond telegrams of a slave
structure has the same structure:
ASCII-, RTU- The CP supports Modbus Master and Modbus Slave. Here there are the
Modus following 2 modes for data transfer as follows:
• ASCII mode: Every Byte is transferred in 2-character ASCII code. A
start and an end ID mark the data. This enables high control at the
transmission but needs time. The ASCII mode is only used at master
operation.
• RTU mode: Every Byte is transferred as character. Thus enables a
higher data throughput than the ASCII mode. Instead of start and end
ID, RTU uses a time watcher.
The mode selection is at parameterization.
Proceeding Open the Siemens SIMATIC manager with your project after installation.
The parameter plugin "Point-to-Point-Communication, Parameter
Assignment" is started from the properties dialog of the CP by the button
[Parameter...]. Here the parameters for transfer protocol, data receipt and
interface may be adjusted.
General This dialog contains every information of the loadable driver. Here nothing
may be changed.
At Loadable Driver the Modbus type followed by the transfer format may be
found.
At KP respectively SCC offline on the programming unit name and version
of the communication driver respectively the serial low level transfer driver
is displayed.
Modbus Master
(RTU)
Speed Here the data transfer speed may be selected from a list.
Character frame The data between the CP and the communication partner were transferred
via the serial interface within a character frame. This ensures that each
character can be recognized and checked.
Please regard that the following parameters must have the same settings
at each communication partner.
Protocol
parameter
Parameter Description Default value
Reply monitoring time Here a waiting time in ms may be preset spent by 2000
the CP waiting for a reply message from the slave
after output of a request message.
Range: 5 ... 65500ms
Operating mode Here the operating mode of the driver may be set. Normal operation
In Normal Operation every recognized transmission
error and break will result in error handling, even if
the driver is in idle mode.
In the operating mode Interference suppression
transmission errors and breaks are ignored when
the driver is in idle mode.
If the driver leaves the idle mode transmission error
and break will result in error handling.
Range: Normal operation, Interference suppression
Multiplier character If one communication partner cannot meet the time 1
delay time requirements set by the Modbus specifications, you
have the option to increase the character delay time
with the multiplier.
Range: 1 ... 10
Modbus Master
(ASCII)
Speed Here the data transfer speed may be selected from a list.
Character frame The data between the CP and the communication partner were transferred
via the serial interface within a character frame. This ensures that each
character can be recognized and checked.
Please regard that the following parameters must have the same settings
at each communication partner.
Protocol-
Parameter
Parameter Description Default value
Character Delay Time Here the delay time may be preset in ms. 1000
The Character Delay Time is the time that may
elapse between two characters within a Modbus
frame. The receiving station checks the incoming
data for time out and if detected the message is
ignored and an error is indicated.
Range: 1 ... 6500ms
Response Time-out Here a waiting time in ms may be preset spent by 2000
the CP waiting for a reply message from the slave
after output of a request message.
Range: 5 ... 65500ms
Turnaround Delay Here the time is preset, for which the master has to 0
be waiting for between two broadcast messages.
The delay time is deactivated by 0.
Range: 0 ... 65535ms
Operating Mode Here the operating mode of the driver may be set. Normal Operation
In Normal Operation every recognized trans-
mission error and break will result in error handling,
even if the driver is in idle mode.
In the operating mode Interference suppression
transmission errors and breaks are ignored when
the driver is in idle mode.
If the driver leaves the idle mode transmission
error and break will result in error handling.
Range: Normal operation, Interference
suppression
with 32-Bit Register The register oriented function codes 03, 06, 16 can deactivated
also handle 32bit registers.
By setting of this parameter the driver is prepared
to handle registers with the length of 4 Byte.
The decision whether 16bit or 32bit is done via the
byte which contains the function code. By setting of
the 6. bit in the function code a 32bit register is
accessed. If the 6. bit is not set a 16bit register is
accessed.
Range: activated, deactivated
Initial state of the For a connection with minimum reflections and the break evaluation at
receive lines RS422/485 operation, the lines may be preset with defined static voltage
levels. At the CP interface the wiring of the receiver is realized as follows:
5V
Signal R(A) 0Volt This preassignment 5V
Overview With Modbus the data transfer happens without any handshake. The
master initiates the transmission, and after sending a request message it
waits for a reply message from the slave for the duration of the reply
monitoring time set. The type of data transfer between Modbus systems is
controlled by function codes. The length of the message depends on the
used function code.
Message structure For communication Modbus uses the following message structure:
ADDR FUNC DATA CRC-CHECK
Byte Byte n Byte Word
ADDR Modbus slave address with the range 1...255. With slave address 0
(Broadcast Message) every slave at the bus is addressed by the master.
This is only permitted in conjunction with the writing function codes. Here
the message is not applied by the slave.
FUNC The function code defines the meaning as well as the structure of a
message. The following function codes are supported by the CP:
DATA Here the function code specific data are transferred. More information
about the structure of this field may be found at the function codes
beneath.
CRC-CHECK Message end is identified by means of a 2byte checksum. The first byte to
be transferred is the low byte, then the high byte.
The driver for Modbus Master recognizes message end, when no
transmission takes place during the time period for the transmission of 3.5
times character delay time.
This Time_Out for message end is therefore dependent on the
transmission rate:
Baud rate in baud Time_Out in ms
76800 0.5
38400 1
19200 2
9600 4
... ...
300 128
Byte sequence in For the byte sequence in the word is valid: word = high byte | low byte
the word
Error codes The following error codes are defined in accordance with the Modbus
specification:
Error Meaning in accordance Cause
code with Modbus spec.
1 Illegal function Illegal function code
2 Illegal data address Slave has illegal data address
3 Illegal data value Slave has illegal data value
4 Failure in associated Slave has internal error
device
5 Acknowledge Function is carried out
6 Busy, rejected message Slave is not ready to receive
7 Negative Function cannot be carried out
Acknowledgement
Communication with For the processing of the connecting jobs a user program is necessary in
the user program the CPU. Here the blocks FB 7 - P_RCV_RK and FB 8 - P_SND_RK are
used for communication between CPU, CP and a communication partner.
These blocks are more described at "Deployment CP 341...".
Modbus Function The following function codes are supported by the driver:
codes
FC Function Action in the PLC
01 Read coil status read in bits memory bits M
read in bits outputs Q
read in bits timer T
(16bit grid)
read in bits counter C
(16bit grid)
02 Read input status read in bits memory bits M
read in bits inputs I
03 Read holding registers read in words data block DB
04 Read input registers read in words data block DB
05 Force single coil write in bits memory bits M
write in bits outputs Q
06 Preset single register write in words
07 Read exception status read in bits event
08 Loop back test - -
11 Fetch communication read status word and status, event
Event Counter event counter
12 Fetch Communication read additional status status, event,
event log message
15 Force multiple coils write in bits memory bits M
(1...2040bits)
write in bits outputs Q
(1...2040bits)
16 Preset multiple write in words data block DB
registers (1...127 Register)
32bit access with With Modbus Master ASCII the register oriented functions 03,06,16 may
Modbus Master also handle 32bit registers.
ASCII Here the parameter "with 32-bit Register" is to be activated at "Modbus
Master" of the protocol properties.
If activated there is the possibility to access 32bit registers by a "modified"
function code.
By setting the 6. bit of the function code 32bit are accessed. If the 6. bit is
not set, 16bit registers are accessed.
There are the following values for the function codes:
Note!
Please regard the function code, which is sent is not affected by the state
of the 6. bit. This serves for master information, which data size to be
handled.
Please also regard to activate 32bit access in the slave, too.
FC 01 - Read This function serves to read individual bits of the output area of the slave.
Coil Status
The driver enters the data of the reply message into the destination DB
word-by-word. The 1. received byte is entered as the low byte of the 1.
word "data[1]", the 3. received byte as the low byte of the 2. word "data[2]",
etc.
If a quantity of less than 9bit or if only one low byte was read, the value 00h
is entered into the remaining high byte of the last word.
FC 02 - Read This function serves to read individual bits of the input area of the slave.
Input Status
The driver enters the data of the reply message into the destination DB
word-by-word. The 1. received byte is entered as the low byte of the 1.
word "data[1]", the 3. received byte as the low byte of the 2. word "data[2]",
etc. If a quantity of less than 9 bits or if only one low byte was read, the
value 00h is entered into the remaining high byte of the last word.
FC 03 Read This function serves to read individual registers of the output area of the
Output Registers slave.
FC 04 - Read This function serves to read individual registers of the input area of the
Input Registers slave.
FC 05 - Force This function serves to set or delete individual bits in the output area of the
Single Coil slave.
FC 06 - Preset This command serves to overwrite a slave register with a new value.
Single Register
FC 07 - Read This function code serves to read 8 event bits of the connected slave.
Exception Status The start bit number of the event bit is determined by the connected slave
and does not therefore have to be specified by the user program.
The driver enters the individual bits of the reply message into the high byte
in the destination DB "data[1]".
The low byte of "data[1]" remains unchanged.
FC 08 - Loop This function serves to check the communications connection. The slave
Back Diagnostic must return the request message to the master unchanged. The reply
message is not entered in the RCV destination DB.
Test
DB Address Name Type Comment
Send source +0.0 ADDR BYTE Slave address
+1.0 FUNC BYTE Function code
+2.0 diag_code WORD Diagnostic code
+4.0 test_value WORD Test value
diag_code The only permissible value for the parameter diag_code is 0000.
FC 11 - Fetch This function code serves to read the system words "Status word" and
Communications "Event counter" from the slave. These words are more described in the
"Gould Modbus Protocol".
Event Counter
FC 12 - Fetch This function code serves to read the system words "Status word", "Event
Communications counter" and "Message counter" as well as 64byte "Event byte" of the
slave. Here also information may be found in the description of the "Gould
Event Log
Modbus Protocol".
DB Address Name Type Comment
SEND source +0.0 ADDR BYTE Slave address
+1.0 FUNC BYTE Function code
FC 15 - Force This function code serves to change up to 2040 (ASCII: 1976) bits in the
Multiple Coils slave.
FC 16 - Preset This function code serves to overwrite up to 127 (ASCII: 123) registers in
Multiple Registers the slave with one request message.
Proceeding Open the Siemens SIMATIC manager with your project after installation.
The parameter plugin "Point-to-Point-Communication, Parameter Assign-
ment" is started from the properties dialog of the CP by the button
[Parameter...]. Here the parameters for transfer protocol, data receipt and
interface may be adjusted.
General This dialog contains every information of the loadable driver. Here nothing
may be changed.
At Loadable Driver the Modbus type followed by the transfer format may be
found.
At KP respectively SCC offline on the programming unit name and version
of the communication driver respectively the serial low level transfer driver
is displayed.
Modbus Slave
Speed Here the data transfer speed may be selected from a list.
Character frame The data between the CP and the communication partner were transferred
via the serial interface within a character frame. This ensures that each
character can be recognized and checked.
Please regard that the following parameters must have the same settings
at each communication partner.
Protocol
parameter
Parameter Description Default value
Slave address Here the own slave address may be set, which the 222
CP has to respond to.
Range: 1 ... 255
Operating mode Here the operating mode of the driver may be set. Normal operation
In Normal Operation every recognized transmission
error and break will result in error handling, even if
the driver is in idle mode.
In the operating mode Interference suppression
transmission errors and breaks are ignored when
the driver is in idle mode. If the driver leaves the idle
mode transmission error and break will result in
error handling.
Range: Normal operation, Interference suppression
Multiplier character If on e communication partner cannot meet the time 1
delay time requirements set by the Modbus specifications, you
have the option to increase the character delay time
with the multiplier.
Range: 1 ... 10
FC 01, 05, 15 In this dialog window the bit-oriented function codes 01, 05 and 15 may be
FC 02 assigned to address areas of the CPU. Bit memories, outputs, timer and
counter of the CPU may be accessed by means of this function codes.
With timer and counters the reading access is only possible with function
code 01.
With FC 02 a Modbus address area is assigned to bit memory and input
area of the CPU, which is accessed by reading.
FC 03, 06, 16 The data blocks of the CPU may be accessed (R/W) by the register-
FC 04 oriented function codes 03, 06 and 16. Here you can indicate starting from
which DB number the Modbus address starting with 0 is assigned.
Up to 128 DB may be accessed in one block. With the register-oriented
function code 04 data blocks of the CPU may only be accessed by reading.
Here a further block of 128 DBs may be determined. More details may be
found at the appropriate function codes.
Limits For the writing function codes 05, 06, 15 and 16 the access to the
corresponding area must be enabled before. By default the whole output
area of the CPU is disabled for write access, this means each value is 0.
If the master tries to write to an output area of the CPU, which is outside
the enabled area, the access is replied by a corresponding error message.
Initial state of the For a connection with minimum reflections and the break evaluation at
receive lines RS422/485 operation, the lines may be preset with defined static voltage
levels. At the CP interface the wiring of the receiver is realized as follows:
5V
Signal R(A) 0Volt This preassignment 5V
Overview With Modbus the data transfer happens without any handshake. The
master initiates the transmission, and after sending a request message it
waits for a reply message from the slave for the duration of the reply
monitoring time set. The type of data transfer between Modbus systems is
controlled by function codes.
At Modbus slave side the Modbus address of the message of the master is
transformed to the memory area of the CPU by the protocol driver.
The corresponding area assignment may be established by the parame-
terization.
Data transfer between CP and CPU happens by the Modbus commu-
nication FB 80 - MODB_341. FB 7 - P_PRC_RK and FB 8 - P_SND_RK
are internally called by this FB.
At slave side FB 7 - P_PRC_RK and FB 8 - P_SND_RK are necessary for
communication, so copy them to your project.
Message structure For communication Modbus uses the following message structure:
ADDR FUNC DATA CRC-CHECK
Byte Byte n Byte Word
ADDR Modbus slave address with the range 1...255. With slave address 0
(Broadcast Message) every slave at the bus is addressed by the master.
This is only permitted in conjunction with the writing function codes. Here
the message is not applied by the slave.
FUNC The function code defines the meaning as well as the structure of a
message. The following function codes are supported by the Modbus slave
driver:
FC Function Action in the PLC
01 Read coil status read in bits bit memory M
read in bits outputs Q
read in bits Timer T
(16bit grid)
read in bits Counter C
(16bit grid)
02 Read input status read in bits bit memory M
read in bits inputs I
03 Read holding registers read in words data block DB
04 Read input registers read in words data block DB
05 Force single coil write in bits bit memory M
write in bits outputs Q
06 Preset single register write in words
08 Loop back test - -
15 Force multiple coils write in bits bit memory M
(1...2040bits)
write in bits outputs Q
(1...2040bits)
16 Preset multiple write in words data block DB
registers (1...127 Register)
HB130E - CP - RE_341-1CH01 - Rev. 08/43 5-33
Chapter 5 Communication protocols Manual VIPA System 300V
Note!
Please consider as soon as you want to access a slave by a writing
function code, you have to write enable the corresponding area by the
protocol parameters with the dialog "Limits"
DATA Here the function code specific data are transferred. More information
about the structure of this field may be found at the function codes
beneath.
CRC-CHECK Message end is identified by means of a 2byte checksum. The first byte to
be transferred is the low byte, then the high byte.
The driver for Modbus Master recognizes message end, when no
transmission takes place during the time period for the transmission of 3.5
times character delay time. This Time_Out for message end is therefore
dependent on the transmission rate:
Baud rate in baud Time_Out in ms
76800 0.5
38400 1
19200 2
9600 4
... ...
300 128
Byte sequence in For the byte sequence in the word is valid: word = high byte | low byte
the word
Error codes The following error codes are defined in accordance with the Modbus
specification:
Error Meaning in accordance Cause
code with Modbus spec.
1 Illegal function Illegal function code
2 Illegal data address Slave has illegal data address
3 Illegal data value Slave has illegal data value
4 Failure in associated Slave has internal error
device
5 Acknowledge Function is carried out
6 Busy, rejected message Slave is not ready to receive
7 Negative Function cannot be carried out
Acknowledgement
Overview For the processing of the connecting jobs at slave side a user program is
necessary in the CPU.
The data transfer between CP and CPU happens by the Modbus
communication FB 80 - MODB_341. By this FB 7 - P_RCV_RK and FB 8 -
P_SND_RK are called internally.
For communication at the slave side it is necessary to integrate FB 7 -
P_RCV_RK and FB 8 - P_SND_RK to the project.
Attention!
Calling of the FB 80 - MODB_341 within diagnostic or process interrupt is
not allowed.
Please regard the FB does not have a parameter check; which means that
if there are invalid parameters, the CPU may switch to STOP mode.
Installation The function block FB 80 is installed together with the protocol driver. If not
already happen, finish the Siemens SIMATIC manager, start the installation
file of the driver and follow the instructions
FB 80 - MODB_341 may be found in the block library after installation
The library may be opened in the Siemens SIMATIC manager by
File > Open > "Libraries" and here "Modbus"
Reaction time For the write function codes (FC 05, FC 15) is valid:
Reaction time = AG cycle + time CP→CPU + time CPU→CP
The CP does not send the reply message to the master system until after
the data transfer CPU→CP. In this instance the standard reply monitoring
time of 2s can be kept
Parameter
Parameter Declaration Data Description
type
LADDR Input INT
Logical basic address of the CP - corresponds to
the address of the hardware configuration of the
CP.
START_TIMER Input TIMER Timer number for check time for initialization
START_TIME Input S5TIME Timer value for check time
OB_MASK Input BOOL Mask I/O access errors, delay alarms
CP_START Input/Output BOOL Start FB initialization
CP_START_FM Input/Output BOOL Edge trigger flag CP_START
CP_START_NDR Input/Output BOOL Info: Write request from the CP
CP_START_OK Input/Output BOOL Initialization is finished without error
(time within check time)
CP_START_ERROR Input/Output BOOL Initialization is finished with error
(time longer than check time)
ERROR_NR Input/Output WORD Error number
ERROR_INFO Input/Output WORD Error addition information
LADDR Here type in the logical basic address of the CP. This corresponds to the
address of the hardware configuration of the CP.
CP_START After each complete restart or restart of the CPU you have to initialize the
FB 80 - MODB_341. The initialization is activated with a rising edge at input
CP_START.
CP_START_OK As soon as the send job has been completed without error, the output
CP_START_ERROR CP_START_OK is set and the FB initialization is complete.
Is the Send job completed with error, CP_START reset and
CP_START_ERROR is set.
... continue
ERROR_NR ERROR_INFO Error Text
(decimal)
14 Memory bits M - Attempted access to memory area "Memory bits" in excess
End address of range end.
Attention:
Range length in CPU is CPU type-dependent.
Remedy: Reduce Modbus Start Address and/or access
length in Modbus master system.
15 Outputs Q - Attempted access to memory area "Outputs" in excess of
End address range end.
Attention:
Range length in CPU is CPU type-dependent.
Remedy: Reduce Modbus Start Address and/or access
length in Modbus master system.
16 Timers T - Attempted access to memory area "Timers" in excess of
End address range end.
Attention:
Range length in CPU is CPU type-dependent.
Remedy: Reduce Modbus Start Address and/or access
length in Modbus master system.
17 Counters C - Attempted access to memory area "Counters" in excess of
End address range end.
Attention:
Range length in CPU is CPU type-dependent.
Remedy: Reduce Modbus Start Address and/or access
length in Modbus master system.
18 0 Illegal memory area transferred by the driver to the
communication FB.
Remedy: if required restart CP (PowerOn).
19 Error during access to the I/Os.
Remedy: check if required I/Os exist and are error-free.
OB1
Call FB 80 , DB80 // Modbus slave CP341 FB
LADDR :=256 // Basic address of CP
START_TIMER :=T120 // Timer startup
START_TIME :=S5T#5S // Time value startup
OB_MASK :=TRUE // Mask access errors
CP_START :=M100.0 // Initialization START
CP_START_FM :=M100.1 // Edge trigger flag
CP_NDR :=M100.2 // New write job CP
CP_START_OK :=M100.3 // Init. CP-FB without error
CP_START_ERROR :=M100.4 // Init. CP with error
CP_ERROR_NR :=MW102 // Error number
CP_ERROR_INFO :=MW104 // Error additional info
Data consistency Data transfer between CPU and CP happens block-by-block by the
function blocks FB 7 - P_RCV_RK and FB 8 - P_SND_RK. Here the block
size is about 32byte.
Data consistency is given only for a block size of 32byte.
For larger amounts of data, the data is transferred in the listed block size
with a time delay between each block. There is no consistency between
these data blocks because the data may be processed by the user
program at the same time.
Access to the CPU memory area is carried out while the user program is
running whenever the FB 7 - P_RCV_RK is passed. If data consistency is
required when reading/writing registers or bits, the amount of data
transferred by a single message must be limited to 32byte.
For example a maximum of 16 registers with FC 03, 04, 16 or a maximum
of 256bits with FC 01, 02, 15.
Else you have to ensure the consistent processing of related data blocks
by the user program.
Modbus Function The following function codes are supported by the driver:
codes
FC Function Action in the PLC
01 Read coil status read in bits bit memory M
read in bits outputs Q
read in bits Timer T
(16bit grid)
read in bits Counter C
(16bit grid)
02 Read input status read in bits bit memory M
read in bits inputs I
03 Read holding registers read in words data block DB
04 Read input registers read in words data block DB
05 Force single coil write in bits bit memory M
write in bits outputs Q
06 Preset single register write in words
08 Loop back test - -
15 Force multiple coils write in bits bit memory M
(1...2040bits)
write in bits outputs Q
(1...2040bits)
16 Preset multiple write in words data block DB
registers (1...127 Register)
Note!
The Modbus slave driver supports a maximum data block length of 512
data words in all the function codes, which access the DBs in the CPU (FC
03, 04, 06, 16). One DB may be accessed by one message. Otherwise you
get an error message.
FC 01 - Read This function serves to read individual bits of the output area of the CPU by
Coil Status the Modbus master.
Request message
ADDR FUNC start_addr bit_number CRC
Reply message
ADDR FUNC byte_count n n byte data CRC
start_addr The Modbus bit address start_addr contains the start of the area of the
CPU, which is be accessed.
The corresponding address allocation of the CPU memory area are
established by the properties of "FC 01, 05, 15" in the parameterization of
the CP. Here the "Modbus address in transmission message" briefly
Param-start-address may be assigned to a "SIMATIC memory area" briefly
PLC-area.
bit_number Values between 1 and 2040 are permitted as bit_number. This number of
bits are read. When accessing timer and counters, it must be possible to
divide the bit_number by 16. Maximally 16 timers and counters may be
accessed.
FC 02 - Read This function enables the Modbus master to read individual bits from the
Input Status input area of the CPU.
Request message
ADDR FUNC start_addr bit_number CRC
Reply message
ADDR FUNC byte_count n n byte data CRC
start_addr The Modbus bit address start_addr contains the start of the area of the
CPU, which is be accessed.
The corresponding address allocation of the CPU memory area is
established by the properties of "FC 02" in the parameterization of the CP.
Here the "Modbus address in transmission message" briefly Param-start-
address may be assigned to a "SIMATIC memory area" briefly PLC-area.
bit_number Values between 1 and 2040 are permitted as bit_number. This number of
bits are read.
Address calculation
start_addr Access Calculation Area in PLC
hex decimal
0000h 0 Mem.-bit (0 - 0) / 8) +1000 → M 1000.0
0001h 1 Mem.-bit (1 - 0) / 8) +1000 → M 1000.1
01F1h 497 Mem.-bit (497 - 0) / 8) +1000 → M 1062.1
0400h 1024 Input (1024 - 1024) / 8) +100 → I 100.0
0401h 1025 Input (1025 - 1024) / 8) +100 → I 100.1
07DAh 2010 Input (2010 - 1024) / 8) +100 → I 223.2
FC 03 - Read This function enables the Modbus master to read data words from a data
Output Registers block.
Request message
ADDR FUNC start_register register_number CRC
Reply message
ADDR FUNC byte_count n n/2-register data (High, Low) CRC
start_register
15 9 8 7 0
start_register-offset_DB_no. start_register-word_no.
Please regard for DBW it is only allowed to use even numbered data word
numbers.
register_number Values between 1 and 127 are permitted as register_number. This number
of registers are read.
It is valid: Maximum register_number = 512 - start_register
Conversion For e.g. start_register = 80 (0050h) the conversion takes place with the
following approach:
start_register = 0050h
15 9 8 7 0
start_register-offset_DB_no. start_register-word-no.
= 00h = 50h
Further values
FC 04 - Read This function is identical to FC 03. Here the data words of another data
Input Registers block may be accessed.
The corresponding address allocation of the CPU memory area are
established by the properties of "FC 04" in the parameterization of the CP.
Here the fixed "Modbus address in transmission message" 0 may be
assigned to a Base-DB-Number in the "SIMATIC memory area".
For more information see FC 03.
FC 05 - Force This function enables the Modbus master to set and erase individual bits in
Single Coil the output area of the CPU. Please consider as soon as you want to
access an area by writing, you have to write enable the corresponding area
by the protocol parameters with the dialog "Limits".
Request message
ADDR FUNC coil_addr Data_on/off CRC
Reply message
ADDR FUNC coil addr Data_on/off CRC
coil_addr The Modbus bit address coil_addr contains the start of the area of the
CPU, which is be accessed.
The corresponding address allocation of the CPU memory area are
established by the properties of "FC 01, 05, 15" in the parameterization of
the CP. Here the "Modbus address in transmission message" briefly
Param-start-address may be assigned to a "SIMATIC memory area" briefly
PLC-area.
Address calculation:
start_addr Access Calculation Area in PLC
hex decimal
0000h 0 Mem.-bit (0 - 0) / 8) +1000 → M 1000.0
0001h 1 Mem.-bit (1 - 0) / 8) +1000 → M 1000.1
01F1h 497 Mem.-bit (497 - 0) / 8) +1000 → M 1062.1
0400h 1024 Output (1024 - 1024) / 8) +100 → Q 100.0
0401h 1025 Output (1025 - 1024) / 8) +100 → Q 100.1
07DAh 2010 Output (2010 - 1024) / 8) +100 → Q 223.2
FC 06 - Preset This function enables the Modbus master to write one data word in a data
Single Register block of the CPU. Please consider as soon as you want to access an area
by writing, you have to write enable the corresponding area by the protocol
parameters with the dialog "Limits".
Request message
ADDR FUNC start_register Data_value (High, Low) CRC
Reply message
ADDR FUNC start_register Data_value (High, Low) CRC
start_register
15 9 8 7 0
start_register-offset_DB_no. start_register-word_no.
Please regard for DBW it is only allowed to use even numbered data word
numbers.
Data_value Any 16bit value is allowed as Data_value. This is the register value to be
written.
Conversion For e.g. start_register = 80 (0050h) the conversion takes place with the
following approach:
start_register = 0050h
15 9 8 7 0
start_register-offset_DB_no. start_register-word-no.
= 00h = 50h
Further values
FC 08 - Loop Back This function serves to check the communications connection. It does not
Diagnostic Test effect the user program. The received message is independently returned
to the master by the driver.
Request message
ADDR FUNC diagnostic_code (High, Low) test_data CRC
Reply message
ADDR FUNC diagnostic_code (High, Low) test_data CRC
FC 15 - Force This function enables the Modbus master to write several bits to the output
Multiple Coils area of the CPU. Please consider as soon as you want to access an area
by writing, you have to write enable the corresponding area by the protocol
parameters with the dialog "Limits".
Request message
ADDR FUNC start_addr quantity byte_count n n-Data CRC
Reply message
ADDR FUNC start_addr quantity CRC
start_addr The Modbus bit address start_addr contains the start of the area of the
CPU, which is be accessed.
The corresponding address allocation of the CPU memory area are
established by the properties of "FC 01, 05, 15" in the parameterization of
the CP. Here the "Modbus address in transmission message" briefly
Param-start-address may be assigned to a "SIMATIC memory area" briefly
PLC-area.
quantity Each value between 1 and 2040 is valid as quantity (number of bits).
byte_count n byte_count n (byte counter) is formed automatically due to the bit number.
FC 16 - Preset This function enables the Modbus master to write several data words in a
Multiple Registers data block of the CPU. Please consider as soon as you want to access an
area by writing, you have to write enable the corresponding area by the
protocol parameters with the dialog "Limits".
Request message
ADDR FUNC start_register quantity byte_count n n-Data (High, Low) CRC
Reply message
ADDR FUNC start_addr quantity CRC
start_register
15 9 8 7 0
start_register-offset_DB_no. start_register-word_no.
Please regard for DBW it is only allowed to use even numbered data word
numbers.
quantity Any value between 1 and 127 is permitted as quantity (number of register)
It is valid: Maximum quantity = 512 - start_register
byte_count n byte_count n (byte counter) is formed automatically due to the bit number.
n-Data (High, Low) Any value may be used as n-Data (High, Low).
Conversion For e.g. start_register = 80 (0050h) the conversion takes place with the
following approach:
start_register = 0050h
15 9 8 7 0
start_register-offset_DB_no. start_register-word-no.
= 00h = 50h
Further values
Overview With the CP 341 a diagnostic interrupt entry may be released at the
corresponding CPU. In this chapter the possibilities of diagnostics and the
error behavior of the CP at deployment of the various protocols is more
described.
Overview The diagnostics functions enable you to quickly localize any errors, which
occur. The following diagnostics options are available:
Diagnosis via the The CP-LEDs give you an initial overview of any internal or external errors
CP-LEDs as well as interface-specific errors.
More information about the LEDs and their function may be found at
"Components" of the chapter "Hardware description" and at "Firmware
update".
Diagnosis via Every CP error is entered in the diagnostic buffer of the CP.
diagnostic buffer In the same way as with the diagnostic buffer of the CPU, you can also use
of the CP the PLC functions to display the information of the CP diagnostic buffer.
Note!
An error message is only output if the ERROR bit (request completed with
error) is set. In all other cases the STATUS word is zero.
Diagnostics via The CP can trigger a diagnostic interrupt on the CPU assigned to it. The
diagnostic CP provides 4bytes of diagnostic information for the CPU. These data may
interrupt be accessed by reading the diagnostics buffer of the CP respectively by
reacting with OB 82 on the diagnostics.
The diagnostics were also entered in the diagnostics buffer of the CP.
When a diagnostic interrupt event occurs, the red SF LED lights up.
STATUS
Bit 15 ... 13 12 ... 8 7 ... 0
reserved Event class Event number
(Error number)
Event classes The table below describes the various event classes and numbers:
and numbers
Event class 00h "CP start-up"
Event class / number Description
00 03h PtP parameter accepted
00 04h Parameter already on CP (timers match)
00 07h Status transition CPU to STOP
00 08h Status transition CPU to RUN/START-UP
Event class 01h "Hardware fault on CP"
01 01h Fault while testing operating system EPROM of CP
Remedy: CP defective and must be replaced.
01 02h RAM test of CP faulty
Remedy: CP defective and must be replaced.
01 03h Request interface of CP defective
Remedy: CP defective and must be replaced.
01 10h Fault in CP firmware
Remedy: Switch CP off and on again. If necessary, replace CP.
Event class 02h "Initialization error"
02 0Fh Invalid parameterization detected at start of parameterized
communication. Interface could not be parameterized.
Please regard RK512 is not supported by the VIPA CP. This error
message is displayed as soon as RK512 is parameterized.
Remedy: Do not parameterize RK512. Correct the non-permissible
parameterization and initialize a start-up.
continue ...
... continued
Event class 03h "Error parameterization of FBs"
(not displayed in diagnostic buffer)
Event class / number Description
03 01h Invalid or no source/destination data type
Invalid area (start address, length)
DB invalid or no DB (e.g. DB 0) or other data type invalid or missing.
Remedy: Check parameterization on CPU and CP and correct if
necessary.
Event class 04h "CP detected error in data traffic CP - CPU"
04 03h Incorrect, unknown or illegal data type
(e.g. wrong parameterization of FB)
Remedy: Check program for incorrect parameterization of the FB.
04 07h Error during data transmission between CPU and CP.
Remedy: If fault indication persists, check whether function blocks you
have called in user program are parameterized correctly.
If error is indicated immediately after PowerON, no connection has yet
been set up to the CPU. In the case of ASCII driver and 3964(R), the
receiving CP re-attempts data transfer until the data is transmitted to
the CPU.
If fault indication is sporadic in the course of data transfer, the CPU is
temporarily unable to accept data. In the case of the ASCII driver and
3964(R) the receiving CP re-attempts data transfer until the data is
transmitted to the CPU.
04 08h Error during data transmission between CPU and CP (reception).
• CPU is temporarily overloaded, request queued for repetition.
Remedy: Reduce number of communication calls
• CPU data area temporarily unavailable for access, for example
because receive block is called too infrequently.
Remedy: Call the receive block more frequently.
• CPU data area temporarily unavailable for access, for example
because receive block is temporarily locked (EN = false).
Remedy: Check whether the receive block is disabled for too long.
continue ...
... continued
... Event class 04h "CP detected error in data traffic CP - CPU"
Event class / number Description
04 09h Data cannot be received. Error during data transmission between CPU
and CP (reception). Request is canceled in 10s following multiple
attempts, because:
• Receive block is not called
Remedy: Check whether your user program runs the receive block.
• Receive block is disabled
Remedy: Check whether the receive block is disabled.
• Access to CPU data area denied
Remedy: check that the data area to which the data is to be
transferred is available.
• CPU data area too short.
Remedy: Check the length of the data area.
04 0Ah Error during data transmission between CPU and CP.
Data transfer canceled by RESET because:
• Destination DB is not available
• Destination DB is too short
• RESET bit set at FB.
Remedy: Create destination DB in the user program or increase the
length of the existing destination DB, as applicable.
Event class 05h "error while processing CPU request"
05 01h Current request aborted as a result of CP restart.
Remedy: No remedy is possible at PowerON. When re-parameteriza-
tion of the CP from the programming device, before writing an interface
you should ensure there are no more request running from the CPU.
05 02h Request not permitted in this operating mode of CP
(e.g. device interface not parameterized).
Remedy: Parameterize the device interface.
05 14h Specified start addresses too high for desired data type, or start
address or DB/DX number too low.
Remedy: Obtain from the request tables the permissible start
addresses and DB/DX numbers that can be specified in the program.
05 17h Transmission length > 1kbyte too great for CP or too short for interface
parameter.
Remedy: Split the request up into several shorter requests.
05 18h with Modbus Master only
Transmission length during transmission is too large (> 4kBytes) or
transmission length for Send is too small.
Remedy: Check the parameter LEN for SEND.
continue ...
... continued
Event class 07h "Send error"
Event class / number Description
07 01h Transmission of the first repetition:
• An error was detected during transmission of the message frame
• The partner requested a repetition by means of a negative
acknowledgment code (NAK)
Remedy: A repetition is not an error, but it can be an indication that
there are disturbances on the transmission line or that the partner
device is behaving incorrectly. If the message frame still has not been
transmitted after the maximum number of repetitions, an error number
describing the first error that occurred is output.
07 02h with 3964(R) only
Error during connection setup: after STX was send, NAK or any other
code (except for DLE or STX) was received.
Remedy: Check for malfunction at partner device, possible by using
interface test device switched into the transmission line.
07 03h with 3964(R) only
Acknowledgment delay time (ADT) exceeded: after STX was sent, no
response came from partner within acknowledgement delay time.
Remedy: Partner device is too slow or not ready to receive, or there is a
break on the send line, for example. Check for malfunction at partner
device, possible by using interface test device switched into the
transmission line.
07 04h with 3964(R) only
Termination by partner: during current send operation, one or more
characters were received by partner.
Remedy: Check whether the partner is also showing an error, possible
because not all transmission data has arrived (e.g. due to break on line)
or due to serious fault or because the partner device has
malfunctioned. If necessary, use an interface test device switched into
the transmission line for this purpose.
07 06h with 3964(R) only
Error at end of connection:
• Partner rejected message frame at end of connection with NAK or a
random string (except for DLE).
• Acknowledgment code (DLE) received to early.
Remedy: Check whether the partner is also showing an error, possible
because not all transmission data has arrived (e.g. due to break on line)
or due to serious faults or because the partner device has
malfunctioned. If necessary, use an interface test device switched into
the transmission line for this purpose.
continue ...
... continued
... Event class 07h "Send error"
Event class / number Description
07 07h with 3964(R) only
Acknowledgment delay time exceeded at end of connection or
response monitoring time exceeded after send message frame.
After connection release with DLE ETX no response received from
partner within acknowledgment delay time.
Remedy: Partner device faulty or too slow. If necessary, use an
interface test device switched into the transmission line to check.
07 08h With ASCII driver only
The waiting time for XON respectively CTS = ON has elapsed.
Remedy: The communication partner has a fault, is too slow or is
switched off-line. Check the communication partner or, if necessary,
change the parameterization.
07 09h Connection setup not possible. Number of permitted setup attempts
exceeded.
Remedy: Check the interface cable or the transmission parameters.
Also check that receive function between CPU and CP is correctly
parameterized at the partner device.
07 0Ah The data could not be transmitted. The permitted number of transfer
attempts was exceeded.
Remedy: Check the interface cable or the transmission parameters.
Event class 08h "Receive error"
08 01h Expectation of the first repetition:
An error was detected on receipt of a message frame, and the CP
requests a repetition by means of negative acknowledgment (NAK) at
the partner.
Remedy: A repetition is not an error, but it can be an indication that
there are disturbances on the transmission line or that the partner
device is behaving incorrectly. If the message frame still has not been
transmitted after the maximum number of repetitions, an error number
describing the first error that occurred is output.
08 02h With 3964(R) only
Error during connection setup:
• In idle mode, one or more random codes (other than NAK or STX)
were received.
• After a STX was received, partner sent more codes without waiting
for response DLE.
After the partner has signaled PowerON:
• While partner is being activated, CP receives an undefined code.
Remedy: Check for malfunction at partner device, possible by using
interface test device switched into the transmission line.
continue ...
... continued
... Event class 08h "Receive error"
Event class / number Description
08 05h With 3964(R) only
Logical error during receiving:
After DLE was received, a further random code (other than DLE or
ETX).
Remedy: Check whether partner DLE in message frame header and in
data string is always in duplicate or the connection is released with DLE
ETX. Check for malfunction at partner device, possible by using
interface test device switched into the transmission line.
08 06h Character delay time (ZVZ) exceeded:
• Two successive characters were not received within character delay
time or
With 3964(R) only
• 1. character after sending of DLE during connection setup was not
received within character delay time.
Remedy: Partner device faulty or too slow. Use an interface test device
switched into the transmission line to check.
08 08h With 3964(R) only
Error in block check character (BCC):
Internally calculated value of BCC does not match BCC does not match
BCC received by partner at end of connection.
Remedy: Check whether connection is badly damaged; in this case you
may also occasionally see error codes. Check for malfunction at partner
device, possible by using interface test device switched into the
transmission line.
08 0Ah There is no free input buffer available.
Remedy: The FB P_RCV_RK must be called more frequently.
08 0Ch Transmission error:
• Transmission error (parity error-, stop bit error or overflow error)
detected.
With 3964(R) only
• If faulty character is received in idle mode, the error is reported
immediately so that disturbances on the transmission line can be
detected early.
• If this occurs during send or receive operation, repetitions are
initiated.
Remedy: Disturbances on the transmission line cause message frame
repetitions, thus lowering user data throughput. Danger of an
undetected error increase. Correct fault by changing system setup or
line installation. Check connecting cable of communications partner or
check whether both devices have same setting for baud rate, parity and
number of stop bits.
continue ...
... continued
... Event class 08h "Receive error"
Event class / number Description
08 0Dh BREAK
Receive line to partner is interrupted.
Remedy: reconnect or switch partner on again.
Check and change the connector pin assignment of the 2-wire receiving
line R(A), R(B).
08 15h Discrepancy between settings for transfer attempts at CP a commu-
nication partner.
Remedy: Parameterize same number of transfer attempts at
communication partner as at CP. Check for malfunction at partner
device, possible by using interface test device switched into the
transmission line.
08 16h • The length of a received message frame was longer than the length
agreed upon.
Remedy: a correction is necessary at the partner.
• The length of the parameterized input buffer is too short
Remedy: the length of the input buffer must be enlarged
08 18h With (Modbus) ASCII driver only
DSR = OFF or CTS = OFF
Remedy: The partner has switched the DSR or CTS signal to "OFF"
before or during a transmission.
Check the partners control of the RS 232 secondary signals.
08 30h With Modbus Master only
A request message has been sent and the reply monitoring time has
elapsed without the start of a reply message being recognized.
Remedy: Check if transmission line is interrupted
(interface analyzer may be required).
Check if the protocol parameters transmission rate, amount of data bits,
parity, and amount of stop bits have the same settings in CP and the
link partner.
Check if the value for the reply monitoring time set with PtP_PARAM is
big enough.
Check if the specified slave address exists.
08 31h With Modbus Master RTU only
The first character in the reply message from the slave is different from
the slave address sent in the request message
(for operating mode "normal").
Remedy: The wrong slave has replied.
Check if the transmission line is interrupted
(interface analyzer may be required).
08 32h With Modbus Master only
Overflow of receive buffer in CP during reception of the reply message.
Remedy: Check protocol settings for the slave.
continue ...
... continued
... Event class 08h "Receive error"
Event class / number Description
08 33h With Modbus Master ASCII only
A wrong start character was received. This was not a ":" (3Ah)
Remedy: Check protocol settings for the slave.
08 34h With Modbus Master ASCII only
A start character was received within a message. The first part of the
message is discarded and reception starts again with the second start
character.
Remedy: Check if transmission line is interrupted. This does not in itself
fail the send job. The error only appears in the CP diagnostics buffer.
Event class 14 (0Eh) "Loadable Driver - General Processing Errors
<Processing of a BSEND Job>"
0E 31h With Modbus Slave only
TimeOut during data transfer to CPU
Remedy: Check CP-CPU interface.
0E 38h With Modbus Slave only
Error occurred when accessing one of the CPU areas "memory bits",
"outputs", "timers", "counters", "inputs" with function codes FC 01 or FC
02: for example, input does not exist or read attempt in excess of range
end.
Remedy: Check if the addressed CPU area exists and whether an
attempt was made to access in excess of range end.
0E 39h With Modbus Slave only
Error occurred when accessing CPU area "data block" with function
codes FC 02, 04, 06, 16: Data blocks does not exist or is too short.
Remedy: Check if the addressed data block exists and that it is
sufficiently long.
0E 40h With Modbus Master only
Value specified for parameter LEN at SFB SEND too small.
Remedy: Minimum length is 2bytes.
0E 41h With Modbus Master only
Value specified for parameter LEN at SFB SEND too small. A greater
length is required for the transferred function code.
Remedy: The minimum length for this function code is 6bytes.
0E 42h With Modbus Master only
Transferred function code is illegal.
Remedy: The only function codes, which are permitted are those listed
in the chapter "Function codes".
continue ...
... continued
... Event class 14 (0Eh) "Loadable Driver - General Processing Errors
<Processing of a BSEND Job>"
Event class / number Description
0E 43h With Modbus Master only
Slave Address 0 (=Broadcast) not permitted with this function code.
Remedy: Only use slave Address 0 for the suitable function codes.
0E 44h With Modbus Master only
The value of the transferred parameter "Amount of Bits" is not within
the range 1...2040 (Modbus Master ASCII: 1...2008).
Remedy: Correct your source DB.
0E 45h With Modbus Master only
The value of the transferred parameter "Amount of Registers" is not
within range 1...127 (Modbus Master ASCII 1...125, with 32bit 1...62).
Remedy: Correct your source DB.
0E 46h With Modbus Master only
Function codes 15 or 16:
The value of the transferred parameters "Amount of Bits" and/or
"Amount of Registers" are not within the range 1...2040 and/or 1...127
(Modbus Master ASCII 1...1976 and/or 1...123, with 32bit 1..61).
Remedy: Correct your source DB.
0E 47h With Modbus Master only
Function codes 15 or 16:
The parameter LEN for SFB BSEND does not correspond to the
transferred parameters "Amount of Bits" and/or "Amount of Registers".
Parameter LEN is too small.
Remedy: Increase parameter LEN for SEND until a sufficient amount of
user data is transferred to the CP. A larger amount of user data must
be transferred to the CP because of the "Amount of Bits" and/or
"Amount of Registers".
0E 48h With Modbus Master only
Function code 5:
The code specified in SEND source DB for "Set Bit" (FF00h) or "Delete
Bit" (0000h) is wrong.
Remedy: The only permitted code is "Diagnostic Code" 0000h.
0E 49h With Modbus Master only
Function code 8:
The code specified in SEND source DB for "Diagnostic Code" is wrong.
Remedy: The only permitted code is "Diagnostic Code" 0000h.
0E 4Ah With Modbus Master ASCII only
Access to 32bit registers is only allowed with FC 03, 06, 16.
Here bit 6 of FC in source DB is set.
Remedy: Correct your source DB.
0E 4Fh With Modbus Master only
The R_TYP specified for SFB SEND RK is illegal with this driver.
Remedy: "X" has not to be entered as R_TYP.
continue ...
... continued
Event class 14 (0Eh) "Loadable Driver - General Processing Errors
<Receive Evaluation>"
Event class / number Description
0E 50h With Modbus Master only
Slave address incorrect:
The received slave address is different from the sent slave address.
Remedy: The wrong slave has replied.
Check if the transmission line is interrupted
(interface analyzer may be required).
0E 51h With Modbus Master only
Function code incorrect:
The function code received in the reply message is different from the
sent function code.
Remedy: Check slave device.
0E 52h With Modbus Master only
Byte underflow:
Amount of characters received is less than should have resulted from
the byte counter of the reply message or is less than expected with this
function code.
Remedy: Check slave device.
0E 53h With Modbus Master only
Byte overflow:
Amount of characters received is more than should have resulted from
the byte counter of the reply message or is more than expected with
this function code.
Remedy: Check slave device.
0E 54h With Modbus Master only
Byte counter wrong:
The byte counter received in the reply message is too small.
Remedy: Check slave device.
0E 55h With Modbus Master only
The byte counter received in the reply message is wrong.
Remedy: Check slave device.
0E 56h With Modbus Master only
Echo wrong:
The data of the reply message (amount of bits, ...) echoed from the
slave are different from the data sent in the request message.
Remedy: Check slave device.
0E 57h With Modbus Master only
CRC check incorrect (Modbus Master ASCII: LRC check incorrect):
An error has occurred on checking the CRC (LRC) checksum of the
reply message from the slave.
Remedy: Check slave device.
continue ...
... continued
... Event class 14 (0Eh) "Loadable Driver - General Processing Errors
<Receive Evaluation>"
Event class / number Description
0E 58h With Modbus Master ASCII only
A received character within the reply message is not an ASCII
character (0...9, A...F).
Remedy: Check slave device. Make sure it is in ASCII mode and not
RTU.
0E 61h With Modbus Master only
Reply message with Exception Code 01: Illegal Function
Remedy: See manual of slave device.
0E 62h With Modbus Master only
Reply message with Exception Code 02: Illegal Data Address
Remedy See manual of slave device.
0E 63h With Modbus Master only
Reply message with Exception Code 03: Illegal Data Value
Remedy: See manual of slave device.
0E 64h With Modbus Master only
Reply message with Exception Code 04: Failure in associated device
Remedy: See manual of slave device.
0E 65h With Modbus Master only
Reply message with Exception Code 05: Acknowledge
Remedy: See manual of slave device.
0E 66h With Modbus Master only
Reply message with Exception Code 06: Busy, Rejected message
Remedy: See manual of slave device.
0E 67h With Modbus Master only
Reply message with Exception Code 07: Negative Acknowledgment
Remedy: See manual of slave device.
Event class 30 (1Eh) "Error during communication between CP and CPU via backplane bus"
1E 0Dh Request aborted due to complete Restart or Reset.
1E 0Eh Static error when the SFC 59 "RD-REC" (Read Data).
Return value RET_VAL of SFC is available for evaluation in SFCERR
variable in instance DB.
Remedy: Load SFCERR variable from instance DB.
1E 0Fh Static error when the SFC 58 "WD-REC" (Write Data).
Return value RET_VAL of SFC is available for evaluation in SFCERR
variable in instance DB.
Remedy: Load SFCERR variable from instance DB.
1E 41h Number of bytes set in LEN parameter of FBs illegal
Remedy: Keep to the value range of 1 to 1024bytes.
Overview The CP has its own diagnostic buffer. There all the diagnostic events of the
CP are entered in the order in which they occur.
Note!
The diagnostic buffer is a ring buffer for a maximum of 9 diagnostic entries.
When the diagnostic buffer is full, the oldest entry is deleted when a new
entry is recorded. This means that the most recent entry is always the first.
The contents of the diagnostic buffer are lost in the event of a PowerOFF
or when the CP is re-parameterized.
Reading the Via the Siemens SIMATIC manager the contents of the diagnostic buffer of
diagnostic buffer the CP may be read by means of the PLC functions. The access takes
at the PG place with the following proceeding:
• Start the Siemens SIMATIC manager with your project.
• Select the station and open the hardware object via the hardware
configurator.
• Select the CP and choose PLC > Module → the "Module Information"
dialog box of the CP appears.
• Select the "Diagnostic Buffer" register. Here the most recent diagnostic
events of the CP are displayed.
Overview The CP can trigger a diagnostics alarm on the assign CPU, thus indicating
a malfunction of the CP.
You can specify at parameterization whether the CP is to trigger a
diagnostics interrupt or not in the event of an error.
As default Diagnostics interrupt is deactivated.
Diagnostics In the event of an error the CP provides diagnostics data on the backplane
interrupt bus. These were read by the CPU and entered to its diagnostics buffer.
At any time the CPU diagnostics buffer may be read with the PC by means
of the PLC functions.
When a diagnostics interrupt occurs, the SF LED lights up and the OB 82
is called.
Appendix
A Index
3 Master
Function codes .................. 5-23
3964(R)......................................... 5-8
Functionality....................... 5-21
Parameters ............................. 5-10
Parameterization................ 5-15
A User program..................... 5-22
ASCII ............................................ 5-3 Slave
Parameters ............................... 5-4 Answer ...................... 5-22, 5-34
Assembly ...................................... 2-1 Function codes .................. 5-40
B Functionality....................... 5-33
Basics ........................................... 1-1 Parameterization................ 5-29
User program..................... 5-35
C
Communication protocols ............. 5-1 P
3964(R)..................................... 5-8 Parameters ................................... 4-5
ASCII ........................................ 5-3 Power supply ......................... 2-6, 3-3
Modbus Master ....................... 5-15 Properties ..................................... 3-2
Modbus Slave ......................... 5-29 R
D RS422/485
Deployment................................... 4-1 Interface ................................... 3-4
Fast introduction ....................... 4-2 static voltages.................... 3-4, 3-6
Diagnostics ................................... 6-1 S
Buffer ...................................... 6-14 Safety Information ........................ 1-2
Interrupt .................................. 6-15 Structure ....................................... 3-3
Messages ................................. 6-3 System 300V
Overview................................... 6-2 Assembly.................................. 2-5
F Bus connector .......................... 2-2
FB 7 (P_RCV_RK)...................... 4-10 Cabling ..................................... 2-6
FB 8 (P_SND_RK)........................ 4-8 Front connectors.................. 2-8
FB 80 (MODB_341) .................... 5-35 Core cross-section ................... 1-4
FB-STATUS.................................. 6-3 EMC ....................................... 2-10
Firmware update......................... 4-12 Basic rules ......................... 2-11
Environmental conditions ......... 1-4
H
Installation dimensions ............. 2-3
Hardware
Installation guidelines ............. 2-10
Configuration ............................ 4-4
Interference influences ........... 2-10
Description................................ 3-1
Isolation of conductors ........... 2-12
I Overview................................... 1-3
Installation guidelines.................... 2-1 Structure................................... 2-4
ISO/OSI reference model ............. 1-5 T
L Technical data .............................. 3-7
LEDs ............................................. 3-3 U
M User program ............................... 4-7
Modbus ....................................... 5-14
M. Stich