You are on page 1of 5

http://support.automation.siemens.

com/WW/view/en/370000

How is data exchanged between two SIMATIC S7-200 devices in PPI mode? Entry ID:370000 Date:2006-03-01 STEP 7 Micro/WIN -- Configuring and programming communication -- Using S7 communication blocks How is data exchanged between two SIMATIC S7-200 devices in PPI mode? Data exchange by means of NETR/NETW Data exchange between two SIMATIC S7-200 controllers in PPI mode (point-to-point connection) involves the NETR and NETW communication blocks. A controller acts as a master in which communication programming takes place. Only the data ranges from which the master reads or to which the master writes are to be provided in the slave controller. The physical connection between the two CPUs is established via port 0 or port 1 using a PROFIBUS cable. Ensure that the BUS parameters for all communication partners are identical on the bus. There are two alternative options available for creating the communication program. Communication configuration with the "NETR/NETW" wizard Communication configuration without a wizard The FAQ contains a sample program to download for each of the alternatives. Both programs serve the same purpose. A data word is transmitted from the master to the slave and back to the master again from there. Communication configuration with the "NETR/NETW" wizard Based on the NETR and NETW blocks, the wizard creates a subroutine NET_EXE (name can be changed by the user) which is called up in the main program unconditionally and cyclically (SM0.0) and which can contain up to 24 network operations. NETR and NETW do not appear for you as the user at all. Using the wizard, the user merely assigns parameters to the CPU addresses, length and addresses of the data being exchanged in the local (master) and remote (slave) PLCs, as well as to a variable memory area for this configuration data. The configuration data essentially corresponds to the tables which are addressed by the TBL parameters of the NETR/NETW functions. Where the wizard saves the tables in the variable memory, it writes to the NET_EXE commentary, thereby making it accessible to the user (refer to the attached sample project CPU_NET_EXE.mwp). NET_EXE has the following parameters: Parameter Declaration Data type Timeout Input INT Memory area EW, AW, MW, SW, SMW, T, Z, VW, LW, AEW, AC, constant, *VD, *LD,*AC Description The "Timeout" parameter allows you to monitor the timing of each NETR/NETW function. A monitoring time of 1 - 36767 seconds can be entered. 0 deactivates this monitoring function. Whenever NET_EXE starts a NETR/NETW function, a timer also starts. Once the relevant NETR/NETW function ends, the "Done" bit (bit 0.7 of the NETR/NETW-specific TBL data record) is set for it. If the timer runs out before the "Done" bit is set, NET_EXE ends the PPI/master mode (SM30.1 is reset) and sets the "Error" bit parameter. NET_EXE provides you with a "Cycle" bit as a

Cycle

Output

BOOL E, A, M, S, SM,

Page 1 of 5

8/3/2013 2:06:48 PM

http://support.automation.siemens.com/WW/view/en/370000

T, Z, V, L Error Output BOOL E, A, M, S, SM, T, Z, V, L

debug. Its status changes once all the NET operations are finished. The "Error" bit indicates an error during one of the configured network operations. For error details, refer to the status bytes of the individual network operations, whose addresses are listed in the NET_EXE commentary. The status byte corresponds to the first byte of the configuration data record of an NETR or NETW operation, whereby the data record is addressed by the TBL parameter.

For further information about communication configuration with the wizard and about NET_EXE, refer to the entries... Online help: "NETR / NETW Wizard", Online help: "NET_EXE Instruction". You can find information about the configuration data record (TBL) and the list of corresponding error codes, in byte 0 of TBL, in the entries... System manual "S7-200 Programmable Controller" (Entry ID 1109582) chapter 6 "S7-200 Instruction Set / Communications instructions" The following attachment contains an extract from the manual.

Attachment 1: TBL_e.pdfTBL_e.pdf ( 203 KB ) Online help: "Network Read/ Write TBL Definition". Example for the NETR/NETW wizard Here is a sample project for writing 1 word to a slave CPU and for reading 1 word from a slave CPU.

Attachment 2: NET_EXE_e.exeNET_EXE_e.exe ( 73 KB ) (NET_EXE.exe is a self-extracting ZIP archive containing the subprojects CPU_NET_EXE.mwp for the master controller and CPU_Slave.mwp for the slave controller.) VW0 is transferred from the master CPU with the address 2 (port 0) after VW0 is transferred to the slave CPU with address 4 (port 0). The variable is transferred to VW2, read from the master CPU again and also saved in it after VW2.

Fig. 1 The status table in the project shows the data source and data target (VW0, VW2), as well as the TBL data records for the NETR and NETW functions.

Page 2 of 5

8/3/2013 2:06:48 PM

http://support.automation.siemens.com/WW/view/en/370000

Fig. 2 If you enter a value in row 1 of the status table in VW0 ("+12345" in Fig. 2), it is transferred to the master CPU (row 12 of the status table) via the slave-CPU detour after VW2. Communication configuration without the wizard If the user does not use the wizard, he is responsible for parameterizing and triggering the NETR/NETW functions himself. Furthermore, the PPI/master mode has to be set on the master CPU (in SMB30). NETR and NETW are explained in detail in the entries... System manual "S7-200 Programmable Controller" (Entry ID 1109582) chapter 6 "S7-200 Instruction Set / Communications instructions", Online help: "Network Read, Network Write", Online help: "Network Read/ Write TBL Definition". Example for NETR/NETW without the wizard Here is a sample project for writing 1 word to a slave CPU and for reading 1 word from a slave CPU.

Attachment 3: NETR_NETW_e.exeNETR_NETW_e.exe ( 71 KB ) (NETR_NETW.exe is a self-extracting ZIP archive containing the subprojects CPU_NETR_NETW.mwp for the master controller and CPU_Slave.mwp for the slave controller.) VW0 is transferred from the master CPU with the address 2 (port 0) after VW0 is transferred to the slave CPU with address 4 (port 0). The variable is transferred to VW2, read from the master CPU again and also saved in it after VW2.

Fig. 3 In the example without the wizard, the addresses used for the configuration data (TBL) for communication were the same as those used for configuration with a wizard. Consequently, the status tables (Fig. 2) are also identical. There is no time monitoring of communication of the sort implemented with the "Timeout" parameter on the NET_EXE subroutine. If requested, the user must provide appropriate routines. Keywords: Data communication

Fig. 1

Page 3 of 5

8/3/2013 2:06:48 PM

http://support.automation.siemens.com/WW/view/en/370000

Fig. 2

Fig. 3

Part number: 6ES7022-1AX00-8BH0 6ES7298-0AA20-0DA0

Programming S7-200 Ref. (e) True Power Box, spanish

Page 4 of 5

8/3/2013 2:06:48 PM

http://support.automation.siemens.com/WW/view/en/370000

6ES7298-8BA00-8DH0 6ES7810-2AA00-0YX0 6ES7810-2AA00-0YX1 6ES7810-2AA00-0YX3 6ES7810-2AA00-4YX0 6ES7810-2AA00-8AA0 6ES7810-2AA00-8BA0 6ES7810-2AA00-8CA0 6ES7810-2AA00-8DA0 6ES7810-2AA00-8EA0 6ES7810-2AA01-0YX0 6ES7810-2AA01-0YX1 6ES7810-2AA01-0YX3 6ES7810-2AA11-0YX0 6ES7810-2AA11-0YX1 6ES7810-2AA11-0YX3 6ES7810-2BA00-0YX0 6ES7810-2BA00-0YX3 6ES7810-2BC00-0YX0 6ES7810-2BC00-0YX3 6ES7810-2BC01-0YX0 6ES7810-2BC01-0YX3 6ES7810-2BC02-0YX0 6ES7810-2BC02-0YX3 6ES7810-2CC03-0YX0 6ES7810-2CC03-0YX3 6ES7810-2DA00-0YX0 6ES7810-2DA00-0YX1 6ES7810-2DA00-0YX3 6ES7810-2DA00-8AA0 6ES7810-2DA00-8BA0 6ES7810-2DA00-8CA0 6ES7810-2DA00-8DA0 6ES7810-2DA00-8EA0 6ES7810-2DA10-8AA0 6ES7810-2DA10-8BA0 6ES7810-2DA10-8CA0 6ES7810-2DA10-8DA0 6ES7810-2DA10-8EA0 6ES7810-2TC00-0YX0

Manual pogramming S7-200 s. STEP 7-Micro/WIN STEP 7-Micro/WIN, copy license STEP 7-MICRO/WIN,UPDATE Toolite2 AWL Windows Software STEP 7-Micro, Manuals (g) STEP 7-Micro, Manual (e) STEP 7-Micro, Manuals (f) STEP 7-Micro, Manuals (s) STEP 7-Micro, Manuals (i) STEP7 Micro/WIN 16 (V2.1) EL STEP7 Micro/WIN 16 (V2.1) KL STEP7 Micro/WIN 16 (V2.1) UD STEP7 Micro/WIN 32 (V2.1) EL STEP7 Micro/WIN 32 (V2.1) KL STEP7 Micro/WIN 32 (V2.1) UD STEP 7-Micro/WIN32 V3.0 EL Disk STEP 7-Micro/WIN32 V3.0 UG Disk STEP 7-Micro/WIN32 V3.0 EL CD STEP 7-Micro/WIN32 V3.0 UG CD STEP7 Micro/WIN 32 (V3.1) SL STEP7 Micro/WIN 32 (V3.1) UL STEP7 Micro/WIN 32 (V3.2) SL STEP7 Micro/WIN 32 (V3.2) UL STEP7-MICRO/WIN V4.0 (SL)G/E/F/I/S/C STEP7-MICRO/WIN V4.0 (UG) G/E/F/I/S/C STEP 7-Micro/DOS STEP 7-Micro/DOS, copy license STEP 7-Micro/DOS Update (5sp) STEP 7-Micro/DOS, Manual (g) STEP 7-Micro/DOS, Manual (e) STEP 7-Micro/DOS, Manual (f) STEP 7-Micro/DOS, Manual (s) STEP 7-Micro/DOS, Manual (i) STEP7-Micro/DOS Manual (g) STEP7-MICRO/DOS Manual (e) STEP 7-MICRO/DOS Manual (f) STEP 7-MICRO/DOS Manual (sp) STEP 7-MICRO/DOS Manual (i) STEP 7-Micro/WIN32 Toolbox V1.0

Entry ID:370000 Date:2006-03-01

Siemens AG 2013 - Corporate Information - Privacy Policy - Terms of Use

Page 5 of 5

8/3/2013 2:06:48 PM

You might also like