Sunteți pe pagina 1din 5

Siemens - Industry Automation and Drive Technologies - Service& Support - Automation...

Page 1 of 5
show the entry list S7-200 CPUs -- Product information -- System description How does data communication work between S7-300/S7- 400 and S7-200 via MPI using S7 basic communication? How does data communication work between S7-300/S7- 400 and S7-200 via MPI using S7 basic communication? Display part number Description: You can access various S7-200 CPUs from the S7-300 / 400 using X_PUT / X_GET via MPI. Here, the S7-300 / S7-400 is the master and the S7-200 the slave.

Fig. 01 With S7-200 CPUs of the CPU 22x series, you can work with the baud rates 19.2kBd and 187.5kBd. Refer to the technical data of the CPUs concerned for the transfer rates supported by your S7-300 / S7-400 CPU at the MPI interface. The manual with the technical data of the S7-300 CPUs is available in Entry ID: 12996906 The manuals with the technical data of the S7-400 CPUs is available in the following Entry IDs:
l l l

23904550: S7-400 CPUs FW V5.x 14016796: S7-400 CPUs FW V4.x 19538001: S7-400 CPUs FW V3.x

The table below gives you information about the maximum number of connections available for S7 basic communication in the S7-300 CPUs. CPU CPU 312, CPU 312C CPU 313 CPU 313C, CPU 313C-2DP, CPU 313C-2PtP CPU 314 CPU 314C-2DP, CPU 314C-2PtP CPU 315 CPU 315-2DP, CPU 315F-2DP Max. number of connections for S7 basic communication 2 4 4 8 8 8 12

http://support.automation.siemens.com/WW/llisapi.dll/23586365?func=ll&objId=235863... 02.09.2010

Siemens - Industry Automation and Drive Technologies - Service& Support - Automation... Page 2 of 5

CPU 315-2PN/DP, CPU 315F-2PN/DP CPU 316 CPU 316-2DP CPU 317-2DP, CPU 317F-2DP CPU 317-2PN/DP, CPU 317F-2PN/DP CPU 318-2DP CPU 319-3PN/DP, CPU 319F-3PN/DP CPU 614

14 8 8 30 30 30 30 8

The table below gives you information about the maximum number of connections available for S7 basic communication in the S7-400 CPUs. CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU 412-1 < FW V5.0 412-1 from FW V5.0 412-2DP < FW V5.0 412-2DP from FW V5.0 413-1 413-2DP 414-1 414-2DP 414-3DP 414-3PN/DP 416-1 416-2DP, CPU 416F-2DP 416-3DP 416-3PN/DP, CPU 416F-3PN/DP 417-4 Max. number of connections for S7 basic communication 14 30 14 30 14 14 30 30 30 30 42 42 42 42 42

Requirements for the S7-200 CPU:


l

Set the address of the S7-200 CPU. Put the data to be sent into the relevant Send buffer or get the received data from the Receive buffer. You define the Send and Receive buffers in STEP 7 when parameterizing the system functions SFC67 "X_PUT" and SFC68 "X_GET". Refer to the notes on networking CPUs in the S7-200 system manual in Entry ID: 1109582.

Reading data from the S7-200 CPU with the system function SFC67 "X_GET" You use the system function SFC67 "X_GET" for reading data from the S7-200 CPU. You call this in the OB1 of the S7-300 / S7-400, for example. In this example, 10 bytes are read as from address 10 from the variable area of the S7-200 CPU. The 10 bytes of data received are stored in data block DB10 as from address 10 in the S7-300/S7-400. The following table gives an overview of the input parameters of the system function SFC67 "X_GET".

http://support.automation.siemens.com/WW/llisapi.dll/23586365?func=ll&objId=235863... 02.09.2010

Siemens - Industry Automation and Drive Technologies - Service& Support - Automation... Page 3 of 5

Input parameter REQ

Variable M0.1

Description The input parameter REQ (request to activate) is a level-triggered control parameter. A positive level at M0.1 of the S7-300 / S7400 starts reading of the data from the S7200. The input parameter CONT (continue) is a control parameter that determines whether or not the connection to the communication partner remains established upon completion of the job. CONT=0: connection is cleared down after completion of data transfer. CONT=1: connection remains established after completion of data transfer.

CONT

FALSE

DEST_ID VAR_ADDR

W#16#4 P#DB1.DBX 10.0 BYTE 10

MPI address of the S7-200 CPU Reference to the area to be read in the partner CPU. 10 bytes of data are read as from address 10 from the variable area (VB) of the S7200.

The following table gives an overview of the output parameters of the system function SFC67 "X_GET". Output parameter Variable RET_VAL MW 2 Description If an error occurs during processing of the function, the return value includes the relevant error code. If no error occurs, the RET_VAL contains the length of data block copied into the receive area RD as a positive number in bytes. BUSY M12.1 BUSY=1: The receive procedure has not yet finished. BUSY=0: The receive procedure has been completed or no receive procedure is active. Reference to the receive data area. The following data types are permitted: BOOL, BYTE, WORD, DWORD, and arrays of these data types except BOOL. The receive area RD must be at least as long as the read area VAR_ADDR of the communication partner. In addition, the data types of RD and VAR_ADDR must match.

RD

P#DB10.DBX 10.0 BYTE 10

Writing data to the S7-200 CPU with the system function SFC68 "X_PUT" You use the system function SFC68 "X_PUT" for writing data to the S7-200 CPU. You call this in the OB1 of the S7-300 / S7-400, for example. In this example, 10 bytes are written as from address 10 to the variable area of the S7-200 CPU. The

http://support.automation.siemens.com/WW/llisapi.dll/23586365?func=ll&objId=235863... 02.09.2010

Siemens - Industry Automation and Drive Technologies - Service& Support - Automation... Page 4 of 5
10 bytes of data sent are stored in data block DB10 as from address 20 in the S7-300/S7-400. The following table gives an overview of the input parameters of the system function SFC68 "X_PUT". Input parameter REQ Variable M100.1 Description The input parameter REQ (request to activate) is a level-triggered control parameter. A positive level at M100.1 of the S7-300 / S7-400 starts writing of the data to the S7200. The input parameter CONT (continue) is a control parameter that determines whether or not the connection to the communication partner remains established upon completion of the job. CONT=0: connection is cleared down after completion of data transfer. CONT=1: connection remains established after completion of data transfer. MPI address of the S7-200 CPU Reference to the area to be written to in the partner CPU. 10 bytes of data are written as from address 20 to the variable area (VB) of the S7-200.

CONT

FALSE

DEST_ID VAR_ADDR

W#16#4 P#DB1.DBX 20.0 BYTE 10

The following table gives an overview of the output parameters of the system function SFC68 "X_PUT". Output parameter SD Variable P#DB10.DBX 20.0 BYTE 10 Description Reference to the area in your own CPU that contains the data to be sent. The following data types are permitted: BOOL, BYTE, WORD, DWORD, and arrays of these data types except BOOL. SD must have the same length as the VAR_ADDR parameter of the communication partner. In addition, the data types of SD and VAR_ADDR must match. If an error occurs during processing of the function, the return value includes the relevant error code. BUSY=1: The send procedure has not yet finished. BUSY=0: The send procedure has been completed or no send procedure is active.

RET_VAL

MW102

BUSY

M112.1

More information on the system functions SFC67 "X_GET" and SFC68 "X_PUT" is available in Entry ID: 1214574. A sample program for parameterizing the system functions SFC67 "X_GET" and SFC68 "X_PUT" is attached for downloading.

http://support.automation.siemens.com/WW/llisapi.dll/23586365?func=ll&objId=235863... 02.09.2010

Siemens - Industry Automation and Drive Technologies - Service& Support - Automation... Page 5 of 5
The sample program is a STEP 7 project that contains the complete hardware configuration including the user program of an S7-300 station. The STEP 7 project is available for downloading as a ZIP file. Extract the "S7_basic_communication.zip" file into a separate directory. The STEP 7 project is unpacked automatically with all its subdirectories. You can then use the SIMATIC Manager to open and process the extracted STEP 7 project.

S7_basic_communication.zip ( 412 KB ) Note: Set the S7-300/S7-400 control to STOP mode before loading the block that calls the system functions SFC67 "X_GET" and SFC68 "X_PUT" into the controller. This ensures that the system functions SFC67 "X_GET" and SFC68 "X_PUT" are initialized in any case and the data is transferred. If you need faster data transmission, use PROFIBUS DP instead of S7 basic communication via MPI. PROFIBUS DP is not connection-oriented communication. If you use PROFIBUS DP, then you need a PROFIBUS expansion module EM 277 in the S7-200. Detailed information on the expansion module EM 277 is available in the S7-200 system manual in Entry ID 1109582. Entry ID:23586365 Date:2009-10-21 as helpful I regard this article.... Copy link
Print Siemens AG 2010 - Corporate Information - Privacy Policy - Terms of Use

as not helpful Send to a friend

Suggestion for the entry

http://support.automation.siemens.com/WW/llisapi.dll/23586365?func=ll&objId=235863... 02.09.2010

S-ar putea să vă placă și