100% found this document useful (1 vote)
834 views4 pages

Simatic CP 341 First Steps: Getting Started Guide

This guide walks through setting up a CP 341 communication module on a SIMATIC S7-300 PLC to enable data transfer via a serial interface. It describes installing configuration software, hardware configuration in STEP 7, parameterizing the CP 341 module, and linking it to a demo user program to test serial communication. The guide estimates it will take 1-2 hours to complete the example setup depending on experience level. It provides an overview of preconditions, configuration, programming, and testing steps to get basic hardware and software features operational.

Uploaded by

Taciano Grando
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
834 views4 pages

Simatic CP 341 First Steps: Getting Started Guide

This guide walks through setting up a CP 341 communication module on a SIMATIC S7-300 PLC to enable data transfer via a serial interface. It describes installing configuration software, hardware configuration in STEP 7, parameterizing the CP 341 module, and linking it to a demo user program to test serial communication. The guide estimates it will take 1-2 hours to complete the example setup depending on experience level. It provides an overview of preconditions, configuration, programming, and testing steps to get basic hardware and software features operational.

Uploaded by

Taciano Grando
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

SIMATIC CP 341

Getting Started Guide

First Steps

This Guide uses a real-life example to take you through the four steps for setting up a fully functional application that will enable you to transfer data via the serial interface and to familiarize yourself with and test the basic hardware and software features of your CP 341. The cross-references tell you where to find more detailed information on specific topics in the operating manual. It will take you between one and two hours to work your way through the example, depending on your prior experience.

Preconditions
These are the preconditions for this example: S You have an S7-300 station, consisting of power supply module and CPU. S STEP 7 (wV5.0) is correctly installed on your programming device. S You have configured a project for the S7-300 station. S The programming device is connected to the CPU. S You have a CP 341 module complete with the appropriate configuration package and connecting cable. S You have prepared your connection partner for serial data transfer. If you are using a CP 341 with RS232/V.24 interface, your programming device running the Hyper Terminal program can function as the connection partner. You will find Hyper Terminal in Windows under StartPrograms Accessories Hyper Terminal. The procedure for starting the program is described below.

Installing the Configuration Package on your Programming Device


The configuration package consists of a parameterization tool for the CP 341, a library containing function blocks, and a demo program. Start the installation program on the CD by double-clicking the file called SETUP.EXE. Follow the instructions issued by the installation program.

Installing the CP 341, Connecting to the Communication Partner


Plug the bus connection supplied with the CP 341 into the CPUs bus port. Hook the CP 341 over the rail, lower the bottom edge into position and install the securing screws. Connect your power supplys L+ and M terminals to the corresponding terminals on the CP. Use the connecting cable to interconnect the CP 341 and your connection partner. The pin assignment of the interface adapter is detailed in Appendix B of the operating manual.

Test: Apply line voltage to the power supply module. When the initialization phase completes, the SF LED on the CP 341 is on.

Parameterizing the CP 341


Open your project in SIMATIC Manager. In your project, call up the HW Config configuration table. In the hardware catalog, select the CP 341 with the correct order number and drag it to the appropriate slot. Double-click the CP 341 to open the Properties CP 341 form. Note the module address under Address (in the demo this address is 256 100 hex). You will need this value when you set up the link to your user program. Click the Parameters button and select the ASCII protocol. Double-click the Envelope. Click the OK button to accept the parameterization defaults: 9600 bit/s, 8 data bits, 1 stop bit, even parity. Select File Save to save your parameterization settings and exit the form with File Exit. In the Properties CP 341 form, click the OK button. Save the configuration in your project by selecting Station Save and Compile. Transfer the configuration with the CPU in STOP by selecting PLC Load to module. The data are transferred directly to the CPU and the CP 341. The SF LED goes out to indicate that loading was successful. Select Station Exit to close HW Config.

-2

Linking to the User Program


The demo project CP340_41 was installed in the \Siemens\STEP7\Examples catalog when you installed the configuration package. In SIMATIC Manager, open this project by selecting File Open... Projects and double-click the sub-project called CP341Protocol 3964 (suitable for ASCII protocols, despite the name). Open the S7 program of the CPU in this project. Double-clock the Blocks container. Copy all the blocks except the system data from this container to your project under SIMATIC 300 Station CPU3xx S7 Program Blocks. S S S S S S S S S S S FC21 FC22 DB21, DB22 DB40, DB41 DB42 DB43 OB1 OB100 VAT1 FB7, FB8 SFC 58, 59 FC with SEND FC with RECEIVE Instance DBs for the standard FBs Work DBs for the standard FBs The source DB for send The destination DB for received data Cyclic OB Restart (warm start) OB Variables table Standard FBs for RECEIVE, SEND SFCs for the standard FBs

In your project, double-click FC22 to open it and in the first line of Network 1, change the module address LADDR from 272 to 256. Save the blocks by selecting File Save. No other changes have to be made to the FCs, so select File Exit. In SIMATIC Manager, select SIMATIC 300 Station CPU3xx S7 Program Blocks. Load all the S7 blocks to your CPU (CPU in STOP mode) with PLC Load. Switch the CPU to RUN. The CP 341 starts to send data cyclically via the serial interface (the TxD LED flashes). Data you send from your communication partner are received by the CP 341 in DB 43. The destination is entered in the DB_NO and DBB_NO parameters of FB7 (P_RCV_RK) in FC22.

-3

Test: Double-click VAT1 in the Blocks directory in your project to observe data transfer: Go online by selecting PLC Set up connection to configured CPU. Go to observe mode by selecting Variable Monitor.
The DB42.DBW0 operand (send counter) indicates the number of transfers. The counterpart counter for incoming data is DB41.DBW18 (receive counter). If you use your programming device as connection partner, you can receive data and send data to the CP 341 using the Hyper Terminal program. Double-click the file called Getting.ht (in \Siemens\STEP7\s7fptp\Terminal\....) to start Hyper Terminal with the appropriate settings. The data sent by the CP 341 are displayed. Press a key on your keyboard to send the corresponding character to the CP 341.

Diagnosis
Operator mistakes, incorrect wiring of the serial interface or parameterization conflicts can cause errors. Possible errors and the diagnosis messages are described in Section 8 of the operating manual.

Siemens AG Bereich Automatisierungs- und Antriebstechnik Geschaeftsgebiet Industrie-Automatisierungssysteme Postfach 4848, D-90327 Nuernberg

E Siemens AG 1999 Technical data subject to change C79000-Z7076-C341 Printed in the Fed. Rep. of Germany

Siemens Aktiengesellschaft

-4

You might also like