Sie sind auf Seite 1von 6

show the entry list

Industrial Ethernet S7-300/400 CPs -- Configuring and programming communication -Using communication blocks
How do you program the FC10 "AG_CNTRL"?
Which commands (CMD) of the FC10 "AG_CNTRL" are supported by the IE CPs?
How many communication jobs may be used simultaneously in an S7-300 CPU for S7 communication
via a CP343-1?
Which ports are released for Modbus/TCP communication and how many Modbus clients can
communicate with a SIMATIC S7 CPU as Modbus server?
Notes on using an instance for multiple connection IDs
Internal call of FC5 (AG_SEND) with FTP client blocks (FC 40-44) for the CP343-1 IT (6GK7 343-1GX110XE0)
How do you program the communication blocks FB63 "TSEND", FB64 "TRCV", FB65 "TCON" and FB66
"TDISCON" in order to use the ISO-on-TCP protocol for data exchange via the integrated Industrial
Ethernet interface of a CPU or via the CP443-1 Advanced?
How do you program communication blocks FC11 and FC12 for the PROFINET IO device?
Block calls for communications processors in multiple runtime layers
Changing the input parameter of the user blocks "AG_SEND" and "AG_RECV" during the runtime of a
job
What should you watch out for if you transfer variables with the data type "REAL" when calling the
communication blocks FC5/50 "AG_SEND/AG_LSEND" and FC6/60 "AG_RCV/AG_LRCV"?
What should you pay attention to when using the communication blocks FC53 "AG_SSEND" and FC63
"AG_SRECV"?
What points do you need to remember when calling communication blocks FC5/50 and FC6/60 in the
STEP 7 user program of the CPU?
How do you program communication blocks FC11 and FC12 for the PROFINET IO controller?
How can you establish OPEN MODBUS / TCP communication from a SIMATIC S7 and where can you
find further information?
How do you program the communication blocks FC50 and FC60?
Error STATUS "0x7000" on function block FC6 / FC60 (AG_SEND) with Send/Receive communication on
the S7-400 controller
How do you program the communication blocks FC5 and FC6?
Sample program: S7 communication with the blocks SFB14 ("GET") and SFB15 ("PUT") with S7-400
Sample Program: S7 Communication with blocks FB14 ("GET") und FB15 ("PUT") of the
CPU 317-2PN/DP
How do you program communication blocks FB8 "USEND" and FB9 "URCV" for data exchange on the
S7-300?
"STATUS = 27" (0x001B) with the loadable S7 communication on the S7-300
How do you program communication blocks FB14 "GET" and FB15 "PUT" for data communication on
the S7-300?
How do you program communication blocks FB12 "BSEND" and FB13 "BRCV" for data exchange on
the S7-300?

Repeating the "BSEND" job (SFB12) when the "BRCV" block (SFB13) is in the "disabled" state ("EN_R
= 0")

Sample Program: S7 Communication with blocks FB14 ("GET") und FB15 ("PUT") of the CPU
317-2PN/DP
Display part number

QUESTION:
How are the loadable communication blocks FB14 ("GET") and FB15 ("PUT") programmed
for a data exchange on the S7-300 with a CPU 317-2PN/DP?
ANSWER:
In order to exchange data between two S7-300 stations with a CPU 317-2PN/DP via a S7
connection which was configured with NetPro, in the S7 program communication blocks
must be called. The block FB14 ("GET") serves to retrieve data out of a remote CPU and
the block FB15 ("PUT") to write data into a remote CPU.
Properties of the Communication Block FB14 ("GET") and FB15 ("PUT") of the
CPU 317-2PN/DP

FB14 and FB15 are asynchronous communication functions.


The blocks may run through several OB1 cycles.
FB14 or FB15 are activated via input parameter REQ.
The end of job is indicated by DONE, NDR or ERROR.
PUT and GET can communicate simultaneously via a connection.
The blocks are contained in a standard library of STEP 7 V5.3.

Attention:
You cannot use communication blocks of library SIMATIC_NET_CP for CPU317-2PN/DP.
The sample program contains a S7 connection via which data can be retrieved with a FB
14 from a remote CPU and data can be written with a FB15 into a remote CPU.
Description of the Sample Program
The STEP 7 project contains two stations S7-300 with CPU 317-2PN/DP for communication
via Industrial Ethernet. A S7 connection was setup as the communications basis between
both stations. In NetPro, if you open the properties of the S7 connection via "Right mouse
click > Object properties", you can view the block parameter "ID" of the communication
block. This information has to be taken into account, when calling FB14 or FB15, in order
to facilitate a data exchange via a S7 connection.

Fig. 1: Properties of the S7 Connection ( 53 KB )


The STEP 7 program consists of blocks OB100, OB1, FB100, DB100, DB200, DB201, FB14
and FB15.

OB100
OB100 is a start up OB and is executed during a reboot of the CPU (warm start). In
this OB M1.0 and M0.1 release the first communication trigger.

Fig. 2: OB100

OB1
OB1 is called cyclically. In this OB the call of the FB100 (instance DB: DB100) is
done with M1.0 and M0.1. After FB100 was executed, M1.0 is reset.

Fig. 3: OB1

FB100
FB100 is called in the OB1 cycle. In this FB you find the call of the FB14 ("GET")
and FB15 ("PUT"). FB14 is activated via input parameter "REQ", if the interval

marker M10.6 has a positive edge and no job is running.


The input parameter ID must be adopted from the properties dialog of the S7
connection in NetPro (Fig.1). Parameter ADDR_1 contains that data area that is to
be retrieved from a remote CPU. Parameter RD_1 contains the data area for
retrieved data. Output parameters NDR, ERROR and STATUS are required for job
evaluation and are only valid in the same cycle!

Fig. 4: FB100 - Invoking FB14


If the block was processed with error, the status word of the block is saved for error
analysis.

Fig. 5: FB100 - Saving the Status Word


FB15 is activated via input parameter REQ, if clock memory M10.6 has a positive edge
and no job is running. Input parameter ID must be adopted from the property dialog in
NetPro (Fig.1). In case of parameter ADDR_1 the data area must be stated in the remote
CPU, to which the values are to be written. With parameter SD_1 the address of the data
to be sent is preset. Output parameters DONE, ERROR and STATUS are required for
evaluating the job and are only valid in the same cycle!

Fig. 6: FB100- Invoking FB15


If block was processed with error, the status word of the block is saved for error analysis.

Fig. 7: FB100 - Saving the Status Word


STEP 7 Project as Download:
STEP 7 project contains a sample program on invoking the FB14 and the FB15 with status
evaluation. It was designed with STEP 7 V5.3.

Cpu317-2_PUT_GET.exe ( 364 KB )
Copy file "Cpu317-2_PUT_GET.exe" into a separate directory and then start the file with a
double click. The STEP 7 Projekt will be automatically unpacked with all sub directories.
You can now open and edit the project with SIMATIC Manager.

Das könnte Ihnen auch gefallen