show the entry list
Industrial Ethernet S7-300/400 CPs -- Configuring and programming communication -- Using communication blocks
How do you copy the CFC chart "Modbus" from the sample project for OPEN MODBUS / TCP into your user project?
What is the difference between the initialization and runtime parameters on the blocks for Modbus TCP?
Why is the status value A090 (hex) output for Modbus TCP although you have entered the correct license?
What are the differences between the licensed version and the downloadable demo version of the blocks for Modbus TCP?
Why is the value A083 (hex) output permanently at the STATUS output parameter of the block for Modbus TCP when the ENQ_ENR=true input parameter has been set?
How is data with variable message length transferred via the TCP protocol and received by an S7-300 station via the Industrial Ethernet CP?
How do you program the function blocks FB14 "GET" and FB15 "PUT" in the S7 program of the S7-300 in order to transfer more than 160 bytes of data?
Where can you find sample programs and documentation for communication from SIMATIC S5 modules to SIMATIC S7 modules via Industrial Ethernet using the UDP protocol?
Where can you find sample programs and documentation for communication from SIMATIC S5 modules to SIMATIC S7 modules via Industrial Ethernet using the TCP protocol?
Where can you find sample programs and documentation for communication from SIMATIC S5 modules to SIMATIC S7 modules via Industrial Ethernet using the ISO transport protocol?
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-1GX11-0XE0)
How do you program the communication blocks FB63 "TSEND", FB64 "TRECV", FB65 "TCON" and FB66 "TDISCON" in order to use the ISO-on-TCP protocol for data exchange by way of the integrated PROFINET interface of a CPU or by way of 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 exchange in the S7 program of an S7-300 CPU?
How do you program communication blocks FB12 "BSEND" and FB13 "BRCV" for data exchange in the S7 program of an S7-300 CPU?
Repeating the "BSEND" job (SFB12) when the "BRCV" block (SFB13) is in the "disabled" state ("EN_R = 0")
How do you program communication blocks FC11 and FC12 for the PROFINET IO controller?
Part number:

Instructions:
If you are operating an Industrial Ethernet CP of the S7-300 as PROFINET IO controller or PROFINET IO device, then you must call the following communication functions in the user program:

  • FC11 "PNIO_SEND"
  • FC12 "PNIO_RECV"

Features of communication blocks FC11 "PNIO_SEND" and FC12 "PNIO_RECV":

  • FC11 and FC12 are synchronous communication blocks.
  • The blocks are contained in the "SIMATIC_NET_CP" library for the S7-300 controller.
  • The blocks must be called in the OB1 cycle (see also Entry ID: 2795485)
  • The end of the job is indicated by "DONE", "NDR" or "ERROR".

Features of communication block FC11 "PNIO_SEND":

  • Operation as PROFINET IO controller
    The block transfers the process data (outputs) of a specified output range to the IE CP for forwarding to PROFINET IO devices and as status display supplies the IO Consumer Status (IOCS) of the outputs of the PROFINET IO devices.
  • Operation as PROFINET IO device
    The block reads the preprocessed process inputs of the CPU in the PROFINET IO device and transfers them to the PROFINET IO controller (configured I addresses); furthermore, the block supplies the IO Consumer Status (IOCS) of the PROFINET IO controller as status display.

Features of communication block FC12 "PNIO_RECV":

  • Operation as PROFINET IO controller
    The block accepts the process data (inputs) from PROFINET IO devices (inputs of the controller) and the IO Provider Status (IOPS) of the inputs from the PROFINET IO devices in the specified input areas.
  • Operation as PROFINET IO device
    The block accepts the data (configured Q addresses) transferred by the PROFINET IO controller and the IO Provider Status (IOPS) of the PROFINET IO controller and writes it to data areas of the CPU reserved for the process outputs in the PROFINET IO device.

Description of the configuration:
The STEP 7 project includes the following S7-300 station that is configured as PROFINET IO controller:

  • CPU 315-2DP with CP343-1 (6GK7 343-1EX21-0XE0)

In the STEP 7 project the following modules are configured as PROFINET IO device:

  • ET 200S with IM151-3 PN (6ES7 151-3AA10-0AB0)
  • ET 200S with IM151-3 PN HF (6ES7 151-3BA22-0AB0)


Fig. 01: Configuration

The following input and output modules are configured for the ET 200S with IM151-3 PN:

  • 4 DO with the address area 0.0-0.3
  • 4 DI with the address area 0.0-0.3
  • 4 DO with the address area 1.0-1.3

 
Fig. 02: I/O address area of the ET 200S with IM151-3 PN

The following input and output modules are configured in the ET 200S with IM151-3 PN HF:

  • 2 DO with the address area 20.0-20.1
  • 4 DI with the address area 10.0-10.3


Fig. 03: I/O address area of the ET 200S PN HF

This results in a total address area for the:

  • Inputs: 0 to 10 = 11 bytes
  • Outputs: 0 to 20 = 21 bytes

Note:
The address area of the inputs and outputs must begin with the I/O address "0".

Description of the user program:
In this example, a S7-300 station with CP343-1 is used as PROFINET IO controller.
The STEP 7 program consists of the blocks OB1, FB100, DB30, DB31, DB12, FC11 and FC12.

  • OB1
    OB1 is called cyclically. In this OB is the call of FB100 (instance DB: DB100).


Fig. 04: OB1 

  • FB100
    FB100 is called in the OB1 cycle. In this FB is the call of FC11 "PNIO_SEND" and FC12 "PNIO_RECV".


Fig. 05: Call of FC11 "PNIO_SEND"


Fig. 06: Call of FC12 "PNIO_RECV"

The input parameter MODE=0, because the IE CP is only operated as PROFINET IO controller. If the IE CP is operated in parallel as PROFINET IO controller and PROFINET IO device, then the input parameter is MODE=1.

At the input parameter LEN of FC11 "PNIO_SEND" you specify the length of the total address area of the configured outputs (21 bytes). The data area for the Send data is specified by the SEND parameter of FC11 "PNIO_SEND". This data area must be as long as the address area of the configured outputs (21 bytes).

At the input parameter LEN of FC12 "PNIO_RECV" you specify the length of the total address area of the configured inputs (11 bytes). The data area for the Receive data is specified by the RECV parameter of FC12 "PNIO_RECV". This data area must be as long as the address area of the configured inputs (11 bytes).

The send and receive buffers (for example data blocks), which contain the data to be sent or received, must be at least as long as the data area defined for the Send and Receive data. In this example, the DB that contains the Send data must be at least 21 bytes long and the DB in which the Receive data is stored must be at least 11 bytes long.

At the input parameter CPLADDR of the communication functions you specify the module address of the PROFINET IO device. You take this from the hardware configuration, in the Properties dialog of the Industrial Ethernet CPs -> "Addresses" tab (see Fig. 07). In this example, the module address of the CP343-1 is 256dec = 100hex.


Fig. 07: Properties dialog of the CP343-1 -> "Addresses" tab

The output parameters "DONE", "NDR", "ERROR" and "STATUS" of the communication functions FC11 "PNIO_SEND" and FC12 "PNIO_RECV" are required for job evaluation.
The output parameter "DONE" at FC11 "PNIO_SEND" is set if the Send job has been completed successfully.
The output parameter "NDR" at FC12 "PNIO_RECV" is set if the Receive job has been completed successfully, i.e. the data has been accepted.

If the communication function FC11 "PNIO_SEND" or FC12 "PNIO_RECV" ends with an error, the communication functions's status word is saved for error analysis.


Fig. 08: Saving STATUS of F11 and FC12

Note:
A detailed description including sample program for the call of the communication blocks FC11 and FC12 in the PROFINET IO device is available in Entry ID: 31764614.

The STEP 7 project as download:
The following STEP 7 project contains a sample program for the call of the FC11 and the call of the FC12 with status evaluation. It has been created with STEP 7 V5.4 SP4.

FC11_und_FC12_CTRL.zip ( 553 KB )

Dearchive the "FC11_und_FC12_CTRL.zip" file in the SIMATIC Manager via the menu "File > Dearchive". The STEP 7 project is now unpacked with all the subdirectories. Now you can open and edit the STEP 7 project with the SIMATIC Manager.

 Entry ID:26558253   Date:2008-10-09 
I regard this article....as helpfulas not helpful                                 
mySupport
My Documentation Manager 
Newsletter 
CAx-Download-Manager 
Support Request
To this entry
Print
Create PDF 
Send to a friend
QuickLinks
Compatibility tool 
Help
Online Help
Guided Tour