Beruflich Dokumente
Kultur Dokumente
Figure 1-1
Solution Requirements
The solution must fulfill the following points:
▪ Only one S7 connection is used
▪ 4 different data packages are to be transferred at 4 different areas
in the target CPU.
▪ The transfer must be performed in sequences, i.e. all components
of a sequence must have been transmitted before a new package
is transmitted.
The selected data quantities are user-defined and can be changed in the
sending and receiving application.
For data transfer, the functions BSEND and BRECEIVE are used for coor-
dinated data transfer via a configured connection.
Fig. 2-1
Hardware components
The following hardware components are required for using the application.
Example project
The example application consists of the following components
▪ PROFIBUS
20987358_BSEND_PB_DOKU_v10_e
Fig. 3-1
The protocol itself is located in the ISO / OSI 7 layer reference model for
communication on level 7, as the used interface of the system is merely
based on application data. Services for managing the connections or for
converting the data are not necessary, as these are provided by functions
of the operating system.
(1 Corresponds to the total amount of user data for the SFB / FB in case of Indus-
trial Ethernet.
(2 corresponds to the maximum length of a data block of the respective system.
(3 Depending on the used CPU.
Read services. Those have been realized in the S7 controller as “PUT“ and
20987358_BSEND_PB_DOKU_v10_e
“GET“.
Overview
User interfaces of the S7 protocols can be divided into 3 groups:
• Read and write services
Read and write services have been realized within the S7 protocols as
“PUT“ and “GET“. They enable data to be read from or written to a control-
ler in a simple manner.
• Uncoordinated send and receive services
Fig. 3-8
Note
The block BSEND of the S7 300 is available in the SIMATIC-Net-CP library as FB
12, within the S7300 program container.
As opposed to the S7 400 SFBs the FBs of the S7-300 can also be provided dy-
namically with parameters.
Fig. 3-9
Note
The block BRCV of the S7 300 is available in the SIMATIC-Net-CP library as FB
13, within the S7300 program container.
As opposed to the S7 400 SFBs the FBs of the S7-300 can also be provided dy-
namically with parameters.
The block only becomes ready for receiving after calling the control param-
ter EN_R with a value of 1 (TRUE). Setting the parameter to 0 (FALSE)
cancels the currently running job or prevents a new send request from the
sender by means of a respective error message, partner SFB / FB has the
wrong status.
As a limiting factor, only one RD parameter is possible in the S7 300.
Note
Please note that parameters SD_1 and RD_1 of the blocks interconnected via ID
and R_ID have been concordantly defined by you in
• length (LEN) and
• data type
Introduction
This example illustrates in a simple manner how, via one S7 connection,
data from four different source areas of an automation device can be trans-
ferred exclusively to several target areas of a remote automation device,
using the address parameter R_ID.
The following graphic illustrates the processes realized in this example.
Fig. 3-10
In the following chapter the setup and structure of the example is discussed
on the function and datablock level of the automation system.
Fig. 3-11
Program procedure
Table 3-14: Program procedure sending part 1
Flowchart Description
Using an edge evaluation, input 1.0 triggers proc-
essing of the BSEND chain by triggering the first
BSEND block.
interrupted.
20987358_BSEND_PB_DOKU_v10_e
Note
A positive edge is sufficient for triggering a send request.
Fig. 3-12
Program procedure
Table 3-16: Program sequence receiving
Flowchart Description
All BRECEIVE function calls are cyclically called in
the OB 1 program, in order to guarantee a maximal
possible variability.
Each receive block must also have its own instance
data block assigned to it.
Copyright © Siemens AG 2005 All rights reserved
20987358_BSEND_PB_DOKU_v10_e
Fig. 3-13
5 Bus cabling Ensure that the cabling end points of both bus systems are termi-
20987358_BSEND_PB_DOKU_v10_e
nated at both ends of the bus system using the matching resistors in
the connectors.
STEP7
We will not go into the installation of STEP7 here. The installation takes
place in the familiar Windows environment and is self-explanatory.
Table 4-2
Step No. Instruction Note / Explanation
1 Open the Step 7 manager.
2 Extract the project via the menu File -> Retreive... Search for the project
20987358_BSEND_PB_CODE
_v10.zip using the browser
function and acknowledge
with OK.
Introduction
A variable table is available for operating the example application. This en-
ables depicting the statuses of the individual function calls.
Table 4-3
No. Description
1 Open the Step 7 project.
2 Within the project tree of the “SIMATIC 400“ select the object VAT_1,
which is located on the right side of the SIMATIC Manager window, via
CPU 416-2 DP -> S7-Program(1) -> Block.
3 As illustrated in figure 4-1, double-clicking VAT_1 opens the prepared
variable table.
4
Pressing the button starts the “Monitor variables“ functions.
Each BSEND block is displayed in the variable table with the following val-
ues:
• SendX_REQ
Copyright © Siemens AG 2005 All rights reserved
20987358_BSEND_PB_DOKU_v10_e
• DoneX_SendreqY
• ErrorX
• StatusX
• History SendX
Note
In case of an error, the status information is stored in the History memory of the
respective call as soon as the error occurs.
Pressing the “Modify variables“ button, see red circle, starts the send procedure.
2
Step
28/33
Step
3
Copyright © Siemens AG 2005 All rights reserved
20987358_BSEND_PB_DOKU_v10_e
After successful run of the first BSEND block, the second BSEND block is activated.
After successful run of the second BSEND block, the third BSEND block is activated.
After successful run of the third BSEND block, the fourth BSEND block is activated.
After terminating the 4th BSEND block, the step chain is terminated. The send pro-
cedure must be restarted with step 1 of this table.
We do not accept any liability for the information contained in this docu-
ment.
Any claims against us - based on whatever legal reason - resulting from the
use of the examples, information, programs, engineering and performance
data etc., described in this document shall be excluded. Such an exclusion
shall not apply in the case of mandatory liability, e.g. under the German
Product Liability Act (“Produkthaftungsgesetz”), in case of intent, gross
negligence, or injury of life, body or health, guarantee for the quality of a
product, fraudulent concealment of a deficiency or breach of a condition
which goes to the root of the contract (“wesentliche Vertragspflichten”).
However, claims arising from a breach of a condition which goes to the root
of the contract shall be limited to the foreseeable damage which is intrinsic
to the contract, unless caused by intent or gross negligence or based on
mandatory liability for injury of life, body or health. The above provisions
does not imply a change in the burden of proof to your detriment.
Copyright © Siemens AG 2005 All rights reserved
20987358_BSEND_PB_DOKU_v10_e
The Application Examples are not binding and do not claim to be complete
regarding the circuits shown, equipping and any eventuality. They do not
represent customer-specific solutions. They are only intended to provide
support for typical applications. You are responsible in ensuring that the
described products are correctly used.
These Application Examples do not relieve you of the responsibility in
safely and professionally using, installing, operating and servicing equip-
ment. When using these Application Examples, you recognize that Sie-
mens cannot be made liable for any damage/claims beyond the liability
clause described above. We reserve the right to make changes to these
Application Examples at any time without prior notice. If there are any de-
viations between the recommendations provided in these Application Ex-
amples and other Siemens publications - e.g. Catalogs - then the contents
of the other documents have priority.
csweb@ad.siemens.de