SIMATIC CP 441 Getting Started Guide First Steps This Guide uses a real-life example to take you through the five 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 441. 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-400 station, consisting of rack, 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-400 station. S The programming device is connected to the CPU. S You have a CP 441-1 or CP 441-2 module complete with the appropriate configuration package, an interface submodule and connecting cable. S You have prepared your connection partner for serial data transfer. If you are using a CP 441 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 441, 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 441, Connecting to the Communication Partner Insert the interface submodule into the upper slot and install the screws securing it to the module. Hook the CP 441 onto the rack, lower the bottom edge into position and install the securing screws. Use the connecting cable to interconnect the CP 441 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 "FAULT1" LED lights up. Parameterizing the CP 441 Open your project in SIMATIC Manager. In your project, call up the HW Config configuration table by double-clicking on Hardware. In the hardware catalog, select the CP 441 with the correct order number and drag it to the appropriate slot. Double-click the CP 441 to open the "Properties CP 441" form. Select interface 1 and specify the module. 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 441" form, click the OK button. Save the configuration in your project by selecting Station Save and Compile. -2 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 441. The interface's "FAULT1" LED flashes at a slow rate of 0.5 Hz to indicate that loading was successful. Select Station Exit to close HW Config. Configuring a Connection In SIMATIC Manager, click the CPU in your project. Double-click the "Connections" icon. This takes you to the "NetPro" form. Select Insert Connection to open the "New Connection" dialog box. Select "unspecified" as the connection partner and "PtP connection" as the connection type. Click the OK button to confirm. Open the "Object Properties - Connection" form and select the rack and interface you want to use in the "With CP" and "Interface" fields, respectively. Note the "Local ID" (in the demo this address is 1000 hex). You will need this value when you set up the link to your user program. Click the OK button to close the form. Save your connection-table settings by selecting Network Save and compile (all). In your station's screen, select the "SIMATIC 400" field and use PLC Load Selected Stations to upload the connection description to the CPU. The "FAULT1" LED goes out to indicate that loading was successful. Select Network Exit to terminate connection configuration. Linking to the User Program The demo project "CP441" 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 "CP441ASCII Send/Recv". 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 400 Station CPU4xx S7 Program Blocks. S S S S S S S S S S FC21 FC23 DB12, DB13, DB22, DB23 DB40, DB41, DB45, DB46 DB42 DB43 OB1 OB100 VAT1 SFB12, SFB13, SFB22 FC with SEND FC with BRCV Instance DBs for the SFBs Work DBs for the SFBs The source DB for send The destination DB for received data Cyclic OB Restart (warm start) OB Variables table SFBs for BSEND, BRCV, STATUS In your project, double-click FC23 to open and enter the value "W#16#1000" for the "ID" parameter in the SFB13 (BRCV) call and the SFB22 (STATUS) call. Save the block by selecting File Save. No other changes have to be made to the FC, so select File Exit. In SIMATIC Manager, select SIMATIC 400 Station CPU4xx 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 441 starts to send data cyclically via the serial interface (the "TxD1" LED flashes). Data you send from your communication partner are received by the CP 441 in DB 43. The destination is entered in the "RD_1" parameter of SFB13 (BRCV) in FC23. -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.DBW6" (receive counter). If you use your programming device as connection partner, you can receive data and send data to the CP 441 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 441 are displayed. Press a key on your keyboard to send the corresponding character to the CP 441. 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 Siemens Aktiengesellschaft C79000-Z7076-C441 Printed in the Fed. Rep. of Germany -4