902584--siemens s7 plc connection

15
APPLICATION NOTE SIEMENS S7 PLC CONNECTION TO DIGITAL MASS FLOW / PRESSURE INSTRUMENTS Doc. no.: 9.02.584 B Date: 09-03-2009 Multi-bus ATTENTION: Please read this instruction manual carefully before installing and operating the instrument. Not following the guidelines could result in personal injury and/or damage to the equipment..

Upload: kicior

Post on 01-Dec-2014

191 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: 902584--Siemens S7 PLC Connection

APPLICATION NOTE

SIEMENS S7 PLC CONNECTION

TO DIGITAL MASS FLOW / PRESSURE INSTRUMENTS

Doc. no.: 9.02.584 B Date: 09-03-2009

Multi-bus

ATTENTION: Please read this instruction manual carefully before installing and operating the instrument.

Not following the guidelines could result in personal injury and/or damage to the equipment..

Page 2: 902584--Siemens S7 PLC Connection

BRONKHORST HIGH-TECH B.V.

9.02.584 Page 2

SCOPE OF THIS APPLICATION NOTE

This application note describes step-by-step how to connect a Bronkhorst High-Tech Profibus-DP slave instrument (meter/controller) to a Siemens S7 PLC Profibus-DP master using Step7. This example may be also used for other types of PLC’s.

Page 3: 902584--Siemens S7 PLC Connection

BRONKHORST HIGH-TECH B.V.

9.02.584 Page 3

TABLE OF CONTENTS 1 Setting up master-slave communication with Siemens S7 PLC................................................................. 4

1.1 Prepare Siemens S7 PLC ................................................................................................................... 4 1.2 Step 7 configuration actions for Profibus communication ................................................................... 5 1.3 Adding a Bronkhorst meter/controller to the Profibus-DP system..................................................... 11 1.4 Testprogram on master PLC sending setpoints to slave Bronkhorst meter/controller...................... 15

Page 4: 902584--Siemens S7 PLC Connection

BRONKHORST HIGH-TECH B.V.

9.02.584 Page 4

1 Setting up master-slave communication with Siemens S7 PLC

1.1 Prepare Siemens S7 PLC This example is given for a Siemens S7-300 CPU315-2 DP. Setting-up other types of Siemens PLC will look almost the same, but may differ on details. Communication between PC(-card) and PLC for programming and setting can be realized by means of an MPI-cable or via Profibus. On the CPU315-2 DP both interfaces are present and can be used. In the example the MPI-interface will be used for programming/setting the PLC and the Profibus connector on the PLC will be used to communicate with the Bronkhorst meters/controllers. At the PLC: - Connect the MPI-cable between PC-card and PLC (left sub-D 9 connector) - Connect the Profibus cable to the PLC and the Bronkhorst meter(s)/controller(s)

See picture below for details:

- Put switch on PLC on RUN-P For more information about Siemens PLC or Simatic equipment see:

http://www.ad.siemens.de/simatic For more information about Bronkhorst High-Tech equipment see:

www.bronkhorst.com

Page 5: 902584--Siemens S7 PLC Connection

BRONKHORST HIGH-TECH B.V.

9.02.584 Page 5

SIMATIC Manager.lnk

1.2 Step 7 configuration actions for Profibus communication 1. Start-up Simatic Manager (Step 7) 2. Select [File][New project wizard][Next]

3. Select CPU315-2 DP and press [Next]

Page 6: 902584--Siemens S7 PLC Connection

BRONKHORST HIGH-TECH B.V.

9.02.584 Page 6

4. Select Blocks OB1 and Language STL and press [Next]

5. Fill-in Project name, e.g.: “Bronkhorst demo” and press [Finish]

Page 7: 902584--Siemens S7 PLC Connection

BRONKHORST HIGH-TECH B.V.

9.02.584 Page 7

6. On the new screen click on [Simatic 300 station] at the left side of the screen

7. At the right will appear two icons with “Hardware” and “CPU315-2 DP(1)” 8. Double-click on [Hardware] and a new screen will appear: the HW-Config screen

9. At the right side, with available hardware, first add a power supply, therefore:

Page 8: 902584--Siemens S7 PLC Connection

BRONKHORST HIGH-TECH B.V.

9.02.584 Page 8

10. Under [Simatic 300][PS-300] drag&drop [PS 307 5A] to little screen left with rail and CPU315-2 DP

11. Now double-click on [DP-Master] and select Tab [General] and at “interface”: [Properties]

12. Select Tab [Parameters] and at “Address” fill in address of master (PLC)

Page 9: 902584--Siemens S7 PLC Connection

BRONKHORST HIGH-TECH B.V.

9.02.584 Page 9

13. At “Subnet” select [New] in case of “---not networked---“, otherwise select [Properties]

14. At [Network Settings], select “Transmission rate” (Baudrate) and “Profile”: [DP]

Page 10: 902584--Siemens S7 PLC Connection

BRONKHORST HIGH-TECH B.V.

9.02.584 Page 10

15. Press 3x [OK] to close all (Profibus properties) screens, a dashed line with “PROFIBUS(X): DP master system(Y)” will appear next to the object with the PLC to screen “UR”. The PLC has been setup now as Profibus master. Now your PLC (master) is ready to add slaves to the Profibus system.

Page 11: 902584--Siemens S7 PLC Connection

BRONKHORST HIGH-TECH B.V.

9.02.584 Page 11

1.3 Adding a Bronkhorst meter/controller to the Profibus-DP system 16. Now the slave(s) can be added to the Profibus system. First GSE or GSD-file has to be loaded (when

not already done before) to add a new slave (Bronkhorst meter/controller).

17. Go to [Options][Install new GSE]. Select path and load file “BHT_0586.GSD”.

18. Now look at the right side under [PROFIBUS DP] (double click on it or press “+” left to text)

19. Select [Additional Field Devices][General][Bronkhorst meter/controller], drag&drop [Bronkhorst

meter/controller] to left side dashed line with “PROFIBUS(X): DP master system(Y)”, give it the wanted slave-address at [Parameters] and press [OK].

Page 12: 902584--Siemens S7 PLC Connection

BRONKHORST HIGH-TECH B.V.

9.02.584 Page 12

20. An icon with a Bronkhorst High-Tech instrument will appear on the screen. 21. At the bottom-left side a table will appear with slots for modules from the Bronkhorst meter/controller.

Press “+” in front of [Bronkhorst meter/controller] (right). A list with available modules for slave configuration will appear. These modules are available variables/parameters in the Bronkhorst meter/controller for cyclic I/O, which means that these variables/parameters will be send/requested several times in a second.

22. At least [Measure, integer (read)] should be dragged&dropped into the slot-table to slot 0 at the bottom-left side. Add also [Setpoint, integer (write)] to slot 1 (NOTE: slave should be a Bronkhorst controller, able to receive setpoints !). See document nr. 9.17.023 for description of all Bronkhorst meter/controller variables/parameters.

23. Add all modules wanted for cyclic I/O communication between master and Bronkhorst meter/controller slave. Max. 50 modules can be add to the slot-table. Each variable/parameter will get one or more bytes reserved in the Input or Output area of the memory of the PLC. All variables will be stacked, starting from address 0. I/O address may be adjusted when needed and are available for further handling in the PLC.

Page 13: 902584--Siemens S7 PLC Connection

BRONKHORST HIGH-TECH B.V.

9.02.584 Page 13

24. To set parameter data (A-cylic I/O that will be sent only to the slave instrument when communication starts between master and slave), double-click the icon with the Bronkhorst meter/controller. At [Parameter Assignment] all parameter data can be set. See document nr. 9.17.023 for description of all Bronkhorst meter/controller variables/parameters. Press [OK] when ready.

25. Make sure switch on PLC is in RUN-P position.

26. Select [PLC][Download] to download all settings into the PLC. Select Target module and press [OK]. Select Station Addres: MPI address 2 and press [OK]. Press [OK] at the message screen [Stop Target Modules].

Page 14: 902584--Siemens S7 PLC Connection

BRONKHORST HIGH-TECH B.V.

9.02.584 Page 14

27. Press [Yes] if program asks if it is o.k. to restart the PLC.

28. After a few seconds all red and orange LED’s will go off, the green LED on the PLC at RUN will blink a

few times and will stay on, together with the green LED at DC5V. The master is now communicating with the slave(s) without problems.

Page 15: 902584--Siemens S7 PLC Connection

BRONKHORST HIGH-TECH B.V.

9.02.584 Page 15

1.4 Testprogram on master PLC sending setpoints to slave Bronkhorst meter/controller

29. For further testing a little program can be load into the PLC, e.g. to send setpoint changes. 30. In the Simatic Manager select at [Blocks] [OB1]. This is a module which will be called cyclicly by the

PLC.Double-click [OB1] to open the editor and write following lines into the square where the cursor is blinking.

31. Select [File][Save] and [PLC][Download], Press [Yes] at next question. From now on the testprogram will send each 10 sec. Setpoint step changes between 20% and 80%.