winplc7 v4 user manual

Upload: erlon-carvalho

Post on 14-Oct-2015

181 views

Category:

Documents


28 download

TRANSCRIPT

  • 5/24/2018 WinPLC7 V4 User Manual

    1/186

    WinPLC7 Version 4User Manual

    English

    User Manual WinPLC7 V4

    1

  • 5/24/2018 WinPLC7 V4 User Manual

    2/186

    Revision: 11.05.2007

    Trade Marks:S7-300, S7-400, SIMATIC, STEPare registeredtrademarks of SIEMENS AG.

    User Manual WinPLC7 V4

    2

  • 5/24/2018 WinPLC7 V4 User Manual

    3/186

    1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7. .

    1.1 What features does WinPLC7 offer? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7. .

    1.2 WinPLC7 V4 versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7. .

    1.3 New features in version 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8. .

    1.4 System requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    1.5 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    1.6 Information on this manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    2 Quick start and brief tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    2.1 Overview of the user interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    2.2 Quick start tutorial on the basis of a small program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

    2.2.1 Create new project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

    2.2.2 Create the icon file if required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

    2.2.3 Create OB1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

    2.2.4 Select the target system (software PLC or external S7 PLC) . . . . . . . . . . . . . . . . . 22

    2.2.5 Transferring blocks to the target system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

    2.2.6 Monitor OB1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

    2.2.7 Simulation of OB1 with the PLC mask simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

    2.2.8 Status variable (monitor variable) .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

    2.3 Projects in WinPLC7 V4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

    2.4 Creating, opening and deleting projects .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

    2.5 Creating, opening and deleting a sub-project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

    2.6 Target: External or internal simulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

    2.7 Importing and exporting a STEP7 project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

    2.8 Sending a project by e-mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

    2.9 S7 program simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

    2.10 Connecting to a S7 PLC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

    2.11 Modifying the program in a S7 PLC .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

    2.12 Creating a new S7 program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

    3 Object list window (OFFLINE and ONLINE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

    3.1 Open the object list window (OFFLINE) .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

    3.2 Creating the documentation file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

    3.3 Creating a filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

    3.4 Opening the object list window (ONLINE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

    4 Symbolic programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

    4.1 Absolute programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

    4.2 Symbolic programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

    5 Creating an FC, FB and DB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

    5.1 Creating an FC (function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

    5.2 Creating a FB (Function block) with the respective DB (data block) . . . . . . . . . . . . . . . . 60

    6 Creating a global data block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

    User Manual WinPLC7 V4

    3

  • 5/24/2018 WinPLC7 V4 User Manual

    4/186

    6.1 Change actual values to initial values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

    7 Loading and testing the program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

    7.1 Establishing an online connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

    7.2 Loading the program into the target system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

    7.3 Changing the PLC to RUN mode .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

    7.4 Testing a program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

    7.4.1 Status block window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

    7.4.2 Status/Modify variable window .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

    8 Working with the library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

    8.1 Extending the library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

    9 Working with the global clipboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

    9.1 Copying objects into the project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

    9.2 Copying objects into the global clipboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76

    10 Checking the PLC program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

    10.1 Program structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

    10.2 Assignment plan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

    10.3 Cross-reference list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80

    10.4 Check PLC program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

    10.5 Consistency check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

    10.6 Displaying the UDTs that are being used . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

    10.7 Displaying local instances in FBs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

    11 Programming of a multiple instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85

    11.1 Creating an instance in a FB .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85

    11.2 Calling the instance in the FB .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86

    12 Monitoring blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

    12.1 Monitoring the STL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

    12.2 Monitoring the FBD/LAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

    12.3 Changing the block while monitoring is active . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

    13 Monitoring variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9114 Useful functions for STEP7 beginners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

    14.1 Function to check a PLC program .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

    14.2 Analyzing the PLC program in the cross-reference list . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

    15 Working wi th the software PLC of WinPLC7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

    15.1 Turning the software PLC on . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95

    15.2 Technical data of the software PLC .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

    16 Working efficiently with WinPLC7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

    16.1 Selecting symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9716.2 Parameter selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98

    16.3 Selection of DB variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99

    User Manual WinPLC7 V4

    4

  • 5/24/2018 WinPLC7 V4 User Manual

    5/186

    16.4 Automatic address entries in the symbolic editor, status variable window . . . . . . . . . 99

    16.5 Important keyboard shortcuts (hotkeys) .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100

    16.6 Hotkeys related to a block editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100

    16.7 Global hotkeys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100

    16.8 Hotspots that are only accessible with the mouse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101

    17 STL programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102

    17.1 Using the STL editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102

    17.2 Hints regarding the STL editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104

    18 FBD programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105

    18.1 Principles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105

    18.2 Hints about FBD programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110

    19 LAD programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111

    19.1 Principles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111

    19.2 Hints about LAD programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116

    20 PLC program backup and restore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117

    20.1 Backup of the blocks in the PLC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117

    20.2 Restore (recover) the blocks in the PLC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

    20.3 Backup of a project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119

    20.4 Restoring the project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119

    21 The sequencer wizard (new in version 4) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120

    21.1 Principles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12021.2 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122

    22 Check consistency (new in version 4) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132

    22.1 Error type: "Time-stamp error in CALL" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133

    22.2 Error type: "Structure of call xy is wrong" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134

    22.3 Dialog: "Edit call" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136

    23 Determining the reason for a stop (diagnostic options) . . . . . . . . . . . . . . . . . . 137

    23.1 Diagnostic messages in the module state dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137

    23.2 Interrupt stack (USTACK) and block stack (BSTACK) in the dialog module state . . 13823.3 Go to byte address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140

    24 Remote maintenance with WinPLC7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141

    24.1 Accessing a S7 PLC via the internet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141

    24.1.1 Direct TCP/IP connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142

    24.1.2 NetLink PRO connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144

    24.1.3 NetLink connections (NetLink Lite, IBH Link) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146

    24.1.4 Summary regarding the internet access to a S7 PLC . . . . . . . . . . . . . . . . . . . . . . . 148

    24.2 Accessing a S7 PLC via ISDN by means of LAN to LAN routers . . . . . . . . . . . . . . . . . . 14924.2.1 How does the connection operate and what are the conditions that apply to

    establish a connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .150

    24.2.2 Direct TCP/IP connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150

    User Manual WinPLC7 V4

    5

  • 5/24/2018 WinPLC7 V4 User Manual

    6/186

    24.2.3 NetLink PRO connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151

    24.2.4 NetLink connections (NetLink Lite, IBH Link) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152

    24.2.5 Summary of Accessing a S7 PLC via ISDN Routers . . . . . . . . . . . . . . . . . . . . . . . . 152

    24.3 Remote maintenance by means of the Siemens Teleservice software with theTeleservice adapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    153

    24.3.1 Preparations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154

    24.3.2 The SIEMENS Teleservice software .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155

    25 The SPS-Analyzer for S7+S5 "WinPLC-Analyzer" . . . . . . . . . . . . . . . . . . . . . . . . 157

    26 Communicat ing with a PLC v ia the MAC address . . . . . . . . . . . . . . . . . . . . . . . 159

    27 Working with the hardware configurator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160

    27.1 Selecting the system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161

    27.2 Example: Configuration of a SIEMENS S7-300CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162

    27.2.1 Installing a PS module in the rack .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164

    27.2.2 Installing the CPU module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164

    27.2.3 Inserting digital input and output modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165

    27.2.4 Changing the input and output addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167

    27.2.5 Analog input configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170

    27.2.6 Configuring the properties of the CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171

    27.2.7 Transferring the configuration to the CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173

    27.2.8 Summary of example 1 in respect of the hardware configuration . . . . . . . . . . . 174

    27.3 Second example regarding the hardware configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . 175

    27.3.1 Starting the hardware configurator .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176

    27.3.2 Summary of example 2 in respect of the hardware configuration . . . . . . . . . . . 181

    27.4 Example: Configuration of a VIPA 100V CPU 114 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182

    27.5 Configuration of VIPA SPEED7, VIPA 200V, Profibus-DP- configuration andEthernet configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    184

    28 Starting WinPLC7 with parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185

    User Manual WinPLC7 V4

    6

  • 5/24/2018 WinPLC7 V4 User Manual

    7/186

    1 Introduction

    1.1 What features does WinPLC7 offer?

    WinPLC7 is a complete programming system for the S7-PLCs of the type S7-300

    ,S7-400and compatible PLCs.

    WinPLC7includes asoftware PLCthat simplifies the simulation of S7 programs.You can monitor digital and analog inputs and outputs by means of a graphical S7-300

    -mask. At the same time you can also monitor a block in the editor.

    The hardware configurator provides special support for S7-PLCs supplied by VIPA

    GmbH. It offers a simple user interface for the configuration of VIPA-CPUs andmodules.Most of the hardware modules that are currently available from VIPA GmbH havealready been implemented in the hardware configurator, i.e. it is not necessary to

    import these via GSD files.

    1.2 WinPLC7 V4 versions

    The following versions are available:

    Standard-VersionThis version is intended for pupils and students.It provides unrestricted programming and simulation facilities.New features in version 4:

    The external operating mode provides support for VIPA GmbH's compatibleS7-PLCs CPU112, CPU114 and CPU115.The other types of CPU are only supported by the pro-version of WinPLC7.The standard-version must not be used for commercial applications.

    Profi-VersionWith this version you can program and configure all S7-300-PLCs and allVIPA-PLCs.It also contains the Software-PLC.The Profi-Version is intended for commercial applications.

    Note:WinPLC7is also distributed under the name WinSPS-S7. This package contains thesame software.

    User Manual WinPLC7 V4

    7

  • 5/24/2018 WinPLC7 V4 User Manual

    8/186

    1.3 New features in version 4

    Consistency-check with straightforward trouble shooting facilitiesThe consistency-check scans the entire application program and creates a list with thefollowing errors:

    Obsolete instance data blocks

    Conflicting time stamps in block calls

    Bad call-statements

    The list details the problem locations and they can easily be corrected via adialog-based user interface

    Global dialog-controlled CALL-statement processingYou can use dialog-controlled Call-statement processing for the following situations:

    A FB/FC header was modified and you want to update all the calls.

    Other parameters of one or more CALL-statements must be modified.

    All the actual parameters of a specific block must be listed and inspected.

    Sequencer wizardThe sequencer wizard creates a sequencer that can be edited in a STL, FBD or LAD.You can enter every step via a dialog and define the respective step-condition in theSTL. You can also specify whether the step addresses should consist of bit memoriesor the variables of a data block. In this case the wizard programs the following itemsautomatically:

    Setting and resetting of step-addresses

    Resetting the sequencer in the start-up OB

    PLC ON/OFF and emergency-off mechanism

    Symbol table

    Using the sequencer wizard you can achieve results much quicker!

    New project-manager w ith context-sensitive qu ick-start buttonsThe new project-manager is located on the left side of the screen. This section always

    displays all the sub-projects that exist in the project that is currently open. You canadminister sub-projects much quicker by means of a right-click of the mouse.The familiar quick start buttons for the most important functions are located directlybelow this window. These are divided into two groups: The first group includes buttonsthat always execute the same commands. The second group consists of so-calledcontext-sensitive buttons. These commands change with the context of the application.If, for example, the PLC-mask simulation is active, buttons will be inserted here thatpermit you to add further modules.

    Network view in the hardware configuratorThe new network view in the hardware configurator displays the network topology of the

    current configuration. In this way larger configurations become clear and moreserviceable.

    User Manual WinPLC7 V4

    8

  • 5/24/2018 WinPLC7 V4 User Manual

    9/186

    Object list for OFF-LINE and ON-LINE viewsThe new object list replaces the existing "block management" dialog (note: this dialog isstill available). The object list displays the project contents (sub-project). The followingobjects are displayed here:

    Blocks (OB, FB, FC, SFC, SFB, SDB)

    UDTs (user defined types)Lists of status variables

    Symbol tables

    Document files that describe the current sub-project (WORD, EXCEL, etc.)

    An object list can also display PLC blocks directly (ONLINE object list). It is alsopossible to open several object lists and objects can be copied and edited by drag anddrop operations.

    Stations that are accessible via Ethernet with temporary assignment of IP

    parametersVersion 4 of WinPLC7 provides TCP/IP access to any PLC that has not beenconfigured. This is made possible by allocating a temporary IP address that remainsvalid until the PLC is switched off. Until now it was necessary to first configure the PLCby means of an MPI interface, before it could be accessed via Ethernet.

    A new and comprehensive online help systemThe online help was revised completely. Not only does it offer help on WinPLC7, but italso contains tips and tricks on S7 PLCs.

    You can now use the SIEMENS MPI adaptersStarting with version 4 of WinPLC7, the system supports the SIEMENS MPI adapters:

    CP5611

    CP5512

    SIEMENS MPI-USB adapter

    etc.

    This option is subject to the condition that the hardware drivers are available on the PC.This is true, if one of the following software products was installed on the computer:

    STEP

    7 V5.xProdave V5.6 incl. service pack

    SIEMENS Teleservice option

    Remote maintenance via analog/ISDN telephone lines is available when usingSIEMENS Teleservice V6 (e.g. TS adapter II)WinPLC7 version 4 was tested and released for use under Windows Vista.

    Support for Windows VistaWinPLC7 version 4 was tested and released for use under Windows Vista.

    User Manual WinPLC7 V4

    9

  • 5/24/2018 WinPLC7 V4 User Manual

    10/186

    1.4 System requirements

    WinPLC7 is compatible with the following systems:

    Hardware:

    At least 256 MB RAM

    App. 200 MB of hard disk space

    CD-ROM for the installation CD

    Operating system:

    Recommended: Windows XP (Home or Professional) orWindows VISTA (all versions)

    Windows 98SE, Windows ME

    A working version of the Internet Explorer is necessary, since this is required for the

    help system.

    1.5 Instal lat ion

    Separate installation hints are supplied with the software.

    A serial number is required for the installation.This is included with the package that is shipped to the end use.

    1.6 Information on this manual

    The sample programs in this manual are based on the English syntax.

    You can select your specific syntax settings under Extras->Settingsin the tab"Language" if you have not yet saved any blocks in the sub-project.

    User Manual WinPLC7 V4

    10

  • 5/24/2018 WinPLC7 V4 User Manual

    11/186

    2 Quick start and brief tutorial

    2.1 Overview of the user interfaces

    Fig.:WinPLC7 without projects having been opened.

    When WinPLC7 starts, it displays a quick start windowwith the following options:

    Open last project

    Go to 'Open Project' dialog

    Create new project

    Note:If you always want to load the most recent project when the program starts, you can

    change the settings in Extras->Settings, General tab via:

    Place a tick mark next to "Load the last project when starting program".

    User Manual WinPLC7 V4

    11

  • 5/24/2018 WinPLC7 V4 User Manual

    12/186

    The user interface of an open project is displayed as follows(block OB1 is open in the figure below):

    Fig.: WinPLC7 with OB1 open

    The most important operator elements are:

    Mode settings for the software PLC (simulator ) or the external S7-PLCIn this list you can select whether you want to work with the internal simulatoror with an external S7 PLC.Here you can also define the communication path (serial, Netlink, Ethernet, Simatic

    Net, etc.) that will be used to access the external S7 PLC.

    Project window with sub-projectsThis displays all the sub-projects of the project that you have opened. Each entry in thelist can include a separated PLC program and the respective hardware configuration.

    The project color is displayed in a rectangle located to the left of each. The selectedsub-project is identified by a large rectangle.A context menu appears if you click with the right mouse key on the project window.Here you can activate, delete, duplicate, adjust the color, etc. of sub-projects.

    Quick start buttons (static)This section always contains the same buttons providing rapid access to importantfunctions:Display OB1, display project contents (sub-project), symbol table, status variable,cross-reference list, PLC Mask Simulation, global clipboard and connection diagram.

    User Manual WinPLC7 V4

    12

  • 5/24/2018 WinPLC7 V4 User Manual

    13/186

    Quick start buttons (context sensitive)This section displays those buttons that match the current context. For instance, thisfigure shows block OB1 open and selected. The following matching context sensitivebuttons are displayed: Send current block, send all blocks, turn on monitoring, hideblock header.

    Catalog and call structureYou can select STEP7-commands in the catalog when you edit the network of a block -this function is available in the FBD, LAD and also in the STL-display.In addition this section contains: the standard-library, multiple instances of the currentblock, the user library and the blocks of the current sub-project.

    User Manual WinPLC7 V4

    13

  • 5/24/2018 WinPLC7 V4 User Manual

    14/186

    2.2 Quick start tutorial on the basis of a small program

    This section describes how you would go about creating and simulating a WinPLC7program and how you would go about transferring it to the S7 PLC.

    Procedure in telegram style:

    1.Create new project

    2.Create the icon file if required

    3.Create OB1

    4.Select target system (software PLC or external S7 PLC)

    5.Transferring blocks to the target system

    6.Monitor OB1

    7.Status variable (monitor variable)

    The following paragraphs contain a detailed explanation of the different items.

    2.2.1 Create new project

    When WinPLC7 is started a quick start window is displayed (see paragraph 2.1). Clickon the button "Create new project".An input window is displayed. Enter the name of the new project (e.g. "Test1") andconfirm the dialog with a click on the OK button.A new project "Test1" will be created and opened. WinPLC7 appears as follows:

    Fig.: The new project was created.

    The project window with the sub-projects is visible at the left. Since you have created anew project, only one (1) sub-project with the name "Test1" exists. The name of the(main) project is always assigned to the first sub-project.If you right click the project window with the mouse, you can create or delete additionalsub-projects. More information will follow later.

    Summary:We have created a new project with the name "Test1". Project "Test1" contains asub-project "Test1" where we will now create OB1.

    User Manual WinPLC7 V4

    14

  • 5/24/2018 WinPLC7 V4 User Manual

    15/186

    2.2.2 Create the icon file if required

    It is common practice to create an icon file. This increases the legibility of the programand enables others to quickly follow the flow of the program. In the icon files a symbolicname (e.g. switch1) is assigned to absolute addresses (e.g. I0.0).

    To create an icon file, press quick start button "symbolic table". Alternatively, you canselect menu item "View->Symbolic editor.The display shows the empty symbolic editor:

    Fig.: The empty symbolic editor

    Select the Address column and enter "I0.0" via the keyboard. Next, press the buttonwith the plus sign 5 times (see figure).Now the window appears as follows:

    Fig.: 6 symbols were created

    Using the "+" button, we have quickly and logically created the following icons.Select the Address column that is located below the last entry. Press the insert keytwice on your keyboard. This inserts two empty rows.Into the Address column you now enter output Q0.0 and directly below Q0.1 and Q0.2.The resulting window appears as follows:

    User Manual WinPLC7 V4

    15

  • 5/24/2018 WinPLC7 V4 User Manual

    16/186

    Fig.: At this point you have created a total of 9 symbols.

    Replace the standard symbol names with meaningful names.Select the symbol column in row 1 with a click of the left mouse key.You can immediately enter the new symbol by means of the keyboard, or you may firstpress the RETURN button to edit the existing symbol. Modify all the symbols one byone as shown in the figure below:

    Fig.: Symbolic editor with all the symbols

    Hint:Click the right mouse key to display a context-sensitive menu with suitable commandsfor the symbolic editor.

    Now we close the symbolic editor by clicking on the red cross (at the right edge of thetitle bar in the window). Click the YES-button when you are prompted whether thesymbols should be saved.

    Summary:Now we have created an icon file. The symbols that were created can now be used forprogramming purposes.

    2.2.3 Create OB1

    We will now create block OB1. This is always processed cyclically by

    the S7-PLC.Press quick start button "Display OB1" or select menu itemView->Display OB1.As an alternative you can also use File->Create new block.Enter the block into the input field, i.e. "OB1" in our case.

    User Manual WinPLC7 V4

    16

  • 5/24/2018 WinPLC7 V4 User Manual

    17/186

    This will display an empty block OB:

    Fig.: The empty OB1

    We will now create three networks in the OB1. Press quick start button "New network"or menu itemEdit->Insert new network.Dialog box "Insert new network" will be displayed. In the fieldNumber of networksselectnumber 2 (since network (1) exists already). Press the OK button.The first network (network 1) is created in STL (statement list). In network 1 click on

    "STL" representation if network 1 is not displayed in STL:

    Fig.: Selecting STL representation

    Continue with a mouse click in the code area of network 1. Currently this is ,since no STL statements exist at this point.This opens the code editor where you can enter STL statements.

    Enter the following:

    A I 0. 0A I 0. 1= Q 0. 0

    User Manual WinPLC7 V4

    17

  • 5/24/2018 WinPLC7 V4 User Manual

    18/186

    The editor replaces the absolute address with the symbols:

    A "I 0" A "I 1" = "Lamp1"

    WinPLC7 supports you when you enter symbols:

    Enter the following into the editor:

    A " - >press t he RETURN key

    All available symbols are displayed in a selection box where you can quickly and easilyselect the required symbol. The symbol is inserted into the editor.

    Press the ESC key to exit from the code editor.Network 1 now appears as follows:

    Fig.: Contents of network 1, STL representation

    We will create network 2 in "FBD" representation. Click on "FBD" representation:

    Fig.: Network 2 in FBD representation

    You can edit the FBD network if it is dotted as shown in the figure above.

    Hint for experts:You can also access the block header in a similar manner:

    L # - >pr ess t he RETURN key

    All the variables of the block header will be displayed.

    Or you can access the variables of a data block:

    L DB1. - >press t he RETURN key

    User Manual WinPLC7 V4

    18

  • 5/24/2018 WinPLC7 V4 User Manual

    19/186

    Select an AND statement in the command catalog:

    Fig.: AND statement

    Double click the AND statement to insert it into the current network. As an alternative,you can also press the "F2" key to insert an AND symbol.At this point the network contains an AND gate with two inputs:

    Replace the question marks with I0.2 and I0.3. and select the output of the AND gate:

    Fig.: The output was selected so that the next block may be connected.

    We now select the assignment block in the catalog and insert it by means of a doubleclick:

    Hints:In FDB or LAD you can use the keys Alt + Backspace or menu item Edit->Undo toreverse the most recent change.

    In FDB or LAD you can also select symbols from a list, if you enter an exclamation

    mark as the address followed by the return key.

    User Manual WinPLC7 V4

    19

  • 5/24/2018 WinPLC7 V4 User Manual

    20/186

    Fig.: The assignment block is inserted.

    As an alternative, you can also press the "F7" key to insert a coil.Replace the question marks of the assignment block with "Q0.1 ".

    The completed network 2 is shown as follows:

    Fig.: Network 2 in FBD representation

    Note:The assignment box has a blue background. In FBD and LAD representation, all theblocks that write values are displayed in color.

    We will now program network 3 in LAD:

    Fig.: Network 3 is a LAD network

    Start by selecting the horizontal line in the LAD. Continue by selecting a normally opencontact in the command catalog and insert it twice:

    Fig.: Select the NO-contact and execute two double clicks.

    User Manual WinPLC7 V4

    20

  • 5/24/2018 WinPLC7 V4 User Manual

    21/186

    As an alternative, you can also press the "F2" key to insert a normally open contact.Continue by replacing the question marks with I0.4 and I0.5.

    Fig.: Select the end of the line to insert the assignment block.

    Next, insert the assignment (coil) the catalog. As an alternative, you may also press the"F7" button:

    Fig.: The assignment (or coil) is inserted.

    Replace the question marks with Q0.2.

    The completed network 3 is displayed as follows:

    Fig.: Now network 3 has been completed.

    Save the block by pressing keys CTRL+S.Alternatively, you can also select File->Save current block.

    Summary:You have created a block (OB1) containing three networks.In the block we have created networks using STL, FBD and LAD respectively.

    The following steps will transfer this block into the simulator and/or a real S7 PLC.

    User Manual WinPLC7 V4

    21

  • 5/24/2018 WinPLC7 V4 User Manual

    22/186

    2.2.4 Select the target system (software PLC or external S7 PLC)

    WinPLC7 includes an integrated software PLC (simulator). This is active if you haveselected simulator as the target:

    Fig.: Target selection

    The first entry in the list is "target: simulator". If this is selected, all the commands (e.g.send block) refer to the simulator. In this case no additional hardware is required to test

    a PLC program.All the other entries refer to an external S7 PLC. Every entry represents a specificcommunication path to the S7 PLC.

    We now select "target: simulator" to be able to test OB1 in the simulator:

    Fig.: Simulator selected.

    2.2.5 Transferring blocks to the target system

    WinPLC7 offers many different possibilities to transfer the SPS program.Select the quick start button "send current block" or the quick start button "send allblocks".

    Alternatively, you may also select menu item PLC->Send block. A list containing all theblocks in the sub-project will be displayed. Select the blocks that you wish to transferand press the Start transfer" button.

    From version 4 onwards, it is also possible to transfer the blocks by means of "drag anddrop". Open the object list window "online" and the object list window of the currentsub-project is displayed:

    Fig.: Select target entry ...

    Select the respective entry (see figure) and press the right mouse key.Select view project content in the context-sensitive menu.

    User Manual WinPLC7 V4

    22

  • 5/24/2018 WinPLC7 V4 User Manual

    23/186

    Select the entry "Test1" (the current sub-project containing OB1) and click the rightmouse key again. Select view project content in the context-sensitive menu.

    Two object list windows will be displayed on screen:

    Fig.: you can drag and drop OB1 to start the transfer.

    The window with the colored background is the ONLINE window. This window displaysthe blocks of the simulator or the external S7 PLC.You can now drag block OB1 into the ONLINE window. The block is transferred whenyou release the mouse key.

    Summary:At this point you have become acquainted with the different methods to transfer blocksto the target system.

    2.2.6 Monitor OB1

    Close the object window so that only OB1 is visible.If you have already closed OB1 you can redisplay it by pressing quick start button"Create OB1".

    OB1 may be monitored since it has already been transferred to the target system.

    User Manual WinPLC7 V4

    23

  • 5/24/2018 WinPLC7 V4 User Manual

    24/186

    After you have opened OB1, press the following mouse keys in the specified order:

    1)This button hides the block header to free up more space for the code section.

    2)This button displays a PIO bar. For example, you can use this to set the logical state of the inputs in the program to '1'.

    Note:This option is only available in simulator mode!

    3)This button (monitor) turns monitoring on.

    The display now appears as follows:

    In the PIO window (process image window), bits I0.5, I0.3 and I0.0 were set to '1' bymeans of the mouse.If you should now set the state of the inputs (I0.0 to I0.5) to '1' you will be able to seethe result in the networks.

    User Manual WinPLC7 V4

    24

  • 5/24/2018 WinPLC7 V4 User Manual

    25/186

    Note:When you click on the monitor-icon, the simulator is switched to RUN mode.If you have connected an S7 PLC, you would have to switch it to RUN mode via menuitemPLC->Operating mode.

    To turn off monitor mode, press the button with the glasses again or you can click quick

    start button "Monitoring off".

    User Manual WinPLC7 V4

    25

  • 5/24/2018 WinPLC7 V4 User Manual

    26/186

    2.2.7 Simulation of OB1 with the PLC mask simulation

    In simulator mode, a graphic representation of S7-300can be used to control theinputs and to monitor outputs.

    Start by defining the modules of the PLC mask simulation.

    Press quick start button PLC Mask Simulation.As a result a CPU module is displayed on screen:

    Right-click the CPU module with the mouse. Thisdisplays the context menu. Select a digital inputmodule (8 bit) and a digital output module (8 bit).Each address is preset to zero. Since we have onlyused inputs and outputs with byte address zero inOB1, we do not need to change them.A double-click on the modules address displays a

    configuration dialog box with a tab "Descriptions ofthe individual bits". Here you can enter the symbols.This means that the modules have been labeledautomatically.

    The resulting PLC-mask appears as follows:

    Fig.: PLC Mask Simulation with IB0 and QB0.

    To change the status of the inputs to '1' and '0', simply click on them with the mouse.The selected input module can be also be controlled by means of buttons '0' to '7' (forbits '0' to '7'). The selected module is highlighted in red.

    User Manual WinPLC7 V4

    26

  • 5/24/2018 WinPLC7 V4 User Manual

    27/186

    The PLC Mask Simulation can also display analog inputs and analog outputs.You can adjust an analog input by means of a slider. Analog outputs are displayed asbar graphs.The resolution and the span are adjusted by means of the configuration dialog that isaccessible by double-clicking the address of the module.

    Close the PLC Mask Simulation with a click on the red exit symbol located at the topright of the title bar.

    User Manual WinPLC7 V4

    27

  • 5/24/2018 WinPLC7 V4 User Manual

    28/186

    2.2.8 Status variable (monitor variable)

    Using the "Status variable", any number of addresses of the PLC can be monitored andcontrolled (modified).

    Press quick start button "Status variable" or select menu item View->Status variable.

    If you have not yet configured any variables an empty window will be displayed:

    Fig.: Empty window "Status/Modify variable"

    This window contains the following columns:

    Address The address that must be monitored or controlled.

    Format Select the format of the address

    Status value Indicates the current actual value of the PLC.

    Active (s tatus) The blue tick specifies whether the actual value should bedisplayed or not.

    Modify value Enter the target value that will be saved to the PLC.

    Active (modifyvalue)

    A red tick specifies whether the target value should be savedor not.

    Symbol Displays the respective symbol of the address (if it exists).

    Symbol comment Displays the symbol comment for the respective address (if itexists).

    User Manual WinPLC7 V4

    28

  • 5/24/2018 WinPLC7 V4 User Manual

    29/186

    The following figure shows the window with the available addresses:

    Fig.: Status variable window with different addresses

    When you press the button "Monitoring (permanent)" you can monitor addresses M10.0,M10.1 and M10.2 because you have activated these rows with a blue tick mark.

    Since address MW20 has a red tick mark it is set to W#16#FFFFwhen the button"Modify (permanent)" is pressed.

    Explanation of the buttons:

    Monitoring (permanent) Permanent monitoring of all selectedaddresses

    Monitoring (single) The actual value is read once from the PLCand displayed.

    Modify (permanent) The set-point value is transferred repeatedlyto the PLC.

    Modify (single) The set-point value is transferred once to thePLC.

    Duplicate (+) Duplicate current entry and increment theaddress

    Duplicate (-) Duplicate current entry and decrement theaddress

    Settings Displays the settings dialog.

    Important note:Buttons only refer to addresses that were selected by means of tick marks.

    User Manual WinPLC7 V4

    29

  • 5/24/2018 WinPLC7 V4 User Manual

    30/186

    Important editing operations:

    Insert rows Press the [Ins] keyor the menu item with the right mouse key

    Delete rows Select columns address to modified valueand press the [Del] key.

    Copy a row in to theclipboard

    [CTRL] + [C]

    Insert a row from theclipboard

    [CTRL] + [V]

    The object list displays all variable tables:

    Fig.: Object list with OB1 and a variable table

    You can open the object list of the Sub-projects with a double click or a right-click with

    the mouse.You can also create a status variable table in the object list using the context-sensitivemenu (right mouse key).

    2.3 Projects in WinPLC7 V4

    WinPLC7 refers to a project and a sub-project.A project contains one or more sub-projects. Every sub-project is an independent PLCprogram with icon file, variable tables, etc.

    Sub-projects are useful to save the different versions of a system.When a system consists of several different PLCs, all PLC programs can beencapsulated in a project.

    In WinPLC7 you can access a project using menu item "File->Open/Create project":

    User Manual WinPLC7 V4

    30

  • 5/24/2018 WinPLC7 V4 User Manual

    31/186

    The "Project Folder"In the dialog above is the location where all projects will be saved.You can change this using the [...] button.Every project is saved in a folder (directory) on the hard disk. Every sub-projectoccupies a separate subdirectory.

    When you open a project, the respective sub-projects are displayed in the left section ofWinPLC7:

    User Manual WinPLC7 V4

    31

  • 5/24/2018 WinPLC7 V4 User Manual

    32/186

    2.4 Creating, opening and deleting projects

    You can open and deleteWinPLC7 projects using menu item File->Open/Createproject:

    If you want to save a project with a different name, start by opening the project andcontinue with menu itemFile->Project save as.

    2.5 Creating, opening and deleting a sub-project

    You can manage sub-projects in the project manager that is displayed on the left side ofthe screen. Click the right mouse key to open the context-sensitive menu:

    Using the context-sensitive menu you can

    open, delete, rename and copysub-projects.

    You can also use the context-sensitivemenu to assign colors to everysub-project. The colors are then displayedin the block editor just below the title bar.This has many advantages when you openblocks of different sub-projects.

    User Manual WinPLC7 V4

    32

  • 5/24/2018 WinPLC7 V4 User Manual

    33/186

    2.6 Target: External or internal simulator

    WinPLC7 is provided with an integrated simulator that enables you to test PLCprograms without a hardware PLC.The selection that defines whether you will work with the simulator or with an external

    S7 PLC is entered under target:

    If you wish to work with the simulator select" Target: Simulator" .All the other parameters apply to an external S7 PLC:

    Target: RS232 PC and PLC are connected via MPI adapter serialor MPI adapter USB (with a virtual COM-port)

    Target: MHJ-Netlink PC and PLC are connected via the MHJ Netlinkadapter, Netlink-Lite or IBH-link.

    Target TCP/IP Direct PC and PLC are connected via a standardEthernet patch cable.

    Target: MHJ-Netlink TS PC and PLC are connected via the MHJ-Netlink

    adapter, Netlink-Lite, IBH-Link.Use this setting to establish the connection via theInternet.

    Target: NETLink-PROTCP/IP

    PC and PLC are connected via the Netlink-PROadapter.

    Target: SIMATIC-NET PC and PLC are connected via the Simatic

    Net-driver. With this setting you select theinterface by means of the PG/PC interface dialogof the Simaticmanager or the Teleservicesoftware V6.

    User Manual WinPLC7 V4

    33

  • 5/24/2018 WinPLC7 V4 User Manual

    34/186

    2.7 Importing and exporting a STEP7 project

    Import a SIEMENS STEP7 project as followsBefore you can import a project you must have opened a project in WinPLC7. Thedifferent blocks of the Siemens project are saved in the current sub-project.

    For this reason it is often advisable to create a new sub-project for the import.If the Siemens project is available in a ZIP file, you can use menu itemFile->Loadproject from ZIP file:

    Fig.: Importing a ZIP file

    Use the [...] button to select the ZIP file. The S7 programs are displayed in the list.Select an entry and press the "Start" button.Now the blocks of the project are displayed in a list. Select the blocks that you want toimport and press OK. All the selected blocks are imported into the current project.

    If you have already opened the STEP7 project (not in a ZIP file), select menu i temFile->Export->Import S7 project (S7P).

    With the file selection dialog, select the entry point of the STEP7 project: a file with thefile extension .S7P, .S7S or .S7L:

    Fig.: File selection dialog

    User Manual WinPLC7 V4

    34

  • 5/24/2018 WinPLC7 V4 User Manual

    35/186

    Export a SIEMENS STEP7 project as follows

    The following objects are exported:

    blocks

    symbol file

    comments

    If you wish to share the project, it is more convenient to save the SIEMENSproject in a ZIP file.Select menu itemFile->Save project as a ZIP file.

    Fig.: Save the sub-project as a ZIP file

    Start by selecting the sub-project that must be saved in the ZIP file. Select "S7" asformat, so that the ZIP file can be opened using SIEMENS STEP7. Press the "Start"button. A file selection dialog will be displayed where you can enter the directory for theZIP file.Save the current sub-project in an open (not a zipped) STEP7 project by selectingmenu item File->Export->Export S7 project (S7P):

    The dialog displays the path where the STEP7 project will be saved.Use the "Change" button to modify the path.In this case you can also create a ZIP file by placing a tick mark into "Save S7 projectas a ZIP file".

    User Manual WinPLC7 V4

    35

  • 5/24/2018 WinPLC7 V4 User Manual

    36/186

    2.8 Sending a project by e-mail

    Because a single project consists of many different files, you should save the project ina ZIP file. Then it is simple to send the complete project via e-mail.

    If the recipient works with the SIEMENS STEP

    7 software, you should generate a ZIPfile of the Siemens project. The previous paragraph describes how you can create sucha ZIP file.

    If the recipient also uses WinPLC7, you should choose menu itemFile->Save projectas ZIP fileand select formatWinPLC7 V2.The advantage is that you can pack multiple projects into the ZIP file.

    2.9 S7 program simulation

    You can turn the WinPLC7 simulator on by means of the target specification:

    Fig.: Simulator is turned on.

    If the simulator is on, all commands entered under menu item "PLC" refer to thesimulator (the software PLC).Since the simulator behaves like an external S7 PLC, you must complete the following

    steps to simulate a PLC program:

    1.Create a PLC program

    2.Transfer the PLC program (e.g. by means of the menu itemPLC->Transfer allblocks)

    3.Switch the simulator to RUN mode (e.g. by means of menu itemPLC->Operating mode)

    4. If no errors are detected in the PLC program, the simulator should now be in

    RUNmode:

    Fig.: Simulator is in RUN mode.

    User Manual WinPLC7 V4

    36

  • 5/24/2018 WinPLC7 V4 User Manual

    37/186

    In simulator mode you have many different options to monitor and to control the PLCprogram, i.e.:

    1.You can open a block tomonitorit (menu itemBlock->Monitoring On/Offor youcan click on the icon with the glasses)

    2.Display the PIO windows. These are small fields you can use to monitor inputs,outputs, bit memories, timers, counters, etc. You can control the inputs withmouse or the keyboard (numbers 0-7).You can switch the PIO windows on (and off again) via menu itemView->Process image window.

    3.The PLC Mask Simulationdisplays a S7-300-CPU. Here you can insertmodules and you can modify the addresses of the modules.You can also display analog inputs and analog outputs.

    4.The status variable windowenables you to monitor and control addresses.

    5. If an error occurs that causes the simulator to change to stop mode, you can

    determine the reason by means of the module state. The "Diagnostic" tabdisplays the most recent diagnostic messages. You can display the module statevia menu itemPLC->Module State.

    The memory size (RAM) of the simulator is 250 KB.

    The addressing ranges are: RangePr ocess i mage ( i nput ) 1024 ( Bi t ) I 0. 0 I 127. 7Process i mage ( out put ) 1024 ( Bi t ) Q0. 0 Q127. 7Bi t memory 4096 ( Bi t ) M0. 0 M511. 7

    Ti mer s 512 T0 T511Count er s 512 C0 C511Local dat a 1024 ( Byt e)

    The chapter on the software PLC of WinPLC7 contains all the relevant technical data.

    User Manual WinPLC7 V4

    37

  • 5/24/2018 WinPLC7 V4 User Manual

    38/186

    2.10 Connecting to a S7 PLC

    To be able to connect to an external S7 PLC the target must be set to External.The type of MPI interface depends on the target:

    MPI-Interface Target definitionSerial MPI-adapter Target: RS232

    USB MPI-adapter with a virtual COM-port Target: RS232

    GreenCablesupplied by VIPA, only suitable forVIPA-CPUs.

    Target: RS232The baud rate must be setto 38400.

    MHJ-Netlink, Netlink-Lite, IBH-Link Target: MHJ-Netlink

    NETLink-PRO TCP/IP Target: NETLink-PROTCP/IP

    Siemens MPI-Adapter 5.1 serial6ES7972-0CA23-0XA0

    Target: RS232

    Siemens MPI adapter USB (*)6ES7972-0CB20-0XA0

    Target: SIMATIC-NET

    Siemens TS adapter 5.2 serial6ES7972-0CA34-0XA0

    Target: SIMATIC-NET

    Siemens Notebook adapter CP55126GK1551-2AA0

    Target: SIMATIC-NET

    Siemens PCI adapter CP56116GK1561-1AA01

    Target: SIMATIC-NET

    Siemens Teleservice adapter II6ES7972-0CB35-0XA0

    Target: SIMATIC-NET

    Ethernet patch cable Target: TCP/IP direct

    (*) It is not possible to use "RS232" as target since this USB adapter does not provide avirtual COM port.

    When the target is "SIMATIC-NET", the "PG/PC interface dialog" of SIEMENS must beavailable on the PC.

    The respective start icon is located in the Windows control panel.This dialog exists when you have installed SIEMENS STEP7 or the SIEMENSTeleservice software.

    You can define the properties of the target by means of the [...] button located to theright of the target selection box:

    Fig.: [...] button for the targets

    User Manual WinPLC7 V4

    38

  • 5/24/2018 WinPLC7 V4 User Manual

    39/186

    Hints about the "RS232" target:

    The COM port number and the baud rate are very important for a successfulconnection:

    Fig.: Settings for the RS232 target

    The SIEMENS serial adapter only supports baud rates of 19200 and 38400. These

    baud rates selected by means of a micro switch on the interface.A connection is not possible if you should select the wrong baud rate.

    The serial adapters supplied by MHJ-Software and other vendors support all thepossible baud rates.

    USB adapters that support a with a virtual COM port usually provide a COM port no.that is >=4. The correct COM port number is displayed by the Windows device manager(Control Panle->System->Device manager).

    Hints regarding the targets "MHJ-Netlink, NETLink-PRO and TCP/IP direct" :

    It is important, that the IP address is accessible to the PC if the PLC must be controlledvia an IP address.I.e. the IP address of the PC must be located in the same subnet as the IP address ofthe PLC or the adapter.

    Using the ping commandyou can check whether the PLC is accessible via thespecified IP address.At the Windows command prompt, type:

    ping xxx (replace xxx with the IP address)

    If you do not receive an answer, then the IP address is bad, or the IP address is notaccessible from the PC.Solution: change the Netlink IP address or the IP address of the PC.

    User Manual WinPLC7 V4

    39

  • 5/24/2018 WinPLC7 V4 User Manual

    40/186

    2.11 Modifying the program in a S7 PLC

    You have two optionsto modify a block in the PLC:

    1.When the PLC program was also saved in a sub-project on the PC: Open the

    block in the sub-project. Modify the block and transfer it back to the PLC.2.Open the online window of the PLC, then open the block with a double-click.

    Modify the block and save it to the PLC.

    The first option is preferred:You have saved the PLCs program in a sub-project.When you have modified the block and transferred it back to the PLC, the blocks in thePLC and the project are identical.

    Since text is not savedto the PLC,no comments or original variable names are

    available.When you use this approach, the block is only modified in the PLC and not in thesub-project.

    Fig.: Opening an online block

    User Manual WinPLC7 V4

    40

  • 5/24/2018 WinPLC7 V4 User Manual

    41/186

    2.12 Creating a new S7 program

    You can create a new PLC program either in a new sub-project or in a new project.If the new PLC program belongs to the current project, create a new sub-project in theproject that you have opened currently:

    Click on the sub-projects with the rightmouse key.The context-sensitive menu is displayed.Select the entry: Create new sub-project.

    To create a completely new project, open menu item File->Open/Create a project:

    Press the "New project" button. You can enter the project name via the input dialog.When you have confirmed the project name, the new project is created on the hard disk(in the project folder).

    User Manual WinPLC7 V4

    41

  • 5/24/2018 WinPLC7 V4 User Manual

    42/186

    Then the new project is displayed as follows (in this case "NewProject112" was used asproject name):

    A sub-project with the same name as the parent project is created.To change this, click on the entry with the right mouse key and select "Renamesub-project".

    Every sub-project may include a stand-alone PLC program with symbols and hardwareconfiguration.You can create and manage additional sub-projects by means of the context-sensitive

    menu.

    Hint:You should use sub-projects to save the different versions of a system.Before you start with modifications, save the sub-project with a different name.(context-sensitive menu item Duplicate sub-project). This enables you to return tothe previous version at any time.

    User Manual WinPLC7 V4

    42

  • 5/24/2018 WinPLC7 V4 User Manual

    43/186

    3 Object list window (OFFLINE and ONLINE)

    The object list window serves to manage all the blocks, icon files, variable tables anddocumentation files of the current sub-project.

    Here you can open, rename and delete the objects. The object list window may refer tothe current sub-project (OFFLINE window), but also to the connected S7-PLC (ONLINEwindow).

    3.1 Open the object list window (OFFLINE)

    You can open the list window using of the context-sensitive menu of the project list:

    Fig.: Opening the context-sensitive menu

    You can also open theobject list window of thecurrent sub-project bymeans of the speed startbutton "View Object list".

    User Manual WinPLC7 V4

    43

  • 5/24/2018 WinPLC7 V4 User Manual

    44/186

    The object list window is displayed as follows:

    A double-click of the mouse opens the respective object.Use the right mouse key to display the context-sensitive menu:

    Fig.: The context-sensitive menu of the object list window

    The format of the context-sensitive menu changes, depending on the object that isselected. For example, the line "Transfer to PLC..." does not appear when you haveselected an icon file..

    3.2 Creating the documentation file

    You can also create a documentation file in the object list window. These include:

    WORD document

    EXCEL document

    ASCII file

    etc.

    You can create the documentation file using the context sensitive menu:

    Start by entering a file name and an extension.

    User Manual WinPLC7 V4

    44

  • 5/24/2018 WinPLC7 V4 User Manual

    45/186

    Fig.: Query for the file name

    It is very important that you enter the correct extension:

    Document File name extension

    WORD document .DOC or .DOCX

    EXCEL document .XLS or .XLSX

    ASCII file .TXT

    Fig.: important file extensions

    The file extension is arbitrary. In the table, a suitable icon identifies the file extensions.Unidentified file extensions are identified by a standard icon.

    When you execute a double-click on the icon, the Windows application that is linked tothis file extension is started.

    3.3 Creating a fi lter

    A filter limits the objects that are displayed in the list to the objects permitted by thefilter.For example, you could create a filter that will only display documentation files.You can create a new filter by pressing the "Filter" button:

    Fig.: Creating a filter forthe display

    In the next step you must define a name for the filter:

    Fig.: Defining the filter name

    User Manual WinPLC7 V4

    45

  • 5/24/2018 WinPLC7 V4 User Manual

    46/186

    Now you can specify the properties of the filter:

    Fig.: Specifying the properties of the filter,in this case the filter is limited to documentation files

    When you have confirmed the filter, it is selected immediately. Now you will only see

    documentation files in the display:

    Fig.: Active filter

    If you want to display all the objects again, select "" in the list of filters.

    User Manual WinPLC7 V4

    46

  • 5/24/2018 WinPLC7 V4 User Manual

    47/186

    3.4 Opening the object list window (ONLINE)

    The online object list windowdoes not show the blocks of the sub-project, but insteadit shows the blocksof the S7 automation system.

    To open the online window, select the entry "Target: ...", and click with the right mousekey. Select "View project content" in the context-sensitive menu:

    Fig.: Opening the online window

    Alternatively, you can also execute a double-click on the entry "Target: ...".

    The ONLINE object window is displayed with a colored background.

    The title bar also has a colored background:

    Fig.: The online window

    This is where the blocks that are contained in the S7 PLCare displayed.If you should modify any of these blocks, these changes are immediately applied to theS7 PLC:

    If you open OB1 with a double-click o f the mouse, modify it and then save it bymeans of CTRL+S, it will be transmitted immediately to the PLC.

    User Manual WinPLC7 V4

    47

  • 5/24/2018 WinPLC7 V4 User Manual

    48/186

    You have the following options when the ONLINE window is open:

    Open the block (double-click)

    Copying blocks from / to another offline project list window by "drag and drop".

    Delete blocks*

    Rename blocks*

    Request the properties of a block (context-sensitive menu)

    *: Caution:The PLC may change to STOP mode when you delete or rename blocks.

    User Manual WinPLC7 V4

    48

  • 5/24/2018 WinPLC7 V4 User Manual

    49/186

    4 Symbolic programming

    4.1 Absolute programming

    In absolute programming you are using employs absolute addresses (e.g. M50.0).This means that operands and addresses are immediately recognizable in the PLCprogram. However, the disadvantage is that the function behind an address is notvisible:

    Absolute programming:

    A I 124. 0A I 124. 1A I 124. 2= M 10. 0

    With comments included, this code becomes a lot clearer:

    A E 124. 0 / / door cl osedA E 124. 1 / / emergency- of f sequence okA E 124. 2 / / saf et y l i ght bar r i er= M 10. 0 / / saf et y chai n exi st s

    Advantages of absolute programming:The operand and the address of the operation are immediately visible.For instance, if you want to check the wiring, you can immediately compare the level atthe input module.

    Disadvantages of absolute addressing:The readability suffers, since the relationship to the process is not directly visible.This requires a manual comment.

    For this reason it is common practice to create an icon file so that the person viewingthe code can choose whether the symbols should be displayed or not.

    The next paragraph shows the same statements as a symbolic program.

    4.2 Symbolic programming

    Symbolic programming:

    A "door cl osed"A "emergency- of f chai n"A "saf et y l i ght bar r i er "= "saf ety chai n"

    These STL lines are easily readable without any comments. Symbols can be disabled atthe push of a button so that it is possible to display the absolute addresses as well.

    User Manual WinPLC7 V4

    49

  • 5/24/2018 WinPLC7 V4 User Manual

    50/186

    The symbol assignment is defined in the symbolic editor. Here every absolute addressis associated with a symbol.

    You can display the symbolic editor by opening View->Symbolic editor:

    Fig.: Empty symbolic editor

    When you enter the addresses and symbols, you should start in the address column.When you have specified a row, you can continue to add addresses quickly by meansof the mouse key [..+]:

    Symbolic editor with different entries:

    Fig.: Symbolic editor with four entries

    You can display the context-sensitive menu with a click of the right mouse key. Thismenu contains many different commands for the symbolic editor:

    insert row

    delete row

    search functions

    cross reference list of a symbol/address

    etc.

    User Manual WinPLC7 V4

    50

  • 5/24/2018 WinPLC7 V4 User Manual

    51/186

    The most important keyboard commands are:

    Key Description

    Ins Insert row

    Del Delete the selected row

    (columns 1-3 must be selected!)CTRL+C Copy the selected row into the clip board

    CTRL+V Insert a row from the clip board

    CTRL+S Save

    The cells of addresses or symbols that were duplicatedby mistake are highlighted incolor.This means that you can see possible errors before you save the icon file.

    The resulting STL network could be displayed as follows:

    Fig.: An STL network with symbols

    The absolute addresses are displayed to the right of the STL. All the symbols that wereused in the network are summarized below the network.

    You can use the mouse button to determine whether the summary of the symbols isdisplayed below each network:

    Fig.: Icon "View with symbolic information"

    It is also possible to include the network in the ladder diagram by pressing the LADswitch:

    Fig.: Network in LAD representation

    User Manual WinPLC7 V4

    51

  • 5/24/2018 WinPLC7 V4 User Manual

    52/186

    And here is the same network in FBD representation:

    Fig.: Network in FBD representation

    You can find all the settings regarding "symbols" in menu itemExtras->Settings, tab

    Symbolic settings

    Fig.: Symbolic settings

    User Manual WinPLC7 V4

    52

  • 5/24/2018 WinPLC7 V4 User Manual

    53/186

    5 Creating an FC, FB and DB

    The chapter "Quick Start" describes how to crate and program OB1. However, largerprograms require additional blocks to define the structure of the program.

    For this purpose, blocks of the type FC(function) and FB(function block) are provided.

    FCs and FBs are blocks that are accessible by means of a CALL statement.Block parameters can be used to transfer constants or addresses to the blocks. In thisway subroutines can be created that are supplied with different parameters as required.

    5.1 Creating an FC (function)

    Before you can call an FC or an FB it must first be created.

    Select menu item File-> Create new block to create a new block in the currentsub-project.As an alternative you can also create a new block using the context-sensitive menu inthe object list:

    Fig.: Creating a block using the context-sensitive menu

    In the dialog, specify the block that you wish to create:

    Fig.: We will crate block FC1

    User Manual WinPLC7 V4

    53

  • 5/24/2018 WinPLC7 V4 User Manual

    54/186

    The empty FC1 is displayed as follows:

    Fig.: The empty OB1

    Functions (FCs) can have the following block parameters:

    1. In parameters (IN)

    2.Out parameters (OUT)

    3. IN-OUT parameters (IN_OUT)4.Temp parameters

    These block parameters are declared in the so-called block header. This defines theaddresses or constants that can be transferred to the block.

    The so-calledTemp parameterswill not be transferred, but they are used as buffers bythe block.

    Every parameter has the properties "Name" and "Type". The respective initial value cannot be defined for FCs.

    Specifying the block parameters

    When you create a block parameter, start by defining the name. For instance, enter"Switch1" into the column "Name" and press the return key once. The cursor jumps tothe "TYPE" column. Here you may directly enter the type, or you can press theRETURN key again. In this case a list with all the available types will be displayed.You may either type "bool" or select "BOOL" in the list. Press the RETURN key again.The cursor jumps to the comment column. Enter a meaningful comment for theparameter.

    A row will be inserted when you press the RETURN key again. Now you can define thesecond input parameter:

    User Manual WinPLC7 V4

    54

  • 5/24/2018 WinPLC7 V4 User Manual

    55/186

    Fig.: Parameter "Switch1" was defined.

    At this point we will define parameter "Switch2" in the "IN" area followed by outputparameter "Lamp1":

    Fig.: The block header of FB1

    Make sure that you have defined Switch1 and Switch2 in the IN area. It often happens

    that an input parameter is unintentionally defined in the "OUT" area.

    Now you can use the parameters in the code of the block. For this purpose the "#"symbol must be entered at the start of each parameter.The network is created as a STL:

    A #Swi t ch1

    WinPLC7 is provided with an assistant. Enter the operation followed by a blank and ahash sign. Continue by pressing the RETURN key:

    A # - >pr ess RETURN

    User Manual WinPLC7 V4

    55

  • 5/24/2018 WinPLC7 V4 User Manual

    56/186

    As in the case of the symbols, a selection list will be displayed:

    Fig.: Selection list of block parameters

    Select "Switch1" and confirm the list by pressing RETURN. The parameter isimmediately transferred to the STL. Confirm the STL line again by pressing RETURN.Enter the following lines into network 1:

    A #Swi t ch1 A #Swi t ch2 = #Lamp1

    FC1 now looks as follows:

    Fig.: FC1 with network 1

    Now we have created a function with two input parameters and one output parameter.The purpose of this function is to turn the lamp on when both switches are pressed.We have only used the parameters in the code area. The advantage is that the functioncan easily be called several times in succession using different parameters.

    User Manual WinPLC7 V4

    56

  • 5/24/2018 WinPLC7 V4 User Manual

    57/186

    We now want to use (call) this function in OB1.For this purpose we open or create OB1 (menu itemView->Display OB1).

    Into network 1 we enter in STL:

    CALL FC1 - >pr ess RETURN

    The block parameters are inserted into the STL automatically:

    CALL FC 1 Swi t ch1: =I 0. 0 Swi t ch2: =I 0. 0 Lamp1: =Q0. 0

    The editor automatically inserts the standard addresses that you may now replace withthe required addresses.Modify the CALL statement as follows:

    CALL FC 1 Swi t ch1: =I0.0 Swi t ch2: =I0.1 Lamp1: =Q0.0

    Insert two new networks. For instance, press the quick start button "New network" orclick on menu itemEdit->Insert new network:

    Fig.: quick start button "New network"

    In the dialog select "Insert at the end of the block" and set the number of networks to becreated to "2":

    Fig.: Two new networks will be inserted.

    We adjust new Network 2 to "FBD" and network 3 we adjust to "LAD" representation.

    Click on the code area of network 2 with the mouse.

    User Manual WinPLC7 V4

    57

  • 5/24/2018 WinPLC7 V4 User Manual

    58/186

    Block must now appear as follows:

    In network 2 we now add FC1 to the function diagram.

    Open the node "FCs in the project" in thecatalogue. FC1 is displayed. Double-clickthe entry with the mouse or drag and drop

    FC1 into network 2.

    User Manual WinPLC7 V4

    58

  • 5/24/2018 WinPLC7 V4 User Manual

    59/186

    Now the call to FC1 is located in network 2:

    Fig.: FC1 was called

    Continue by replacing the question marks with addresses.Assign input I0.2 to parameter "Switch1", input "I0.3" to parameter "Switch2". Q0.1 isassigned to output parameter "Lamp1":

    Fig.: the "wired" FC1 call

    Note:FC1 still has one EN-input. If this input is not connected anywhere, the function willalways be called (same as in network 1),For instance, if you connect bit memory M10.0 to this input, then the function is onlycalled if the status of bit memory M10.0 is '1' (conditional call).

    In network 3 you can insert FC1 once more in the LAD representation:

    Fig.: Network 1 to 3

    At this stage we have called FC1 3 times in OB1 but each time with differentparameters. The status of output Q0.0 can be changed to '1' using inputs I0.0 and I0.1.

    User Manual WinPLC7 V4

    59

  • 5/24/2018 WinPLC7 V4 User Manual

    60/186

    I0.2 and I0.3 change the state of output Q0.1 to '1' and I0.4, I0.5 change output Q0.2 to'1'.

    Chapter 2 explained in detail how a program may be simulated; you can now alsosimulate this example:

    1.Load OB1 and FC1 into the software PLC2.Set the software PLC to RUN mode

    3.Test the program with the PLC mask, block status or process image window.

    5.2 Creating a FB (Function block) with the respective DB (datablock)

    In contrast to functions, function blocks require a data block where the block parameters

    are saved.Advantages when compared with a function: The contents of the parameters are not

    lost. An FB has another section in the block header: static local data.In this area you can declare variables that will still contain the same data during the nextcycle. This means that you can use this to save data permanently.

    For the following example we will create a new sub-project with the name"Counter" .Right-click the project window with the mouse and select menu item "Create newsub-project".

    You can create a FB like a FC using menu itemFile->Create new block:

    Fig.: We will crate block FB1

    The empty FB is displayed as follows:

    User Manual WinPLC7 V4

    60

  • 5/24/2018 WinPLC7 V4 User Manual

    61/186

    Fig.: The empty FB1

    The block header contains the declaration area "VAR". This area is only available forfunction blocks (FB).

    As an example we want to program a counter that can count from 0 to 0xFFFFFFFF.

    This counter requires the following inputs:

    Parameter Type Explanation

    CU BOOL When a rising edge is applied to this parameter the counter is incremented by 1.

    Reset BOOL When a '1' is applied to this input the counter isreset

    The counter requires the following outputs:

    Parameter Type Explanation

    Q DWORD Returns the current count

    The respective block header of our FB must look as follows:

    Fig.: The block header of FB1

    User Manual WinPLC7 V4

    61

  • 5/24/2018 WinPLC7 V4 User Manual

    62/186

    The counter in network 1is reset when the status of parameter "Reset" is '1':

    In network 2the count is checked whether it has reached the maximum value. If this istrue, the routine exits from the block with the "BEB" statement.

    In network 3the counter is incremented by 1 when a Hi-edge is applied to the ZV-input:In network 3 the variable #EdgeFlag is required to detect the edge. This is created inthe static area of the block header:

    Fig.: New block header of FB1

    The contents of network 3:

    This completes FB1 and it can now be used in OB1.We insert a new network at the start of OB1 by using menu itemEdit->Insert new network.

    User Manual WinPLC7 V4

    62

  • 5/24/2018 WinPLC7 V4 User Manual

    63/186

    In the FBD representation, FB1 is inserted by means of the catalog (node FBs in theproject):

    Fig.: A new FB1 was inserted.

    Above the block you must insert a DB; enter "DB1" here.Parameter "ZV" is assigned to E1.0 and the "Reset" input assigned to E1.1.The Q-output is assigned to MD10:

    The completed FB1 is displayed as follows:

    Fig.: The completed FB1.

    Now you can simulate the program:

    1.Transfer all the components into the simulator (menu itemPLC->Transfer allblocks)

    2.Switch the simulator to RUN mode (menu item PLC->Operating mode)3.Turn on the block status of OB1 (menu item Block->Monitoring on/off)

    4.Enable the process image window (menu item View->Process image Window)

    5.Change E1.0 to '1', the counter is incremented (MD10)

    The data block that is specified in the CALL is also referred to as instance data block.

    The instance data block has the same block header as the respective function block.

    If you want to issue the call to FB1 at another location in OB1, you must specifyanother data block; otherwise the edge detection would not function properly.

    User Manual WinPLC7 V4

    63

  • 5/24/2018 WinPLC7 V4 User Manual

    64/186

    You can create an instance data block using menu item "File->Create new block.

    If a DB is specified in this case, you will have to specify whether an instance data block(data block with associated function block) or a global data block (data block) should becreated:

    Fig.: Create a new data block

    User Manual WinPLC7 V4

    64

  • 5/24/2018 WinPLC7 V4 User Manual

    65/186

    6 Creating a global data block

    Global data blocks serve as a global storage area that can be accessed by all otherblocks.

    The organization or the structure of a global data block is defined in the block header.Here you can define bits, bytes, words, double words, arrays and structures.

    You can create a global data block usingFile->Create new block:

    Fig.: We will crate DB10 Fig.: A data block (global data block) will be created

    The empty DB is displayed as follows:

    Fig.: DB10 after creation

    The window of the data block is dividedinto two areas. The top half shows thedeclaration section. This section defines the structure of the data block. The bottomhalf is the section containing the actual values. This displays the real content of thedata block. The address of the variables is displayed on the left side of the actualvalues. You must use this address if you want to access on the variable directly (withoutvariable name).

    You can only modify the section at the top. The actual values are always updated whenthe block is being saved.

    The default parameter of the DB is a byte variable with the name "b0". This can bedeleted or be renamed.

    User Manual WinPLC7 V4

    65

  • 5/24/2018 WinPLC7 V4 User Manual

    66/186

    To insert a row.Position the cursor in the leftmost column and then press the [Ins] button.

    To delete a row.Position the cursor in the leftmost column and then press the [Del] button.

    Fig.: The leftmost column is selected.

    Alternatively you can also press the right mouse key. As a result a context-menu isdisplayed. Here you can also insert and delete rows.

    Edit this block header in the same way as you edited the block header of a normalblock:When you acknowledgement a columnwith the RETURN keythe cursor automaticallyjumps to the next column.If you acknowledge the last column with a RETURN a new row is inserted and thecursor jumps to the "Name" column.

    In the following example three variables have been created in DB10:

    Delay_ms (DWORD)

    Duration_ms (DWORD)

    A1 (Array)

    Fig.: DB10

    You can gain access to the variable in a block (OB, FB, FC) as follows:

    L DB10. Del ay_msL DB10. Durat i on_msL DB10. A1[ 1]

    User Manual WinPLC7 V4

    66

  • 5/24/2018 WinPLC7 V4 User Manual

    67/186

    When you select the variable you can also write using the block editor:

    L DB10. - - > press RETURN

    All the variables of DB10 are displayed in a list and you can insert the required variable

    into the editor by means of the RETURN key.Instead of the variable names you can also access the bytes of the DB directly:

    L DB10. DBD0 / / access t o Del ay_msL DB10. DBD4 / / access t o Durat i on_msL DB10. DBB8 / / access t o A1[ 1]L DB10. DBB9 / / access t o A1[ 2]

    If a data block is loaded from a PLC when the original project no longer exists, then thevariable names are replaced with standard names.

    The following DB10 is identical to the one on the last page. However, in this case theoriginal names were replaced by standard names:

    Fig.: DB10 loaded from the PLC with standard names

    6.1 Change actual values to initial values

    The button "Change actual values to initial values" is located to the right of the actualvalues.If you press this button, the actual values (lower section of the window) are replaced bythe initial values from the block header.

    This may become necessary if you load a data block from a PLC and you want torestore the saved values of the DB to their original state.

    User Manual WinPLC7 V4

    67

  • 5/24/2018 WinPLC7 V4 User Manual

    68/186

    7 Loading and testing the program

    This chapter explains how a PLC program is loaded into the S7 PLC and how it may betested.

    7.1 Establishing an online connectionFirst, the target must be defined correctly to enable the connection to the PLC.The target settings depend on the MPI interface being used:

    Fig.: Target selection

    The following target table contains information about the target that you must select.

    MPI-Interface Target definition:

    Serial MPI-adapter Target: RS232

    USB MPI-adapter with a virtual COM-port Target: RS232

    GreenCablesupplied by VIPA, only suitable for

    VIPA-CPUs.

    Target: RS232The baud rate must be set to

    38400.MHJ-Netlink, Netlink-Lite, IBH-Link Target: MHJ-Netlink

    NETLink-PRO TCP/IP Target: NETLink-PRO TCP/IP

    SIEMENS MPI-adapter 5.1 serial6ES7972-0CA23-0XA0

    Target: RS232

    SIEMENS MPI-adapter USB (*)6ES7972-0CB20-0XA0

    Target: SIMATIC-NET

    SIEMENS TS-adapter 5.2 serial6ES7972-0CA34-0XA0

    Target: SIMATIC-NET

    Siemens Notebook adapter CP55126GK1551-2AA0

    Target: SIMATIC-NET

    Siemens PCI adapter CP56116GK1561-1AA01

    Target: SIMATIC-NET

    Siemens Teleservice adapter II6ES7972-0CB35-0XA0

    Target: SIMATIC-NET

    Ethernet patch cable Target: direct TCP/IP

    When "SIMATIC-NET" is used as the target, the "PG/PC interface dialog" of SIEMENSmust be available on the PC.The respective start icon is located in the Windows control panel.This dialog is available when you have installed SIEMENS STEP7 or the SIEMENSTeleservice software.

    User Manual WinPLC7 V4

    68

  • 5/24/2018 WinPLC7 V4 User Manual

    69/186

    You can define the properties of the target by means of the [...] button located to theright of the target selection box:

    Fig.: [...] t arget button

    7.2 Loading the program into the target system

    When you have selected andconfigured the "target" correctly you can access the S7PLC.

    You can use menu itemPLC->Module State(hotkey = CTRL + D) to verify whether aconnection with the S7 CPU is possible or not.

    Several possibilities exist to transfer blocks into the PLC:

    Menu itemPLC->Send active blocktransfers the block that was opened and that is active.

    Menu itemPLC->Send blocksdisplays a list where you can select the blocks that should be transferred.

    Menu itemPLC->Send all blockstransfers all the blocks in the current sub-project.

    Blocks displayed in the "OFFLINE object list" window can be transferred by"drag and drop" into the "ONLINE object list" window.

    The "PC->PLC" transfer dialog is always displayed when you send blocks. Here youcan verify that every component was transmitted correctly:

    Fig.: Verification dialog when sending blocks

    User Manual WinPLC7 V4

    69

  • 5/24/2018 WinPLC7 V4 User Manual

    70/186

    How to display the online and the offline object list windows:

    Fig.: you can use the context-sensitive menuto display the ONLINE object list window.

    Fig.: can use the context-sensitive menuto display the OFFLINE object list window.

    7.3 Changing the PLC to RUN mode

    You can control the PLC to change to RUN mode via menu itemPLC->Operating mode.If the PLC does notchange to