Sei sulla pagina 1di 8

http://support.automation.siemens.

com/WW/view/en/8803325

Configuring communication between an intelligent DP slave and a SIMATIC NET OPC server Entry ID:8803325 Date:2001-10-15 Configuring communication between an intelligent DP slave and a SIMATIC NET OPC server

QUESTION: How can I connect an intelligent DP slave to a SIMATIC NET OPC server? ANSWER: The following explains how to proceed to configure communications between an intelligent DP slave and an OPC server. A CP5412A2 is used as DP master on the OPC server side. However, you can use any PROFIBUS CP that supports the PROFIBUS DP protocol. The intelligent DP slave consists of an S7 314 CPU and a CP 342-5. Configuration in five steps: 1. 2. 3. 4. 5. Configure the hardware Create the program for data transfer Configure the PG/PC interface Configure the SIMATIC OPC server Test the communication with the OPC-Scout

Step 1: Configuring the hardware 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. Open the SIMATIC Manager and create a new project. Add a SIMATIC S7 300 and a SIMATIC PC station to the project. Open the S7 300 station and configure your modules (Rack, PS, CPU, CP etc). Create a new PROFIBUS DP network and define the network address. Close the HW Config of the S7 300 station. Open the HW Config of the SIMATIC PC station and configure the communications processor you are using. When you add the CP, a window opens. In this window assign a network to the CP and assign a network address. Then select the parameters of the interface used. Close the window with OK and add an "Application" to your configuration for the hardware catalog (SIMATIC PC Station > User Application.> Application). Now open the Properties of the communications processor again. Switch to the "Operating Mode" tab and set the "DP master" option.

Page 1 of 8

4/24/2008 10:34:19 AM

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

12. In addition, in the "Assigned application" field, you assign the application you created beforehand. 13. Automatic "Add DP master system (x)". 14. In the hardware catalog switch to the following entry: "PROFIBUS DP > Stations already configured > S7 300 CP 342-5 DP" 15. From the entries available select the CP you are using and add this to the DP master system. 16. A window opens automatically in which you can see your S7 300 station. 17. Mark your station and press the "Connect" button. You station is then no longer visible in this window.

Page 2 of 8

4/24/2008 10:34:19 AM

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

18. Confirm your entries with OK and close this window. 19. Now add a "Universal Module" to the S7 300 station and define the address area you wish to access later via the OPC server.

Page 3 of 8

4/24/2008 10:34:19 AM

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

20. Save and compile your hardware configuration and load this into your CPU. Step 2: Creating the program for data transfer You need an S7 program for data transfer between the CPU and the CP 342-5. For this you can use the functions FC1 "DP_RECV" and FC2 "DP_SEND". These are supplied by default with your communications processor. Make sure when you specify the start address of the CP 342-5 as parameter CPLADDR on the function, that this is specified as decimal in the HW Config and as hexadecimal on the function. Please also make sure when configuring the pointer that with the functions only the data type "Byte" is permissi9ble on the Any Pointer and that the source and target areas for the data are of identical size. See the STEP 7 ONLINE Help for details of the interconnection of the functions. Step 3: Configuring the PG/PC interface 1. Open the "Set PG/PC interface" tool and set the access point of the application as follows: CP_L2_1: --> CP5412A2(PROFIBUS) 2. Press the "Properties" button and switch to the "FMS/DP Protocol" tab. 3. Enable the "Activate DP" check box and load the FMS/DP database. The database is located in your project path in the "LDBs" directory.

Page 4 of 8

4/24/2008 10:34:19 AM

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

4. In the "PROFIBUS" tab check whether the specifications there match those in your hardware configuration. 5. Close the window with OK, press the "Diagnostics" button and then "Read". There must be one active and one passive station visible in the matrix. Step 4: Configuring the SIMATIC OPC server 1. Open "OPC Settings" via "Start > SIMATIC > SIMATIC NET > OPC Server". 2. In the window make the basic OPC settings as follows: In the "OPC Parameters" tab mark the DP Protocol.

Page 5 of 8

4/24/2008 10:34:19 AM

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

3. Then select the "DP Protocol" tab.

Page 6 of 8

4/24/2008 10:34:19 AM

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

4. You must select "CP_L2_1" as the access point. 5. Check the configuration file "ScoreDP1.txt". The figure shows an example of this file. Note: Details on the structure of the configuration file are available in the "OPC Server" manual. Step 4: Testing the communication with the OPC Scout 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. Open the "OPC Scout" via "SIMATIC > SIMATIC NET > OPC Server". In the "OPC Scout" mask open the "Local Server(s)" entry. Click "OPC.SimaticNet" to mark it in blue. Right-click and then click "Connect". The OPC Scout connects itself to the connected user. You are now prompted to enter a group name. Acknowledge your entry with OK. You are now ONLINE on the user. You can now access the address area of the CP342-5. Mark the group created and click "Add Item" in the pull-down menu. You will find your slave under the access point "CP_L2_1:". Now you can choose the variables you need from all those displayed.

Download: The download contains the STEP 7 project "OPC_S7_project" described and the OPC Scout project "OPC_5412_CP342.opp".

Page 7 of 8

4/24/2008 10:34:19 AM

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

net_opc_cp5412.exe ( 269 KB ) Copy the "net_opc_cp5412.exe" file into a separate directory and then start the file with a doubleclick. The STEP 7 and OPC Scout projects unpack automatically with all the associated subdirectories. You can then use the SIMATIC Manager and OPC Scout to open and process the unpacked projects. Keywords: Master slave communication

Part number: 6GK7342-2AH01-0XA0 6GK7342-5DA01-0XE0 6GK7342-5DA02-0XE0 6GK7342-5DF00-0XE0 SIMATIC NET, CP 342-2 SIMATIC NET, CP 342-5 SIMATIC NET, CP 342-5 SIMATIC NET, CP 342-5 FO

Entry ID:8803325 Date:2001-10-15


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

Page 8 of 8

4/24/2008 10:34:19 AM

Potrebbero piacerti anche