Sie sind auf Seite 1von 10

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

Page 1 of 10
show the entry list S7-200 S7-200 Cables / Memory Cards / Accessories -- Setting up and parameterizing hardware -- Connecting and wiring modules How is the assignment of the MPI/DP interface defined? How do you synchronize the real-time clock of an S7-200 with a GPS receiver? How do you clear communications errors with SIMATIC S7-200 in Freeport mode? How do you connect a TD-200 to the S7-200 interface and use the PC/PPI cable at the same time? How is the assignment of the MPI/DP interface defined? Display part number Discription The MPI/DP interface is assigned as follows:

Fig. 1: Connector assignment Pin no.: 1 2 Code NC M24 EXT Meaning Pin 1 is not connected M24 EXT return line (GND) of the 24V power supply. The current load from an external user connected between P24 EXT and M24 EXT must not exceed a maximum of 150mA. 3 4 5 LTG_B RTS_AS M5 EXT Signal line B RTS_AS, control signal for Receive data flow. The signal is "1" active when the directly connected AS sends. M5 EXT return line (GND) of the 5V power supply. The current load from an external consumer connected between P5EXT and M5EXT must not be greater than 90 mA. P5 EXT power supply (+5 V) of the 5V power supply. The current load from an external consumer connected between P5EXT and M5EXT must not be greater than 90 mA. P24 EXT power supply (+24 V) of the 24V power supply. The Input / output Input Output Input / output Output

P5 EXT

Output

P24 EXT

Output

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

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

current load from an external user connected between P24 EXT and M24 EXT must not exceed a maximum of 150mA. 8 9 Shield LTG_A RTS_PG Signal line A RTS output signal of the module. The signal is "1" when the PG/PLC sends. Connector housing Input / output Output

Table 1: Assignment of the MPI/DP interface Pins 2 and 7 (P24 EXT, M24 EXT) are only assigned for the 300 series and 400 series CPUs and for the RS 485 Repeater for PROFIBUS. How do you synchronize the real-time clock of an S7-200 with a GPS receiver? Display part number Description With the block in the library, you can use a GPS receiver to read out the time stamp and date of GPS messages. You can use this data to compensate the time drift of the real-time clock (RTC) of your S7200. In the attached sample PLC application, the minutes and seconds of the real-time clock are synchronized with the time stamp of the GPS message. Restricting time synchronization to minutes and seconds has the following advantages:
l l

It can be applied worldwide, independently of time zones. It can be applied independently of summer/winter time.

Time synchronization is done between xx.20 and xx.40 after the synchronization command.

Fig. 01 Communication The GPS receiver receives GPS messages in compliance with the NMEA standard and sends these as ASCII character strings to the S7-200 basic module. The time stamp and date are read out of them in each case. The S7-200 uses the freely programmable communication mode (Freeport) via the RS485 connection ( Port '0' or Port '1') for communication with the GPS receiver. The library uses the RMC protocol of those available in the NMEA standard.

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

Siemens - Industry Automation and Drive Technologies - Service& Support - Automation... Page 3 of 10
Transfer format The transfer format used for GPS messages in compliance with the NMEA standard requires the following interface parameters:
l l l l

4800 baud 8 data bits No parity 1 stop bit

The resulting interface parameter to be entered at the "GPS_NMEA_TIME_UTC" block is 2#1101 (see description under "Library: Read out time stamp and date"). Requirements The library and the sample PLC application can be used
l l

With a GPS receiver with serial interface that supports the NMEA standard and which is connected to the S7-200 basic module via an RS232 PC/PPI cable. With an RS232 PC/PPI cable

Library: Read out time stamp and date The library contains the "GPS_NMEA_TIME_UTC" block for reading out the year, month, day, hour, minute and second in UTC (Universal Time Coordinated). No. Remarks 1 Use the GPS receiver Connect the GPS receiver to the RS485 connection of your S7-200 basic module via an RS232 PC/PPI cable. Set the DIP switches of the PC/PPI cable as in Fig. 02.

Fig. 02 Additional information The RS485 connection does not provide any power supply for your GPS receiver. 2 Add library Store the attached "gps_time_read_port0.zip" or "gps_time_read_port1.zip" file on your computer. Unpack the file and add the library to your configuration software STEP 7 Micro/WIN. Additional information Instructions for adding libraries are available in Entry ID 16689345. 3 Add GPS block From the "GPS_TIME_READ_PORT0" or GPS_TIME_READ_PORT1" library you drag-anddrop the "GPS_NMEA_TIME_UTC" block into a cyclically called network.

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

Siemens - Industry Automation and Drive Technologies - Service& Support - Automation... Page 4 of 10

Fig. 03 Assign an unused memory area to the library. Additional information


l l l

Approx. 950 bytes are need in the CPU's program memory. The library occupies 214 bytes in the CPU's variable memory. The required interrupt "GPS_NMEA_RC" and the subprogram "GPS_NMEA_INIT_PORT0" or "GPS_NMEA_INIT_PORT1" are inserted automatically in your project. Information on assigning memory area for libraries is available in Entry ID 16689345.

Connect the GPS block Assign the contacts of the block. The variables used in Fig. 04 are examples. Via the "Freeport_Config" contact you configure the freely programmable communication. The parameter "2#1101" results for the NMEA transfer format used (see "Transfer format").

Fig. 04 Additional information Additional information on configuring the freely programmable communication is available in the S7-200 manual, section 7.5 "Creating user-defined protocols in the freely-programmable communication". 5 Use the GPS block You start the GPS evaluation with a positive edge at the 'Start' input. You can tell how well the evaluation is from the contacts 'DONE', 'ABORTED' and 'GPS_status'. The table lists the contacts of the block and tips for usage.

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

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

Contact name Data type EN START

Contact type

Remarks SM0.0 Positive edge = one-off read out '2#1101' = parameter for initializing the freely programmable communication 1 = GPS reception completed 1 = GPS reception defective Output of the year Output of the month Output of the day Output of the hour Output of the minute Output of the second ASCII-coded; = 65 (A) -> Data OK <> 65 (A) -> Data defective

BOOL Input BOOL Input Input

Freeport-Config INT DONE ABORTED UTC_year UTC_month UTC_day UTC_hour UTC_minute UTC_second UTC_status

BOOL Output BOOL Output BYTE Output BYTE Output BYTE Output BYTE Output BYTE Output BYTE Output BYTE Output

Additional information The time stamp of the GPS message include the UTC time. Table 01 Sample application: Synchronize the time The sample application uses the functions of the "gps_time_read_port0.mwl" or "gps_time_read_port1.mwl" library. You can use the sample application without incorporating the library. No. Remarks 1 Use the GPS receiver Connect the GPS receiver to the RS485 connection of your S7-200 basic module via an RS232 PC/PPI cable. Set the DIP switches of the PC/PPI cable as in Fig. 05.

Fig. 05 Additional information The RS485 connection does not provide any power supply for your GPS receiver. 2 Open the sample application Store the attached "gps_time_read_port0.zip" or "gps_time_read_port1.zip" file on your computer. Unpack the file and add open it using your configuration software STEP 7 Micro/WIN. Use the sample application You start the sample application with a positive edge at the 'Start' input of the "GPS_SYNC" block. For this you set the variable V541.0 to 'high' using the variable table. The sample application remains active until synchronization has been done after the time window has been reached. You can tell the status of the evaluation from the contacts 'DONE', 'ABORTED', 'GPS_rcvd_warning' and 'sync_not_in_window'.

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

Siemens - Industry Automation and Drive Technologies - Service& Support - Automation... Page 6 of 10

Fig. 06 The sample application cyclically reads the time stamp of the GPS message received. The minutes and seconds are synchronized automatically in the time window between xx.20 and xx.40. The table lists the contacts of the block and tips for usage. Contact name EN START CANCEL DONE BUSY ABORTED GPS_rcvd_warning Data type Contact type Remarks SM0.0 Positive edge starts the synchronization Abortion of the synchronization Completion of the synchronization Synchronization active Synchronization aborted GPS reception defective Time of synchronization not in time window

BOOL Input BOOL Input BOOL Input BOOL Output BOOL Output BOOL Output BOOL Output

sync_not_in_window BOOL Output

Additional information Change the value of variable VW802 to '1000' to have synchronization tested at any time. At the end of each test, reset the variable to the value '100'. Table 02 Password The password for the library is "1234" (without the quotation marks). Download Description Library for reading out the GPS time via Port '0' gps_time_read_port0.zip ( 3 KB ) Library for reading out the GPS time via Port '1' gps_time_read_port1.zip ( 5 KB ) Sample application for synchronizing the RTC via Port '0' gps_time_sync_port0.zip ( 9 KB ) Sample application for synchronizing the RTC via Port '1' Download

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

Siemens - Industry Automation and Drive Technologies - Service& Support - Automation... Page 7 of 10

gps_time_sync_port1.zip ( 9 KB ) Keywords: Mouse, Navigation, Synchronization How do you clear communications errors with SIMATIC S7-200 in Freeport mode? Display part number Instructions: Communication errors in Freeport mode (e.g. missing or corrupted characters) can have different causes. 1. Bus termination 2. Processing speed of the S7-200 CPU 3. Send priority of the RS-232/PPI Multi-Master cable 1. Bus termination Make sure there is a correct bus termination on the CPU. You can do this, for example, by plugging a PROFIBUS connector with activated terminator and PC socket between the CPU and the PC/PPI cable. 2. Processing speed of the S7-200 CPU The processing speed of the CPUs as from firmware version V2.0 might also mean that in bidirectional communication the block calls RCV and XMT are processed faster than the RS-232/PPI Multi-Master cable used can switch between Send and Receive mode.
l l

Set a higher baud rate with DIP switches 1, 2, 3. The duration of the switching procedure depends on the baud rate set. Delay the time between the calls if necessary in the program by enabling the blocks alternately via interrupt control, for instance.

Example of enabling blocks via interrupt control After receiving data at Port "0", the RCV process triggers the interrupt event "23". For this, you implement an interrupt routine and link activation of the XMT block with it. Accordingly, the XMT block reports via the interrupt event "9" when the Send procedure has been completed. A sample program for an interrupt in Freeport mode is available in Entry ID 30839030, under "3. Freeport". Note: Table 7-11 "Turnaround Time and Settings" for the baud rates is available in the S7-200 manual in Entry ID 1109582. Information on the cable is available in Entry ID 16532946. 3. Send priority of the RS-232/PPI Multi-Master cable As soon as data is sent to the S7-200, the Multi-Master cable switches to Send mode and transmits the data. This is done regardless of the data transfer currently taking place. If the cable happens to be receiving data from the S7-200 at that moment, that data transfer is interrupted. The data is lost and the interruption of the procedure is not reported to the S7-200. Bearing this in mind, you can implement error-free bidirectional communication via a polling or time slice procedure.
l l

Polling: Stations send their data only when polled by the S7-200. Time slice: Each station has a separate time corridor available for sending data one after the other. This can be synchronized by a pulse signal at an appropriate frequency from the S7-200.

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

Siemens - Industry Automation and Drive Technologies - Service& Support - Automation... Page 8 of 10
Note:
l l l

Information on the PPI cable is also available in the manual, chapter 7 "Configuring the RS232/PPI Multi-Master Cable for Remote Operation", in Entry ID 1109582. The RCV function requires an initial condition and an at end condition. Notes on this are also available in the manual, chapter "Transmit and Receive Instructions (Freeport)". In RUN mode you cannot access the CPU via the port that you are using for the Freeport mode.

Keywords: RS485, Freeport, Mode, How do you connect a TD-200 to the S7-200 interface and use the PC/PPI cable at the same time? Display part number Instructions: If you want to connect your S7-200 to a TD-200 and the PC at the same time, then the configuration must look like this:

Fig. 01 Fig. 01 shows the configuration and positions of the DIP switches for an S7-22X, TD200 and a PC with MicroWin 4.x. You need an adapter to connect the TD-200. A PROFIBUS with two connectors (including PC connection socket) assumes this function. You connect one side of the cable to the S7-200. You then plug the PC/PPI cable to this connector side. You connect the other side of the PROFIBUS cable to your TD-200. Switch on the terminator on both connectors. You need the following components for this configuration: Component Power supply unit for TD-200 Comments 230V/24VDC 115V/24VDC MLFB 6ES7 705-0AA00-1AA0 6ES7 705-0AA00-1BA0

or you use the 24V DC sensor power supply from the CPU PROFIBUS cable 2 x PROFIBUS connector Table 1: Components required Please note that the PC/PPI cable has to be plugged directly into the PG interface of the PROFIBUS connector. Only in this connection setup is the PC/PPI cable supplied with the necessary power from the CPU. Minimum ordering quantity: 1m with PG connection socket 6XV1 830-0EH10 6ES7 972-0BB12-0XA0

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

Siemens - Industry Automation and Drive Technologies - Service& Support - Automation... Page 9 of 10
The power supply for the TD-200 must be separate, because the power supply cannot be via the PROFIBUS cable. Here, you can use the DC sensor power supply of the SIMATIC S7-200 or the power supply unit for the TD-200. To connect the power supply on the TD-200 please use the connector supplied or the cable supplied for the TD-200 power supply. Adjusting the PPI Multi master mode: Start STEP 7 Micro/WIN V3 and open the communication window. Open the properties dialog for the PC/PPI cable and activate the multi-master mode under the "PPI" register. Set "USB" as connection in the PG/PC interface, in the properties of the PC/PPI cable, when using the S7-200 USB/PPI Mulit master cable.

Fig. 02 Important: The DIP switch configuration, which needs to be executed at the cable, is dependant on the installed version of STEP 7 - Micro/Win when using the S7-200 RS-232/ PPI Mulit master cable (6ES7 9013CB30-0XA0). More information can be found under entry-ID: 16532946. The installation of STEP 7 Micro/Win V3.2 + SP 4 is necessary, if the S7-200 USB/PPI Multi master cable (6ES7 901-3DB300XA0) is used. Note: The PPI Multi-master mode for the PC/PPI cable can only be selected for the Windows 95, 98, ME, Windows 2000 and Windows XP operating systems. STEP 7 - Micro/WIN is released for Windows XP from version V3.2 + SP3. If problems arise with the communications, then please check in the Control Panel the settings for the COM port used (the "FIFO" option must be activated) and the size of the receive buffer (must be set the smallest possible value). More information on the COM port settings is available in Entry ID:14015814. Keywords: Connection configuration, Communication, Interface options Entry ID:23451070 Date:2010-03-29 I regard this article.... as helpful 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/23451070?func=ll&objId=234510... 02.09.2010

Siemens - Industry Automation and Drive Technologies - Service& Support - Automati... Page 10 of 10

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