Sucosoft s40 User Interface h1305 [PDF]

  • 0 0 0
  • Suka dengan makalah ini dan mengunduhnya? Anda bisa menerbitkan file PDF Anda sendiri secara online secara gratis dalam beberapa menit saja! Sign Up
File loading please wait...
Citation preview

User Interface Sucosoft S40 Programming Software



07/01 AWB2700-1305-GB 1st edition 12/97 2nd edition 06/98 3rd edition 06/98 4th edition 07/99 5th edition 05/00 6th edition 07/01 See list of revisions on inside rear cover © Moeller GmbH, Bonn Author: Arno Dielmann Editor: Thomas Kracht Translator: Terence Osborn



All brand and product names are trademarks or registered trademarks of the owner concerned. All rights reserved, including those of the translation. No part of this manual may be reproduced in any form (printed, photocopy, microfilm or any otherprocess) or processed, duplicated or distributed by means of electronic systems without written permission of Moeller GmbH, Bonn. Subject to alterations without notice.



07/01 AWB2700-1305-GB



Contents



Introduction



7



1 NAVIGATOR Getting to know the NAVIGATOR – Introduction – The NAVIGATOR user interface – Incorporating other applications in the NAVIGATOR – Importing additional libraries – Changing dialog language – Font and colour setting – NAVIGATOR settings – POU Editor settings Project management – Introduction – Source file and device view – Options – Creating a new project – Opening existing projects – Deleting a project – Copying projects – Renaming projects – Saving projects – Restoring projects – Exporting/importing sources – Registering sources – Printer Setting – Printing – POU information Program code generation – Introduction – Selecting PLC type – Creating a new make file – Setting program parameters – Selecting make files – Generating program code – Aborting program code generation



9 9 9 9 13 16 17 17 18 18 19 19 19 22 23 27 28 29 31 31 33 36 39 39 40 41 42 42 43 44 46 61 62 64 1



Contents – Creating a cross-reference file 64 – Program properties 65 Using libraries 67 – Introduction 67 – Library view 68 – Importing or deleting libraries 69 – Creating a library 71 – Using a library 71 – Activating and deactivating library modules 72 – Editing of library modules at a later time 72 – Saving libraries 73 – Restoring a library 73 – Information on libraries 74 – Library properties 75 Importing S30 programs 76 – Structure of the S30 program source 76 – Type of conversion 77 – Conversion procedure 78 – Program adaptions during conversion 79 – S30-S316: conversion restrictions 80 – S30-S3: conversion restrictions 84 – S30-S4: conversion restrictions 84



2



85 85 86 86 86 87 88 88 89 90 91 92 98 99 100 102



07/01 AWB2700-1305-GB



2 POU Editor Overview – Program type POU – Function block POU – Function type POU – Structure of a POU – Primary functions of the POU Editor: Declaration of variables – Starting the POU Editor User interface of the POU Editor – Declaration section – Instruction section – Menu bar – Standard toolbar – Language elements toolbar – Output window Variables declaration



Contents



07/01 AWB2700-1305-GB



– Scopes for variables 103 – Declaring variables 106 Programming in IL 121 – Overview 121 – Creating a POU in IL 121 Programming in ST 127 – Overview 127 – Creating a new POU in ST 128 Programming in LD 132 – Overview 132 – Creating a new POU in LD 135 – Editing POUs in LD 138 Programming in FBD 149 – Overview 149 – Creating a new POU in FBD 153 – Editing POUs in FBD 158 Changing programming language 175 – Conditional function block call 176 – Intermediate storage within an IL sequence 178 – Line-oriented comments 180 POU Info 182 Converting POU types 183 Opening/editing global types 185 Cross-reference file 186 3 Topology Configurator (Offline) Basic principles – Structure – Offline mode – Plausibility checks – Starting the Topology Configurator – Network types Operations – Toolbar functions – Changing a topology configuration Topology configuration with Suconet K – Topology configuration – Device configuration – Addressing the slaves



187 187 187 187 188 189 190 193 193 203 206 206 206 210



3



Contents



4



07/01 AWB2700-1305-GB



– Master - slave operation with Remote control 211 – Special note with PS4-101-DD1 and PS4-111-DR1 213 – Special note with PS4-300 214 – Special note with PS416 217 Topology configuration with AS-Interface® 219 Topology configuration with PROFIBUS-DP 220 – Deviations between current and saved DP configuration 221 – Accessing the I/O of a PROFIBUS-DP slave 221 – Syntax check of access addresses for PROFIBUS-DP slaves 221 – Maximum number of modules per slave 222 – Behaviour of the DDK or KOM diagnostics bits 222 – Changing the DP configuration with CFG-DP 223 – Startup of a PROFIBUS-DP line of the PS416 modular PLC 223 Configuration examples 224 – Example with a local configuration (PS4-200) 224 – Example with PS4-300 228 – Example with PS416 244 – Example with AS-Interface®network (PS4-200 256 – Example with PROFIBUS-DP network (PS416-CPU-300) 262 – Complex configuration example (PS416-CPU-400) 268 – Example with multi-processing operation 271



07/01 AWB2700-1305-GB



Contents 4 Form Editor Overview User interface – Toolbar – Menu bar Functions of the Form Editor – Designing a new print form – Editing an existing standard print form – Using a new print form for a project printout



281 281 281 282 283 284 285 291



5 Test & Commissioning Overview User interface – Menu bar – Toolbar Commissioning – Overview of programming connections – Point-to-point programming connection (directly to the PLC) – Multidrop programming connections – Programming connection via modem – Programming via Suconet K – Connecting and disconnecting a PLC – Wiring test – Transferring the operating system – Transferring the program – Starting programs System diagnostics – CPU status – CPU diagnostics – Program status – Network diagnostics Program test – Overview – Switching the POU Editor to online mode – Test POU – Modifying POUs online – Quitting the online POU Editor – Configuring the AS-Interface®network online



295 295 297 299 303 311 313



293



313 315 316 334 341 343 349 352 357 361 361 366 374 379 384 384 385 387 396 403 403 5



Contents Appendix 417 Modem operation 417 – Modem requirements 417 – Frequently asked questions and problems relating to modems 417 – Overview of the most important Hayes compatible AT commands 420 – V.24 interface cable for modem operation 421 – Connecting the PLC with the PLC modem 422 – Configuration example using ke modems LOGEM 928 and LOGEM LGH 28.8D1 423 – Configuration example using the Westermo modem TD-32 424 – Initialise via remove configuration using a Logem 928 ke modem 426 Using several PS416-CPUs 427 – Configuring a PS416 system 427 – Assigning local inputs and outputs 428 – Addressing remote I/O via Suconet K 430 – Programming master and slave CPU 430 Glossary 431 Shortcuts 437



6



439



07/01 AWB2700-1305-GB



Index



Introduction



The two reference manuals Sucosoft S40 User Interface and Sucosoft S40 Language Elements are part of the Sucosoft S40 programming software. The Sucosoft S40 User Interface reference manual gives a complete description of the software package, its functions and how to use all Sucosoft tools. All the necessary steps up to the finished program are described. The reference manual Sucosoft S40, Language Elements contains definitions, Sucosoft language elements and programming features for all PLC types which can be programmed with Sucosoft S40. Sucosoft provides specific test and commissioning tools for every Sucosoft device type. These tools vary depending on application in either PS4 or PS416 controllers. The differences are indicated by means of headings or footnotes in the reference manual. “PS4-200” refers to PS4-201-MM1, PS4-271-MM1, PS4-151-MM1, and PS4-141-MM1 controllers. “PS4-300” stands for the PS4-341-MM1 controller. “PS416” includes all types of CPUs, i.e. CPU-200, CPU-300 and CPU-400.



07/01 AWB2700-1305-GB



The user interface is a standard Windows interface.



7



07/01 AWB2700-1305-GB



8



1



Getting to know the NAVIGATOR



NAVIGATOR



Introduction The NAVIGATOR will assist you with all tasks involving the organisation of Sucosoft S40 software and the generation of projects. It provides support for all necessary organisational tasks, consistently manages project-related information and enables you to create executable, PLC-specific program code. The NAVIGATOR furthermore allows you the ability to import function blocks and functions in the form of PLC-specific libraries. This supports standardisation and thereby shortens the time required for program development.



The NAVIGATOR user interface



07/01 AWB2700-1305-GB



The NAVIGATOR user interface is bordered on the top by the title bar and by the status bar on the bottom. The title bar displays the project name, and the status bar includes the name of the project folder. The menu bar appears under the title bar, followed by the toolbar, and then the Sucosoft toolbar. The working area located between them is divided into three windows.



9



NAVIGATOR



Figure 1: The NAVIGATOR User Interface



The upper left window (browser window) contains the “tree structure window”, displaying the respective folders. The bottom of this window is made up of the four file card tabs: Sources, Devices, Libraries and Options. The right-hand window shows the view of the file structure. Underneath these windows is the Output window in which status and error messages are shown that may, for example, be output during program code generation.



10



07/01 AWB2700-1305-GB



The division of these windows is fixed. Only the horizontal and vertical size of the windows can be altered by dragging the window margins with the mouse.



Getting to know the NAVIGATOR Menu bar The following menus are provided in addition to the standard Edit, View, Window and Help menus: “Project” for editing new or existing S40 projects. “File” for editing objects selected in the browser and file window, “Generate” for creating executable program codes. “Tools” for implementing Sucosoft Tools or integrated Windows applications, and “Options” for importing and deleting additional libraries, for incorporating Windows applications and for setting up the NAVIGATOR environment to your particular requirements. Toolbar As well as function buttons for project management and program code generation tasks, the toolbars also provide list functions for selecting make files and PLC types.



Figure 2: Toolbar buttons for project management



07/01 AWB2700-1305-GB



Figure 3: Functions in the program code generation toolbar



11



NAVIGATOR Sucosoft toolbar The Sucosoft toolbar initially contains the four Sucosoft project tools that are also available in the Tools menu. To these toolbars can also be added buttons for starting Windows applications, see section “Incorporating other applications in the NAVIGATOR” on Page 13.



Figure 4: Toolbar buttons



Sucosoft S40 tools include: POU Editor. Here you can create the source files of your programs. Test & Commissioning. With this tool you can transfer your program to the PLC for testing. Form Editor. This tool enables you to view and edit standard forms for printing files. Topology Configurator. Here you can define the hardware configuration and set the device parameters. Status bar As in other Sucosoft S40 tools, the left section of the status bar displays the function of an activated button, the progress display when creating a make file or when generating program code, and the result of this generation.



The section in between shows the line, in which the cursor is located in the output window.



12



07/01 AWB2700-1305-GB



The right section of the status bar displays the path to the directory in which the opened project is located.



Getting to know the NAVIGATOR Context menus The context menus contain the most important commands for a selected object. They are opened by right clicking the selected object or window. The content of the context menu depends on where the mouse was activated and the selected object.



Incorporating other applications in the NAVIGATOR To start frequently-used Windows applications easily you can integrate the appropriate tool button into the NAVIGATOR Sucosoft toolbar.



Figure 5: Sucosoft toolbar (before)



Requirement: This is a windows application. 왘 Click Options ➞ Add Tools...



07/01 AWB2700-1305-GB



The Add/Delete Tools dialog will open.



Figure 6: Add/Delete Tools dialog.



13



NAVIGATOR 왘 In the Command Line field enter the name of the executable program together with its directory and path data, in addition to the entry in the Menu Text field. Alternatively you can click the “...” button next to the command line to search for the required application. This will activate the Open dialog.



왘 Select the desired application and accept it by clicking Open. The selected application will be transferred into the Menu Text and Command Line fields of the Add/ Remove Tools window.



After clicking Add, the new application is added to the list of tools in the Add/Remove Tools window and the new icon will be inserted in the Sucosoft toolbar.



14



07/01 AWB2700-1305-GB



You can then specify call arguments for the application concerned.



Getting to know the NAVIGATOR



Figure 7: New application







The Up and Down buttons can be used to change the order of the tools in the toolbar.



Figure 8: Sucosoft toolbar (after)



07/01 AWB2700-1305-GB



You can also use Options ➞ Tools... to remove applications from the NAVIGATOR's Sucosoft toolbar.



15



NAVIGATOR Importing additional libraries The Import Library option is available via Options ➞ Library ➞ Import or via the Import Library button. Importing libraries



This allows you to transfer additional libraries previously created with the help of the Library Manager. Compared to using the source text of function blocks and functions, the use of function blocks and functions in library format has the advantage that the time required for compiling them is no longer necessary, and they can be considered to be error-free without the need for further testing. Such libraries vary according to the type of PLC and are accessible for all projects.



16



07/01 AWB2700-1305-GB



Further information on creating these libraries is available in the online documentation “Library Manager” (AWB-C 2700-1366 GB). Information on the use of libraries is available in the section “Using libraries” on Page 67.



Getting to know the NAVIGATOR Changing dialog language Sucosoft S40 is available in German, English, French, Spanish and Italian. During installation you indicated which of these languages you wished to install and which language you wished to use. You can choose among the installed languages: 왘 Select the required dialog language via Options ➞ Dialog Language. Sucosoft S40 will convert to the selected language and will automatically restart.



Font and colour setting You can make font settings in the NAVIGATOR output window and in the POU Editor using the fields provided under the Font tab in Options ➞ Settings.... As well as defining the font, you can also set the colour of different outputs in the NAVIGATOR and syntax elements in the Editor. These settings can then be saved as a particular Scheme.



07/01 AWB2700-1305-GB







The font styles Italic, Bold and Bold Italic are not supported in the Editor.



17



NAVIGATOR NAVIGATOR settings You can define the behaviour of the NAVIGATOR when printing projects via the Print tab in Options ➞ Settings.... Other settings for the behaviour of the NAVIGATOR are available in the Others tab in Options ➞ Settings....



POU Editor settings



18



07/01 AWB2700-1305-GB



You can define the behaviour of the Editor when creating source files via the Editor tab in Options ➞ Settings....



Project management Project management



Introduction The NAVIGATOR contains the Sucosoft S40 Project Manager. This is used to organise all the necessary folders when you create a new project.







The Project Manager cannot be replaced by other file management programs such as File Manager or Explorer. Source files that are copied with a different tool to the Project Manager or created with different editors can be imported and registered in a project at a later time, see section “Exporting/importing sources” on Page 36 and “Registering sources” on Page 39.



Source file and device view The content of the Tree Structure and File Structure windows depends on whether you have activated the source or device display, i.e. the file card tabs Sources or Devices. Clicking the Sources, tab will cause the tree structure window to show the Sources tree structure. At the same time the source files (POUs) and topology files belonging to the project will be shown in the file structure window.



07/01 AWB2700-1305-GB



Double-click on one of these files to open the Sucosoft S40 Tool that they are associated with.



19



NAVIGATOR



Figure 9: The NAVIGATOR user interface with source file tree



The context menu (right mouse button) or File ➞ New, File ➞ Rename, and Edit ➞ Delete can be used for creating, renaming or deleting subfolders in the source file tree structure. Before you start to create your project files, make sure that the correct type of PLC is selected. This is displayed and selected in a selection window in the NAVIGATOR toolbar. This selection also affects the POU Editor since the data types as well as manufacturer-defined function blocks and functions offered there depend on the controller selected.



Figure 10: Selection window for PLC type



20



07/01 AWB2700-1305-GB







Project management After the Devices file card tab has been clicked, the tree structure window will show the three currently supported groups of “PS416”, “PS4-300” and “PS4-200” PLC types as subfolders (see section “Selecting PLC type” on Page 43).



Figure 11: The NAVIGATOR user interface with the device tree structure



You will not be able to create any further subfolders. If you select one of the three subfolders or have selected the corresponding PLC type in the toolbar selection window, the make files and executable user programs available for this PLC type will be displayed in the file structure window.



07/01 AWB2700-1305-GB



Double-clicking a program code file (executable user program) will open the Sucosoft S40 Test & Commissioning tool.



21



NAVIGATOR Options Clicking the Options file card tab will cause the tree structure window to display the Options folder, in which you can store any documents that you wish to store in your project. To do this use Windows Explorer to drag the file concerned into the file structure window of the Navigator or add it to the Navigator via Edit ➞ Paste. The document can now be opened in the appropriate application by doubleclicking from the file structure window or via the context menu. When saving or restoring a project, the Options folder will be included if this has been set on the Others tab via Options ➞ Settings....



22



07/01 AWB2700-1305-GB



Other subfolders can also be created in the Options folder.



Project management Creating a new project Choose Project ➞ New... or click the corresponding button to create a new project. New Project button



This opens the Create New Project dialog:



Figure 12: Create new project dialog



07/01 AWB2700-1305-GB



왘 First select one of the drives suggested. If you wish to create your project in a subfolder not yet created: 왘 Click the New Folder button and enter the name of the new folder in the New Folder dialog. Confirm the entry with the OK button.



23



NAVIGATOR The OK button will be made available if the project name entered does not already exist as a folder, does not contain any impermissible special characters and is not more than 32 characters long. 왘 Finally, enter the name of the folder for the new project into the New Project Folder entry field. Confirm the entry with the OK button. Sucosoft S40 will set up a project structure with the folders Devices and Source. The name of the open project will be displayed in the title bar, and the project directory, with path data if applicable, will be displayed in the status bar.



24



07/01 AWB2700-1305-GB







Clicking the respective Sources or Devices tab will display in the folder window the files produced during the project in the Source folder (topology files and POUs) or in the Devices folder (make files and loadable application programs).



Project management Source This folder stores all the project files that you create in the POU Editor or in the Topology Configurator. All the files you save are automatically registered by the Navigator under the current project. All topology and POU (program, function, and function block) files are therefore displayed in the file structure window on the right. The Topology Configurator or POU Editor icon in front of the file name allows you to arrange and locate the file types quickly. You can find additional information on the type of POU in the Type column. Other columns show you the size of the file, when it was last modified, and registration status. You can sort the files according to name, type and modification date by clicking the appropriate column header. How to view POU related information is described in section “POU information” on Page 41.



07/01 AWB2700-1305-GB



If you have created Source subfolders, these will be offered as destination folders in addition to Source when you save a POU in the POU Editor.



25



NAVIGATOR Devices All controller-specific files related to the project are stored in this folder. Device folders PS416, PS4-300 and PS4-200 are sub-filed in the Devices tree structure window on the left. After selecting the appropriate folder for the PLC type required, PS416 for example, you will see the make file created and the program code files in the file structure window. The structure and content of the tree structure window are preset and cannot be modified. When you generate a program code file, Sucosoft S40 creates a subfolder for the folder of the corresponding PLC type, identified by the name of the make file belonging to it. If you select this additional subfolder, all files logically connected to the make file will be displayed in the file structure window on the right. In this subfolder you can use the context menu to print, delete or view the properties of program POUs or program code files. Further information on this is provided in the section “Program properties” on page Page 65.



26



07/01 AWB2700-1305-GB



Starting with a double-click in the file structure you can navigate between project-related files and Sucosoft S40 Tools, starting Test & Commissioning, for example. In addition, you can start a print or delete task in this window for each individuallyselected make file via the context menu.



Project management Opening existing projects You can open an existing project by means of the menu item Project ➞ Open... or with the corresponding button. Open Project button



The Open Existing Project dialog window will open:



07/01 AWB2700-1305-GB



Figure 13: Open Existing Project dialog



왘 Select the desired project name and then click the Open button.



27



NAVIGATOR If the desired project is not listed in the tree structure of the dialog window: 왘 Click the Browse... button. 왘 Now select the desired project folder in the Open Existing Project window. 왘 Confirm the selection with the OK button. The OK button is only made available if the selected project folder can be processed by the NAVIGATOR, i.e. it must be a Sucosoft S40 project folder.







Older S40 projects will be automatically converted to the current version and all relevant data will be transferred. The converted project will then no longer be capable of being edited with the older Sucosoft S40 version.



Deleting a project Requirement: The project must be open. 왘 Choose Project ➞ Delete. The open project will be deleted directly, or after a confirmation, depending on the setting in Options ➞ Options ➞ Deletion ➞ Confirm. This latter option is the default setting.



28



Confirm this task only when you are certain that the project does not contain any files that you still need!



07/01 AWB2700-1305-GB







Project management Copying projects Requirement: The project must be open. Copying a project is carried out by choosing Project ➞ Copy... or with the corresponding button. Copy button



The Copy Current Project To dialog window will open:



07/01 AWB2700-1305-GB



Figure 14: Copy Project dialog



29



NAVIGATOR 왘 Change the drive, if necessary, and select the existing destination folder for the new project in the tree structure view of the Copy Current Project To dialog window. 왘 Enter the project name in the New Project Name entry field and confirm with the OK button. If you are just now going to create the folder for the project to be copied: 왘 Click on the New Folder button in the Copy Current Project To dialog window, then enter the new folder name in the new folder dialog window. Confirm the entry with the OK button. 왘 Finally, enter the project name in the New Project Name entry field and confirm with the OK button. Upon completion of copying, you will receive the corresponding report in the status bar.



30



07/01 AWB2700-1305-GB







Copying projects to standard disk drives is not possible. Projects can, however, be saved. Information on how to save a project is provided in section “Saving projects” on Page 31.



Project management Renaming projects Requirement: The project must be open. 왘 Choose Project ➞ Rename.... The Rename Project dialog window will open:



Figure 15: Rename project dialog



왘 Enter the new project name into the entry field and then click the OK button. The new project name appears in the title bar.



Saving projects You can save a project in compressed form via the menu item Project ➞ Save..., or by clicking the corresponding button. If the project to be saved contains imported libraries, read the section “Saving libraries” on Page 73.



07/01 AWB2700-1305-GB



Save Project button



31



NAVIGATOR The Save Current Project To dialog window will open.



Figure 16: Save Project dialog



왘 Choose the drive and select the existing destination folder for the saved project in the tree structure of the Save Current Project To dialog window.



왘 Enter a cross in the Only Sources check box to reduce the space requirements. 왘 Confirm with the OK button.



32



07/01 AWB2700-1305-GB



You can reduce the space needed in the saving medium by saving only project files from the Sources folder.



Project management You can observe the progress of saving in the status bar. The entire project is saved in ZIP format in the destination folder under the project name with the extension ZIP. If you are just now going to create the folder for the material to be saved: 왘 Click the New Folder button in the Save Current Project To dialog window, then enter the new folder name in the New Folder dialog window. Confirm the entry with the OK button. 왘 Save the project as described above.



Restoring projects You can restore a saved project to a destination drive by choosing Project ➞ Restore..., or by clicking the corresponding button. Restore Project button



Upon initiating this action, any other open project will be closed.



07/01 AWB2700-1305-GB



If the project you are restoring contains libraries, please take note of the section “Restoring a library” on Page 73.



33



NAVIGATOR The Restore Project From dialog window will open.



Figure 17: Restore Project From dialog



34



07/01 AWB2700-1305-GB



왘 Select the drive, and, if necessary, the folder(s) of the archived project and the project itself with the extension PCK for archived projects carried out with a Sucosoft S40 version older than 5.0, or with the extension ZIP, for projects archived with Sucosoft S40 version 5.0. 왘 Confirm the task with the Accept button.



Project management The Restore Project To dialog window will open. 왘 Specify a destination drive and the destination folder. 왘 Confirm the task with the OK button. If you are just now going to create the folder for the project to be saved: 왘 Click the New Folder button in the Restore Project To dialog window, then enter the new folder name in the New Folder dialog window. Confirm the entry with the OK button. 왘 Specify the destination drive and the destination folder as described above. Sucosoft S40 will organise a project structure with the folders Devices and Source in the destination project and will enter the project files belonging to it. The Devices folder will not be written if the Only Sources check box was crossed when saving.



07/01 AWB2700-1305-GB



The restored project name will be displayed in the title bar and the project directory, with path data if applicable, will be displayed in the status bar.



35



NAVIGATOR Exporting/importing sources Export This function can be used to copy POU files from the current project to any location outside of the project. This function can be used on one or several selected POUs. To do this first select the POUs to be exported and then choose Project ➞ Export/Import... ➞ Export POU Sources... or select Export/Import... ➞ Export POU Sources... in the context menu for the selected file(s). The Export POU dialog window will open. Now select the destination folder to which you wish to export the file(s). You can also specify the format of the file(s) to be exported: S40 Format: This is the format of POUs for projects that were written with Sucosoft version 5.0 or higher. This format therefore enables you to process the exported files in this type of project.



S40 Format V1.00 to V3.11: This is the POU format for projects that were processed with Sucosoft version 3.11 or an older version. The POU file name is therefore shortened to 8 characters. If the source file to be exported contains POU information, this is converted to a comment. This format therefore enables you to process the



36



07/01 AWB2700-1305-GB



S40 V4.xx Format: This is the format of POUs for projects that were written with Sucosoft version 4.x or higher. The POU file name is therefore shortened to 8 characters. The POU information is retained, however.



Project management exported files in an older project if you use programming elements that were not yet supported by this older Sucosoft version. Text File: This a simple text file. Special entries for processing the file(s) in Sucosoft projects are no longer contained. If the POU to be exported contains POU information, this is converted to comments in text format. This simple format allows you to process the exported file in other IEC/EN 61131-3 programming systems (see following paragraph “Importing IEC/EN 61131-3 sources”). Import This function can be used to copy POU files from any location outside of the project to the current project. All POUs are copied to the current project and registered there. This function can be used on one or several selected POUs. Either IEC/EN 61131-3 sources or S30 sources can be imported. Importing IEC/EN 61131-3 sources To do this choose Project ➞ Export/Import... ➞ Import IEC/EN 61131-3 Sources... or Export/ Import... ➞ Import IEC/EN 61131-3 Sources... in the context menu of a directory in the source file structure.



07/01 AWB2700-1305-GB



This will open the IEC/EN 61131-3 Sources dialog box. Now select the file(s) you wish to import. The file display of this dialog is preset for POU file types. However, it can be set for all file types as required.



37



NAVIGATOR The import function is possible for all IEC/EN 61 1313 source files, i.e. they must have a declaration section and instruction section in ASCII format. The Sucosoft S40 version of the source file or whether it was written with a different editor is not important. The only requirement for a successful import is that the file name corresponds to the name of the program, function or function block inside the file. After the import has been successfully completed, the imported file has the extension POE and is stored in the source file structure for which you have called the function. Importing S30 sources To do this choose Project ➞ Export/Import... ➞ Import S30 Sources... or Export/Import... ➞ Import IEC/EN S30 Sources... in the context menu of a directory in the source file structure. This will open the dialog box with the caption Please Select An S30 Program File. Now select the S30 file(s) you wish to import. This dialog will only display Sucosoft S30 file types.



38



07/01 AWB2700-1305-GB



Further information on importing S30 sources is provided in the section “Importing S30 programs” on Page 76.



Project management Registering sources In order to edit a POU copied to the project with a different tool such as Explorer, it must be registered. POUs not yet registered are indicated by a missing checkmark in the Registered column of the file view window. Requirement: A project must be open and the copied files must be displayed in the Source branch. 왘 Choose Project ➞ Register Sources. The new status will be indicated by a checkmark in the Registered column.



Printer Setting 왘 Choose Project ➞ Print Setup.... The Print Setup dialog window offering you various printer setting options will open. You can select your printer, specify a standard printer, set the paper and print format (portrait or landscape) and select the form and cover sheet which you wish to use for the printout.



07/01 AWB2700-1305-GB



You can use the Form Editor to create other forms which can be used in this dialog in addition to the standard forms.



39



NAVIGATOR Printing Unlike the print function of the individual S40 tools, the NAVIGATOR print function allows you to print files individually or all together. The printout in this case uses the currently set cover and form sheet. Printing all files 왘 To print all the files belonging to a user program, click the Devices tab and select the make file in the file structure window belonging to the program concerned. 왘 You can then print by means of the menu item File ➞ Print, via the context menu, or by clicking the button. The first page printed shows an overview of the project directory with information on the CPU type, the data of the make file, compiler flags, and program parameters as well as the main program and all POUs used, including path and type. After the overview the following is printed out: the Global Data Types, the topology for the make file, the POUs and instance tree.



40



07/01 AWB2700-1305-GB



The program parameters, global data types, the device configuration, the instance tree and the functions and function blocks of the program can only be printed if the appropriate output was activated on the Print file card via Options ➞ Settings... .



Project management Printing individual files 왘 To print the individual files of an application program click the Sources tab, and in the file structure window select the topology file or POU (program, function block, or function) to be printed. 왘 Print as described above. Printing contents of the Output window All Output window contents can be printed via Project ➞ Print Output.



POU information In the file structure window of the Sources file card you can display information on selected POU source files via the direct Help of the context menu (rightclick). This information is created beforehand in the POU Editor via File ➞ POU Info.... For each POU a dialog is opened with fields for Project, Name, Author, Version, PLC Type(s), Date, Comment and the prototype if required.



07/01 AWB2700-1305-GB



This information is also available for POUs in libraries if there is no library Help available for the POU concerned (see “Using Library Help” on Page 69).



41



NAVIGATOR Program code generation



Introduction A wide range of commands are provided for creating executable, PLC-specific program code. These commands can be directly carried out via the Generate menu item or by means of the toolbar buttons (see Figure 3). These commands will be described below in sections. Generation of program code is carried out in two phases:



 42



Make sure that all POUs in a project have different names. If there are function blocks of the same name in different subfolders of the current folder, the function block registered at the time of the generation will be selected. All unregistered sources will be ignored during generation.



07/01 AWB2700-1305-GB



the creation of a make file in which the elements (files) are specified that must be included in the program code generation process, i.e. the program POUs (including the instantiated function blocks and functions they contain), the topology file and the program code parameters. You create the file once for each program POU in your project. The files will automatically have the name of these program POUs. Sucosoft S40 will then automatically update the file as soon as you modify the program POU, for example, by incorporating or removing function blocks or functions, program parameters, or the topology. Only if the program POU is linked with a completely different topology configuration (e.g. another PLC type) or vice versa, does the make file have to be created again. Generation of program code is carried out on the basis of the make file and therefore depends on the elements included in the file.



Program code generation In a project with several program POUs (main programs) several make files can be generated and stored. They will automatically receive the name of the respective program POU.



Selecting PLC type The data types and manufacturer-defined function blocks and functions available to you in the POU Editor depend on the PLC type selected. You should already have selected the PLC type appropriate to the topology files before preparing to generate program code.



07/01 AWB2700-1305-GB



The following controllers are currently grouped under the three selectable PLC types:



43



NAVIGATOR PS4-200: PS4-141-MM1, PS4-151-MM1, PS4-201-MM1, PS4-271-MM1 PS4-300: PS4-341-MM1 PS416: PS416-CPU-200, PS416-CPU-300, PS416-CPU-400 왘 Select the desired PLC type in the selection window in the toolbar. If the PLC type does not correspond to the one specified in the topology file and to the one selected for the make file, you will receive a corresponding error report when you attempt to generate a make file.



Creating a new make file Requirement: The required PLC type must have already been selected. 왘 Choose Generate ➞ New Make File..., or the corresponding button. New Make File button



44



07/01 AWB2700-1305-GB



The New Make File dialog window will open.



Program code generation



Figure 18: New Make File dialog



왘 Select the program POU you wish to generate as an executable control program from the program POUs list box. 왘 Select the topology file from the Topology Configurations list box which is appropriate for your controller configuration and for the program POU you previously created with the Topology Configurator. 왘 Confirm with the OK button. The make file, from which the executable program can be generated, will be created. The selected files and default program parameters are entered in the make file. A report will appear in the status bar when the list is created.



07/01 AWB2700-1305-GB







All other changes to program parameters, i.e. all changes to the project are automatically entered in the make file. Unlike older Sucosoft versions, the required function blocks and functions required for generating the program code are not saved in the make file but are determined anew for each access.



45



NAVIGATOR Setting program parameters Selection of controller-specific program parameters You can set program parameters such as compiler options for the currently selected PLC type or relevant parameters for program performance such as maximum cycle time, password, and marker range. This is carried out via the menu item Generate ➞Program Parameters... or the corresponding button. Program Parameters button



Changing program parameters for the PS4-200 Requirement: PS4-200 must have been selected as PLC type.



46



07/01 AWB2700-1305-GB



왘 Initiate the setting of parameters via Generate ➞ Program Parameters.... The PS4-200 Program Parameters dialog will open for the current make file:



Program code generation Runtime settings 왘 Complete the Runtime Parameters panel or click the Default button to choose the preset default values. Password: The password is used for protecting the PLC from unauthorised access. It can consist of a maximum of 8 characters (letters and numbers). If you wish to change a saved password, enter the new password and confirm with OK. The password is requested every time a connection is established (Connect) if the PLC concerned contains a password-protected program. When the correct password is entered once, all functions are freely available until the connection (Disconnection) is closed. If there is no response to a requested password or in the case of an incorrect entry, an error message will appear and the connection will not be established.



07/01 AWB2700-1305-GB



: A version code for the program to be generated, composed of a maximum of four letters and numbers, can be assigned in this field. The version number will be displayed in the Program Status dialog box of the Test & Commissioning tool under Program Version. This facilitates identifying various program versions when troubleshooting. Startup behaviour after Not Ready: If the running user program is interrupted by a Stop error, such as maximum cycle time exceeded, the PLC will switch to Not Ready.This can occur at any place in the program. Make sure, therefore, that any possibly inconsistent variable or marker values in Warm Start Behaviour are avoided, i.e. that no dangerous circumstances can arise! The startup



47



NAVIGATOR behaviour after Not Ready described is only effective and appropriate with the switch in the RUN position. Stop: After a program error there is no restart. Warm Start:Selects a PLC warm start.







Cold Start:Selects a PLC cold start. Warm start or cold start may only be selected when the process to be controlled can also be restarted after an undefined interruption with the Not Ready status without danger to man or machine.



48



07/01 AWB2700-1305-GB



Maximum Cycle Time: This entry field is used to enter the maximum cycle time for the program in the range from 1 ms to 255 ms. The default setting is 60 ms; it should only be set to a lower value when you know precisely the typical program cycle time and wish to achieve such precise fault control. If the program exceeds the maximum set cycle time while running, the controller will switch to Halt.



Program code generation Markers This is where you define the marker range which is declared with directly represented variables with the identifier AT%M. This range is subdivided into normal markers and warm and cold start retentive markers.



왘 Assign the marker ranges for the PLC working memory under the Markers tab:



07/01 AWB2700-1305-GB



Active Marker Range: This defines the PLC marker range which can be addressed as directly represented variables with the identifier %M. The maximum number of these markers is 16 KByte (0 -16383). The standard setting is no active marker range.



49



NAVIGATOR Retentive Range: This specifies the range of the warm start retentive markers. Warm start retentive markers retain their last value before PLC shutdown and continue to operate with these values after a warm start. The retentive range is a subset of the active marker range and must not overlap the recipe range.







Recipe Range: This specifies the range of the cold start retentive markers. Cold start retentive markers retain their last value before PLC shutdown and also through a cold start. The recipe range is a subset of the active marker range and must not overlap the retentive range. Retentive and recipe marker ranges must both be set within the defined limits of the active marker field and may not overlap each other. The use of the keyword RETAIN in the declaration of retentive markers for the PS4-200 only has a documentation function. The actual retentive setting is made in the marker range.



50



07/01 AWB2700-1305-GB



The settings become active only after compiling and transfer.



Program code generation Changing program parameters for PS4-300 Requirement: PS4-300 must have been selected as PLC type. 왘 Start the parameter setting via Generate ➞ Program Parameters.... The PS4-300 Program Parameters dialog will open for the current make file:



07/01 AWB2700-1305-GB



Runtime settings 왘 Complete the Runtime Parameters panel or click the Default button to choose the preset default values.



51



NAVIGATOR Cyclical: The program is immediately restarted each time program execution is completed. Click on the Cyclical tab to enter the parameters for cyclical program execution.



52



07/01 AWB2700-1305-GB



Enter the maximum program runtime, i.e. the time within which a program execution must be completed (permissible value range 1...1000 ms).



Program code generation Periodic: The program is restarted when the specified time interval has elapsed. In addition, program execution must be completed before the specified maximum program runtime.



07/01 AWB2700-1305-GB



Click on the Periodic tab to enter the parameters for periodic program execution.



왘 You must specify: The required time interval (time between the individual program invocations). The entry can be made in: - Milliseconds in the value range 1 to 60000 - Seconds in the value range 1 to 3600 - Minutes in the value range 1 to 1440 - Hours in the value range 1 to 960 - Days in the value range 1 to 40. The value for the maximum program runtime. The value you specify must not exceed the specified time interval and must be less than or equal to 1000 milliseconds.



53



NAVIGATOR Warm Start: If the user program is restarted, execution will be resumed at the position where it was interrupted. The data declared with the keyword RETAIN is reused. For this the operating mode switch must be set to RUN. Cold Start: This starts the user program with the initialisation values of the variables. The operating mode switch can be set to RUN or RUN-M-RESET for the cold start option. No Restart: If this has been selected with the setting Warm Start as startup behaviour, the user program will not be automatically restarted when the power supply is restored. Attempting a warm start will cause the PLC to switch to NOT-READY and will increment the diagnostics counter for the ENR diagnostics bit.



54



07/01 AWB2700-1305-GB



A version code for the program to be generated, composed of a maximum of ten letters and numbers, can be assigned in this field. The version number is displayed in the Program Status dialog box of the Test & Commissioning tool under Program Version. This facilitates identifying various program versions when troubleshooting.



Program code generation Markers This is where you define the marker range which is declared with directly represented variables with the identifier AT%M. This range is subdivided into normal markers and warm and cold start retentive markers.



07/01 AWB2700-1305-GB



왘 Assign the marker ranges for the PLC working memory under the Markers tab: Active Marker Range: This defines the PLC marker range which can be addressed as directly represented variables with the identifier %M. The maximum number of these markers is 15000 Byte (0 to 14999 Byte). The standard setting is no active marker range. Retentive Range: This specifies the range of the warm start retentive markers. These markers are declared as directly represented variables with the identifier AT %M.



55



NAVIGATOR Warm start retentive markers retain their last value before PLC shutdown and continue to operate with these values after a warm start. The retentive range is a subset of the active marker range and must not overlap the recipe range.







Recipe Range: This specifies the range of the cold start retentive markers. These markers are declared as directly represented variables with the identifier AT%M. Cold start retentive markers retain their last value before PLC shutdown and also through a cold start. The recipe range is a subset of the active marker range and must not overlap the retentive range. Recipe values are retained with each cold start. This means that they must be initialised before they are first used in the user program. With the PS4-300 recipe data is also retained after the operating system is transferred. The retentive marker range and the recipe marker range must both lie within the defined limits of the active marker range and must not overlap each other. Retentive markers for the PS4-300 can also be declared with the keyword RETAIN if required. Only the recipe range must be defined via the Program Parameters.



56



07/01 AWB2700-1305-GB



The settings become active only after compiling and transfer.



Program code generation Changing program parameters for the PS416 Requirement: PS416 must have been selected as PLC type. 왘 Initiate the setting of parameters with Generate ➞ Program Parameters......› . The PS416 Program Parameters dialog will open for the current make file:



왘 Make entries in the dialog box as required or click the Default button to enter the standard values.



07/01 AWB2700-1305-GB







The recipe range (cold start retentive markers) of PS4-200/-300 controllers is defined in the Program Parameters... dialog on the Markers tab. You can define the protected recipe range of the PS416 controller whilst a program is running via the ColdstartRetention function block (see AWB2700-1306-GB).



57



NAVIGATOR Runtime settings Cyclical: The program is immediately restarted each time program execution is completed. Click on the Cyclical tab to enter the parameters for cyclical program execution.



Enter the maximum cycle time, i.e. the time within which a program execution must be completed (permissible value range 1 ... 1000 ms).



Click on the Periodic tab to enter the parameters for periodic program execution.



58



07/01 AWB2700-1305-GB



Periodic: The program is restarted when the specified time interval has elapsed. In addition, program execution must be completed before the specified maximum program runtime.



Program code generation



You must specify:



07/01 AWB2700-1305-GB



The required time interval (time between the individual program invocations). The entry can be made in: - Milliseconds in the value range 1 to 60000 - Seconds in the value range 1 to 3600 - Minutes in the value range 1 to 1440 - Hours in the value range 1 to 960 - Days in the value range 1 to 40. The value for the maximum program runtime. The time value must not exceed the value for the set time interval and must be less than or equal to 1000 milliseconds.



59



NAVIGATOR Warm Start: If the user program is restarted, execution will be resumed at the position where it was interrupted. The data rescued at the time of the program interruption will be reused. For this the operating mode switch must be set to RUN. Cold Start: This starts the user program with the initialisation values of the variables. The operating mode switch can be set to RUN or RUN-M-RESET for the cold start option.







Recipe values are retained with each cold start. This means that they must be initialised before the first use. The recipe data of the PS416 is reset after the operating system is transferred (see AWB2700-1306-GB: PS416 function block, ColdstartRetention).



60



07/01 AWB2700-1305-GB



A version code for the program to be generated, composed of a maximum of ten letters and numbers, can be assigned in this field. The version number will be displayed in the Program Status dialog box of the Test and Commissioning tool under Program Version. This facilitates the identification of various program versions when troubleshooting.



Program code generation Selecting make files Since you are able to create numerous make files in a project you are offered the option of choosing one for generating the desired user program. This is done via the list box in the toolbar.



Figure 19: Make file list box







You can see an overview of make files created with all file attributes in the file structure window by clicking the Devices tab and selecting the corresponding PLC type.



Figure 20: Created make files with file attributes



07/01 AWB2700-1305-GB







When you open the folder of a PLC type in the tree structure window and select one of the make files displayed, the file structure window will show all the POUs assigned to this make file as well as the assigned topology (see following figure).



61



NAVIGATOR



Figure 21: POUs and topologies for the selected make file



Generating program code Requirement: You must have selected a make file for the desired PLC type. 왘 Choose Generate ➞ Generate Program Code, or click the corresponding button: Generate Code button



The executable program will be generated according to the currently selected make file.



Figure 22: Generating via the context menu



62



07/01 AWB2700-1305-GB



If you select the folder of a PLC type in the tree structure window, you can also generate the program code via the context menu.



Program code generation The executable programs are generated according to all the make files assigned to the selected PLC type. The progress of the generation can be viewed in the Output window. An appropriate report will appear after successful execution. Current compiler outputs can be printed via Project ➞ Print Output. Program code errors If an error should occur when generating program code, it will be issued in the Output window with the appropriate report.



Figure 23: Output window after program code generation with error reports



Clicking one of the output lines during this operation, will freeze the list at this position. In this way, the window no longer scrolls through the other output lines.



07/01 AWB2700-1305-GB



Error reports can be printed via Project ➞ Print Output



63



NAVIGATOR Troubleshooting After code generation has been completed, the F4 key can be used to reach the first reported error in the Output window. Each additional press of the F4 key moves the cursor to the next reported error. Double-clicking on an error line or firstly selecting it with a mouse-click and then pressing the Enter key will automatically open the POU Editor. The cursor will then be positioned in the line/column position in the specific POU in which the error was found. Clicking an error line and then pressing the F1 key opens a Help window explaining the error that has occurred.



Aborting program code generation You can abort the current generation process before completion via Generate ➞ Abort Generation or by clicking the Stop button. 왘 Click the Stop button. Stop button



Creating a cross-reference file



You can now create a cross-reference file via the context menu or via File ➞ Cross-Reference File. This then also appears in the file structure window with the same name as the make file for which it was created. This is created as an Excel table and can be loaded into the Excel Editor via the Open function of the context menu, if you have associated this file type with Excel via Explorer.



64



07/01 AWB2700-1305-GB



Requirement:A make file has been created and has been selected in the file structure window after clicking the Devices tab.



Program code generation Program properties Requirement: The program code generation has been completed successfully via a make file. If you have selected a make file in the tree structure window of the Devices tab, you can use the Properties function in the context menu of a source or program file selected in the file structure window to display file related information in a dialog. With Source files this information consists of the POU type (program, function, function block), the PLC series for which the source was written, the number of bytes that this source takes up in the code size of the program code file, the number of bytes that this source takes up in the data size of the program code file, date and time of the last modification to this source, a list of local function blocks used in this source a list of the global function blocks used in this source.



07/01 AWB2700-1305-GB



With program code files, this information is displayed as the instance tree (the hierarchical display of all instances used in the program with the function block name in square brackets) as well as general properties information with the name of the program, the total code size of the program in bytes, the total data size of the program in bytes, the topology configuration assigned to the program, date and time of program code generation, the total number of POU sources used in this program, 65



NAVIGATOR



66



07/01 AWB2700-1305-GB



the number of function blocks used in this program, the number of functions used in this program, the number of function block instances used in this program, the PLC type for which the program was created (corresponding to the PLC type set in the topology configuration), the number of user libraries used in this program, the list of these user libraries.



Using libraries Using libraries



Introduction Sucosoft S40 is provided with ready-made and tested function blocks and functions in the form of manufacturer-defined libraries for each of the three PLC types.



Figure 24: View of a manufacturer-defined library



07/01 AWB2700-1305-GB



In addition to manufacturer-defined libraries you can import other libraries. These can be libraries you have created yourself with the S40 Library Manager, which is available as an S40 add-on module. There may also be other libraries available from Moeller or other suppliers. After you have entered a library into your project, its function blocks and functions (user modules) are available for use in your project in the same way as manufacturer or user-defined blocks.



67



Library view After clicking the Libraries tab, the tree structure window will display the Library file tree with the PS416, PS4-300 and PS4-200 device folders as subfolders and their corresponding library groups (see Figure 24 ). The Library view offers a brief overview of which modules, i.e. which manufacturer-defined and userdefined function blocks and functions are available for effective programming. The Help function also provides information on the individual modules (see section “Using Library Help” on Page 69). No further subfolders can be created. When you select a subfolder, a folder with manufacturer-defined libraries and, if imported, a folder with user-defined libraries will be displayed.



68



07/01 AWB2700-1305-GB



By clicking the appropriate folder, the PLC-specific functions and function blocks belonging to that library will be displayed in the file window.



Using libraries Using Library Help Library Help, for a specific function block, for example, can be accessed by the usual Help procedure in the menu or via “About” in the context menu. First, open the PLC-specific folder in the Library tree view, then select the desired subfolder and select the module you are looking for in the file structure window (see Figure 24). Now call up Help. You will find detailed explanations loaded with example programs for all manufacturer-defined function blocks and functions. If a library POU does not have a Help text, the POU information created in the POU Editor via File ➞ POU Info... will be shown as Help text instead.







You can paste these passages into your POU by selecting the declaration or instruction section of the example program with the left mouse button and then saving on the Clipboard.



Importing or deleting libraries With this option you can transfer or delete an additional library created by the Library Manager itself or by other means.



07/01 AWB2700-1305-GB



Libraries must be created separately for different PLC types. You must take this into account when creating your POU as well as during subsequent library generation in the Library Manager.



69



NAVIGATOR Importing libraries 왘 Choose Options ➞ Library ➞ Import or click on the Import Library button. Import library button



The Import Library dialog window will open. Now select the libraries you wish to import. This dialog will only display libraries (*.lib). After it is imported into a project, Sucosoft S40 manages the library and makes its function blocks and functions available for the corresponding PLC type in all projects. Deleting a library Deleting a library will remove it from Sucosoft S40 management.



70



07/01 AWB2700-1305-GB



왘 Choose Options ➞ Library ➞ Delete or Delete in the context menu for the Library file tree structure in the tree structure window.



Using libraries Creating a library Creation and subsequent modification of a library will only be described briefly here. You will find a detailed description in the manual “S40 Library Manager” AWB-C2700-1366GB. Function blocks (FBs) and functions to be used as library modules are generated like any other POU. The project for generating these POUs is referred to here as the original library project. After creating these library modules, a program POU must be created for testing purposes, in which the library modules are instantiated (FBs) and called up. After the program code has been successfully generated, the modules can be grouped into a library with the help of the Library Manager.



Using a library Imported libraries are available to all projects except the original library project. A library cannot be imported while the library origination project is open in the Navigator.



07/01 AWB2700-1305-GB







A library cannot be imported into its original library project since more than one module of the same name may not appear. POU names used in a library must not be assigned more than once in a project. Sucosoft S40 monitors the assignment of names.



71



NAVIGATOR Activating and deactivating library modules Libraries are automatically activated when imported. After clicking the Library tab you can confirm activation in the appropriate column of the Navigator file structure window. There are two reasons that could prompt you to deactivate a user library: When no library module is being used in a library user project and you wish to conserve memory for saving the project. When you wish to subsequently edit a library module in the original library project. 왘 Choose Edit ➞ Activate/Deactivate or the Activate/Deactivate option in the context menu.



Editing of library modules at a later time



72



07/01 AWB2700-1305-GB



If you open the original library project with the library activated, all the library entries will be deactivated so that the original POUs can be compiled with the next program generation. The corresponding warning messages will appear in the Output window.



Using libraries Follow these steps to ensure that modified POUs are included in the generation: 왘 Deactivate the respective library in the NAVIGATOR. 왘 Modify and save the originating POUs in the POU Editor. 왘 Register the POUs in the NAVIGATOR via the menu point Project ➞ Register Sources. 왘 Generate the program code. 왘 Import the library after creating an updated version in the Library Manager.



Saving libraries Libraries cannot be saved individually, only along with a project as a component. When saving a project the most recently imported libraries apart from those that were deactivated will be saved as well.



Restoring a library Libraries cannot be restored individually, only as part of a project.



07/01 AWB2700-1305-GB



When you restore a project containing a library, it will be stored under the corresponding PLC type folder in the Devices project branch. To transfer the library to Sucosoft S40 management, you must import it manually as described above.



73



NAVIGATOR Information on libraries If you have selected a PLC type in the tree structure window of the Libraries tab, you can use the Properties function in the context menu to display information on the libraries of this PLC type in the Library Information dialog. This information consists of



74



07/01 AWB2700-1305-GB



the selected PLC type, the list of all libraries for this PLC type with the total number of libraries and the number of deactivated libraries, the list of all groups in the libraries for this device type with the total number of groups and the number of hidden groups and the list of all POUs in the libraries for this device type with the total number of POUs, the number of hidden POUs, the number of function blocks and functions.



Using libraries Library properties If you have selected a PLC type in the tree structure window of the Libraries tab, in the file structure window you can use the Properties function in the context menu to display information in the Library Properties dialog on the libraries listed. This information consists of



07/01 AWB2700-1305-GB



a list of the physical libraries of which the displayed library consists (depending on the library file selected in this list, the display for the number of all library modules, the visible, hidden and deactivated library modules changes), the name of the manufacturer of this library, the version number of this library, the name of the Help file linked to this library, the path where the physical libraries are located, the PLC type for which this library was created, the total number of all functions and function blocks in the physical library selected under the Name, the number of functions and function blocks that can be used in the physical library selected under Name,



75



NAVIGATOR the number of the functions and the function blocks that are hidden in the physical library selected under Name and which cannot therefore be used, the number of the functions and the function blocks that are deactivated in the physical library selected under Name and which cannot therefore be used, the notification whether the library is password protected or not.



Importing S30 programs



Programs that you have written in Sucosoft S30 can be imported to Sucosoft S40. A program conversion is used that matches the program content to the IEC/EN 61131-3 standard. Programs can be imported and converted that were written for the PS316/PS306 with the suffixes *.q6b or *.q6w, for the PS3 with the suffix *.q3 and for the PS4-201-MM1 and PS4-141/151-MM1 with the suffix *.q42, with the appropriate reference files.



Structure of the S30 program source



76



07/01 AWB2700-1305-GB



The S30 program source can consist of the main program and several Include programs that are incorporated into the main program.



Importing S30 programs If other reference files are required for generating the S30 program in addition to the main reference file, these must be incorporated into the source programs (*.Q**) using the Include instruction. All S30 sources must be located in the same folder. In this case, symbolic operands are declared and used in the converted program. The symbolic operands are also provided with a comment specifying the contact characteristics (M/B) and terminal designation (T) that were defined in the reference file.



Type of conversion Use a newly created S40 project for the conversion. The conversion will change the S30 program into a program type POU and, if necessary, into one or several function block POUs. The S30 converter automatically generates equivalent S40 programs during the conversion process. S30-S4 or S30-S3 source programs are converted to programs for PS4-200 compact PLCs, S30-S316 source programs are converted to programs for the PS416.







Remember to create a hardware configuration with the Topology Configurator for your PS416 PLC (see Page 187).



07/01 AWB2700-1305-GB



Due to the different programming concepts, the converter may in some cases not be able to make a complete conversion and may not be able to generate syntactically correct POUs. A syntax check should therefore always be carried out after importing in order to rectify any errors reported.



77



NAVIGATOR Conversion procedure 왘 Open the new S40 project and ensure that it does not contain any POUs. Existing POUs will be overwritten by imported POUs with the same name. 왘 Choose Project ➞ Export/Import ➞ Import S30 Sources.... This will open the window for selecting an S30 program file:



왘 Set the File Type list box to the imported source file. 왘 Select the source file (*.Q??) of the main program you wish to import and click the Open button. After this process has been completed successfully, the window opens for selecting the relevant S30 reference file. 왘 Select the relevant reference file (*.Z??) and click the Open button. Ensure that the other programs (*.Z) and (*.K) are located in the same folder as the source file.



78



07/01 AWB2700-1305-GB



Figure 25: Selecting an S30 program file



Importing S30 programs Sucosoft S40 indicates the progress of the conversion in the Output window. The sources are registered automatically after the conversion has been successfully completed. The remaining steps are the same as in general POU processing.







Instructions/sequences that have not be imported are transferred unchanged and appear as comments. In this way, the user is notified of unconvertible program sections via the syntax check.



Program adaptions during conversion Adapting names In order to fulfill IEC/EN 61131-3 requirements with regard to POU and variable names, some adaptions are carried out during the import. Modifications in the name of a program or function block:



07/01 AWB2700-1305-GB



Two “_ _” underlines in succession are converted to “_ I”. An underline at the end of a name is changed to the single character “E”. A number at the beginning of a name is preceded by the single character “A” if the name is less than 8 characters in length. If the name is 8 characters long, the number is changed to the corresponding letters: “0” for “A”, “1” for “B”, “2” for “C” etc.



79



NAVIGATOR Changes in the name of a symbol: A number at the beginning of a symbol is preceded by “D”. An underline at the beginning/end of a symbol is preceded/followed by a “U”. Two “_ _” underlines in succession in a symbol are converted to “_ I”. If these characters were used in your S30 source program, check whether the automatic name change has by accident created identical names for different variables. Transferring the system parameters When importing S30-S4 source programs the system parameters (active marker range, max. cycle time...) are stored as comments in the program POU header. For program code generation in the NAVIGATOR you must first create the make file and then set the commented parameters via Generate ➞ Program Parameters... (see section “Setting program parameters” on Page 46).



S30-S316: conversion restrictions



There is no topology configuration in S30-S316. After the conversion you must create the S40 topology for the required PS416 PLC in the Topology Configurator and save it in the project. You can generate the program after you have written the make file.



80



07/01 AWB2700-1305-GB



Topology configuration



Importing S30 programs SK sequential control function block The SK sequential control function block is available in S40 programming for the PS4200/300 PLCs in the form of the equivalent SFC function block. This function block is not available in S40 programming for PS416 controllers. The SK function blocks are nevertheless portable so that the sources can be used for PS4 controllers or for corresponding function blocks for the PS416. COM serial interface function block



07/01 AWB2700-1305-GB



The COM function block for serial communication functions in Transparent mode. Mask and Text mode are not supported in the PS416. The SlotNumber input and the two outputs InterfaceStatus and SlotError remain unassigned in S40 because they did not yet exist in S30. The S30 inputs I1 to I32, as well as TOFF and ROFF, are not supported in the PS416 system and are therefore not converted. The TADR and RADR inputs are AnyARRAY type inputs in S40. The size of these arrays cannot be recognised by the converter if this information is contained in a variable. The array size must then be defined in the declaration of the S40 source program.



81



NAVIGATOR ICPY function block The ICPY module is converted to the TransferArray function block. The Source and Destination inputs are AnyARRAY type inputs in S40. The size of these arrays cannot be recognised by the converter if this information is contained in a variable. The array size must then be defined in the declaration of the S40 source program. ICP function block The ICP function block is converted to the CompareArray function block. The Source and Destination inputs are AnyARRAY type inputs in S40. The size of these arrays cannot be recognised by the converter if this information is contained in a variable. The array size must then be defined in the declaration of the S40 source program. DSW diagnostics status word Only the following PS306/PS316 compatible diagnostic bits are supported in the PS416: DAK: Card not fitted DBM: CPU battery failure Address operator



82



07/01 AWB2700-1305-GB



The address operator in S30-PS316/306 programming does not have any equivalent in S40 programming for the PS416. Although it is converted for the PS4-200 in S4 programming, the PS416 code generator will report a syntax error.



Importing S30 programs PP and SYS commands The PP operands and the SYS commands are transferred to the S40 source program without any changes. They create a syntax error when compiled. In this case, adapt your program logic accordingly. Flash markers The three flash markers of the PS316 (e.g. FRQ1) are replaced with appropriate time generators. Timers The timers of the PS316 (e.g. T24) are replaced with suitable time generators. NOP command The NOP command does not exist in S40. It is not converted. TEST command The TEST command is replaced by the functions IsZero and IsPositiv. #define command



07/01 AWB2700-1305-GB



The #define command is not supported in S40. It is therefore transferred as a comment.



83



NAVIGATOR S30-S3: conversion restrictions Topology configuration There is no topology configuration in S30-S3. After the conversion you must create the S40 topology for the required PS4-200 PLC in the Topology Configurator and save it in the project. You can generate the program after you have written the make file. C0 high-speed counter function block The C0 function block cannot be converted, because a similar counter with a hardware input and scaling factor is not available. TR function block – on-delayed timer The TR function block has a basic clock rate of 100 ms. It is replaced by a suitable time generator.



S30-S4: conversion restrictions NOP command This command does not exist in S40. It is not converted. Printer control commands Printer control commands such as TITLE are not supported in S40 and are transferred as comments.



Unlike the S30 CK function block, the RealTimeClock function block requires a year entry at the RealDate input. This entry must be updated by the user.



84



07/01 AWB2700-1305-GB



CK function block input DATE



2



Overview



POU Editor



The POU Editor is the Sucosoft S40 tool you use to create your POUs. The term POU stands for Program Organisation Unit and denotes the three POU types – program, function block, and function – from which a PLC program is constructed. These different POU types allow you to divide an extensive programming task into several subtasks which are in turn handled in function blocks or functions. In this way, the user program is kept to a manageable size and handling is simplified. This approach is known as “structured programming”. In the following, the three types of POUs from which a PLC program is constructed – programs, function blocks, and functions – will be described.



07/01 AWB2700-1305-GB



You can convert a previously-created POU (program, function block, or function) into a different type of POU. To do this, use the Convert POU type option Section “Converting POU types” described on Page 183.



85



POU Editor Program type POU The program POU represents the main program. All project variables firmly defined at a physical address (markers and inputs and outputs, for example) are declared in the program. Functions blocks and functions can be called up from a program.



Function block POU Function blocks (FBs) are important elements in structuring your PLC program. They are used by programs or other FBs and can themselves call up other FBs or functions. The internal data of FBs is retained for the time between one call and the next. Sucosoft S40 provides numerous standard function blocks and functions for use in frequently encountered programming tasks.



Function type POU Functions are also structuring elements for your PLC program. They are used by programs or FBs and can themselves call up other functions. A function can display one or any number of input parameters it is linked to and delivers the result as a return value. Unlike a function block, a function only returns one element.



Before beginning to create your POU, select the correct PLC type in the Navigator toolbar selection window. The following three PLC types are displayed, under which the currently selectable



86



07/01 AWB2700-1305-GB



Internal data is not saved so a function, called up with the same input values, always delivers the same return value. Functions are valid throughout the project and can be called up from any POU.



Overview controllers will be listed according to group: PS4-200, PS4-300 and PS416. Depending on the PLC type selected, the corresponding data types, manufacturer-defined function blocks and functions are made available to you.



Structure of a POU POUs always consist of a declaration section and an instruction section: The declaration section is where you declare the variables you wish to use in the instruction section. Sucosoft S40 uses these variables to initialise, process, and save your data.



07/01 AWB2700-1305-GB



You create your user program in the instruction section. To create a user program you can choose between the textual programming languages, Instruction List (IL) and Structured Text (ST), or the graphical languages Ladder Diagram (LD) and Function Block Diagram (FBD).



87



POU Editor Primary functions of the POU Editor: Declaration of variables Declaring variables Editing user programs in the programming languages IL, ST, LD, FBD Syntax control Calling the code generation function Creating “global data types” valid for the entire project Printing Creation of a cross-reference file list Customised user interface display and colour display



Starting the POU Editor



88



07/01 AWB2700-1305-GB



The POU Editor is started as a tool from the NAVIGATOR.



User interface of the POU Editor User interface of the POU Editor



Like the POU itself, the POU Editor window is divided into declaration and instruction sections (Variables Editor and IL Editor, respectively). Both sections are shown when an existing POU is to be opened or a new one is to be created. 햲 햳















Figure 26: POU Editor with declaration section (Syntax mode) at the top and the instruction section at the bottom



07/01 AWB2700-1305-GB



햲 Toolbar, see Page 98 햳 Language element toolbar for IL, ST, LD or FBD; see Page 99 햴 Declaration section (in Syntax mode), see following section 햵 Instruction section, see Page 91 햶 File card tabs for switching quickly between POUs, Output window and Editor for “global types”



A number of Windows standard shortcuts are listed in the Appendix on Page 437 for optimum use of the POU Editor.



89



POU Editor Declaration section Sucosoft S40 provides either a tabular, Syntaxcontrolled Variables Editor (Syntax mode) or a purely textual, Free Variables Editor (Free mode) for entering variables in the declaration section. Both modes are described in Section “Declaring variables” from Page 106. Switching between Syntax mode and Free mode With an open POU you can switch between the two modes by choosing Options ➞ Variables Editor ➞ Free Mode/Syntax Mode or via standard toolbar buttons. Free mode button Syntax mode button



You can define basic settings for the Variables Editor when creating a new POU, i.e. the mode in which the Editor will open, via Options ➞ Settings... ➞ Editor ➞ Display Mode in Declaration Section.



90



07/01 AWB2700-1305-GB



The declaration section is independent of the programming language employed and is therefore the same for all programming languages.



User interface of the POU Editor Instruction section You create your user program in the instruction section. The instruction section is where you link previously declared variables or function blocks via operators to form an operable POU, and possibly using functions, to form an executable user program. New variables that were used in the instruction section can be transferred to the declaration section and declared via Insert ➞ Variables Declaration... or via the context menu: Position the cursor in the instruction line containing the new variable and then call the variables declaration function.







You can switch between the instruction section and the declaration section by clicking the left mouse button or by choosing Window ➞ Change. The language toolbar is activated as soon as the cursor is positioned in the instruction section.



07/01 AWB2700-1305-GB



Tool tips The Sucosoft S40 tool tips offer simple and quick information on the buttons of the toolbars. These can be particularly useful for variables in the instruction section. In this way you can provide information the manufacturer or user-defined data types or function blocks, by positioning the cursor on the variable name. Functions and function blocks are shown as prototypes with all their relevant inputs and outputs and data types. These tool tips are only available in textual programming languages.



91



POU Editor



Figure 27: Tool tip for variables



Menu bar The functions of Sucosoft S40 within the individual windows are described below: File menu The File menu is used for processing new or existing POUs or files containing global types, i.e. with PLCdependent, user-defined data types, for preparing printouts and printing POUs, and for displaying the cross-reference file. The following menu items are described in the appropriate section: POU Info, see Page 182 Converting POU types, see Page 183 Opening global types, see Page 185 Cross-reference file, see Page 186.



92



07/01 AWB2700-1305-GB



Print setup and print menus The same settings are made here as for the NAVIGATOR (see Page 39 and Page 40).



User interface of the POU Editor Edit menu The Edit menu provides standard functions such as Undo, Restore, Find..., Replace... and Go To.... The Undo and Restore functions work separately for the declaration section and the instruction section. If, for example, you wish to undo an action in the instruction section, the cursor must also be positioned in this section. The Find elements for the Go To... function depend on the cursor position and the selected programming language. Pressing the More button in the Find... and Replace... dialog boxes enables you to select additional search criteria. The options for searching/ replacing in several files can be particularly helpful, allowing the search to be extended to the files associated with a particular make file or files that belong to the current project. The result of a find/ replace operation in several files is shown in the Output window.



07/01 AWB2700-1305-GB



The Find Undeclared Variables menu item allows you to search the opened POUs for variables that are used in the instruction section but which are not yet declared. The result is shown in the Output window under Undeclared Variables. Double-clicking a line in the Output window will move you to the location of the variable in the instruction section.



93



POU Editor To do this position the cursor in a suitable line in the Output window and then press F5 to open the Declaration Wizard. Add the missing information to the variable names shown; the variable will then be inserted to the declaration section.



Figure 28: Find, Replace and Go To dialog



94



07/01 AWB2700-1305-GB



Figure 29: Find result



User interface of the POU Editor Insert menu The Insert menu is used for inserting manufacturer and user-defined functions or already declared variables. For this the cursor must be positioned in the instruction section before the menu is opened. The Variables Declaration menu item enables new variables to be declared. The Variables From Topology menu item enables directly addressed variables from your topology to be transferred and declared. When declaring variables, it doesn't matter whether the cursor is located in the declaration section or the instruction section. Online menu The Online menu enables you to edit your POUs online during test and commissioning (see Page 385). Options menu The Options menu offers the following settings: Variables Editor: switching the declaration section between Free and Syntax mode (Page 90).



07/01 AWB2700-1305-GB



Programming language: switching between programming languages IL, ST, LD and FBD, Code generation: for calling the code generator via the NAVIGATOR (see Page 62), Calling the Settings... dialog box and Calling the Customize Toolbars dialog box (Page 97).



95



POU Editor







Settings dialog The setting options of this dialog box are largely self-explanatory and are not fully described here.



Figure 30: Settings Editor dialog



Editor: the options Automatic and Free of the Column Adjustment control the column width, i.e. the width of the entry cells in the declaration section in Syntax mode.



Free: the column width is fixed as set, even with long entries. The whole entry can be seen by moving the cursor within the entry field.



96



07/01 AWB2700-1305-GB



Automatic: column adjustment automatically adjusts to the width of the longest entry.



User interface of the POU Editor Font: This is the same font and colour setting that can be carried out in the NAVIGATOR. For example, you can define the colour for keywords or the background colour of comments. Multiple-nested comments cannot be shown in the same colour. The settings you have made can be saved as a new scheme by clicking the Save As... button and entering a name for the scheme. Print: If you wish to print or display in the NAVIGATOR a project or parts of it selected via a make file, you can define the content of the output in the options selected here. For example, you can include or exclude in the output the display of the device configuration and the global data types. Customize Toolbars... menu Once this dialog has been opened you can adapt the toolbars of the POU Editor to suit your personal requirements or create additional toolbars. The toolbars of the POU Editor can be reduced in size by clicking the unwanted buttons and dragging them (mouse button depressed) over the edge of the POU Editor. You can increase the size of toolbars or re-compose them by adding the buttons from the dialog box or another toolbar.



07/01 AWB2700-1305-GB



You can create your own toolbars named consecutively ToolBar1 ... n by dragging the buttons onto the screen. The toolbar created in this way can be positioned as required or hidden. It cannot, however, be removed from the list of available toolbars.



97



POU Editor



Figure 31: Customize Toolbars dialog box



Standard toolbar You can display or hide the standard toolbar via the View menu. It can be added to with the following buttons: - Buttons for using bookmarks



98



07/01 AWB2700-1305-GB



Within a file (POU or global types) you can assign a bookmark to a line in which the cursor is positioned. Bookmarks enable you to use the following symbols for finding particular positions in the programs.



User interface of the POU Editor



Next Bookmark



Previous Bookmark



You can use bookmarks in the POU Editor in both online and offline mode. In Free mode you can insert bookmarks in the instruction section or declaration section in the POU. For this position the cursor in the appropriate line and click the Set Bookmark button. The other buttons allow you to jump to the previous or next bookmark or delete all of them. Buttons for arranging several POUs on the desktop or for arranging the declaration section or instruction section.



- Buttons for changing the programming language:



Language elements toolbar



07/01 AWB2700-1305-GB



You can display or hide the language elements toolbar via the View menu. The buttons available in the language elements toolbar depend on the programming language selected. They are inactive (dimmed), if the cursor is positioned in the declaration section.



99



POU Editor Output window The Output window is used for displaying the results of different operations. It is opened automatically as soon as the operation you have started has been executed. You can close the Output window at any time if it impairs your view of the screen. The Output window can display error reports, the results of a find/replace operation in several files, the results of a search for undeclared variables or a cross-reference file. The contents displayed depend on the operation you have started or on the file card tab that you have selected: Error report display An error report will appear if you have started a syntax check of the POU and Sucosoft S40 has found an error. Find/Replace display The results of a find/replace operation in several files will be shown with all the locations of the search string with the file name, line, column and program line in the declaration section and instruction section and in the global type file (usertyp.typ), if appropriate.



100



07/01 AWB2700-1305-GB



Cross-reference file The cross-reference file is displayed for the current POU if you have selected File ➞ Cross-Reference File beforehand. This cross-reference file enables you to move easily to the required position of a variable in the instruction section. To do this, doubleclick the appropriate line in the cross-reference file list.



User interface of the POU Editor Display mode of the Output window The Output window can be docked or floated on the screen depending on the setting made. This is carried out via Options ➞ Settings ➞ Editor ➞ Output Window. The Output window is then displayed according to the setting made. When in docked mode the Output window is positioned directly below the Editor window. You can drag the Output window to the position required by clicking the handle and docking it to any of the four edges of the Editor window. A docked Output window is always visible and cannot therefore be moved to the background.



07/01 AWB2700-1305-GB



An undocked Output window can always be moved to the background as required. You can bring one of the opened POUs or the Output window to the foreground as required by clicking the file card tab or via the Window menu.



101



POU Editor Variables declaration



The declaration section is where you define the variables (assign a data type or a function block to the individual variables) you wish to link together in sequences in the instruction section. Depending on the application concerned, add other values to the declaration such as initial values, attributes or, in the case of directly represented variables, an address.







A variable is identified by a name. This name must be different from the POU with which it is associated. Writing conventions for variable names are described in the sections “Variables” and “Compliance with the IEC Standard”, in the manual S40 Language Elements (AWB2700-1306-GB). Element



Entry



Name (variable names)



required



Type



required



(Data type)



Initial value



optional



Attribute



optional



Address



optional



Comment



optional



This assignment of variables in the declaration section is called instantiating, whereby Sucosoft S40 automatically reserves the required memory in the PLC. Function blocks are also declared as variables.



 102



Declarations and instances no longer needed should be deleted from the POU to minimise the amount of memory required.



07/01 AWB2700-1305-GB



Functions occupy no permanent memory and are therefore not declared.



Variables declaration Scopes for variables This section provides information on the permissible scopes for variables, according to the POU type concerned. Understandably, a program POU cannot recognise an External variable since the Global variable type is the only one that can be declared in program type POUs. A program POU can only occur once inside a project. Table 1: Overview of permissible scopes for variables in the three POU types and with global types Scope Free mode



FU



FB











Syntax mode



VAR_INPUT



Input



VAR_OUTPUT



Output







VAR_IN_OUT



Input/output







VAR_GLOBAL



Global



PRG Global types



✓ ✓



VAR_EXTERNAL



External



VAR



Local















Type



Type



















07/01 AWB2700-1305-GB



Input Input variables are used to transfer parameters to functions or function blocks. They can only be accessed as Read Only. Keyword: VAR_INPUT Output An output variable that is declared in the function block in which it is supplied as the return value. You can supplement the declaration of output variables with the attribute RETAIN or CONSTANT (see Page 114). Keyword: VAR_OUTPUT



103



POU Editor Input/output An input/output variable (also known as passing parameter) is read and processed by a function block and output under the same name. When the parameters are passed with the function block call, the IN_OUT variable receives a pointer to the transferred variable and its memory location. Since an operation on an IN_OUT variable thus directly affects the content of the transferred variable, the transferred variable must not be of a type that does not permit write operations such as variables with the attribute CONSTANT. Input/output variables must assigned parameters and connected with every call. Keyword: VAR_IN_OUT Global You declare a variable as global in the program POU when you wish it to be valid in the program POU itself and in the function blocks called up by the POU. It must be declared as an external variable (VAR_EXTERNAL) in all the function blocks in which the variable is to be used. A global variable can therefore only be declared in the program POU. Global variable declarations can be assigned the attribute RETAIN or CONSTANT (see Page 114) as well as being assigned an address (see Page 114). Keyword: VAR_GLOBAL



104



07/01 AWB2700-1305-GB



External If you wish to use a variable declared as global in the program POU within a function block it must be declared as an external variable in the function block. Keyword: VAR_EXTERNAL



Variables declaration Local A local variable is only valid in the POU in which it is declared. Global variable declarations can be assigned the attribute RETAIN or CONSTANT (see Page 114) as well as being assigned an address (see Page 114). Keyword: VAR Type The keyword TYPE is used for declaring userdefined, derived data types with local scope in the relevant POU. Derived data types are special data types you can derive, i.e. compile yourself, from elementary types.







As an alternative to these local type definitions, you can make global type definitions via File ➞ Open Global Types. Example: By declaring a derived data type “Pressure” as an INT data type with a limited value range, the new data type can be used for declaring variables: TYPE Pressure : INT (0..100); END_TYPE VAR ChamberPressure: Pressure; END_VAR



07/01 AWB2700-1305-GB



The variable “ChamberPressure” is thereby also an INT data type but can only hold values in the range of 0..100.Keyword: TYPE



105



POU Editor Declaring variables Table 2: Overview of procedures Procedures



Program



Function block



Function



Page 106











Open POU Editor Select POU type Generate variables from topology? Generate other variables with the Declaration Wizard



Page 109



without the Declaration Wizard in Syntax mode



Page 112



in Free mode



Page 118



Changing declared variables Page 120



Generating variables from the topology This function is only available in program type POUs.



They are entered automatically for the global scope and are therefore known within the program POU as well as within the FBs that are called from this program. The assignment of symbolic names is useful but not compulsory (see the chapter “Directly Represented Variables” in the manual “S40 Language Elements”).



106



07/01 AWB2700-1305-GB



You can transfer the physical PLC addresses defined in the Topology Configurator to the declaration section of a program POU in order to reduce the amount of editing required. These physical PLC addresses such as PLC inputs and outputs or elements of the communications memory are called directly represented variables.



Variables declaration If you wish to create a new program POU, the POU Editor will first of all ask if you wish to create and declare variables from a topology.



Figure 32: Generate variables from a topology?



왘 Answer with “Yes” and then select a topology from your current project. To extend the declaration of an existing program POU: 왘 Open the Insert Variables Declaration dialog box by choosing Insert ➞ Variables From Topology.... 왘 Then select a topology from your current project.



07/01 AWB2700-1305-GB



Figure 33: Topology selection



107



POU Editor Once you have opened the required topology, the variables are automatically transferred to the declaration section. They are assigned global scope. The name of the configuration file (*.dcf) is entered together with the drive, path and device specifications.



Figure 34: Example declaration from a topology



108



07/01 AWB2700-1305-GB



Only the (optional) assignment of symbolic names is required.



Variables declaration Declaration Wizard Variable declarations can be made "free-hand" or with the aid of the S40 Declaration Wizard. The S40 Declaration Wizard simplifies declarations by proposing the order and number of entries required, as well as a selection of available function blocks and data types. It also limits the possible scopes according to the POU type being processed. For example, the local, global and type scopes for the Program POU. Variables declarations using the Declaration Wizard are carried out in the Insert Variables Declaration dialog of the relevant PLC. This dialog box can be opened via Insert ➞ Variables Declaration..., the context menu, function key F5 or via the appropriate toolbar button. The symbol button is enabled if you show the declaration section in Syntax mode or if the cursor is in the instruction section.



07/01 AWB2700-1305-GB



Declare New Variable button



109



POU Editor



Figure 35: Declaration Wizard with a selection of manufacturer-defined data types



Instances of function blocks, i.e. variables assigned with a function block, can be used as local and global variables in the program POU and as local or external variables in function block POUs. In order for a function block instance to be valid in all POUs, it must be declared as a Global variable when used in the program POU and as an External variable when used in a function block POU in a sub-folder.



110



07/01 AWB2700-1305-GB



New variables can be accepted after you have selected a function block or data type and made the necessary entries for variable name, scope and length, if necessary. Only then is the OK button available and no longer dimmed so that variables can be accepted in the declaration section.



Variables declaration The Manufacturer file card tab provides all the manufacturer-defined function blocks and data types available for the PLC used. The data types provide a group with derived data types and several groups with elementary data types. All the data types provided here are pre-defined and are identified by keywords. Further information and notes on manufacturerdefined data types and function blocks are provided in the Help system via the context menu (F1) or direct Help (?).



07/01 AWB2700-1305-GB



The User file card tab provides all the user-defined function blocks and global data types available for the PLC used. These data types, also known as derived data types, are type declarations that were previously created via the Open Global Types function, see Section “Opening/editing global types” on Page 185.



111



POU Editor



Figure 36: Declaration section with a group of user-defined data types



If you have imported a library, its function blocks are available by clicking the appropriate file card tab (in this case "ControllerLib").



112



07/01 AWB2700-1305-GB



Syntax mode In Syntax mode the Variables Editor offers convenient, user-guided variable declaration.For example, you will not need to know the keywords for scopes; they will be entered automatically. Variables can be entered for each scope separately under a separate file card directly in the entry cells.



Variables declaration Procedure: 왘 If necessary, switch to Syntax mode. 왘 Click the appropriate file card tab at the bottom of the window to assign the new variable to a scope. The tab for the selected range is shown in the foreground.



Figure 37: Possible scopes for the program POU



왘 Fill in the entry cells in the editing line.



Figure 38: Editing line for the program POU and Local or Global variable types.



The entry cells for Name, Type and Comment are available for every scope. Attribute and Address entry cells are displayed according to the POU and variable type involved. Attributes can be entered only for Local and Global variable types. Addresses can only be entered for Local and Global variable types in the program POU.



07/01 AWB2700-1305-GB







The display of entry cells can be defined via Options ➞ Settings ➞ Editor ➞ Column Adjustment.



113



POU Editor Entry cells for variable properties in the Syntaxcontrolled Variables Editor: Name: Enter the variable name here. The length of the name is limited to 64 characters. Type: Enter the variable data type in the Type cell. This can be an elementary data type (such as BOOL, UINT, etc.), a derived data type, or a function block. Initial value: The value you enter here will be assigned to the variable when the PLC is started. If you enter nothing, the variable will be assigned the default value (0 for numeric variables). Attribute: Use this box to define whether the variable should be assigned an attribute. You can choose between RETAIN or CONSTANT. RETAIN: This keyword specifies that the variable is retentive, i.e. it is retained in the event of a power failure or when the controller is halted. The RETAIN attribute can also be used with FBs. CONSTANT: This keyword specifies that the variable is a data element whose value cannot be changed by the PLC program.



114



07/01 AWB2700-1305-GB



Address: When you require a variable with a set relation to a physical address, i.e. a directly represented variable, establish this relation by entering an identifier letter for memory location and an identifier letter for data format in the address cell.



Variables declaration Memory location identifiers: I: Q: M: IA: QA: IC: IP: QP: IPA:



Digital input Digital output Marker Analog input (not usable as bit operand) Analog output (not usable as bit operand) Counter input (not usable as bit operand) Digital input (peripheral direct access)* Digital output (peripheral direct access)* Analog input (peripheral direct access)*



QPA: IPC: IS: SD:



Analog output (peripheral direct access)* Counter input (peripheral direct access)* Status information (diagnostics) Send Data – Communication data to a network station Receive Data – Communication data from a network station



RD:



* (See “Direct Peripheral Access for PS4-200 and PS4-300” in the section “Language Extension” in AWB2700-1306GB)



Data format identifiers:



07/01 AWB2700-1305-GB



X or without letter: B: W: D:



Bit size Byte Word Double-word



Example: I0.0.0.0.0 defines a Boolean input



115



POU Editor Comment: Enter here any additional comments for the variable. In Syntax mode, an initial parenthesis and an asterisk [(*] are placed automatically in front of the comment and a closing parenthesis [*)] is placed behind it. You will only see this, however, if you switch to Free mode. (*Comment*).



116



07/01 AWB2700-1305-GB



왘 Conclude variable declaration by pressing the Enter key; the Editor will add an empty line to the end of it. 왘 Declare all variables of this scope in the same way. You can use the right mouse button and the context menu if you need to make any corrections afterwards. Declare variables of the other scopes in the same way after clicking the corresponding tab.



Variables declaration



Figure 39: Sample list of declared variables in Syntax mode







Due to its tabular layout in Syntax mode, the Variables Editor arranges its assigned components (name, type etc.) in a set format during declaration. Tabulators or line breaks inserted into comments in Free mode will be represented as squares in Syntax mode and then again as spaces after switching back to Free mode.



07/01 AWB2700-1305-GB



When writing (variables, for example) you may use upper and lower case letters as you wish. The POU Editor is not case-sensitive here.



117



POU Editor Free mode Free mode is designed for experienced programmers who are familiar with declaring variables in Sucosoft S40 and require a fast entry tool. In Free mode, every declaration line must be entered in the correct syntax. Errors will not be reported until the syntax check for the entire POU is carried out. Unlike Syntax mode operation, the Variables Editor shows all scopes all declared variables at the same time in Free mode, thus providing a better overview of variables already declared.



118



07/01 AWB2700-1305-GB



Figure 40: Declaration section in Free mode



Variables declaration Procedures:







왘 Switch to Free mode, if applicable. 왘 Declare the variables according to scopes in separate declaration blocks. 왘 Enter the appropriate keyword for the required scope. This is shown in colour. For greater clarity separate the individual components of a declaration line with tabs. You must observe the following sequence in declaration blocks: VAR must not be placed in front of VAR_INPUT, VAR_OUTPUT, VAR_IN_OUT. In general, all the variables described for Syntax mode are available (see Section “Scopes for variables” on Page 103).



07/01 AWB2700-1305-GB



왘 Enter the same variable properties that were described for Syntax mode (see Page 114). 왘 Conclude the declaration block with the appropriate keyword. 왘 Enter comments for further explanation of the corresponding declaration lines. Begin comments with an initial parenthesis followed by an asterisk and end them with an asterisk and a closing parenthesis, e.g. (*Comment*). Comments are also shown in colour. 왘 Saving a POU The Editor checks POU format before saving. It begins by checking that all declaration blocks are bracketed with correctly written keywords, e.g. VAR...END_VAR; TYPE...END_TYPE. Sucosoft will show an error message if it finds an error, a missing END_VAR or comment ending, for example. Check the declaration section in Free mode and make sure that there are no additional characters before a VAR or after a END_VAR, and that all comments are correctly closed. 119



POU Editor Examples of variable declaration – Free mode Variable without initialisation:



IntermediateValue : INT;



Variable with initialisation:



Qty : INT := 5;



AT %Q0.0.0.0.0 : BOOL; Directly represented variable, specified by a % character directly in front of the required physical address and a preceding AT identifier, without name and without initialisation: Directly represented variable without name and with initialisation:



AT %Q0.0.0.0.1 : BOOL := 1;



Directly represented variable with name and without initialisation:



Valve AT %Q0.0.0.0.2 : BOOL;



Example of a function block:



Counter1 : CTU;



120



07/01 AWB2700-1305-GB



Changing declared variables To change the properties of a previously declared variable, first position the cursor on the name of the variable concerned either in the declaration section or the instruction section and then call the S40 Declaration Wizard.



Programming in IL Programming in IL



Overview IL is a textual, line-oriented programming language. Each instruction line must be terminated with a line break. This has the following structure: Label (optional) - Operator - Operand - Comment (optional)



Creating a POU in IL Requirement: The POU Editor and the desired POU type (program, function block, or function) must be open. 왘 Click the appropriate toolbar button if the IL programming language has not yet been selected. Using the IL Editor



Once this button is clicked, the language elements toolbar will provide IL operators.



07/01 AWB2700-1305-GB



Figure 41: Toolbar buttons for IL language elements



Inserting operators and functions 왘 Enter the instruction list in the instruction section of the POU. The operators and functions can be entered directly or taken from the language elements toolbar. 왘 Use the F button on this toolbar or choose Insert ➞ Functions... to open a dialog box providing functions compatible with the PLC, from which you can create your instructions.



121



POU Editor



Figure 42: Function selection



The file card tabs provide the manufacturer-defined or, if applicable, user-defined functions or functions from imported libraries. Manufacturer-defined functions for the currently selected PLC are arranged according to functionality in folders.



122



07/01 AWB2700-1305-GB



왘 Select the desired function and click the OK button. 왘 Set the function parameters. You can quickly get instructions for this by selecting the function in the instruction section and pressing function key F1.



Programming in IL Inserting variables You can enter the variable name manually or insert a previously declared variable by mouse click. Open the Insert Variable dialog box and select the name of the variable in the selection list. This dialog box can be opened via Insert ➞ Variable, the context menu or via the appropriate toolbar button. Insert Declared Variable toolbar button



07/01 AWB2700-1305-GB



Figure 43: Variable selection



123



POU Editor Inserting function block variables If you are dealing with a function block in your selected variables it will be inserted with all inputs and outputs if you leave the default option “FB Instances with Prototype” active. Otherwise, only the instance name will be inserted in the instruction section. 왘 Set the function block parameters. 왘 You can make comments for individual lines of the instruction list. Enter comments to the right next to the instruction. Comments must begin with an initial parenthesis followed by an asterisk and end with an asterisk followed by a closing parenthesis, e.g. (*Comment*). Subsequent variable declarations, changing variable declarations Variables not yet used can be edited and at the same time declared from the instruction section with Insert ➞ Variable ➞ (Variable or Function Block).



124



07/01 AWB2700-1305-GB



왘 Enter the new variable name as the search string the Insert Variables dialog. 왘 Define the scope and confirm this dialog and the subsequent prompt with OK. 왘 Assign a function block or data type to the Insert Variables Declaration dialog and acknowledge it with OK. The new variable is inserted in the declaration and instruction section.



Programming in IL Used, but so far undeclared variables marked with ??? in the tool tip can now be declared from the instruction section: 왘 To do this position the cursor in front of the name of the undeclared variable and open the Declaration Wizard, via function key F5 for example. Add the missing entries to the existing variable name. Testing POUs 왘 Check the syntax of the POU or a global data type by clicking the toolbar button, function key F10 or via File ➞ Syntax Check Syntax check



A syntactically correct POU will be reported to you by a corresponding message in the Status bar on the lower edge of the window. The Error Messages window will open if syntax errors are detected. (



07/01 AWB2700-1305-GB



Figure 44: Syntax check with error message



The first entry in each line indicates whether the error is in the instruction section (Ins) or declaration section (Decl). This is followed by the line and column number of the error and a short error description. Up to 400 errors can be listed; if more than 400 errors have been found, the remaining error messages will not be shown until the first 25 have been rectified. 왘 Correct the errors in ascending line order. Double-click on each error message to display



125



POU Editor the source of the error in the IL Editor – the cursor is positioned in the faulty line. If you require further help in rectifying a particular error, select the error message concerned and press F1. The POU is saved with the syntax check. You will be asked to enter a file name when it is checked and saved for the first time. After the syntax check is successfully completed, the tool tip of a variable, depending on the declaration, shows the data type or the prototype of a function block, see Figure 27 on Page 92. Saving and closing POU 왘 Save the POU by clicking the corresponding toolbar button. Save button



If you are saving the file for the first time, you will be asked in the following dialog window for the name under which the POU is to be saved. The current project is pre-set as a folder. In the window that opens, select, if applicable, one of the sub-folders you created. POUs are always saved in the project in the Source folder or any possible Source subfolders. Choose File ➞ Save As... to save a POU file under a new name. The save operation is carried out exclusively in the currently opened project, even if the POU was loaded from another project.



126



07/01 AWB2700-1305-GB



왘 Close the POU via File ➞ Close.



Programming in ST Programming in ST



Overview Structured text, or ST for short, is a PASCAL-based programming language. In PLC programming, ST simplifies the programming of loops and alternative instructions and the programming of powerful command constructs using abstract commands. The instruction section of a POU created in ST consists of at least one statement or a sequence of statements. Statements consist of command constructs that are combined to form an executable function. Each statement must be terminated with a semicolon.







The syntax rules to be observed when creating a POU in ST are described completely in the manual “S40 Language Elements” (AWB27001306-GB), in the chapter “Programming in Structured Text (ST)”. ST and IL sequences can be combined inside a POU if the IL sequence or ST statement is properly terminated.



07/01 AWB2700-1305-GB



However, a POU containing ST elements cannot be displayed in graphical languages LD and FBD or completely changed to IL.



127



POU Editor Creating a new POU in ST Requirement: The POU Editor and the desired POU type (program, function block, or function) are open. In order to reduce the declaration work required, the hardware configuration of your PLC should be created beforehand in the TOPOLOGY CONFIGURATOR. 왘 Click the appropriate toolbar button if the ST programming language has not yet been selected. Using the ST Editor



Once this button is clicked, the language elements toolbar will provide ST operators.



Figure 45: Toolbar buttons for ST language elements



Inserting operators and functions 왘 Enter the statements in the instruction section of the POU. The operators and functions can be entered directly or taken from the language elements toolbar. When inserting the assignment operator via the toolbar button, you can insert the variable directly that is to be assigned to the expression.



왘 Click the F button on this toolbar or choose Insert ➞ Function... to open a dialog from which you can insert PLC-compatible functions for your ST instructions.



128



07/01 AWB2700-1305-GB



Assignment operator



Programming in ST



Figure 46: Function selection



The file card tab provides the manufacturer-defined or, if applicable, user-defined functions or functions from imported libraries. Manufacturer-defined functions for the currently selected PLC are arranged according to functionality in folders.



07/01 AWB2700-1305-GB



왘 Select the desired function and click the OK button. The function is entered with the necessary syntaxrelated additions. 왘 Set the function parameters. You can quickly get instructions for this by selecting the function in the instruction section and pressing function key F1.



129



POU Editor Inserting variables You can enter the variable name manually or insert a previously declared variable by mouse click. Open the Insert Variable dialog box and select the name of the variable in the selection list. This dialog box can be opened via Insert ➞ Variable, the context menu or via the appropriate toolbar button. Insert Declared Variable button



130



07/01 AWB2700-1305-GB



Figure 47: Variable selection



Programming in ST Inserting function block variables The Insert Variable dialog is opened via the FB button on the toolbar, by choosing Insert ➞ Variable..., or via the context menu. The FB will be inserted with all its operands if you leave the default option “FB Instances with Prototype” active. Otherwise, only the instance name will be inserted in the instruction section. The function block is entered with the possible syntax additions to the operands. 왘 Set the function block parameters. 왘 Variables not yet declared can be declared now from the instruction section with Insert ➞ Variables Declaration ➞ (appropriate data type). Inserting control statements Control statements enable the required program flow in your POU. Control statements consist of either selection statements, iteration statements and jump instructions. Selection statements (alternative statements): Selection statements that you can use to control the program can be inserted in your statements using the language element toolbar buttons.



07/01 AWB2700-1305-GB



Figure 48: Alternative statement buttons



131



POU Editor Iteration statement: Iteration statements are used for the control of loops. While, Repeat and For loops are used to repeat sections of your POU until the defined condition is fulfilled.



Figure 49: Iteration statement buttons



Jump statements: Jump statements cause the immediate exit of a loop (Exit statement) or from a POU (Return statement).



Figure 50: Jump statement buttons



How to check, save and close your POU is described on Page 125.



Programming in LD



Overview



LD represents the flow of current through a network starting from the left “current rail” possessing the TRUE state, through the various network elements and the variables, to the right “current rail”. The resulting sequence is determined by the network elements, their order, and their type of connection (serial or parallel).



132



07/01 AWB2700-1305-GB



The graphical programming language LD originated from the field of electromagnetic relay systems and is therefore especially suited to the programming of logical sequences of binary variables with their potential states of TRUE-1 or FALSE-0.



Programming in LD A POU may consist of individual networks corresponding to the program sequences. The sequence network number is located in the network header and comments can be entered below the network number. LD networks consist of the graphical objects: Connections (horizontal and vertical lines), Contacts and coils, Jump instructions, Function and function block calls. You can declare variables in the Variables Editor which is common to all programming languages. You will find a detailed description of variable declaration on Page 106. Programs can always be written in IL, LD and FBD programming languages interchangeably. This means that you can create a program in LD, for example, and then display it or continue working in IL or FBD. While doing this, you must take note of the restrictions which are explained in the section Section “Changing programming language” from Page 175. 왘 To create a POU in LD click on the LD POU Editor in the instruction section, i.e. via the corresponding toolbar button.



07/01 AWB2700-1305-GB



Using the LD Editor



133



POU Editor Once this button is clicked, the language elements toolbar will provide LD operators. All programming steps in the LD Editor are available in the LD language element toolbar.



Figure 51: LD language element toolbar buttons



In addition to the language element toolbar buttons, you can also use the context menu (press the right mouse button) to speed up the completion of different stages of the POU. You must still, however, use the keyboard for certain programming entry tasks. The basic structure of a POU, i.e. the network sequence and structure of the individual networks are described below. Identifying networks as jump destinations as well as entering variable names and comments are discussed in later sections.



134



07/01 AWB2700-1305-GB



Variable names and jump labels are initially assigned the designation “undef_opd” in the graphical view of the POU. These must then be replaced with the required variable names or jump labels.



Programming in LD Creating a new POU in LD Requirement: The POU Editor must be open. 왘 First select the Program POU type and declare the variable as described on Page 106. 왘 Click the LD Editor button and, if necessary maximise the LD Editor window. Move to the instruction section. Start LD network 왘 Choose Insert ➞ Start LD Network or click the corresponding toolbar button: Start LD network button



07/01 AWB2700-1305-GB



The first network will appear in the instruction section with a contact and a coil. You can also carry out this action via the toolbar or context menu.



135



POU Editor Execution control (jumps) 왘 Click the Unconditional Jump to a Network Label button. Unconditional Jump button



The jump symbol, the element for entering and editing the jump destination will appear in the new network.



왘 Press the Enter key. The Name Element window in which you enter the jump destination will open.



Figure 52: Naming an element as jump destination



136



07/01 AWB2700-1305-GB



Displaying and inserting operators All operators are made available via the Sucosoft S40 language element toolbar buttons.



Programming in LD Inserting FB variables 왘 Position the cursor at the required location in the instruction section of your LD POU. 왘 Select the function block from a list of all declared variables which you can open from the Insert ➞ Variable... menu item or via the context menu. 왘 Select the instance of the required function block and click on OK. The graphical symbol for the function block will appear with all inputs and outputs as a new network if the FB Instances with Prototype option is kept active. You can name and connect inputs and outputs as you wish.







You can reproduce any number of graphic elements in a network; however, only one function block call per network.



07/01 AWB2700-1305-GB



Inserting functions Functions cannot be entered in LD networks. Switch to FBD to enter a function. When changing later to LD, the function is shown as a rectangular FBD symbol (see Section “Creating a new POU in FBD” on Page 153).



137



POU Editor Editing POUs in LD Select the section of the POU you wish to modify. You can even select a single graphic element, several adjacent elements, a network, or the entire POU. Selecting POU elements You can use the mouse pointer, the cursor keys, or the tab key to select an individual element. To select several adjacent elements in a network you have various options: Select one of the outermost elements with the mouse pointer and, holding down the Shift key, select the other outermost element. Select an element with the mouse pointer and then, while holding down the Shift key, select the desired elements. Drag a frame around the desired section of the network with the mouse pointer while holding down the left mouse button. To select an entire network use the mouse pointer to click the square marking point located on the left edge of the screen directly below the network. To select several networks, first click on one of the marking points. Then, while holding down the Shift key, click the marking points for the other appropriate networks above or below the first one selected.



138



07/01 AWB2700-1305-GB



Select the entire POU via Edit ➞ Select All.



Programming in LD Inserting an additional network A new network can be inserted in front of or behind an existing network. 왘 Select the network marking point of an existing network behind which the new network is to be inserted. 왘 Add the new network via Insert ➞ Start LD Network..., the context menu or via the appropriate toolbar button. Start LD network button



07/01 AWB2700-1305-GB



Deleting networks 왘 Select the network to be deleted. 왘 Press the DEL key or select Delete from the menu bar or the context menu. The selected network will be deleted.



139



POU Editor Selecting networks as jump destination A network can be selected as a jump destination for a jump operation programmed in another network. 왘 Position the cursor in the network you wish to select as a jump destination. 왘 Click the toolbar button: Insert jump label button



The Edit Network Jump Label dialog will open.



Figure 53: Editing the LD network jump label



왘 Enter the name of the jump label, in this case “Label_2”, in the cell and confirm by clicking OK. The jump label name will appear in the network header of the selected network.



140



07/01 AWB2700-1305-GB



Editing a logical sequence An LD start network consists of a contact and a coil. You can insert and edit logic sequences in this network.



Programming in LD Inserting AND sequences 왘 Select the point on the horizontal line in which the new contact is to be inserted.



왘 Press the space bar and a series contact will be inserted. The AND operator can also be taken from the language element toolbar.



Inserting OR sequences 왘 Select the contact or the network area to which a parallel contact should be added.



07/01 AWB2700-1305-GB



왘 The OR operator can also be taken from the language element toolbar. A new contact will be added parallel to the selected area.



141



POU Editor Inserting conditional coils 왘 Select the horizontal line directly before or after the existing output symbol.



왘 Select the required conditional coil from the language element toolbar The corresponding graphical symbol will appear above (marking in front of the output symbol) or below (marking behind the output symbol) the existing output symbol.



142



07/01 AWB2700-1305-GB



You can also select the horizontal line directly in front of Output_2 and insert the conditional operation behind it. You will obtain the same result in this way.



Programming in LD Converting the sequence type You can change the logic sequence of a mixed AND/ OR sequence by adding or deleting vertical connection lines between the parallel branches. 1. Adding vertical connection lines In order to add a vertical line the two lines to be connected must be selected. 왘 Use the mouse or the cursor keys to select the first point between the parallel branches you wish to connect. 왘 Press the Ctrl key and hold it down while selecting the second point. 왘 Release the Ctrl key.



07/01 AWB2700-1305-GB



왘 Press the space bar The selected points will be connected; the logic sequence has changed:



143



POU Editor 2. Deleting vertical connection lines 왘 Select the vertical line you wish to delete.



왘 Press the DEL key or select Delete from the menu bar or the context menu. The selected line will be deleted and the OR before AND sequence becomes an AND before OR sequence:



Negating jumps, contacts or coils Only individual selected elements can be negated. 왘 Select the element to be negated.



144



07/01 AWB2700-1305-GB



왘 Press the space bar The selected element will be negated.



Programming in LD You can also carry out this action via the toolbar button. Negate button



Deleting elements You can delete a single graphical element or a group of adjacent elements. If you wish to delete several elements in mixed AND/OR sequences, the POU will only allow element groupings resulting in a logical network content, i.e. at least one valid network start must be left after deleting.



07/01 AWB2700-1305-GB



In networks with conditional jump operations the entire logic sequence can be deleted. An unconditional operation will remain in the network. At least one contact must be retained in networks with coils.



145



POU Editor Naming elements The contacts and coils must be completed by entering variable names. Parameter passing in the program requires the assignment of variable names to the connections of functions and function blocks. Inputs can also be assigned constants, i.e. values. 왘 Select the element for which you wish to enter an element name. 0001 undef_opd >>undef_opd



왘 Press the Enter key. The Name Element dialog box will open.



Figure 54: Naming LD Elements



왘 Or select the variable from a list of all declared variables which you can open from the Insert ➞ Variables... menu item, the toolbar button or via the context menu.



146



07/01 AWB2700-1305-GB



Insert Declared Variable button



Programming in LD Enter names with Jump operations A jump symbol must be completed by defining the jump destination. 왘 Select the jump symbol for which you wish to define a jump destination.



왘 Press the Enter key.



Figure 55: Naming an LD element as jump destination



왘 Enter the name of the jump destination and confirm by clicking OK or the Enter key.



Entering network comments Each network can be assigned a comment of several lines in length.



07/01 AWB2700-1305-GB



왘 Position the cursor in the network. 왘 Choose Network Comment... from the context menu or click the corresponding toolbar button: Network Comment button



147



POU Editor 왘 The Network Comment window will open.



Figure 56: Network Comment – LD



왘 Enter the comments and confirm by clicking OK. The comments entered will appear in the network header beneath the network number.



Creating function blocks in LD Requirement: The POU Editor must be open, you must have selected Function Block as POU type and must have clicked the LD Editor button.



148



07/01 AWB2700-1305-GB



The rules for creating function blocks in LD are the same as those for creating program POUs.



Programming in FBD Creating functions in LD Requirement: The POU Editor must be open, you must have selected Function and must have clicked the LD Editor button. The rules for creating functions in LD are the same as those for creating program POUs. How to check, save and close your POU is described on Page 125 .



Programming in FBD



Overview The FBD programming language has it origins in the field of electrical signal processing. In FBD, the instruction section is divided into networks as in LD. The individual objects (language elements) are represented with the help of graphical symbols. Structuring of the POU is carried out via these graphics. FBD recognises the following objects:



07/01 AWB2700-1305-GB



Connections Execution control elements (jumps) Function block and function calls Operators Operators, functions and function blocks are shown as rectangular block symbols with connection lines for inputs on the left side and connection lines for outputs on the right. The ends of connection lines are to be assigned parameters (variables/constants) or connected with other inputs or outputs. They are initially assigned with “undef_opd”. Several operators and functions can be linked in any sequence within a network. A function block is treated as an individual network to which no other program components can be added



149



POU Editor except for pre-switching conditions in the form of contact elements. In contrast to a function, it can contain several inputs and outputs. A function can only have one output with several possible inputs. When writing a user-defined function block, the inputs and outputs are shown on the function block symbol in the order in which they were declared in the Variable Editor of the function block concerned. This order can be changed via the Variables Editor. FBD networks consist of the following graphical elements described below: Network labels, Network comment and Network graphics. Network label Every network which is to be a jump destination for another network must begin with an alphanumeric identifier or an unsigned decimal integer which serves as a jump label. This label must not be confused with the consecutive numbering with which the POU Editor automatically begins each network.



150



07/01 AWB2700-1305-GB



Network comments Network comments can be entered between network labels and network graphics. One comment per network is allowed but it can be extended to several lines by pressing the Enter key.



Programming in FBD Network graphics Network graphics consist of graphical elements (block symbols) with input connection lines on the left and output connection lines on the right side. Data flows over these connection lines and then over the further-extending horizontal or vertical connection lines to graphical elements where it is processed and led on to the output. Outputs from one block, as well as those of different blocks, cannot be connected together because the source of the data to be passed on would not be clear. Data flow can only occur from an output or from a variable/constant to one or several inputs of a subsequent block. Declare the variables in the Variables Editor common to the programming languages. You will find a detailed description of the variables declaration on Page 106. Programs can always be written in IL, LD and FBD programming languages interchangeably. You can therefore begin writing a program in FBD and then display or continue writing it in IL or LD. While doing this, you must take note of the restrictions which are explained in the section Section “Changing programming language” on Page 175. To create a POU in FBD activate the FBD POU Editor in the instruction section via the corresponding toolbar button.



07/01 AWB2700-1305-GB



Using the FBD Editor



Once this button is clicked, the language elements toolbar will provide FBD operators. All programming steps in the FBD Editor are available in the FBD language element toolbar.



151



POU Editor



Figure 57: FBD language element buttons



A number of language elements such as the network division of the POU, the representation of functions or function blocks is the same in both LD and FBD. The differences between LD and FBD are in the programming of logical operations with binary operands. In addition to the language element toolbar buttons, you can also use the context menu (press the right mouse button) to speed up the completion of different stages of the POU. You must still, however, use the keyboard for certain programming entry tasks.



152



07/01 AWB2700-1305-GB



The basic structure of a POU, i.e. the network sequence and structure of the individual networks are described below. Identifying networks as jump destinations as well as entering variable names and comments are discussed in later sections. Variable names and jump destinations are initially assigned the designation “undef_opd” in the graphical view of the POU. These must then be replaced with the required variable names or jump destinations.



Programming in FBD Creating a new POU in FBD Requirement: The POU Editor must be open. 왘 First select the Program POU type and declare the variable as described on Page 106. 왘 Then click the toolbar button for FBD programming and move to the instruction section. Start FBD network 왘 Choose Insert ➞ Start FBD network or click on the toolbar button:



The first network will appear in the instruction section with a contact and an assignment symbol.



Execution control (jumps) 왘 Click the Unconditional Jump to a Network Label button. Unconditional Jump button



07/01 AWB2700-1305-GB



The jump symbol, the element for entering and editing the jump destination will appear in the new network.



153



POU Editor



Displaying and inserting operators All operators are made available via the Sucosoft S40 language element toolbar buttons. Inserting FB variables Function blocks are treated as individual networks. 왘 Position the cursor in the required place in the instruction section of your FBD POU. 왘 Select the function block from a list of all declared variables which you can open from the Insert ➞ Variable... menu item or via the context menu. Function block call button



왘 Select the required function block and click on OK. The graphical symbol for the function block will appear with all operands as a new network if the FB Instances with Prototype option is kept active.



154



07/01 AWB2700-1305-GB



왘 Assign parameters with the appropriate variable identifiers and connections.



Programming in FBD







You can reproduce any number of graphic elements in a network; however, only one function block call per network.



07/01 AWB2700-1305-GB



Inserting functions 왘 Choose Insert ➞ Start FBD Network or click the corresponding toolbar button when the function is designated for a separate, new network. If you wish to insert the function into an existing network observe the following procedure. 왘 Select the complete connection line behind which a function is to be inserted.



왘 Open the Function dialog box with the appropriate toolbar button and select the function required.



155



POU Editor Function block call button



The Function dialog box will open, in which manufacturer and user-defined functions or functions from a library are organised under the respective tabs. Manufacturer-defined functions for the currently selected controller, arranged according to functionality, are grouped in folders and will be displayed by opening the respective folder.



156



07/01 AWB2700-1305-GB



Figure 58: Insert function FBD



Programming in FBD 왘 Select the required function or enter it directly into the entry field and click on OK. The graphical symbol for the function will be inserted behind the selected location.



An error message will inform you if you are trying to enter a function with incorrect syntax.



07/01 AWB2700-1305-GB



Deleting function blocks or functions 왘 Select the function block or function and press the DEL key or select Delete in the menu bar or context menu. The selected graphical symbol will be deleted.



157



POU Editor Editing POUs in FBD In order to modify a POU you must first select the appropriate part. You can either select a single graphic element, several adjacent elements, a network, or the entire POU. Selecting POU elements You can use the mouse pointer, the cursor keys, or the tab key, also in conjunction with the Shift key, to select the elements required. To select several adjacent elements in a network you have various options: Select one of the outermost elements with the mouse pointer and, holding down the Shift key, select the other outermost element. Select an element with the mouse pointer and then, while holding down the Shift key, select the desired elements. Drag a frame around the desired section of the network with the mouse pointer while holding down the left mouse button.



158



07/01 AWB2700-1305-GB



To select an entire network use the mouse pointer to click the square marking point located on the left edge of the screen directly below the network.



Programming in FBD To select several networks, first click on one of the marking points. Then, while holding down the Shift key, click the marking points for the other appropriate networks above or below the first one selected. Select the entire POU via Edit ➞ Select All. Inserting networks A new network can be inserted in front of or behind an existing network. 왘 Select the network marking point behind which the new network is to be inserted. 왘 Select the desired network content from the Insert menu or from the context menu. The following options are available: FBD network start, variables (only function blocks, however, and via Operators...) an unconditional jump and an unconditional return.



07/01 AWB2700-1305-GB



Deleting networks 왘 Select the network to be deleted. Press the DEL key or select Delete from the menu bar or the context menu. The selected network will be deleted.



159



POU Editor Selecting networks as jump destination A network can be selected as a jump destination for a jump operation programmed in another network. 왘 Position the cursor in the network you wish to select as a jump destination. 왘 Choose Insert ➞ Edit Network Jump Label or click the corresponding toolbar button: Insert jump label button



The Edit Network Jump Label dialog will open:



Figure 59: Editing the FBD network jump label



160



07/01 AWB2700-1305-GB



왘 Enter the name of the jump label, in this case “Label_2”, in the cell and confirm by clicking OK. The jump label name will appear in the network header of the selected network.



Programming in FBD Editing networks You can insert graphical symbols such as operators and functions into an existing network. You can thereby program several operators and functions in any sequence in a network. When combining functions, an additional graphical symbol can only be inserted in front of the first function input. .







When a network is edited in FBD, you can nest any number of operators and functions, even if the data types are different. The data types are not checked until the syntax check. Inserting graphical symbols In order to insert a graphical symbol, the connection line in front of or behind an existing symbol must be selected. The new graphical symbol is inserted to the right of the selected position. 1. Inserting operators 왘 Select the connection line behind which you wish to insert a new operator, e.g. a logical AND operator. 0001 SUB Measuring Value_1



ispositive Result



07/01 AWB2700-1305-GB



Measuring Value_2



:=



161



POU Editor Clicking the Insert AND function button in the language element toolbar will immediately transfer the sequence to the selected point. Insert AND function



0001



SUB Measuring Value_1 Measuring Value_2



ispositive



AND Result undef_opd



:=



Other sequences are available (next to the AND button) by the pressing the cursor key.



Figure 60: List of logical sequences



2. Inserting functions



162



07/01 AWB2700-1305-GB



See Section “Inserting functions” on Page 155.



Programming in FBD Deleting graphical symbols Selected graphical symbols can be deleted from a network. When a selected sequence symbol is deleted, only the graphical symbols at the topmost input upstream and the graphical symbols downstream are kept. 왘 Select the graphical symbol to be deleted.



07/01 AWB2700-1305-GB



왘 Press the DEL key or select Delete from the menu bar or the context menu. The selected graphical symbol will be deleted.



163



POU Editor Inserting inputs The number of inputs can only be increased for some logic sequence symbols and the arithmetic operations ADD and MUL. 왘 Select the input behind which you wish to insert a new input.



왘 Click the Add Input To Function button. Add Input To Function button



An additional input is inserted after the selected input.



164



07/01 AWB2700-1305-GB



In order to insert an input at the bottom, select either the existing bottom input or the graphical symbol itself.



Programming in FBD Deleting inputs You can reduce the number of input variables for logic sequences and for arithmetic operations to two input variables in the following way. Note: the entire symbol will be deleted if you reduce the number of inputs to one. 왘 Select the input to be deleted.



왘 Press the DEL key or select Delete from the menu bar or the context menu. The selected input will be deleted.



07/01 AWB2700-1305-GB



You can also select and delete several adjacent inputs.



165



POU Editor Inserting outputs An output can be inserted above or below an existing output.The operators ST, STN, S, R, JMPC,JMPCN, RETC and RETCN are available for Boolean outputs and only ST for the other data types. STN can also be used with bit patterns. 1. Inserting an output above all existing outputs 왘 Select the connection line in front of the output symbol.



왘 Select the operator from the language element toolbar. The usable operators, organised by group, are listed below.



Branches group: for Boolean outputs: JMPC, JMPCN, RETC and RETCN



166



07/01 AWB2700-1305-GB



Logic group: for Boolean outputs: S, R



Programming in FBD



Assignments group: for Boolean outputs: ST for other data types: ST for bit patterns: STN (by negating an ST instruction via the One's Complement function or the space bar)



왘 Select the required operator. The appropriate graphical symbol will be inserted above existing outputs.



2. Inserting outputs behind an existing output



07/01 AWB2700-1305-GB



왘 Select the output behind which you wish to insert the new output.



167



POU Editor



168



07/01 AWB2700-1305-GB



왘 Select the operators as described above. 왘 Select the required operator. The appropriate graphical symbol will appear below the existing output.



Programming in FBD Deleting outputs Individual outputs or several adjacent outputs can be deleted. At least one output symbol must be left when outputs are deleted. 왘 Select the output range to be deleted.



07/01 AWB2700-1305-GB



왘 Press the DEL key or select Delete from the menu bar or the context menu. The selected output range will be deleted.



169



POU Editor Negating inputs You can negate inputs assigned to Boolean data types or bit pattern data types. 왘 Select the input to be negated.



170



07/01 AWB2700-1305-GB



왘 Press the space bar. The selected input will be negated. You can also carry out this action via the One's Complement button in the language element toolbar.



Programming in FBD Negating outputs You can negate outputs assigned to binary or bit pattern data types. This does not apply to “S” and “R” operators. 왘 Select the output to be negated.



07/01 AWB2700-1305-GB



왘 Press the space bar. The selected output will be negated. You can also carry out this action via the One's Complement button in the language element toolbar.



171



POU Editor Naming elements The contacts and outputs must be completed by entering the variable names. Parameter passing in the program requires the assignment of variable names to the connections of functions and function blocks. Inputs can also be assigned constants, i.e. values. 1. Naming inputs 왘 Select the input for which you wish to enter a variable name or a constant. 왘 Press the Enter key. The Name Element dialog box will open.



Figure 61: Name Element, FBD



왘 Enter the variable name directly or via the Clipboard or enter the value of a constant and confirm with the OK button, 왘 or select the function block from a list of all declared variables which you can open via Insert ? Variable..., via the toolbar button or via the context menu. 왘 Confirm the entry with the OK button or the Enter key. 왘 Select the output for which you wish to enter a variable name. The remaining procedure is the same as described in the section “Name input”.



172



07/01 AWB2700-1305-GB



2. Naming outputs



Programming in FBD Entering names with Jump operations A jump symbol must be completed by defining the jump destination. 왘 Select the jump symbol for which you wish to define a jump destination.



왘 Press the Enter key. The operation is also available in the context menu. The Name Element dialog box will open.



Figure 62: Name element as jump destination, FBD



07/01 AWB2700-1305-GB



왘 Enter the name of the jump destination and confirm with the OK button.



173



POU Editor Entering network comments Each network can be assigned a comment of several lines in length. 왘 Position the cursor in the network. 왘 Choose Network Comment... or click the corresponding toolbar button. Network Comment button



The Edit Network Comment window will open.



Figure 63: Edit FBD Network comment



174



07/01 AWB2700-1305-GB



왘 Enter the comment (you can switch lines by pressing the Enter key) and confirm with the OK button. The comments entered will appear in the network header beneath the network number.



Changing programming language



How to check, save and close your POU is described on Page 125.



Changing programming language



In general, IL, LD and FBD programming languages are interchangeable if the POU is syntactically correct. If not, an appropriate error message will be generated. IL and ST language elements can also be mixed, however, they must be terminated with an IL sequence or an ST statement, as well as being syntactically correct. ST language elements and elements of the LD and FBD graphical programming languages cannot be mixed. The programming language can be changed in the following way:



07/01 AWB2700-1305-GB



왘 Choose Options ➞ Programming Language ➞ IL/ FBD/LD/ST or 왘 Select the desired programming language via the toolbar button in the standard toolbar.



Figure 64: Language selection button



175



POU Editor The instruction section for the POU will appear in the selected programming language. Some instruction sequences of a program created in IL cannot be shown graphically, even when the Sucosoft syntax is correct. When converting programs of this kind into one of the graphical languages, a network with the message “Network cannot be graphically displayed” will be issued for each program section which cannot be converted. The instructions and statements concerned will be displayed in IL.



Figure 65: POU section which cannot be graphically displayed



The following examples are offered to help you solve any problems arising from conversion restrictions.



Conditional function block call



176



07/01 AWB2700-1305-GB



A CALC or CALCN function block call that was programmed in IL cannot be displayed graphically.



Changing programming language Example: (* Conditional call of the CTU counter function block when the “palletizing” production step is running *) LD Palettizing CALC Counter_3( CU := Lightbarrier, RESET := RES_button, PV := 120 | full := Q, := CV )



After changing to LD or FBD the program section appears as follows (it cannot be edited here).



07/01 AWB2700-1305-GB



Solution: Programming a conditional jump of the CAL function block call when the variable Palletizing is “0” results in an IL program that can be displayed graphically. LDN Palletizing JMPC Label_4 CAL Counter_3( CU := Lightbarrier, RESET := RES_button, PV := 120 | full := Q, ) Label_4:



177



POU Editor After changing to FBD the program section appears as follows:



Intermediate storage within an IL sequence Intermediate storage within a sequence is possible in IL programming.



(* AND-before-OR-sequence, only displayable in IL *) LD var1 OR ( var2 AND var3 ST AND_result (* Intermediate storage not displayable in LD/ FBD *) ) OR var4 ST OR_result



178



07/01 AWB2700-1305-GB



Example:



Changing programming language After changing to LD or FBD the program section appears as follows:



Solution: (* AND-before-OR-sequence, LD/FBD compatible, Part1 *) LD var2 AND var3 ST AND_result (* AND-before-OR-sequence, LD/FBD compatible, Part2 *) LD var1 OR AND_result OR var4 ST OR_result



07/01 AWB2700-1305-GB



After changing to FBD the program section appears as follows:



179



POU Editor



Line-oriented comments Line comments are possible in IL at any point in the program. In graphical programming languages, comments can only be entered in the network header. When a program written in IL is displayed in LD or FBD, all line comments of an IL sequence will appear in the network header.These comments can then no longer be re-assigned to the respective IL lines if you change back into IL format, and will be placed at the beginning of the IL sequence. Example:



After changing to FBD the program section appears as follows:



180



07/01 AWB2700-1305-GB



(* Counting the produced parts *) CAL Counter_4( (* Instance of the CTD function block*) CD := Part, (* Pulses from a light barrier *) Load := SetKey, PV := 50 (* Quantity in a packing unit *) | empty:= Q (* Counter elapsed, i.e. Packing full *):= CV )



Changing programming language



07/01 AWB2700-1305-GB



After returning to IL the program looks as follows:



181



POU Editor POU Info



The POU Info... function in the Editor provides useful help when using your POUs. You can edit important POU data such as destination PLC type, author, date created, comments on the POU, etc. in the left portion of the dialog box displayed below. The edited information on a POU is displayed when you select the POU in the Navigator and select the “About” option in the Edit menu or you can call it up via the context menu. 왘 With an open POU choose File ➞ POU Info... and click the Prototype button in the dialog box that opens. The following figure will appear:



The prototype is shown in the right-hand part of this figure, i.e. the interface of an FB or function type POU.



182



07/01 AWB2700-1305-GB



Figure 66: POU Info



Converting POU types Converting POU types



Use this option when you want to use the contents of an existing POU in a new POU of a different type (program, function, or function block) or when you have selected the wrong POU type when creating the POU with File ➞ New POU. Requirement: The POU whose type you wish to change is open in the POU Editor.







When the POU type is converted, there are some declarations that cannot be converted. This applies to the scopes that are not available with the new POU type (e.g. input or output variables in the Program POU). The instruction section is nevertheless accepted unchanged. 왘 Choose File ➞ Convert POU Type. Select the desired POU type in the list box that opens showing the current POU type with a check mark and the change will be carried out. The new POU type will be displayed in the title line of the POU Editor.



Figure 67: Convert POU type



07/01 AWB2700-1305-GB



왘 Switch the Variables Editor to Free mode via Options ➞ Variables Editor ➞ Free Mode in order to have the entire declaration section with all variable types in view. Check both the instruction and the declaration sections of your POU. 왘 Save the POU.



183



POU Editor You can also use this option to convert the return value of a function POU currently in process to another return value. 왘 Choose File ➞ Convert POU Type. In the list box that opens, where the Function... POU type is marked with a tick, select Convert Function Type... to open the Function Type window where you can select the new function type and confirm the selection by clicking the Accept button.The return value will be converted and the new value will then be displayed in the title bar of the POU Editor.



184



07/01 AWB2700-1305-GB



Figure 68: Convert function type



Opening/editing global types Opening/editing global types



You can easily make declarations of complex types, such as structures, that you wish to use for several POUs within the overall project, by declaring them in a separate editor that you can call up via the menu bar by choosing File ➞ Open Global Types. You can make type declarations by combining derived and elementary data types within the keywords TYPE...END_ TYPE (See “Derived Data Types” in AWB2700-1306-GB). Remember that although this kind of type declaration is valid for all POU types, it is only valid for the selected PLC!



07/01 AWB2700-1305-GB



Figure 69: Global user-defined data types



Unlike derived data types that only have scope within the POU concerned, the data types formed here are global, i.e. their scope is within the entire project. They can thus be used, for example, as data types



185



POU Editor for input or output variables for function blocks. As a further example, complex data can be transferred by using a structure variable at a function block input for processing.



Cross-reference file



This shows a list of all declared variables for the current POU including the POU lines in which they are used. It also provides the physical address or location of directly represented variables. The POU cross-reference file is created via File ➞ Cross-Reference File. The updated cross-reference file is then shown in the Output window. Doubleclicking the line that contains the required variable in the cross-reference file will cause the POU Editor to move to the position in the instruction section where the variable was first used. Menu item Print in the context menu of the Output window can be used to document the cross-reference file.



A POU cross-reference file list for all POUs listed in the current make file can be created via File ➞ CrossReference File in the NAVIGATOR. This kind of central cross-reference file list shows, for example, the global/external interrelationships between program and function block POUs.



186



07/01 AWB2700-1305-GB



Figure 70: POU cross-reference file



3



Basic principles



Topology Configurator (Offline)



Structure The Topology Configurator supports two operating modes: Offline mode and Online mode. In Offline mode you can create your hardware system and enter the information required for the topology. The topology configuration is then compiled with the program it belongs to and loaded into the PLC. Online mode is used for commissioning the system. You can use the Test & Commissioning tool to carry out extensive diagnostics and test functions, such as wiring tests or network diagnostics. Online mode is described in further detail in chapter “Test & Commissioning”.



Offline mode



07/01 AWB2700-1305-GB



The Topology Configurator allows you to create the hardware configuration of your automation system. The CPU is the hardware component that forms the basis of this configuration. Starting from the CPU unit (master PLC), the local and remote expansions of the automation system are defined and assigned parameters in the graphical user interface of the Configurator. The graphical Topology Configurator supports both Suconet K and AS-Interface®topologies. PROFIBUS-DP, PROFIBUS-FMS and INTERBUS topologies are configured with their own configurators:



187



Topology Configurator (Offline) Table 3: Overview of the configurators Configurator in Offline mode Configurator in Online mode (Test & Commissioning) Suconet K



Sucosoft S40



AS-Interface® PROFIBUS-DP



Sucosoft S40 + CFG-DP



CFG-DP



PROFIBUS-FMS



Sucosoft S40 + CFG-Suconet-P



CFG-Suconet-P



INTERBUS



Sucosoft S40 + CFG-CMD



CFG-CMD



Plausibility checks



188



07/01 AWB2700-1305-GB



The range of possible functions and the availability of cards and modules in the selection windows is determined by means of plausibility checks within the Topology Configurator. In this way the Configurator only offers the options that are permissible within the context defined. Tasks and considerations like complex current calculations, checks on I/O utilisation, the maximum number of connectable network lines, the permissible location of cards/modules, the memory requirement, the maximum number of LEs or cards/modules as well as syntax checks are handled by the Configurator automatically, thus ensuring that all configurations that are created are actually plausible.



Basic principles







The Topology Configurator will propose a suitable even numbered byte address for the highest output byte address of all configured PS416-OUT-400/-410 output cards. However the Topology Configurator cannot detect if you assign a PS416-OUT-410 (8 outputs) with a possible odd numbered byte address that overlaps the even byte address of a PS416-OUT400. These kinds of overlaps should therefore be avoided if you have mixed the configurations of PS416-OUT-400 and PS416-OUT-410 output cards!



Starting the Topology Configurator Start the Topology Configurator via The NAVIGATOR menu: Tools ➞ Topology Configurator or click the appropriate icon in the Sucosoft toolbar of the NAVIGATOR:



07/01 AWB2700-1305-GB



Topology Configurator



189



Topology Configurator (Offline) Network types Suconet K network PLCs used in a networked system can be programmed via a point-to-point connection established between the programming unit and the PLC concerned. The data is exchanged via Suconet K in master-slave mode.



190



07/01 AWB2700-1305-GB



With Sucosoft it is also possible to program and commission subordinate PLCs in the first network level via a so-called “master” PLC, which is connected to the programming unit via a normal programmer interface. These PLCs are stations on Suconet K network lines that are managed by the master. Only one cable is thus required for programming, maintenance and communication, and several PLCs can be accessed from one central programming system.



Basic principles AS-Interface®network The Actuator-Sensor Interface®is an open-standard and rugged fieldbus system which extends the networkability of automation devices down to the “field level”, i.e. the lowest process level. This is a single master system. There is therefore only one master for every AS-Interface®subnetwork, which addresses the slaves in succession and carries out read or write data exchanges with them. This “singlemaster system” operates a typical cyclical polling of slaves, and ensures a defined reaction time. The AS-Interface bus also features a user-friendly and rugged connection system. Its open system capabilities are promoted and protected by the AS-Interface®Association. The ASInterface®Association also defines the so-called profiles which lay down the specifications for particular groups of similar network stations. AS-Interface®slaves are defined by: the IO code, the ID code, a maximum of four initial parameters.



07/01 AWB2700-1305-GB



IO code The number and division of inputs and outputs are specified by the IO code. The IO code is a parameter value between 0 and F. Up to four inputs and outputs can be selected. ID code The ID code identifies the device type and thus defines the meaning of the data and parameter bits. It is used to distinguish slaves with the same IO code. The ID code is for the generic AS-Interface® components, which are the first 15 components of the Type selection window, and which can be selected with hex. 0 to F. 191



Topology Configurator (Offline) When configuring non-Moeller devices (generic AS-Interface®components), the device is uniquely identified by its IO code and ID code. Depending on the device type or profile, the initial parameters can be used to choose or enable/disable certain device parameters such as the frequency for proximity switches, the value range for current inputs and outputs, and the characteristics of make and break contacts for digital inputs and outputs. PROFIBUS-DP network The PROFIBUS-DP fieldbus is one of three different versions, all of which are compliant with EN 50170. PROFIBUS was developed for high-speed communication in applications for industrial automation and building services. “DP” stands for decentralised periphery and is based on the RS 485 protocol for data transmission. It covers layers 1 and 2 of the ISO/OSI reference model for networks.



192



07/01 AWB2700-1305-GB



The PROFIBUS-DP network is configured in Sucosoft with the Topology Configurator and the PROFIBUS-DP CFG-DP Configurator (see online manual AWB-C2700-1336GB).



Operations Operations



Toolbar functions The Topology Configurator has a toolbar with all the functions required for creating a configuration.



New Configuration: Creates a new configuration and opens the New Configuration dialog box. You must specify the file name for the new configuration and the type of CPU to be configured.



Figure 71: Creating a new configuration



The PLC Type selection field shows all the installed CPU types available. You must select one of the available CPU types listed. Open Configuration: Loads an existing topology configuration into the configurator.



07/01 AWB2700-1305-GB



Save Configuration: Saves the edited configuration in a configuration file with the extension “.dcf” in the “Source” folder of the current project. Print Configuration: Opens the standard Sucosoft print dialog.



193



Topology Configurator (Offline)







Graphical printing is not implemented in this version. It is possible, however, to print out the configuration in list form. The displayed topology can be printed out as a graphic by pressing ALT+PRINT SCREEN with the Configurator window active in order to copy the graphic to the Clipboard, from where it can be loaded into Microsoft®PAINT and printed out. Local Expansion:This adds a local expansion to the selected PLC or network station, i.e. directly on the device. A selection list will appear with all possible expansion devices for the current configuration.



The Preselection drop-down list box allows you to divide the available expansions into groups to simplify the selection of the possible components. The selected components will then be shown graphically in the configuration. The device designation and the relevant technical data are displayed in the field at the bottom of the dialog.



194



07/01 AWB2700-1305-GB



Figure 72: Local Expansion dialog



Operations Remote Expansion (in the Suconet K network): Expands a network module or a network-compatible device via Suconet K. A selection list will appear with all modules and devices for the current configuration.



Figure 73: Remote Expansion dialog box



07/01 AWB2700-1305-GB



The Preselection drop-down list box allows you to divide the available expansions into groups to simplify the selection of the possible components. The selected components will then be shown graphically in the configuration. The device designation and the relevant technical data are displayed in the field at the bottom of the dialog.



195



Topology Configurator (Offline) Remote expansion (in the AS-Interface® network):To add a remote expansion to an ASInterface®line, you have to add a master module as a local expansion in the topology configuration or open a configuration already containing an ASInterface®master. You can then add remote expansions to the AS-Interface®network.



Figure 74: Remote expansion in the AS-Interface® network



196



07/01 AWB2700-1305-GB



왘 For this select the AS-Interface®master module, such as LE4-505-BS1, or any device in the AS-Interface®line behind which you wish to add a new AS-Interface®network component. 왘 Open the Remote Expansion window by clicking the Remote Expansion button or choose Edit ➞ Remote Expansion. A list of possible expansion modules is shown:



Operations Select an AS-Interface profile which corresponds to a device group with the required features in the Preselection list. The Type list box then only shows devices of the specified profile. To get a list of all so-called generic components, which can be used to describe any AS-Interface® device, choose All Profiles in the Preselection list. The names of the generic types indicate the number of inputs and output, e.g. “2 INP/2 OUT”. 왘 Choose a profile in the Preselection list if you want to limit your selection to devices with a particular profile. 왘 Choose the required device from the Type list box. When specifying a new device, you are automatically prompted with the next unused address in the Station number pop-up list. If there are unused addresses between two stations, these will be assigned first of all. 왘 Change this value if you wish to set another unused address. The Properties field shows the particular features of the selected components: Manufacturer:Manufacturer of the selected AS-Interface® component



07/01 AWB2700-1305-GB



IO code:Each type is assigned a special IO code which appears automatically. The code 0 to F indicates the number of inputs and outputs. ID code: Identification code of a station type. For generic AS-Interface® components selectable from 0 - F.



197



Topology Configurator (Offline) Input/outputs:Shows the number of inputs and outputs as well as their position “0”, “1”, “2” or “3” for the selected device type. The position of the “X” determines the address of the respective input or output in the PLC program. 왘 For generic AS-Interface devices, you must specify the ID code listed in the manufacturer’s documentation. 왘 Confirm your entries by clicking OK. 왘 Save the topology configuration by choosing Configuration ➞Save As.... 왘 Specify a name for the topology configuration in the File Name field. The file is saved with the file name extension “.DCF” as the new permanent configuration in the Source folder for the current project. Delete:Deletes a selected element.



198



07/01 AWB2700-1305-GB



Parameters:Assigns the device parameters (if appropriate). The values are set in the Parameters dialog. These dialogs will have a different appearance depending on the device type (see the following examples).



Operations Examples of Parameters dialogs



07/01 AWB2700-1305-GB



Figure 75: Parameters dialog for PS4-341-MM1



Figure 76: Parameters dialog for PS416-AIO-400 analog I/O card



199



Topology Configurator (Offline)



Figure 77: Parameters dialog for AS-Interface



Procedure for assigning parameters:



200



07/01 AWB2700-1305-GB



왘 Create a configuration or load an existing configuration file using the Open Configuration button or by choosing File ➞ Open.... The configuration will appear in the graphic window of the Configurator. 왘 Left-click the device or card/module for which you wish to change the parameters. 왘 Click the Parameters button or choose Edit ➞ Parameters.... 왘 Set the required parameters. 왘 Save the new settings.



Operations Change Display: Toggles between graphical and compressed display. In compressed mode, the device names are shown abbreviated and the user descriptions of the components are not shown. Changing views does not affect the configuration functions available.



07/01 AWB2700-1305-GB



Figure 78: Compressed display of a topology configuration



201



Topology Configurator (Offline) Display I/O utilisation:This displays the utilisation of the communication memory in the status line. Clicking the button once more hides the information again. The information shown includes the number of assigned inputs and outputs and the total number of inputs and outputs available.







I



Inputs



O



Outputs



I+O Total number of inputs and outputs Inputs refer here to physical inputs, receive data and diagnostics data from stations. Outputs are physical outputs and send data. The information shown applies to the currently selected network line.



202



07/01 AWB2700-1305-GB



Display Bus Cycle Time:This displays in the status line the theoretical bus cycle time for the selected network line. The figure shown is a typical value for trouble-free communication. Clicking the button once more hides the information again.



Operations Changing a topology configuration Requirement: For this a configuration file must already exist. 왘 Load the existing configuration file using the Open Configuration button or by choosing Configuration➞ Open.... The configuration will appear in the graphic window of the Configurator. Proceed as follows to change a topology configuration. Changing parameter data 왘 Left-click the device or device/module for which you wish to change the parameters. 왘 Select the Parameters button or Edit ➞ Parameters.... 왘 Change the parameters as required. 왘 Save the new settings.



07/01 AWB2700-1305-GB



Adding new local devices 왘 Select the device directly to the left of the position where you want to insert the new device. 왘 Open the Local Expansion window by clicking the Local Expansion button or choose Edit ➞ Local Expansion.... A list of possible expansion modules is shown. 왘 Select the required device from the list and click OK to confirm. The new device is inserted to the right of the selected device, whilst all other devices to the right are moved one position further to the right. The Configurator automatically updates the module numbers shown above the device concerned. With the PS416 modular controller, if you add a device to an empty slot, there is no need for the Configurator to update existing device numbers.



203



Topology Configurator (Offline) Deleting local devices 왘 Select a device to be deleted. 왘 Click the Delete button or choose Edit ➞ Delete. This will delete the element. With PS416 modular PLCs empty slots will be shown instead of the deleted cards. These can be removed also by clicking the Delete button once more. If the device to be deleted is connected to other subordinate elements such as slaves or local expansion modules, they are deleted together with the local device. A warning prompt warns you that subordinate elements will be deleted and allows you to cancel deleting if required.



왘 Select the device directly to the left of the position where you want to insert the new device. 왘 Open the Remote Expansion window by clicking the Remote Expansion button or choose Edit ➞ Remote Expansion.... A list of possible expansion modules is shown. 왘 Select the required device from the list and click OK to confirm. The new station is inserted below the selected station, whilst all other devices below are moved one position further downwards. The Configurator automatically updates the device numbers of all affected devices. 204



07/01 AWB2700-1305-GB







Adding new remote devices Add a new remote device to the AS-Interface® network as described in Section “Remote expansion (in the AS-Interface®network):To add a remote expansion to an AS-Interface®line, you have to add a master module as a local expansion in the topology configuration or open a configuration already containing an AS-Interface® master. You can then add remote expansions to the AS-Interface®network.” on Page 196.



Operations Deleting a remote device 왘 Select the device to be deleted. A remote device is always connected directly to the line. 왘 Click the Delete button or choose Edit ➞ Delete. A warning prompt will warn you that deleting the device will also delete all local expansion devices assigned to it. Confirm or cancel the deletion as required. Replace component You can also change the type of master in an existing configuration by replacing the device concerned. 왘 Select the master (first device in the topology configuration). 왘 Choose Edit ➞ Replace. This will open a selection window with a list of possible masters. 왘 Select the required device and click OK to confirm. A message will appear to notify you that the set parameters are not accepted. Confirm this prompt. The new master will then be added.



07/01 AWB2700-1305-GB



왘 Set the master parameters if necessary.



205



Topology Configurator (Offline) Topology configuration with Suconet K



Topology configuration A hardware system for a special application can be made up of different network lines and stations connected to them. In this “Single-master” system one master and up to 30 slaves are possible. The topology consists of all the lines and stations (see Fig. 83 on Page 228) defined in the topology configuration. This topology configuration is therefore the overall configuration for the entire hardware system, and may consist of several individual device configurations.



Device configuration



206



The Sucosoft S40 Topology Configurator cannot display several device configurations at the same time. An example of a displayed device configuration is shown in Fig. 87 on Page 233.



07/01 AWB2700-1305-GB







The device configuration must be created for each intelligent station (station with CPU that can run a user program) separately. It consists of a file containing all the information required by the intelligent station in order to operate its local and remote components, i.e. all the information for the Parameters dialog, I/O addressing and communication. The file is saved with the file name extension “.DCF” in the project.



Topology configuration with Suconet K A configuration file defines the following types of stations: the master all local components of the master PLC; they are later identified by line and station number 0. all remote components of the master PLC (network slaves). Network slaves are configured differently, depending on whether they have their own CPU or not: Configuration of a slave without CPU Only enter this slave, if necessary, with connected local components, in the master configuration. Suconet K automatically selects the appropriate telegram length for these slaves and addresses the data ranges addressed in the application. The receive and send data lengths (RD/SD) do not have to be set. Configuring a slave with a CPU (“intelligent slave”) This kind of slave runs its own user program and therefore has its own configuration. As well as being specified in the master configuration, a slave configuration must also be created for it.



07/01 AWB2700-1305-GB



In the slave configuration enter the station and any connected local components. Also set the receive and send data lengths (RD/SD) from the point of view of the slave.



207



Topology Configurator (Offline) In the master configuration enter this slave on the line concerned. Only the basic unit is specified in the master configuration and not the local expansions. Also set the receive and send data lengths (RD/SD) for this slave from the point of view of the master. Setting send and receive parameters Receive and send data lengths (RD/SD) do not have to be defined in the Topology Configurator for Suconet K communication between master and slaves without their own CPU. Suconet K automatically selects the appropriate telegram length and addresses the data ranges addressed in the application.



208



07/01 AWB2700-1305-GB



For Suconet K communication between master and “intelligent slaves” (slaves with their own CPU), the number of receive and send data bytes (RD/SD) must be set accordingly in both the master and slave configurations. This is carried out in the Parameters dialog for the “intelligent slave” concerned. This is necessary since the data to be exchanged between master and “intelligent slaves” is communication data. The master cannot access the I/O data of the “intelligent slave” directly.



Topology configuration with Suconet K Define send and receive data in the master configuration as follows: Send data is data that the master sends to the “intelligent slave”. Receive data is data that the master receives from the “intelligent slave”. The number of send data bytes defined in the slave configuration must correspond to the number of receive data bytes defined in the master configuration and vice versa (see diagram). Master



Intelligent slave



RD SD



RD SD Line 1



RD = 5



RD = 2



SD = 2



SD = 5



07/01 AWB2700-1305-GB



The data exchange is initiated with the operands “RD” (Receive Data) for reading and “SD” (Send Data) for writing.



209



Topology Configurator (Offline) Addressing the slaves Each configuration component is displayed with a network and module address and the relevant component designation. A name up to twelve characters in length can also be assigned to each component. The Configurator shows the entry in the component designation (for example, see Fig. 89 on Page 235). The three-digit number sequence appearing above each configuration component is the card or module address. It is automatically generated when the component is added to the configuration. The address consists of the three elements for line number, station number and slot/module number. This three-digit address corresponds to the first three numbers of the variable address in the PLC program. For example, a module with the number sequence 1.3.7 is accessed in a PLC program with the variable address %Q1.3.7.0.0. Line Number: The line numbers are automatically assigned by the Topology Configurator and are numbered consecutively in ascending order from left to right, the first line being assigned the number “1”. The master is always assigned line number “0”. The number of network lines that can be connected depends on the type of master used.



210



07/01 AWB2700-1305-GB



Station Number: The station numbers of the slaves are assigned in ascending order from the master, so that the master is assigned the number “0” and the first slave the number “1” etc.



Topology configuration with Suconet K Module Number: The module numbers are assigned in ascending order from left to right so that the basic unit is assigned the number “0” and the first local expansion module the number “1” etc. Power supply units are not included in the configuration.



Master - slave operation with Remote control All slaves that are configured as “intelligent slaves” in a Suconet K network can be set for Remote Control mode if required. In this mode, “intelligent” Suconet K slaves with their operating mode selector switch either in Run or Run M-Reset can be synchronised with the operating status of the master (Run or Halt). For this the Suconet master must be connected and its startup phase must have been completed.



07/01 AWB2700-1305-GB



Warning! When Remote Control is active, the following special case must be taken into account in the event of a failure and subsequent restoration of the power supply due to the different times for the restart phases (see following table).



211



Topology Configurator (Offline) Master operating status



Restart phase of a slave in relation to the restart phase of the master... ...shorter



...longer



Boot (during restart)



Slave operating status: Run (when slave restart phase completed) Master connection: Disconnected



Slave restart phase



“Ready” (transition state after restart)



Slave operating status: Ready Master connection: Connected



Slave restart phase



“Run” (automatically after Ready)



Slave operating status: Run Master connection: Connected



Slave operating status: Run Master connection: Connected



In order to prevent undefined states occurring in the sections of the installation controlled by the slave, the running of the slave user program should be made dependent on the secure Run state of the master. The communication status byte of the master can be used to see whether the Suconet K master is connected and in Run status. Example declaration VAR Master _Statusbyte AT %ISB0.0.0.1 :BYTE; Master_Run_Status AT %IS0.0.0.1.1:BOOL; Master_Net_Status AT %IS0.0.0.1.6:BOOL; END_VAR



212



07/01 AWB2700-1305-GB



Example instruction: LD Master _Statusbyte EQ 0 JMPCN End . . . End:



Topology configuration with Suconet K Special note with PS4-101-DD1 and PS4-111-DR1 The PS4-101-DD1 and PS4-111-DR1 compact PLCs can be run both as active slaves or passive slaves on the Suconet K line. When used as an active slave, which is also commonly known as “intelligent slave”, these PLCs run a user program and communicate with the master via receive and send data (RD/SD). This must be defined in the Topology Configurator on the master and the slave. When configured as a passive slave, without a user program, these PLCs provide the master with remote I/O (I/Q, IA/QA) information. The physical outputs (Q), however, can only be forced on passive slaves.



07/01 AWB2700-1305-GB



The activation of an output byte on active slaves has no effect.



213



Topology Configurator (Offline) Special note with PS4-300 “Synchronous” operation of the Suconet K interface (default setting) Use Synchronous mode when you wish to synchronise the user program cycle with the Suconet K cycle. In this way both cycles are started simultaneously. This operating mode is the same for the PS4-200. The following two cases must be noted: User program cycle > Suconet K cycle:After one Suconet K cycle has elapsed, the next Suconet K cycle will be missed until the currently running program cycle is completed. The data exchange with the Suconet K slaves is therefore slower than is possible for Suconet K. User program cycle < Suconet K cycle:If the Suconet K cycle is longer, i.e. the data in the communication buffer is not yet refreshed, only data that was previously used is available for the user program.



214



07/01 AWB2700-1305-GB



If you have selected Synchronous mode, you can optimise access to Suconet K data by using the diagnostics bits NKD_1 to NKD_3 of the message byte (see manual “Hardware and Engineering”, PS4-300, AWB2700-1311-GB). These diagnostic bits are refreshed by the PS4-300 – according to the number of configured Suconet K network lines –and can be queried via the OS system function “PLC_Message”. A completed data exchange is indicated by the diagnostics bits for the duration of one program cycle.



Topology configuration with Suconet K If, for example, you have configured the PS4-341-MM1 with one Suconet K network line on its on-board SBI, this will refresh the NKD_1 bit. This can be used as follows for checking: LD NKD_1 PLC_Message JCN ...



Depending on whether the PS4-300 is operating as Suconet K master or slave, a 1 at NKD_* bit will indicate the following: PS4-300 is master, NKD_1 = 1: data exchange with all slaves on line 1 has been completed. The receive data from all slaves is in the communications buffer, has been refreshed and can be read by the user program. The send data to the slaves can be overwritten by the user program.







PS4-300 is slave, NKD_1 = 1: data exchange with the master of line 1 has been completed. The receive data in the communications buffer has been refreshed and can be read. The send data to the master in the communications buffer can be overwritten by the user program. When using the PS4-300 as Suconet K master with synchronous Suconet K mode, the maximum cycle time should not exceed 255 ms.



07/01 AWB2700-1305-GB



Use Asynchronous mode if the program cycle and the Suconet K cycle should run independently, i.e. asynchronously. This has the same behaviour as the PS416. Data exchange is executed as quickly as possible for each station separately. Operation as Suconet K slave If, for example, the power supply for all the Suconet stations of an installation has failed and has been restored, a PS4-300 running as a Suconet K slave



215



Topology Configurator (Offline) will consider itself as disconnected from the network if its restart phase is shorter than that of the master. After switching to Run the PLC will therefore set its DDK bit = 1. In this case the DDK bit signals a temporary fault that is cleared when the Suconet K master is restarted and the connection is completed.



216



07/01 AWB2700-1305-GB



Configuration of send and receive data For problem-free Suconet K operation with a PS4-300 (as master and/or slave) you must not set 0 bytes send/receive data. If you do not require any data exchange, configure at least 1 byte of send data and 1 byte of receive data anyway.



Topology configuration with Suconet K Special note with PS416 Input and output cards As the digital I/O cards of the PS416 modular PLC are not addressed according to their slot location, there are two ways of describing cards: The digital cards can be selected and displayed individually. This method is useful if you wish to ensure that the actual configuration matches the visual display in the Configurator. This method, however, is not absolutely necessary. The digital I/O cards of one rack can be combined together and configured with a symbol. Depending on which method you choose, you will later be able to use a group display of all digital I/O or an I/O display for each individual card when using the Force/Display I/O function in the Test and Commissioning tool. Multi-processing Multi-processing is a configuration in which several PS416 controllers are interconnected and exchange data via the local parallel bus. The following important points must be taken into account:



07/01 AWB2700-1305-GB



When several PS416-CPU-200/300/400 cards are used in one rack, the function block CPUDataExchange can be used to exchange data between the individual controllers. For this the function block is used in the master and in the slave CPUs. This requires the following PS416 system configuration: Slot 2: Master CPU; Slot 4/6/8/...: Slave CPUs; PS416-CPU



217



Topology Configurator (Offline) Data is exchanged via a special 2032 byte memory range. Write or read operations to this data range can be carried out via a function block call. The PLC fitted in slot 2 is the so-called master PLC and all other CPUs are slaves on the local bus. In a configuration with several local CPUs remember that only the master CPU (slot 2) or the first CPU slave (slot 4) fitted in the rack is able to access the I/ O cards. There is an additional restriction for the slave card fitted in slot 4. It can only access digital I/ O cards.



218



07/01 AWB2700-1305-GB



All other CPUs are not able to access local I/O cards. This must be taken into account in the configuration files for the CPU cards.



Topology configuration with AS-Interface® Topology configuration with AS-Interface®



The configuration of an AS-Interface®network is basically the same as for a Suconet K network, in which the configuration is started with the bus master. Once this is completed you can then address individual slaves in an AS-Interface®line transparently using the Moeller address notation. Configuration can be carried out in two ways: You can create a complete AS-Interface® configuration offline in the Topology Configurator. You can just create a basic configuration offline. Sucosoft will then automatically detect the AS-Interface®slaves on a line. With the first method you create a topology configuration to which you add the AS-Interface® master to a network line and add the slaves as remote devices. This procedure is basically the same as for a Suconet K configuration, although the slaves of an AS-Interface®line can be modified as required. The second method also requires a topology configuration with a locally specified AS-Interface® master. Sucosoft uses this basic configuration to automatically detect online all active slaves on the AS-Interface®network.



07/01 AWB2700-1305-GB



Both approaches result in a new configuration which must then be transferred to the PLC as the so-called “Permanent configuration” together with the PLC program. The permanent configuration specifies all devices on the AS-Interface®line and allows the PLC in Run mode to access all inputs and outputs of the AS-I devices.



219



Topology Configurator (Offline) Topology configuration with PROFIBUS-DP



A topology configuration containing Suconet K and PROFIBUS-DP networks requires the use of two network configurators. The global configuration is created with Sucosoft, whilst the DP network is configured with a separate configurator (CFG-DP configurator) as part of the overall configuration. This configurator is also supplied with Sucosoft. The Sucosoft Topology Configurator just displays the DP master that starts the DP network. This card or module organises and executes the data exchange between the user program of the superordinate PLC and all connected slaves. The CFG-DP Configurator is used to define the bus parameters of the PROFIBUS-DP network. It is also used for configuring and assigning slave parameters and defining the allocation to one or several DP master cards or modules. The diagnosis and monitoring of the DP network is carried out with the DP Configurator. The configuration of the PROFIBUS-DP network is loaded directly on the DP master card or module with the CFG-DP Configurator.



220



07/01 AWB2700-1305-GB



If the DP master is an LE4-504-BS1 module you must specify in the Parameters dialog the name of the PROFIBUS configuration file created in the CFG-DP Configurator.



Topology configuration with PROFIBUS-DP Deviations between current and saved DP configuration When the user program is started, the current DP configuration of the DP master is registered by the system and saved as the permanent configuration. When the PLC is restarted after the power supply is switched on, the current configuration of the DP master is compared with the permanent configuration saved. The user program cannot start if any differences are detected. The PLC will then remain in Halt status.



Accessing the I/O of a PROFIBUS-DP slave PROFIBUS-DP slave I/O can be addressed via I or Q operands. For example, to access analog I/O use IW and QW to form the access address.



Syntax check of access addresses for PROFIBUS-DP slaves With the PS4-300 compact PLC the syntax of DP slave access addresses is checked during program generation.



07/01 AWB2700-1305-GB



With the PS416 modular PLC the syntax of PROFIBUS-DP slave access addresses is not checked until the program is started.



221



Topology Configurator (Offline) Maximum number of modules per slave The PS416-NET-440 and LE4-504-BS1 PROFIBUSDP masters support up to 60 DP modules per slave. In other words up to 60 I/O entries can be made in the CFG_DP Slave Configuration dialog.



Behaviour of the DDK or KOM diagnostics bits DP master The KOM diagnostics bit (PS416) and DDK diagnostics bit (PS4-341-MM1) are only set in the master CPU for a PROFIBUS-DP line when the master is in Run status (for Suconet in Ready and Run status). DDK signals a deviation between the actual configuration and the set configuration for one or several slaves, for example, due to wire breaks or a missing slave configuration. DP slaves The KOM diagnostics bit (PS416) and DDK diagnostics bit (PS4-341-MM1 or PS4-2xx-MM1) are not set in the slave CPU if a DP slave card/module (PS416-NET-441 or LE4-504-BT1) is disconnected.



222



07/01 AWB2700-1305-GB



When the slave user program is in Run status, the NoDPCommunication diagnostics bit can be used to determine whether the slave is correctly exchanging data with the master.



Topology configuration with PROFIBUS-DP Changing the DP configuration with CFG-DP If the PLC is in Run status when the DP configuration is downloaded to the master using CFG-DP, it will automatically be switched to Halt. In order to address the new DP I/O, the user program must be adapted, re-compiled and reloaded onto the CPU. The user program of a PS4-341-MM1 must always be re-compiled using the Generate All function.



Startup of a PROFIBUS-DP line of the PS416 modular PLC Depending on the number of slaves connected and the baud rate set, the time required to start a PROFIBUS-DP line may take longer than the start of the user program. This will cause the KOM bit to be set and the Error LED to light up on the PLC. In this case use the PS_ClearKomBit function block to reset the KOM bit and only evaluate the KOM bit in the program from then.



07/01 AWB2700-1305-GB



Further information on the PROFIBUS-DP Configurator is available in the online documentation AWB-C2700-1336-GB.



223



Configuration examples



Example with a local configuration (PS4-200) The following local configuration without network expansion illustrates the procedure for creating a topology configuration. Topology Module no.



0 PS4-200



1



2



3



4



5



LE



LE



LE



LE



LE



Figure 79: Configuration with PS4-200



The configuration example consists of: one PS4-201-MM1 compact PLC with different local expansion modules (LE4) for I/O expansion:



224



07/01 AWB2700-1305-GB



LE4-108-XD1: 8 digital outputs LE4-206-AA1: 4 analog inputs/2 analog outputs LE4-108-XR1: 8 relay outputs LE4-116-DX1: 16 digital inputs LE4-116-DD1: 8 digital inputs/8 digital outputs



Configuration examples Procedure 왘 Create a new configuration file under a new file name, here DEVICE_A. Select from the list the PLC type to be configured, in this case PS4-201-MM1.



Figure 80: Creating a new configuration



07/01 AWB2700-1305-GB







왘 Use the Local Expansion button or choose Edit ➞ Local Expansion... to configure all the modules of the basic unit by selecting and adding them from the list. 왘 Save the completed configuration. The file is saved with the configuration name “local” specified at the beginning in the Source folder for the current project. The complete configuration is shown in Fig. 81. Remember that the address assignment of the modules depends on the order in which they are entered (automatic address assignment).



225



Topology Configurator (Offline)



Figure 81: Device configuration for PS4-200 (local slaves)



Fig. 81 shows the 3-digit numbering of each configuration component, which is used as card or module addresses. They are automatically generated when components are placed in the overall system. The address consists of the three elements for line number, station number and slot/module number. This three-digit address corresponds to the first three numbers of the variable address in the PLC program. For example, a module with the number sequence 0.0.4 is accessed in a PLC program with the variable address %Q0.0.4.0.0.



226



07/01 AWB2700-1305-GB



If required modules can be set using the Parameters button or via Edit ➞ Parameters.... The CPU of the master PLC is usually defined as network master.



Configuration examples To set the parameters of the master, left-click it and call up the Parameters dialog via the Parameters button or via Edit ➞ Parameters.... Change the parameters as required and save the new settings.



07/01 AWB2700-1305-GB



Figure 82: Parameters dialog for PS4-201-MM1



227



Topology Configurator (Offline) Example with PS4-300 Module no.



0 PS4-300 1



1



2



3



4



5



SBI



LE



LE



LE



LE



Device A



2



Line no.



1



Device B



PS4-150



2 PS4-200 Station



SBI



LE



Device C



1 1



2



1



PS4-200



SBI



LE



EM



Device E



EM



Device F



LE



Device D



1 1



EM



Device G



EM



Device H



Station



POW



SBI



INP



AIO



Device I



2



Figure 83: Topology for configuration example with PS4-341-MM1 (for key see opposite page)



228



07/01 AWB2700-1305-GB



2



Configuration examples The configuration example consists of: Device A: PS4-341-MM1 compact PLC with an integrated SBI in master mode. The basic unit is locally expanded with an additional SBI as master (e.g. LE4-501-BS1) and 4 local expansion modules (e.g. digital modules like LE4-116-XD1) Device B: PS4-141-MM1 compact PLC with an integrated SBI in slave mode. Device C: PS 4-201-MM1 compact PLC with an integrated SBI as master, an additional SBI as slave and one local expansion module. Device D: A PS 4-201-MM1 compact PLC with an integrated SBI as slave and an additional SBI as master and 2 local expansion modules. Devices E, F, G, H: Four expansion modules (EM...) as remote expansion modules (e.g. EM4-201-DX1) Device I: Rack without CPU with a power supply unit, an PS416-NET-400 E SBI card (E= expansion mode), a digital input card (PS416-INP-400) and an analog I/O card (PS416-AIO-400).



07/01 AWB2700-1305-GB



Key to Fig. 83: PS4-300



Compact PLC (PS4-341-MM1)



PS4-150



Compact PLC (PS4-141-MM1)



PS4-200



Compact PLC (PS4-201-MM1)



SBI



Serial bus interface (e.g. LE4-501-BS1, PS416-NET-400 E)



EM



Expansion module (e.g. EM4-201-DX2, EM4-201-DX1)



LE



Local expansion module (e.g. LE4-116-XD1, LE4-116-DD1)



INP



Digital input card (PS416-INP-400)



AIO



Analog I/O card (e.g. PS416-AIO-400)



229



Topology Configurator (Offline) Procedure Create the configuration as described in Section “Topology configuration with Suconet K” on Page 206. Ensure that a configuration file is created for each device with its own CPU. In this example this is necessary for devices A, B, C and D. First of all create a new configuration file for the master (compact PLC PS4-341-MM1) called Device A. This configuration should define the local and remote expansions accessible for this PLC, which are all the local expansion modules of device A, the PLC of device D (PS4-201-MM1), and device I. The slaves of device A's SBI module (device B and the SBI of device C) should also be defined in the configuration file for device A.



230



07/01 AWB2700-1305-GB



Device B, the PLC of device D and the SBI of device C are slaves with their own CPU, i.e. they should be defined in the master configuration (device A configuration) without their local expansion modules.



Configuration examples Configuration of device A PS4-300



SBI



LE



LE



PS4-150



PS4-200



LE



LE



A



B



SBI



LE



C



EM



EM



PS4-200



SBI



LE



LE



D



EM



EM



POW



SBI



INP



AIO



I



07/01 AWB2700-1305-GB



Figure 84: Configuration of device A



The shaded elements in the graphic should be defined in the configuration for device A.



231



Topology Configurator (Offline) 왘 Create a new configuration file with the name “DEVICE_A” and choose the type of the CPU to be configured from the list (in this example PS4-341-MM1).



Figure 85: Creating a new configuration



왘 Use the Local Expansion button to configure all the local modules of this PLC, in this case LE4501-BS1, LE4-116-XD1, etc. (see Fig. 86).



232



07/01 AWB2700-1305-GB



Figure 86: Local expansion of device A



Configuration examples 왘 Use the Remote Expansion function to configure all network stations that communicate with device A as slaves via Suconet K (see Fig. 87). These are the CPUs of device D (master configuration) and device I.



Figure 87: Device configuration of device A with view of line 1



07/01 AWB2700-1305-GB



Specify the number of send and receive data bytes to be exchanged between the CPUs of device A and D (see also Page 208 ): 왘 Select device D and open the Parameters dialog. 왘 Enter the number of send and receive data bytes (in the example SD = 9 bytes, RD = 7 bytes); i.e. the CPU of device A is to send 9 bytes of data to the CPU of device D and should receive 7 bytes of data from it.



233



Topology Configurator (Offline)



Figure 88: Setting send and receive data bytes



234



왘 Select the LE4-501-BS1 module and define the slaves of line 2 (PS4-141-MM1, LE4-501-BS1) using the Remote Expansion function. The topology configuration will now show a compact PLC (device B) in the master configuration and the network module LE4-501-BS1 (SBI) of device C. A separate configuration file will be created later for device C since it has its own CPU. The device configuration for device A only has the SBI of device C in line 2. Fig. 89 shows the configuration of device A with the view of line 2.



07/01 AWB2700-1305-GB







These values must later correspond to the configuration of device D (see Page 242).



Configuration examples



Figure 89: Device configuration of device A with view of line 2



왘 As the CPU of device B is a slave on the Suconet K line, the receive and send data bytes must be set in the Parameters dialog for this slave (see also Page 208). The Topology Configurator shows the complete network line selected. The remaining lines are indicated by a short line underneath the module.



07/01 AWB2700-1305-GB



In this example, if you select the master PLC (PS4-341-MM1), line 1 will be displayed whilst line 2 is shown with a short line underneath the LE4-501-BS1 module. If the SBI is selected that is the master of line 2, the slaves of line 2 are shown. 왘 Save the completed configuration. This will be saved under the name “DEVICE_A”, as specified at the start.



235



Topology Configurator (Offline) Configuration of device B PS4-300



SBI



LE



LE



PS4-150



LE



LE



B



SBI



PS4-200



LE



EM



EM



PS4-200



SBI



LE



LE



EM



EM



POW



SBI



INP



AIO



236



07/01 AWB2700-1305-GB



Figure 90: Device configuration of device B



Configuration examples The configuration of device B simply specifies the compact PLC.



07/01 AWB2700-1305-GB



왘 Create a new configuration for device B (slave configuration). The selected compact PLC PS4-141-MMI will appear in the New Configuration dialog. 왘 Set the PLC parameters in the Parameters dialog as a slave since it is a slave on the Suconet K line. For this set the Bus status option to Suconet K slave on the General Settings tab. The configuration indicates this with a short line above the module. 왘 In the Parameters dialog set the station address on the Suconet K Slave tab to the address set in the master configuration (in example station number 1). You must also set the number of send and receive data bytes (see Page 208). 왘 Save the completed configuration. This will be saved under the name “DEVICE_B”, as specified at the start.



237



Topology Configurator (Offline) Configuration of device C PS4-300



SBI



LE



LE



LE



LE



PS4-150



PS4-200



PS4-200



SBI



SBI



LE



LE



C



EM



E



EM



F



LE



EM



EM



POW



SBI



INP



AIO



238



07/01 AWB2700-1305-GB



Figure 91: Device configuration of device C



Configuration examples The shaded elements in the graphic should be defined in the configuration for device C.



07/01 AWB2700-1305-GB



왘 For this create a new configuration for device C with the name “DEVICE_C”. In this configuration define the PS4-201-MM1 compact PLC, together with the SBI the LE4-104-XP1 local expansion module as well as remote expansion modules EM4-201-DX2 and EM4-201-DX1. 왘 In the Parameters dialog for the SBI set it for slave operation and set the correct station address, in this case station 2. 왘 Save the completed configuration. This will be saved under the name “DEVICE_C”, as specified at the start.



Figure 92: Configuration of device C



239



Topology Configurator (Offline) Configuration of device D PS4-300



SBI



LE



LE



LE



LE



PS4-150



SBI



PS4-200



LE



EM



EM



PS4-200



POW



SBI



SBI



LE



INP



LE



D



EM



G



EM



H



AIO



240



07/01 AWB2700-1305-GB



Figure 93: Device configuration of device D



Configuration examples The shaded elements in the graphic should be defined in the configuration for device D.



07/01 AWB2700-1305-GB



왘 For this create a new configuration for device D with the name “DEVICE_D” (slave configuration). This configuration should define the PS4-201MM1 compact PLC, the local expansion modules LE4-116-XD1, LE4-116-DD1 and remote expansion modules EM4-101-AA1W33 (device G) and EM-111-DR1 (device H). 왘 In the Parameters dialog for the PS4-201-MM1 set the CPU as slave since this is a slave on line 1. Fig. 95 indicates this with a short line above the module. For this set the Bus Status option to Suconet K Slave on the General Settings tab. The configuration indicates this with a short line above the module. 왘 Set the station address and the number of send and receive data bytes on the Suconet K slave tab of the Parameters dialog:



241



Topology Configurator (Offline)



Figure 94: Parameters dialog for CPU of device D



Station Address: The address set here must be the same as the corresponding address in the master configuration (in the example station 1). Send and Receive Data: In accordance with the master configuration (see Page 234) you must set 9 bytes as receive data and 7 bytes as send data; i.e. the CPU of device D is to receive 9 bytes of data from the CPU of device A and send 7 bytes of data back to it.



242



07/01 AWB2700-1305-GB



왘 Save the completed configuration. This will be saved under the name “DEVICE_D”, as specified at the start.



Configuration examples



Figure 95: Device configuration of device D



The status line of the Configurator shows the I/O utilisation and the theoretical bus cycle time of the selected network line. This information can be activated or deactivated using the Display I/O Utilisation and Display Bus Cycle Time buttons or by choosing Display ➞ I/O Utilisation and Display ➞ Bus Cycle Time.



07/01 AWB2700-1305-GB



If the topology is so extensive that it cannot be displayed completely, use the Change Display button or choose Display ➞ Compress to switch to a more compact display form.



243



Topology Configurator (Offline) Example with PS416 Slots



0 POW



2 PS416 CPU 1



5 A I N



4 S B I



6 A I O



7 I N P



8 O U T



Device A



2 1



Line no.



PS4-200



Device B



0



2 S B I



Station



POW



3 A I N



4 A I O



Device C



2 0



2 PS416 CPU



POW



5 A I O



4 A I N



6 I N P



7 O U T



8 S B I 1



Device D



1 1



Station



EM



LE



LE



0



1



2



Device F



Module no. 2



EM



LE



LE



0



1



2



Device E



Figure 96: Topology for configuration example with PS416-CPU-400 (for key see opposite page) Key to Fig. 96:



244



07/01 AWB2700-1305-GB



Module no.



Configuration examples PS416-CPU Central processing unit, (e.g. PS416-CPU-400) PS4-200



PS4-201-MM1 compact PLC



SBI



Serial Bus Interface, e.g. PS416-NET-400 E, PS416-NET-400



EM



Expansion module, e.g. EM4-201-DX2



LE



Local expansion module e.g. LE4-116-XD1, LE4-116-DD1



INP



Digital input card, (e.g. PS416-INP-400)



OUT



Digital output card, e.g. PS416-OUT-400



AIO



Analog I/O card, (e.g. PS416-AIO-400)



AIN



Analog input card, (e.g. PS416-AIN-400)



07/01 AWB2700-1305-GB



The configuration example consists of: Device A: PS416 modular PLC as master with a power supply unit and an integrated SBI, an SBI card in master mode (PS416-NET-400), two analog (PS416-AIN-400, PS416-AIO-400) and two digital cards (PS416-INP-400, PS416-OUT-400) Device B: PS4-201-MM1 compact PLC Device C: Expander rack without CPU with a power supply unit, an PS416-NET-400 E SBI card (E= expansion mode), and two analog cards (PS416-AIN-400). Device D: PS416 modular PLC as slave with a power supply unit and an integrated SBI, two analog and two digital cards, as well as one SBI card in master mode Device E, F: Two remote expansion modules (EM...) each with two local expansion modules (LE...)



245



Topology Configurator (Offline) Procedure Create the configuration as described in Section “Topology configuration with Suconet K” on Page 206. Remember that a configuration file is created for each device with its own CPU. Configuration files must therefore be created for devices A, B, and D. First of all create a configuration file for the CPU of device A (PS416-CPU-400). This should describe the local and remote expansion modules that can be seen from the line/device views from the master. In this example, these are the I/O cards of the modular PLC device A, the connected stations in the Suconet K network of the master, as well as the slaves of the SBI module on device A.



246



07/01 AWB2700-1305-GB



New configuration files must also be created for the PS416-CPU-400 modular PLC of device D and device B. These must be configured as slaves.



Configuration examples Configuration of device A POW



PS416-CPU



S B I



A I N



A I O



I N P



PS4-200



O U T



B



S B I



POW



POW



PS416-CPU



A



A I N



A I N



A I O



A I O



I N P



C



O U T



S B I



EM



EM



LE



LE



D



LE



LE



E



Figure 97: Device configuration of device A



07/01 AWB2700-1305-GB



The shaded elements in the graphic should be defined in the configuration for device A. 왘 Create a new configuration file and file name “DEVICE_A”. Select from the list the CPU type to be configured, in this case PS416-CPU-400 on slot 2.



247



Topology Configurator (Offline)



Figure 98: Creating a new configuration for device A



왘 Define the local expansion of the central rack with all the relevant cards. These are the PS416-NET-400 network card, the PS416-AIN-400 analog input card, the PS416-AIO-400 analog output card, the PS416-INP-400 digital input card and the PS416-OUT-400 digital output card. 왘 Set the local expansion parameters as required.



왘 Select the PS416-CPU-400 and configure the network station via Remote Expansion. These remote cards are the CPU of device D (PS416-CPU-400) (master configuration), the EM4-201-DX2 expansion module with the



248



07/01 AWB2700-1305-GB



Figure 99: Local expansion modules of device A



Configuration examples connected local expansion modules LE4-116-DD1 and LE4-116-XD1.



Figure 100: Remote expansion of device A with view of line 1



07/01 AWB2700-1305-GB



왘 The receive and send data for the CPU of device D (slave on Suconet K line) must be set in the Parameters dialog (see also Page 208). 왘 Now select the PS416-NET-400 and configure the network stations of the line via Remote Expansion. The stations concerned are the PS4-201-MM1 compact PLC (device B, master configuration) and the SBI of device C (PS416-NET-400 E) with the local expansion modules PS416-AIN-400 and PS416-AIO-400. The line is automatically assigned line number 2.



249



Topology Configurator (Offline)



Figure 101: Remote expansion of device A with view of line 2



250



07/01 AWB2700-1305-GB



왘 The receive and send data for the CPU of device B (slave on Suconet K line) must be set in the Parameters dialog (see also Page 208 ). 왘 Save the completed configuration. This will be saved under the name “DEVICE_A”, as specified at the start.



Configuration examples Configuration of device B POW



PS416-CPU



S B I



A I N



A I O



I N P



PS4-200



O U T



B



S B I



POW



POW



PS416-CPU



A I N



A I N



A I O



A I O



I N P



O U T



S B I



EM



EM



LE



LE



LE



LE



Figure 102: Device configuration of device B



07/01 AWB2700-1305-GB



The configuration of device B simply specifies the PS4-201-MM1 compact PLC. 왘 For this create a new configuration for device B with the name “DEVICE_B” (slave configuration). The selected compact PLC PS4-201-MMI will appear in the New Configuration dialog.



251



Topology Configurator (Offline)



252



07/01 AWB2700-1305-GB



왘 Set the PLC parameters in the Parameters dialog as a slave since it is a slave on the Suconet K line. For this set the Bus status option to Suconet K slave on the General Settings tab. The configuration indicates this with a short line above the module. 왘 In the Parameters dialog set the station address on the Suconet K Slave tab to the address set in the master configuration (in example station number 1). You must also set the number of send and receive data bytes (see Page 208). 왘 Save the completed configuration. This will be saved under the name “DEVICE_B”, as specified at the start.



Configuration examples Configuration of device D POW



PS416-CPU



S B I



A I N



A I O



I N P



O U T



PS4-200



S B I



POW



PS416-CPU



POW



A I N



A I N



A I O



A I O



I N P



O U T



S B I



EM



EM



LE



D



LE



LE



F



LE



07/01 AWB2700-1305-GB



Figure 103: Configuration of device D



253



Topology Configurator (Offline) As device D has its own CPU, it must be defined in a separate configuration.



254



07/01 AWB2700-1305-GB



왘 For this create a new configuration with the name “DEVICE_D” (slave configuration) and define all the local expansion modules (PS416-AIN-400, PS416-AIO-400, PS416-INP-400, PS416-OUT-400, PS416-NET-400) as well as the network stations of the network card (device F). 왘 Remember to configure the CPU of device D as a slave since it is connected to line 1 of device A. In Fig. 104 you will notice a short line above the CPU of device Dindicates that it is a slave. 왘 In the Parameters dialog set the station address on the Suconet K Slave tab to the address set in the master configuration (in example station number 1). You must also set the number of send and receive data bytes (see Page 208).



Configuration examples



Figure 104: Configuration of device D



In the configuration of device D also define the stations of device F since the expansion module EM4-201-DX2 is a network slave and does not have its own CPU.



07/01 AWB2700-1305-GB



왘 Save the completed configuration. This will be saved under the name “DEVICE_D”, as specified at the start.



255



Topology Configurator (Offline) Example with AS-Interface®network (PS4-200 )



Module no. 0



1



2



3



PS4-200



SBI



LE



LE



1



2



Line no.



1



2 Station



3



4 INP/3 OUT



Device C



ATI1 DNSASI



Device D



EM2-105-DX1 Device E



4 RMQ-M2CASI



Station



Device A



1



Device F



EM



LE



LE



0



1



2



Device B



Module no.



256



07/01 AWB2700-1305-GB



Figure 105: Topology for the configuration example with AS-Interface®network (for key see opposite page)



Configuration examples Key to Fig. 105: l



PS4-200



PS4-201-MM1 compact PLC



SBI



Serial Bus Interface, e.g. LE4-505-BS1



EM



Expansion module, e.g. EM4-201-DX2



LE



Local expansion module e.g. LE4-116-XD1, LE4-116-DD1



4 INP/3 OUT



Generic AS-Interface®device



ATI1-DNS-ASI



Inductive proximity switch in the AS-Interface®



EM2-105-DX1



Interface for connecting sensors and actuators in the AS-Interface®



RMQ-M2C-ASI



Interface for connecting RMQ in the AS-Interface®



The configuration example consists of: Device A: PS4-201-MM1 compact PLC. The basic unit is provided with an additional SBI local expansion in master mode (LE4-505-BS1) and two other local expansion modules such as digital modules Device B: Expansion module (EM...) with two local expansion modules Devices C, D, E, F: AS-Interface®station Procedure Create the configuration as described in Section “Topology configuration with Suconet K” on Page 206.



07/01 AWB2700-1305-GB



As the example only contains one CPU (master), define all stations in one configuration file. 왘 Choose Configuration ➞ New... and assign a new file name (in this example “AS_INTER”) to create a configuration with the master (PS4-201-MM1). 왘 Choose Edit ➞ Local Expansion... to insert the master module for the AS-Interface®line (LE4-505-BS1) and add the local expansion modules (LE...).



257



Topology Configurator (Offline)



Figure 106: Configuration of an AS-Interface®network



Figure 107: Remote expansion of the master with view of line 1



왘 Select the LE4-505-BS1 AS-Interface®master and use the Remote Expansion function to define



258



07/01 AWB2700-1305-GB



왘 Select the PS4-201-MM1 master and use the Remote Expansion function to add the EM4-201-DX2 expansion module. 왘 Select the EM and add the local digital expansion modules.



Configuration examples the slave stations of the network line (devices C, D, E, F).



Figure 108: AS-Interface®network stations (line 2)



07/01 AWB2700-1305-GB







If the topology is so extensive that it cannot be displayed completely, use the Change Display button or choose Display ➞ Compress to switch to a more compact display form. 왘 Save the completed configuration. This will be saved under the name AS_INTER, as specified at the start. The file is saved with the file name extension “.DCF” in your project. 259



Topology Configurator (Offline) Setting the parameters of the LE4-505-BS1 master module 왘 Select the LE4-505-BS1 module and use the Parameters button or choose Edit ➞ Parameters....



Figure 109: Setting the parameters of the AS-Interface® master



왘 Check the Enable Autoaddressing option if you want to be able to swap a faulty slave on the AS-Interface®line with the system running without having to stop the PLC. Confirm your entry with OK. For the Enable Autoaddressing function to work you must ensure that the faulty slave is replaced with one of the same type that is set to the standard address 0 and has the same IO and ID code values.



260



07/01 AWB2700-1305-GB



If Autoaddressing is activated, the LE4-505-BS1 master module will automatically set the address of the new slave to that of the faulty slave and resume data communication with it.



Configuration examples Changing the parameters for a device 왘 Left-click on the AS-Interface®device for which you wish to change the parameters. 왘 Click the Parameters button or choose Edit ➞ Parameters.... This will call up the Parameters window for the device concerned. 왘 Change the parameters as required. Select one of the available station numbers for the selected device from the Station Number list box. 왘 Assign a name up to 12 characters long in the Name box for the station concerned. The Properties field shows four check boxes under Initial Parameters with which you can modify operating parameters. Refer to the relevant documentation of the device concerned as to the meaning of the four parameters. With generic AS-Interface®stations, which have IO codes that are determined by the input/output configuration concerned, the ID code must be adapted to the specifications in the station's documentation.



07/01 AWB2700-1305-GB



왘 Save the new settings by clicking the Accept button. The window will remain open. 왘 Select other AS-Interface®stations from the topology configuration in order to check or modify their configuration data. 왘 Close the dialog with Exit when you are finished.



261



Topology Configurator (Offline) Example with PROFIBUS-DP network (PS416-CPU-300) CFG-DP configuration software Slots



Slots



0



2



POW



PS416 CPU 1



4 S B I



6 A I O



7 I N P



Device A



2 PROFIBUS-DP



PS4-300



Suconet K



Line no.



SBI



LE



Device D



1 Station 1



EM



Device B



MI



Device C



2



EM



Device E



ZB



Device F



Station 2



3



Figure 110: Topology for configuration example with PROFIBUS-DP network PS416-CPU



Modular PLC with integrated SBI



SBI



Serial Bus Interface:



PS4-300



PS4-341-MM1 compact PLC



EM



Expansion module, e.g. EM4-101-AAB64, EM4-204-DX1



MI



Display unit, e.g. MI4-101-KC1



ZB



Operator unit, e.g. ZB4-504 IF1



INP



Digital input card, e.g. PS416-INP-400



AIO



Analog I/O card, e.g. PS416-AIO-400



262



07/01 AWB2700-1305-GB



PROFIBUS-DP master: PS416-NET-440 PROFIBUS-DP slave: LE4-504-BT1



Configuration examples The configuration example consists of: Device A: PS416 modular PLC with a power supply unit and an integrated SBI, DP master as SBI (PS416-NET-440), one analog and one digital card Device B: Analog expansion module (EM4-101-AA1B64) Device C: Text operator panel (MI4-101-KC1) as remote expansion of the master Device D: DP slave communication module (LE4-504-BT1) with compact PLC (PS4-300 CPU) and local expansion (LE4-108-XD1) Device E: IO module as DP slave (EM4-204-DX1) Device F:Operator unit ZB4-504-IF1 Procedure Create the configuration as described in Section “Topology configuration with Suconet K” on Page 206.



07/01 AWB2700-1305-GB



For every device with a CPU create a separate configuration file and define in it the local and remote expansions. Configuration of device A 왘 Open the Sucosoft Topology Configurator and create a new configuration file and file name “DEVICE_A”. Select from the list the CPU type to be configured, in this case PS416-CPU-300 on slot 2. 왘 Add the PROFIBUS-DP master interface (PS416-NET-440), the analog I/O module and the digital input card as local expansions. The PROFIBUS-DP line is ordered in the line numbering of the Suconet K lines (line 2). 왘 Select the master and add the analog I/O module (EM...) and the text operator panel (MI4...) as remote expansions. 263



Topology Configurator (Offline) 왘 Save the configuration under the name “DEVICE_A.dcf”.



264



07/01 AWB2700-1305-GB



Figure 111: Device configuration of device A



Configuration examples Configuration of device D 왘 Create a new configuration for device D with the PS4-341-MM1 compact PLC, the PROFIBUS-DP slave and the digital expansion module (see Fig. 112). 왘 Save the configuration under the name “DEVICE_D.dcf”.



Figure 112: Configuration of device D



07/01 AWB2700-1305-GB



Configuring the DP line with CFG-DP 왘 Open the DP CFG-DP Configurator, in which the DP master (PS416-NET-440) and the connected slaves (EM4-204-DX1, ZB4-504-IF1) must be configured. Use the CFG-DP Configurator for the slave configuration. In this configuration, assign the modules and their data to the addresses of the process data image of the master. These addresses correspond to the addresses of the slaves in the Sucosoft user program. For a detailed description of the CFG-DP Configurator and how to use it refer to the electronic manual AWB-EM 2700-1336 GB. The manual (PDF file) and the Configurator are supplied with Sucosoft S40.



265



Topology Configurator (Offline) 왘 Save the configuration and transfer this to the PS416-NET-440 using the CFG-DP Configurator. The configurations created in the Sucosoft Topology Configurator for devices A and D are combined with the user program during compiling and then transferred to the master PS416-CPU-300 and PS4300. The PROFIBUS-DP configuration is not compared with the user program in the PS416-CPU until the first cold start.



266



When using a PS416 as the master, instead of the PS4, use the LE4-504-BS1 as the DP master. In this case, you must specify the file names of the PROFIBUS configuration created in the CFG-DP Configurator in the S40 Parameters dialog for the LE4 -504-BS1.



07/01 AWB2700-1305-GB







You can evaluate the diagnostics data of the PS416-NET-440 and the network slaves during operation via the diagnostics bytes or the PdpStationDiag function block in the user program of the PS416.



Configuration examples



07/01 AWB2700-1305-GB



Figure 113: Configuration in the PROFIBUS-DP Configurator CFG-DP



267



Topology Configurator (Offline) Complex configuration example (PS416-CPU-400) CFG-DP configuration software Slots



0 POW



2



5 I N P



4 A I N



PS416 CPU



8 I N P



6 S B I



Device A



2



1 Line no.



0 1



PROFIBUS-DP



Module no. 1 2



PS4-300



SBI



3



LE



LE



Station



1



2



ZB



Device F



EM



Device G



Device B 3



1



AS-Interface



1 Station



4 OUT/3 INP



2



3



Suconet K



SBI



Device H



ATI2DNS-ASI



KLAS44



Device C 2



PS4-300



MI4-CFG-1 configuration software



MI Module no. 1



2



PS4-200



LE



SBI



Station Module no.



4



Suconet K



1



0



1



2



EM



LE



LE



Device D 1



EM



2



EM



Device E



Figure 114: Topology for complex configuration example (for key, see opposite page)



268



07/01 AWB2700-1305-GB



3



0



Configuration examples Key to Fig. 114: PS416-CPU PS4-200 PS4-300 SBI



EM MI ZB INP AIO 4OUT/3INP ATI2-DNS-ASI KLAS 44



Modular PLC with integrated SBI PS4-201-MM1 compact PLC PS4-341-MM1 compact PLC Serial Bus Interface: PROFIBUS-DP master: PS416-NET-440 PROFIBUS-DP slave: PS416-NET-441 AS-Interface®master: LE-505-BS1 Suconet K master: LE4-501-BS1 Expansion module, e.g. EM4-204-DX1, EM4-101-AAB64 MI4-471-TC1 display element ZB4-604-IF1 operating unit Digital input card (PS416-INP-400) Analog I/O card (PS416-AIO-400) Generic AS-Interface®device Inductive proximity switch Networkable load feeder system



07/01 AWB2700-1305-GB



The configuration example consists of: Device A: PS416 modular PLC as master with a power supply unit, a DP master as a local expansion (PS416-NET-440), two analog cards and one digital card Device B: PS4-300 (PS4-341-MM1) compact PLC with two local expansion modules and one master module for the AS-Interface®network with connected slaves Device C: Touch panel as operator interface Device D: PS4-200 compact PLC (PS4-201-MM1) with a local expansion module and one Suconet master with connected expansion modules as slaves Device E: Digital expansion module (EM4-201-DX2) provided with two local expansion modules Device F: Operating device (ZB4-604-IF1) as PROFIBUS-DP slave



269



Topology Configurator (Offline) Device G: Expansion module (EM4-204-DX1) as PROFIBUS-DP slave Device H: DP slave as slave local expansion module with connected compact PLC Procedure The example shows a complex configuration with the Suconet K, PROFIBUS-DP and AS-Interface® networks. The separate configurators must be used for the DP network and for the MI4-471-TC1 touch panel. DP network: Create the DP network using the CFG-DP Configurator. In this configuration define the master with the connected slaves and save it as a separate configuration file. The Sucosoft Topology Configurator will only show the master (PS416-NET-440) that opens the line and the slave (PS416-NET-441) that passes on the information from all DP network slaves to the master. The configuration for the DP line is loaded to the master PLC via the CFG-DP Configurator. Touch Panel: The configuration of the touch panel is carried out with the MI4-CFG-1 Configurator, which is used to create a separate configuration file. Load the configuration directly from the MI4-CFG-1 Configurator to the touch panel operating system.



270



07/01 AWB2700-1305-GB



Suconet K, AS-Interface®: Sucosoft is used for the configuration of the Suconet K networks and the AS-Interface®networks. This is where the configuration files for devices A, B, D, F and K, are created since these all include a CPU.



Configuration examples Example with multi-processing operation Slots



0



2



4



6



8



POW



PS416 CPU



PS416 CPU



PS416 CPU



CNT



1



2



Line no.



12 O U T



3 1



1



10 I N P



EM



EM



LE



1



EM



Station 2



EM



2



EM



07/01 AWB2700-1305-GB



Figure 115: Topology for configuration example with multiprocessing operation PS416-CPU



PS416-CPU-300, PS416-CPU-400 modular PLC



CNT



PS416-CNT-200 counter card



INP



Digital input card (PS416-INP-400)



OUT



PS416-OUT-400 digital output card



LE



LE4-116-DD1 local expansion module



EM



EM4-101-DD2/88, EM4-201-XD2, EM4-101-AA2B84, EM4-101-TX1 and EM4-111-DR1 expansion modules



271



Topology Configurator (Offline) The configuration example consists of: A PS416 modular PLC as central master in multiprocessing operation. Two other PLCs are connected to it via the local parallel bus. The digital output cards (PS416-INP-400, PS416-OUT-400) are addressed by the second PLC. The PS416-CNT-200 counter card is addressed by the master via the local bus. The master is connected to two remote expansion modules (EM4-101-DD2/88, EM4-201-XD1) via Suconet K. One expansion module is connected in turn to a digital local expansion module. Procedure Create the configuration as described in Section “Topology configuration with Suconet K” on Page 206. Create separate configurations for all three CPU cards. As described in Section “Topology configuration with Suconet K” remember that in a configuration with several local CPUs only the master CPU (slot 2) or the first CPU slave (slot 4) fitted in the PS416 rack is able to access the I/O cards. There is an additional restriction for the slave card fitted in slot 4. It can only access digital I/O cards. All other CPUs are not able to access local I/O cards.



The communication between several PS416-CPU-200/300/400 controllers in one rack is handled by the local bus using the CPUDataExchange function block. For this the function block is used in the master and in the slave CPUs.



272



07/01 AWB2700-1305-GB



In this example the first slave CPU fitted in slot 4 is configured so that its device configuration contains the digital I/O cards. The master PLC defines the counter card in its configuration file.



Configuration examples Configuration of device 1 Master CPU Slave CPU1 Slave CPU2 0 POW



2



4



6



PS416 CPU PS416 CPU PS416 CPU



8 CNT



10 I N P



12 O U T



EM



EM



EM



LE



EM



EM



Figure 116: Configuration of the master CPU



The configuration of the master CPU contains all the CPU slaves and the cards of the remote Suconet K line. The counter card is also defined as a local expansion.



07/01 AWB2700-1305-GB



왘 Choose Configuration ➞ New... and create a new configuration under a new file name (DEVICE_1). Ensure that the master CPU (PS416-CPU-400) is set for slot 2.



273



Topology Configurator (Offline)



Figure 117: Creating a new configuration for device 1



274



07/01 AWB2700-1305-GB



왘 Expand the master CPU with the local expansion slave CPUs (PS416-CPU-300, PS416-CPU-416) and counter card (PS416-CNT-200). 왘 Select the master CPU and configure the Suconet K network stations via Remote Expansion. The modules of Device 1 include both the EM4-201-DX2 expansion module with LE4-116-DD1 local expansion modules, and the EM4-101-AA2B84 expansion module.



Configuration examples



Figure 118: Configuration of device 1



07/01 AWB2700-1305-GB



왘 Save the completed configuration. This will be saved under the name DEVICE_1, as specified at the start.



275



Topology Configurator (Offline) Configuration of device 2 0 POW



2



4



6



PS416-CPU PS416-CPU PS416-CPU



8 CNT



10 I N P



12 O U T



EM



EM



LE



EM



EM



EM



Figure 119: Configuration of device 2



왘 Choose Configuration ➞ New... and create a new configuration under a new file name (DEVICE_2). Ensure that the first slave CPU (PS416-CPU-300) is set for slot 4.



276



07/01 AWB2700-1305-GB



Figure 120: Creating a configuration for device 2



Configuration examples 왘 Add the digital input card (PS416-INP-400) and the digital output card (PS416-OUT-400) as local expansions of the slave CPU. 왘 Select the PS416-CPU-300 and add the EM4-201-DX2 as a remote expansion module.



Figure 121: Configuration of device 2



07/01 AWB2700-1305-GB



왘 Save the completed configuration. This will be saved under the name DEVICE_2, as specified at the start.



277



Configuration of device 3 0 POW



2



4



6



PS416-CPU PS416-CPU PS416-CPU



8 CNT



10 I N P



12 O U T



EM



EM



LE



EM



EM



EM



Figure 122: Configuration of device 3



왘 Choose Configuration ➞ New... and create a new configuration under a new file name (DEVICE_3). Ensure that the second slave CPU (PS416-CPU-400) is set for slot 6.



278



07/01 AWB2700-1305-GB



Figure 123: Creating a new configuration for device 3



Configuration examples 왘 Select the PS416-CPU-400 and configure the Suconet K network stations via Remote Expansion. The remote cards of device 3 include both the EM4-101-TX1 and EM4-111-DR1 expansion modules.



Figure 124: Configuration of device 3



07/01 AWB2700-1305-GB



왘 Save the completed configuration. This will be saved under the name DEVICE_3, as specified at the start.



279



07/01 AWB2700-1305-GB



280



4



Overview



Form Editor



The Form Editor allows you to create your own print forms, i.e. cover sheets and forms that you can use for printouts of topology and POU project files. You can: specify a range or area in which the project file is to be printed out draw graphic elements such as lines, circles or rectangles incorporate standard text and bitmaps create different variable placeholders for current data such as time, date or POU name with supplementary text if required make changes to the standard cover sheets and forms supplied with Sucosoft S40.



User interface



Open the Form Editor via the Tools menu in the NAVIGATOR or the corresponding button on the toolbar.



07/01 AWB2700-1305-GB



Form Editor



This will open the application window of the Form Editor. The menu bar and toolbar containing the editing buttons are shown below the title bar. Both toolbars can be arranged on your desktop as required. To do this, click the handle (double vertical line) of the toolbar and, with the mouse button depressed, drag it to the required position. This position will be saved when you exit the Form Editor.



281



ack to b Send ward g for Brin ent elem Edit p itma de B t Inclu d tex ndar r sta Ente e circl Draw ngle recta Draw line me Draw ct na proje tion Posi ame file n tion ber Posi num page tion Posi time tion Posi date tion e Posi rang rint ne p Defi lour ll c o ne fi Defi our l o ne c ne li ess Defi ickn ne th ne li Defi form Save m n for Ope form New



282



07/01 AWB2700-1305-GB



óForm Editor



Figure 125: Form Editor application window



Toolbar



Figure 126: Toolbar



The following pages provide a detailed explanation of the toolbar buttons in context.



User interface Menu bar The Edit, Elements, and Options menus are provided in addition to the standard File, View, Windows and Help menus. Edit menu Delete All: Use this command to delete all the entries in the print form. Delete: Use this command or the Del button to delete an element selected in the print form. Elements menu All the menu items in this menu are available via the toolbar. They are explained in Section “Functions of the Form Editor”. Options menu Line Thickness: The Line thickness option is used to define the width of the lines of drawn elements, such as lines, circles or rectangles. Line Colour: The Line colour option is used to define the colour of the lines of drawn elements. This setting is also applied to standard texts and the project texts that appear at the placeholders and in the print range. The Fill colour setting applies to the background colour of graphic elements drawn and all texts. To obtain a coloured background, deactivate the Transparent option in the Fill Colour dialog box.



07/01 AWB2700-1305-GB



Font: Use the Font option to define the font type, font style and font size of the standard text.



283



óForm Editor Grid Lines: Activating this option will cause the grid lines to appear on the screen. It is normally activated, thus enabling the snap-to-grid function, which aligns all the elements inserted on the print form to the grid lines. The horizontal and vertical distance between the grid lines, and therefore the positioning possibility for elements, can be set at between 2 and 50 pixels using the Width numeric entry field. Deactivate the grid lines and the snap-to-grid function via the Grid lines checkbox if you wish to position the elements in the form without any restrictions.



Figure 127: Grid setting



Functions of the Form Editor



This section describes the range of functions of the Form Editor and shows how to



284



07/01 AWB2700-1305-GB



design a new print form, edit an existing standard print form, use a new print form for a project printout.



Functions of the Form Editor Designing a new print form Requirement: A form must have been opened in the Form Editor either via File ➞ New or by clicking the appropriate icon. The standard form format is A4 portrait. All elements are printed with the settings which were in force when they were created. The Form Editor will decide on the basis of the form contents whether this should be printed out as a cover page or as a form. A print form will be saved as a form as soon as you define for it a print range in which the contents of your project file are to be printed. Page setup 왘 Choose File ➞Page Setup... to select a different paper format or page layout if required. Defining the print range Choose Elements ➞ Print Range or click the appropriate icon to define the area on the form in which the contents of your project file should be printed. Define print range



07/01 AWB2700-1305-GB



왘 Define the size of this range by dragging the cursor with the mouse button depressed. The font and font size of the text entries in the subsequent printout will be the same as the setting when the print range was defined. Refer to Section “Editing an existing standard print form” from Page 291for how to subsequently modify the text entries. The term 'text entry' refers to the project text inside the print range and the text that will appear at



285



óForm Editor placeholders (e.g. date, project name etc.) when the print form is printed out.







Inserting placeholders The Form Editor also provides placeholders for current data such as “Date”, “Time” and “Page Number”, or project data such as POU file name and project name. You should set the required font, font style and size via Options ➞ Font.... before inserting the placeholders and possibly adding a supplementary text. Entered text will then be shown with these font settings. 왘 Choose the placeholder required via the Elements menu or the placeholder buttons in the toolbar.



Figure 128: Placeholders buttons



왘 Click the mouse at the required location in the print form and enter the supplementary text assigned for the placeholder in the entry field. Correct any entry errors via Backspace, and undo any operator error with Alt + Backspace.



286



07/01 AWB2700-1305-GB



왘 Close the text entry function by pressing Enter.



Functions of the Form Editor







Editing standard text On every printout using this print form standard text will appear in the way it was edited. The Line colour option is also used to define the colour of the standard text in the printout. You should set the required font, font style and size via Options ➞ Font.... before editing the standard text. Entered text will then be shown with these font settings. 왘 Choose Elements ➞ Standard Text or click the Standard Text icon. Standard text



왘 Click the mouse at the required location in the print form and enter the standard text in the entry field. Correct any entry errors via Backspace, and undo any operator error with Alt + Backspace. 왘 Close the text entry function by pressing Enter. Press Esc to abort text entry. Double-click a text element to correct the standard text. The font, font style and font size of standard text can also be modified later:



07/01 AWB2700-1305-GB



왘 Choose Elements ➞ Edit Element, select the text element concerned and press the right mouse button.



Figure 129: Changing the font of standard text



287



óForm Editor Drawing graphic elements 왘 To draw a rectangle, for example, select the required element from the toolbar or via Elements ➞ Rectangle. 왘 Use the mouse to define the start position of the graphic element in the print form. 왘 Define the size of this element by dragging the cursor with the mouse button depressed. Choose Elements ➞ Edit Element or click the appropriate icon to move an element with the mouse. Edit element



Graphic elements, placeholders, and standard text fields can be provided with coloured backgrounds via Options ➞ Fill Colour... or by clicking the appropriate icon. Placing elements in the background/foreground Large elements such as page frames or bitmaps may cover smaller elements. These may then be no longer selectable or visible. In this case, the covering element must be positioned in the background or deleted. Placing elements in the background/foreground



288



07/01 AWB2700-1305-GB



To edit a covered element:



Functions of the Form Editor 왘 Choose Elements ➞ Edit Element or press the appropriate button and then select the covering element. 왘 Now choose Elements ➞ Element in Background or press the appropriate button to position the element in the background. 왘 Edit the required element. If required you can then choose Elements ➞ Element To Foreground to restore the previous state. Loading bitmaps 왘 Choose Elements ➞ Bitmap or click the appropriate icon to copy the required bitmap to the Clipboard. 왘 Use the mouse cursor to locate the starting position of the bitmap in the print form and click to set it. Load bitmap



07/01 AWB2700-1305-GB



Deleting elements 왘 Choose Elements ➞ Edit Element or click the appropriate button and then select the element to be deleted (standard text, placeholder, graphic element or bitmap). 왘 Delete the element via Edit ➞ Delete or press the Del button. All elements of a print form can be deleted via Edit ➞ Delete All.



289



óForm Editor Print form preview 왘 Choose File ➞ Page Preview to check whether the design of the opened print form meets your requirements. The preview shows the form with all its elements. The text entries appear on the printed form. 왘 Exit the page preview by pressing the Esc button, clicking the Close button or by starting a print job. Saving print forms 왘 Choose File ➞ Save As... or click the appropriate icon to save the new form. Save



This opens the Save As dialog.



The Form Editor saves your print form under the name specified with the file extension “wmf” and offers the standard Forms folder in your current Sucosoft S40 application.



290



07/01 AWB2700-1305-GB



Figure 130: Saving print forms



Functions of the Form Editor







Only save the print form in the proposed Forms folder. Otherwise the print form will not be available later for the printing out of a project file in the Printer Setup dialog.



Editing an existing standard print form Requirement: A standard form, e.g. gbform1.wmf, an English form template, has been opened in the Form Editor via File ➞ Open or by clicking the appropriate icon. Changing the format of text entries Proceed as follows to change the font and font size of project text entries:



07/01 AWB2700-1305-GB



왘 Choose Elements ➞ Edit Element or click the appropriate icon. 왘 Double-click the mouse inside the print range and set the required format in the Font dialog box. The format of created standard texts is not changed in this way!



291



óForm Editor Correcting or deleting standard text 왘 Choose Elements ➞ Edit Element or click the appropriate icon. 왘 Double-click the standard text to be changed. 왘 Correct or delete the text, for example, using the Del key. The font, font style and font size of standard text can also be modified later: 왘 Choose Elements ➞ Edit Element, select the text element concerned and press the right mouse button.



Figure 131: Changing the font of standard text



Repositioning elements in the form All the elements of a form can be subsequently repositioned.



292



07/01 AWB2700-1305-GB



왘 Choose Elements ➞ Edit Element or click the appropriate icon. 왘 Select the element concerned and drag it to the new location in the print form with the mouse button depressed.



Functions of the Form Editor Using a new print form for a project printout 왘 Choose the Print Setup dialog in the NAVIGATOR before printing a project file. Choose here the required print forms from the Form and Cover Sheet drop-down list boxes. 왘 Open the Printer Setup dialog:



Figure 132: Printer Setup dialog



Form: Select the form on which you wish to print out your document. Cover Sheet: Select the cover sheet required.



07/01 AWB2700-1305-GB



Standard forms and cover sheets in English forms begin with “GB”. German begin with “D”, French with “F”, Italian with “I” and Spanish with “E”.



293



07/01 AWB2700-1305-GB



294



5



Overview



Test & Commissioning



You can activate the Test and Commissioning tool in the Navigator via Tools ➞ Test and Commissioning or via the button in the toolbar. Test and Commissioning



With the Test & Commissioning tool you can: Define programming connections Test wiring Test PLCs Perform network diagnostics Test programs Force variable values.



07/01 AWB2700-1305-GB



The main window of the Test & Commissioning tool provides several tools for these tasks that can be accessed by means of toolbar buttons.



Figure 133: Test & Commissioning tool with opened Connection List window



295



Test & Commissioning Defining programming connections In this step you define the connections between the programming device and the PLCs. This is further described on Page 313. Carrying out a wiring test This step is carried out with the Topology Configurator online. The wiring of the connections between the controller and the production plant can be checked. For this the PLC must be connected, must be provided with a valid configuration, and the CPU must be in Halt status. The wiring test is described on Page 343. Carrying out a PLC test This function is accessible via the CPU Status button in the main Test and Commissioning window. It allows you to carry out troubleshooting on the hardware components. This is further described on Page 361. Carrying out network diagnostics This step is carried out with the Topology Configurator online. This allows you to view the CPU diagnostics data of the connected PLC as well as all other network stations and devices connected to it via Suconet K or AS-Interface®. For this the PLC must be connected, must be provided with a valid configuration, and the CPU must be in Run status.



Carrying out program tests A program test can be carried out online with the POU Editor. This allows you to display the states of the variables used in the program online in IL, ST, LD or FBD and modify the POU online if necessary. Switching between programming languages is possible offline, i.e. when the Status display is



296



07/01 AWB2700-1305-GB



These functions are described on Page 379.



User interface switched off, and online when the Status display is active. This function is further described on Page 384. Forcing variable values With the PS416 and PS4-300 controllers, you can also force variable values statically or dynamically in the Variables window when the PLCs are in the Run status. A description of how to force variables is provided on Page 398.



User interface



The main window of the Test & Commissioning tool is bordered at the top by the title bar 햲, the optional menu bar 햳, and the optional and user-definable toolbar with the relevant toolbar buttons 햴, and by the optional status bar 햵 at the bottom.



햲 햳 햴







07/01 AWB2700-1305-GB



Figure 134: Main Test & Commissioning window



297



Test & Commissioning You can activate the Connection List, Topology Configurator, Program and Variables windows via the menu bar or toolbar in the main window of the Test & Commissioning tool. The Connection List window is automatically opened by Sucosoft S40. The toolbar consists of individual toolbars with different functions that are available when the relevant Test & Commissioning window is activated. The individual toolbar elements can also be removed from the toolbar and positioned as required on the user interface. The Sucosoft S40 tool tips offer simple and quick information on the buttons of the toolbars.







The content of the menu bar automatically adjusts to the Test & Commissioning window that is activated. Follow the points below in order to change between the different test and commissioning windows: Starting from the standard Connection List window which opens automatically, you can move to the Topology Configurator and Program windows provided that:



The Variables window is opened first from the Program window, provided that variables were transferred to the Variables window in a POU that has been opened online. For safety reasons Sucosoft S40 does not allow you to transfer a different program to the connected



298



07/01 AWB2700-1305-GB



A device with an active process running is connected. You have opened in your programming device the project containing the POUs and the program code file of the active process.



User interface device or disconnect it if other windows are opened as well as the Connection List window. You have unrestricted access to the device once you have closed all windows apart from the Connection List window.



Menu bar The Options, Window and Help menus are available in all of the four Test & Commissioning windows mentioned above and offer the same functions. Descriptions of functions that are not part of the standard Windows range of functions are already explained for the Sucosoft S40 Navigator and POU Editor tools. The Test & Commissioning tool functions are described in this chapter primarily with reference to the toolbar buttons. The following description of the menu bars therefore only refers to functions that are not explained by the toolbar buttons or are not selfexplanatory. Menu bar for the Connection List window. File menu: The File menu is used for saving and printing the connection list, for setting up the printer (see Page 39 and Page 40), and for quitting the Test & Commissioning tool via File ➞ Exit.



07/01 AWB2700-1305-GB



Device menu: Apart from the following descriptions, the individual items of the Device menu are described in the appropriate chapters or with the descriptions of the buttons in the toolbar: Connect, Disconnect....: These menu items are used to establish or terminate the connection between the programming device and the controller. Password...: Use this menu item to define or modify passwords for the PS4-300 or PS416 PLCs in order



299



Test & Commissioning to prevent unauthorised access. The password can consist of up to eight numbers and letters. Procedure: 왘 Choose Device ➞ Password, enter the required password, enter it again in the Confirm Password box and click OK to confirm the entry.



Figure 135: Password request on PS4-300 and PS416



Delete: Use this menu item to remove the selected connection definition for the relevant automation product from the connection list. Deleting is only possible for a connection definition that is not used to connect a device. New: This menu item is used to add another connection to the connection list with the standard entries for name, PLC type and interface. Copy: Use this menu item to copy the selected connection definition for the relevant automation product to the Clipboard.



300



07/01 AWB2700-1305-GB



Paste: Use this menu item to add a connection definition to the connection list from the Clipboard.



User interface Menu bar for the Topology Configurator window The function description for the menu items of the Topology Configurator in online mode is explained with the toolbar buttons (see Page 306). Menu bar for the Program window. Program menu: The Program menu offers the following functions: Show Next Level: This function is used to show the lower levels of the displayed program, e.g. a function block instance. Instead of using this function you can double-click a level to show the next level required. Show/Hide Branch: This function is used to show/ hide all subordinate levels of the selected POU. Instead of using Program ➞ Hide Branch, you can also double-click RESOURCE to hide the branch again. Display/Modify POU: Use this menu item to open the POU Editor in Online mode, with the current POU active, i.e. in the foreground. Display menu: The Display menu offers the following functions: Instance Tree and POU Calls: This function displays both panes of the Program window (standard setting).



07/01 AWB2700-1305-GB



The instance tree appears in the left window, and shows the structure of the user program starting from the resource. The right window shows the names of the POUs that are subordinate to the POU selected on the left, as well as any additional information. Only Instance Tree/Only POU Calls: Each of these functions hides the other pane.



301



Test & Commissioning Menu bar in the Variables window To show variables in the Variables window, you first transfer them from a POU that you have opened online in the POU Editor (see Section “Variables window” on Page 393). Variables menu:The Variables menu offers the following functions: Show Next Level: This function is used to show the variables of the POU selected in the Variables list. These variables were entered in the Variables list beforehand in the POU Editor (online mode). Instead of using this function you can double-click a POU to show the next level required. Show/Hide Branch: This function is used to show/ hide the variables of the selected POU. Status Display: This function starts or closes the Status Display for the variables shown (see Section “Variables window” on Page 393). Delete: This function is used to remove the selected variables of a POU in the left or right panes from the variables list. When you delete the last variable shown of a POU, the POU is also removed from the variables list. The variables are only removed from the window, and are not physically deleted.



Variables List and Info: This function displays both panes of the Variables window (standard setting). The POUs are shown in the left window with the associated variables. The right window shows the names and any additional information on the variables that are subordinate to the POU selected on the left. Only Variables List/Only Info: Each of these functions hides the other pane (left or right). 302



07/01 AWB2700-1305-GB



Display menu: The Display menu offers the following functions:



User interface Decimal, Hexadecimal, Binary, BCD: These functions are used to select the required display format in the right Info pane for the selected variables. This changes the display of the Status column of the Info pane. The display of string variables can be disabled accordingly with ANSI, ASCII.



Toolbar Buttons in the Connection List window The Connection List window shows the configured connections for the individual device types, the different programming device interfaces or coupling types. Connect: This button connects the device to the selected connection (see Page 341).



07/01 AWB2700-1305-GB



Disconnect: This button terminates the connection to the connected device (see Page 342).



303



Test & Commissioning CPU Status: This button opens the Status and Diagnostics function in which you can check the status of the CPU (see Page 361). Transfer/File Manager: This button opens the Transfer/File Manager dialog with a display of the programmer unit. Here you can transfer the operating system or programs from the programmer to the PLC or memory card. You can also compare a program in the PLC with a program on the programmer unit or memory card. With the Controller tab active, you can display a program loaded in the PLC, cold start it, and, depending on the type of PLC, delete it there or transfer it to the memory card. The Memory Card tab allows you to format the memory card, transfer a program from it to the PLC or delete a program on it (see Page 349). Program Status: This button opens the Status and Diagnostics dialog with the Program Status display. This shows the operating state of the CPU, and provides buttons for starting stopping and deleting the program (see Page 357). Display/Change Date/Time: Use this button to open the Display/Change Date/Time dialog.



304



07/01 AWB2700-1305-GB



Requirement: Only the Connection List window must be opened in the T & C.



User interface



Figure 136: Display/Change Date/Time dialog



The left of the dialog allows you to set the date and time as required, or accept the settings from the PC by clicking the button on the left. Sucosoft S40 will calculate the weekday on the basis of the date shown on the left. The right of the dialog shows you the date and time of the real-time clock in the controller CPU. It is not possible to make settings here. Clicking the middle button transfers the values shown on the left to the PLC's CPU, together with the calculated weekday.



07/01 AWB2700-1305-GB



Click the Close button to close the dialog.



305



Test & Commissioning Buttons in the Topology Configurator window All functions with the Topology Configurator in Online mode can be chosen using the buttons of the configurator.



Figure 137: Buttons in the Topology Configurator window (Online mode)



Compare Configuration: Opens a standard file dialog to allow you to choose the topology file to compare with the topology information stored in the PLC. If both topologies are identical, optional user descriptions for the cards and devices are then displayed on the screen, if available. If the topologies are not identical, the following message is shown:



Save: Writes to a file the topology configuration read from PLC. The standard Save As... dialog is shown on the screen.



Display CPU Status: Shows the CPU Status if a CPU is selected in the topology configuration. The information displayed includes operating state, switch position, memory size, operating system version, diagnostic bits, etc. The same information is shown when you click the CPU Status button in the main window of the Test and Commissioning tool.



306



07/01 AWB2700-1305-GB



Compressed Display: Switches between graphical and compressed display. In the latter case, the device names are shown abbreviated and the user descriptions of the devices are not shown.



User interface Display Network Diagnostics: This switches on or off the monitoring of the network status in the Online display of the Topology Configurator. In the event of a fault, devices with communication problems are shaded in red, network lines with communication problems are shown as dotted lines and the master CPU which controls the line is marked with a lightning symbol. Display Diagnostics: The diagnostics status is only shown if you have enabled network diagnostics. Diagnostics information is shown for the currently selected device or module. The descriptions for the diagnostics bits are always shown in English.



07/01 AWB2700-1305-GB



Display/Force I/O: This function is used for carrying out a wiring test in your system. This is used to display and to change values for inputs and outputs of up to 10 devices simultaneously. The response of your system can also be tested by setting outputs (see Page 343).



307



Test & Commissioning Buttons when using an ASi topology configuration If you have selected an Asi component in the Topology Configurator (Online mode), the relevant menu items of the Components menu and the relevant buttons will be made available.



Figure 138: ASi buttons in the Topology Configurator window (Online mode)



ASi Master Status: Use this button to obtain information on the status of the LE4-505-BS1 master module. ASi Slave Status: Use this button to view the configured and actual values of a slave. If the ASI Slave status is started from the actual configuration when the PLC is in Halt, you can assign a new station number to a slave or change the current parameters. ASi Actual Configuration: Use this button to view the configured and actual values of a station.



308



07/01 AWB2700-1305-GB



ASi Permanent Configuration: Use this button to view the permanent configuration. The permanent configuration is the one created in the Topology Configurator, which was loaded into the PLC as part of the *.pcd file.



User interface







Buttons in the Program window Display/Modify POU: Use this button to open the POU Editor online with the selected POU active, i.e. in the foreground. This button and the corresponding menu item are only available if you have selected a POU in the instance tree of the Program window. Information on how to make online modifications on the displayed POU or how to display variables is provided in Section Program test from Page 384.



07/01 AWB2700-1305-GB



Variables window: Use this button to open the Variables window and display a previously created variables list. The window will remain empty if no variables have been transferred.



309



Test & Commissioning Buttons in the Variables window Status Display: This button starts or closes the Status Display for the variables shown. Enter Forced Status: Use this button to enter the forced value and the forcing mode for the selected variables (see Section “Forcing variable values” on Page 398). Force: Values that were defined beforehand with the Enter Forced Status button are forced with this button. The variables concerned must be listed beforehand in the variables list. Cancel Forcing: This button cancels forcing for selected variables.



310



07/01 AWB2700-1305-GB



Cancel All: This button cancels forcing for all variables.



Commissioning Commissioning



When calling the Test & Commissioning tool from the Navigator for the first time with a newly created project, you must create a new connection list.



Figure 139: Creating a connection list



Confirming your entry with OK will open the Test & Commissioning tool with the Connection List window. This connection list shows an initial connection with the standard settings for device name, device type (PLC type, according to the selection in the Navigator ) and programming device interface.



Figure 140: Connection List window



07/01 AWB2700-1305-GB



You can change the standard settings as follows: 왘 Click the Device Name field and assign a name for the PLC to be connected or click in the Interface field and select another programming device interface. A new connection can be created via Device ➞ New. You can remove an unnecessary connection via Device ➞ Delete. Once you have created a connection list, proceed with commissioning according to the flow diagram given below. The steps will now be described in detail.



311



Test & Commissioning Define establish PRG - PLC connection, page 313



Operating system present?*



No Transfer operating system or boot from memory card, page 350



Yes



PLC test?



Yes Check CPU status, display diagnostics bits, page 361



No Transfer to the PLC, page 352



Yes



Wiring test?



Other tests?



No



Yes Display/force inputs/outputs, page 343



No Exit Online mode, page 403 Modify POU offline and compile, page 62



Yes



Other tests?



No



Start program, page 357



Test POU, page 387



Modifications online possible? Yes Modify POU online, possible force variables, page 396



Test other POUs? No Clear connection, page 342



312



* for PS4-300/PS416



Yes



07/01 AWB2700-1305-GB



No



Commissioning Overview of programming connections Sucosoft S40 automatically offers a standard pointto-point programming connection for a direct connection to the PLC (see the following section). Sucosoft S40 also offers three other kinds of programming connections that can be selected and assigned parameters in the Connection List window: Multidrop programming connections, see Page 315 Programming connection via modem, see Page 316 Programming via Suconet K, see Page 334.



Point-to-point programming connection (directly to the PLC) If your serial programming cable is not connected to the default serial interface COM1, click in the Interface field and select another interface from the pop-up list which is shown. 왘 Click the Interface Parameters button. Interface Parameters button



07/01 AWB2700-1305-GB



The Interface Settings dialog box will appear.



313



Test & Commissioning



Figure 141: Interface settings for PS416



왘 Enter here the required interface parameters for your programming connection: Only when setting interface parameters for a PS416 can an address be selected in the CPU Address list box. This is necessary for multidrop programming connections, see Page 315 . With PS4-200 compact PLCs the maximum transfer rate is 9600 Baud! 왘 Activate the Connection Via Modem check box if you want to program the PLC remotely via a modem. The programming connection is made in this case via the public telephone network. Detailed information on remote diagnostics is provided in Section “Programming connection via modem” on Page 316.



Note! When working with several CPUs and one programming device cable, reconnect via the connection list in the Test and Commissioning window after you have replugged the cable. Otherwise the second CPU would operate with the internal data of the first.



After you have specified the transfer parameters, you can then establish the connection between the 314



07/01 AWB2700-1305-GB







왘 Choose File ➞ Save to save the connection list.



Commissioning programming device and the controller by clicking the Connect button, i.e. connect the PLC.



Multidrop programming connections A multidrop connection can be used to connect several PS416s to a serial interface on your PC. For this you require a UM 1.2 (RS 232 ➞ RS 485) interface converter or a later model, as well as a multidrop cable. Multidrop cable This cable must be prepared as follows: SUB-D socket, 9-pole



1



2 6



3 7



4 8



SUB-D plug, 9-pole



5



1



9



2 6



Connection Converter



3 7



4 8



SUB-D plug, 9-pole



5



1



9



2 6



Connection PS416 No. 1



3 7



4 8



5 9



Connection PS416 No. n



3



------



3



------



3



4



------



2



------



2



5



------



1



------



1



7



------



8



------



8



9



------



6



------



6



07/01 AWB2700-1305-GB



Figure 142: Preparation of the multidrop cable



Settings on CPU 왘 Push the PRG interface selector switch to the right for RS 485 bus operation. 왘 For each PLC connected to an interface via a multidrop connection set the individual CPU address via the DIP switches.



315



Test & Commissioning These switches are on the right of the CPU. The CPU must be removed from the rack before it can be set. The factory setting for the programming interface is address 1. 왘 If the CPU is either the first or last station on the bus, set the RS 485 bus terminating resistors to ON. The bus terminating resistors of all other CPUs must be set to OFF. Setting in the Test & Commissioning tool 왘 Specify a connection in the Connection List window for each connected PS416, and enter a different Device Name (see Fig. 140 on Page 311). 왘 Enter the appropriate CPU address for each connection under Interface Settings (see Fig. 141 on Page 314). This provides an unambiguous identification for each CPU. 왘 Select a baud rate of 9600 baud. Restrictions Multidrop programming connections are subject to the following restrictions: No more than 31 PS416 controllers can be connected to one interface in this way. The transfer rate is limited to 9600 baud. Subordinate PS4-200, PS4-150 or PS4-271 PLC types cannot be programmed via Suconet K.



Data can be transferred between a PC and the PLC via the public telephone network using a modem. A PLC that is connected to the public telephone network via a modem can be diagnosed, for



316



07/01 AWB2700-1305-GB



Programming connection via modem



Commissioning example, from a PC which is located in another town or country and also connected to a PC via a modem. You can also remotely operate and test a PLC via modem. For example you can remotely load program updates into the PLC, check the status of machines or carry out program diagnostics and remedy faults. All functions that can be carried out locally with the Sucosoft software can also be carried out remotely via modem. Requirements: Activate the Connection Via Modem check box in the Interface Settings dialog if you want to program the PLC remotely via a modem (see Fig. 144 on Page 321). To commission your modem you need the following components: Telephone connection (on PC and PLC) 2 modems (with manual)1) PC with available serial interface Connecting cables to the telephone socket and to the DTE. 1) Recommended modems tested by Moeller in pairs:



07/01 AWB2700-1305-GB



Manufacturer



Type



ke



LOGEM LGH 28.8D1 and LOGEM 928



Westermo



TD-32 (DC)



317



Test & Commissioning Modem requirements Data transmission on telephone line: Modulation from V32 (9600 Bit/s, full-duplex) Data security from MNP4 or V42 Data compression from MNP5 or V42 Data transmission to DTE:







9600 Bit/s 8N1 (or 8E1 with an earlier hardware version of PS416-CPU-xxx than V04). The modems must be run in Transparent mode, i.e. they must not automatically form blocks, checksums or make block repetitions. A telephone connection is necessary for data communication in the public telephone network. You can either connect the modem in parallel to an existing telephone by sharing the same telephone socket. In the case of a private telephone exchange (PBX) – the modem can be connected to a separate telephone extension.



Check the switch positions on the PC and PLC modem and change if necessary. Connect PC and PLC modems (Page 319) Initialise PC and PLC modem (Page 321 and Page 326) Establish the connection (Page 329), Terminate the connection (Page 331), Protection of PLC from unauthorized access (Page 332).



318



07/01 AWB2700-1305-GB



Establishing a remote connection (Overview) Establish remote connection to a PLC by carrying out the following steps:



Commissioning Connecting the PC modem The PC is connected with an RS 232 cable to the PC modem via an unused serial interface on the PC. The PC modem is connected to the PLC modem via the telephone network (see Fig. 143 on Page 320). 왘 Connect the modem to your PC and to the telephone socket as described in the modem manual. Connecting up the PLC modem After installing and configuring the PC modem, it is necessary to connect up the PLC modem. The following items are required: A V.24 interface cable for the PLC modem A telephone connection close to the PLC One of the following PLCs: PS4-141-MM1 PS4-151-MM1 PS4-201-MM1 from version 05 PS4-271-MM1 PS4-341-MM1 PS416-CPU-400 from version 04 PS416-CPU-200/300 An external, asynchronous Hayes compatible modem.



07/01 AWB2700-1305-GB



The modem is connected to the PLC by attaching the serial cable to the PRG interface socket. The socket and the pin assignments for the PS4-200 series controllers (PS4-141/151-MM1, PS4-201/271-MM1) and the PS4-341-MM1 controller are identical but are different from those of the PS416 series (PS416-CPU-200/300/400). More information on wiring and technical information can be found in the Appendix and in the following manuals:



319



Test & Commissioning AWB27-1208-GB (PS416) AWB27-1184-GB (PS4-200) AWB27-1311-GB (PS4-300). 왘 Connect up the PLC modem to the PLC and the telephone socket and switch on the modem. The modem will carry out a short self-test and is then ready for operation. LEDs on the modem are provided to indicate the modem’s status.



Figure 143: Connecting modem to PC and PLC



320



07/01 AWB2700-1305-GB



Warning! Remote programming allows you to program a running PLC. Since you can influence running processes and machines, this can present a potential hazard for persons and machinery. Only change the settings of a PLC – in particular during online programming and forcing outputs remotely – if you are sure it will not cause any hazardous conditions for persons or machinery.



Commissioning Initialising PC modem 왘 Start the Test & Commissioning tool. 왘 Define a connection to the required device in the connection list (see Page 303). 왘 Click the Interface Parameters button or choose Device ➞ Interface Parameters. 왘 Enter the correct CPU address and select the appropriate baud rate. 왘 Activate the Connection Via Modem check box in the Interface Settings dialog. The dialog will then include the options for modem setting:



07/01 AWB2700-1305-GB



Figure 144: Interface settings for PS4-201-MM1



The settings in the Modem Connection section in the above dialog box are used to configure your PC modem.



321



Test & Commissioning Baud rate: The Baud Rate drop-down list is used to choose the transfer speed between the programming PC and the PC modem. The communication speed between the PC modem and the PLC modem is not configurable – the two modems negotiate the fastest possible speed automatically when the connection is initiated. The configured interface speed between the PLC and the PLC modem must not exceed the configured interface speed between the PC and the PC modem. With remotely configurable modems this can be set via the standard terminal software or by sending modem AT commands from your PLC program using the SendATCommand function block. The SendATCommand function block is described in AWB2700-1306GB, “Sucosoft S40, Language Elements”. Further information on initialising the PLC modem is provided on Page 326.



AT commands for establishing a connection: The so-called AT commands, which are used to issue commands to the modem, have been standardised to a certain extent by the Hayes company. The AT Commands for the Connection text field is used to enter the commands for establishing the modem connection. In this way you can use this entry field to transfer an initialisation string (see Appendix) to the modem before the command for establishing the connection is entered.



322



07/01 AWB2700-1305-GB



Timeout delay: The Timeout delay in ms entry field is used to define a standard delay time depending on the baud rate. This value defines the maximum time that Sucosoft waits for a response from the PLC. The suggested value depends on the configured modem baud rate and should not be reduced. You can increase the value if you expect a poor quality connection or an existing connection is often dropped without warning.



Commissioning Start the connection establishment by clicking on the Connect button or via Device ➞ Connect. Connect



Important AT commands are summarized in the Appendix. Please refer to your modem manual for a complete list of the AT commands which are supported by your particular type of modem. The standard AT command for a standard telephone connection is ATDP for pulse dial. Tone dialling is activated using the ATDT command. If pauses are necessary during the dialling process, this can be achieved by inserting the letter “W” within the number to be dialled.



07/01 AWB2700-1305-GB



If your PC modem is connected to a private telephone exchange (PBX), the dial tone may differ from the standard dial tone and will then not be recognized by the modem. This can be remedied by changing the dialling command to ATX3DP for pulse dial and ATX3DT for tone dial, respectively.



323



Test & Commissioning Examples: ATDP02286021414 Dial the telephone number 02286021414 from a direct telephone connection using pulse dialling. ATDT00W02286021414 Dial the telephone number 02286021414 from a PBX using tone dialling; wait for the outside line signal after dialling 00. ATX3DT1414 Dial the telephone number 0228 602 1414 from a PBX without a normal dial tone using tone dialling. If the modem can store configuration parameters, save your configuration with the command AT&W0. The command ATZ and a number can then be used to call this saved configuration, e.g. ATZ0. AT commands for terminating a connection: This field is used to enter the commands that are executed via Device ➞ Disconnect or via the Disconnect button. Disconnect button



324



07/01 AWB2700-1305-GB



The standard AT command to disconnect the line is ATH0. It may be necessary to prefix this command with the characters +++ to ensure that the modem switches from the data communications mode back to the command mode in order to accept the command.



Commissioning







Connection Check via DCD line: The program will inform you if the connection to the PLC modem is established. Programming actions can only be carried out when the connection is valid. To use the Connection Check via DCD line function, the PC modem must be able to evaluate the status of the PLC modem carrier signal. The AT&C0 command cannot therefore be used for the PC modem, as it keeps the DCD signal permanently set. Display connection protocol: If you activate this check box, you will see a detailed log of each of the modem commands and reactions while the connection is being established. If this option is disabled, you should check the option Connection Check via DCD line, since otherwise you will not be informed about the connection status. If the log window is disabled, you will only see a short message to indicate whether the connection was made successfully or not. Wait for connection in s: This field is used to enter the maximum time that Sucosoft should wait for the connection via the PC modem to be established. If the connection has not been established within this time, the connection attempt will be aborted with an error message.



07/01 AWB2700-1305-GB



왘 Choose File ➞ Save to save the connection list.



325



Test & Commissioning Initialising the PLC modem Several options are also available for initialising the modem and assigning parameters:



326



The transfer rate for the PC and PLC modems must be the same . This must be particularly observed when there has previously been a direct connection between the programming device and PLC. In this case, the transfer rate set there must be the initial setting of the PLC for the new modem connection. Depending on the functions available on the modem and the quality of the telephone network, the transfer rate must be reduced before the modem connection is established. A transfer rate of 9600 baud is suitable for most conditions. With the PS 4-200 compact controller, the baud rate should be set to 9600 baud only.



07/01 AWB2700-1305-GB







Set the parameters once with a standard terminal program on your PC before connecting to the PLC. The configuration must then be stored in the modem’s non-volatile memory (Page 327 ). In a PS4-300 or PS416 program you can use the SendATCommand function block to address the modem and send it AT commands via the PRG interface (Page 329). If remote configuration is supported by your modem, you can configure the PLC modem from a remote PC through the telephone line.



Commissioning



07/01 AWB2700-1305-GB



Initialising with a standard terminal program: You can initialise the modem with a standard terminal program, (e.g. Hyperterminal or Telix). 왘 Connect the PLC modem temporarily to a free serial interface on your PC. 왘 Start the terminal program and configure it to use the serial interface to which the modem is connected. Configure the serial interface as follows: Serial interface: 9 600 baud, 8 data bits, 1 Stop bit, no parity Flow control: disable XON/XOFF or CTS/RTS Local echo: OFF Terminal type: VT100 or similar. 왘 Check whether the PLC modem is ready and connected up correctly. In your terminal program, switch to Terminal mode, type in the characters AT and press Enter. The modem is ready and connected up correctly if it responds with the characters OK. 왘 Enter the following modem AT commands in the order shown. They are necessary to configure the modem for use with the PLC. The initialisation string shown in the Appendix for LOGEM 928 and LOGEM LGH 28.8D1 modems (Page 423) is an example. Since the necessary commands are not completely standardised for all modem types, compare the commands and their significance with the command list in your modem manual. The Appendix to this manual contains a selection of common Hayes compatible AT commands.



327



Test & Commissioning







왘 Store the configuration settings in the modem’s non-volatile memory. Use the AT command AT&W0 to store the configuration in user setting parameter set 0. The settings are retentive even if the modem is switched off – the settings are activated again when the modem is switched on. Modern modems usually have two or more parameter sets in non-volatile memory, whereby the default action is to load user setting parameter set 0 following power up or reset.



328



AT Command



Meaning



AT%C0



Disable data compression



AT\N0



Disable automatic error correction



AT&U1



Additional error protocols with V.32 (e.g. Trellis)



AT-J0



Disable V.42 detection



07/01 AWB2700-1305-GB



왘 Disconnect the modem from the PC and connect it to the programming interface of the PLC. If you have problems with data transmission or an existing connection is terminated without warning, disable the following protocols in the PLC modem with the AT commands listed below:



Commissioning Initialising via the PLC program: Use the SendATCommand function block in your PLC program in order to send the appropriate AT commands. Output the AT commands in the first cycle following the cold start to ensure that the modem is always correctly initialised without further program actions. See the manual AWB2700-1306-GB “Sucosoft S40, Language Elements” for information on the SendATCommand function block and an example of its usage. Initialising via remote configuration: An example of this is shown on Page 426.



07/01 AWB2700-1305-GB



Using the modem with a private telephone exchange (PBX):When connecting up the modem to a private telephone network, pay attention to nonstandard features, e.g. differing pin assignment of the telephone socket, enabling the telephone extension for outside calls, or the procedure or code necessary to get an outside line. If necessary, contact the supplier of the PBX. Setting up a modem connection Requirements: The parameters of the required PLC connection have been set and the modem is properly connected to the PC and PLC. Ensure that the baud rates between the modem and the DTE (PC or PLC) are the same. 왘 Establish the modem connection between the programming device and the controller by clicking the Connect button. If you have activated the Display Connection Protocol check box, a successful connection establishment will be indicated by an appropriate message (in the following picture the plain text message CONNECT): 329



Test & Commissioning



Figure 145: Connection protocol window with connection established



왘 Confirm the connection establishment log by clicking OK. Sucosoft S40 establishes the connection to the PLC in the same way as with direct point-to-point connections. All the options provided by the Test & Commissioning tool with a direct connection between a programming device and a PLC are also available with the modem connection.



Clicking the Cancel button instead of the Clear Connection button will both clear the existing connection and close the SucoTerminal dialog.



330



07/01 AWB2700-1305-GB



Use the Clear Connection button in the SucoTerminal dialog to clear an existing connection. The SucoTerminal dialog will continue to remain open.



Commissioning Terminating a modem connection Requirement: Only the Connection List window must be opened in the main T & C window. Proceed as follows to terminate the remote connection to the PLC from the main Test & Commissioning window: 왘 Click the Disconnect button or choose Device ➞ Disconnect. Disconnect button



The connection is also terminated when the T & C tool is closed.



07/01 AWB2700-1305-GB



If you have activated the Display Connection Protocol check box, the connection termination will also be displayed in the SucoTerminal dialog:



331



Test & Commissioning



Figure 146: Connection termination log window



If the log window check box is disabled, you will only see a short message to indicate whether the connection termination was successful or not.



Password protection: Sucosoft provides password protection to protect a program or the PLC from unauthorized access. Password protection is the same for all modems used, but differs according to the controller type as follows:



332



07/01 AWB2700-1305-GB



Protection of PLC from unauthorized access Since it is possible to make a connection to the PLC modem with any other modem, you should protect the PLC and the connected machines against unauthorized access. Several methods are available:



Commissioning PS4-300: With these PLCs, the PLC program can be protected with a password. The password must be entered for all actions that change the program or PLC status. See Page 300 for information on entering the password. PS416:



A password can be assigned to the controller irrespective of the individual program or the number of simultaneously loaded programs. The password is requested each time you connect to the controller. See Page 300 for information on entering the password.



Access protection via the PLC modem: Modern modems provide a feature which requires a password to be entered before the connection is established. Note that this feature is not available for all modems and needs to be explicitly activated.



07/01 AWB2700-1305-GB



Access protection via automatic callback: With this method of protection, the called PLC modem automatically terminates the connection after successful connection establishment, and returns the call automatically to a previously specified telephone number. Some modems allow several callback telephone numbers to be configured. Note that this feature is not available for all modems and needs to be explicitly activated. The PC modem must be configured for automatic call answering to use this option.



333



Test & Commissioning Programming via Suconet K PLCs that are designed for use in a Suconet network can be individually programmed just like stand-alone PLCs using a programming cable connected in turn between each PLC and the programming device (PC). Sucosoft also allows one or more subordinate PLCs to be programmed and commissioned via the Suconet network from a central master PLC which is connected to the programming device using a single programming cable. The subordinate PLCs must be stations on Suconet K lines which are directly managed by the master. Only one cable is thus required for programming, maintenance and communication and it is possible to address several PLCs from a single central programming system. Information on whether a particular PLC type can be programmed via Suconet is contained in the documentation of the respective PLC. Requirements: Programming via Suconet K requires the following:



334



Programming cable



PS4: ZB4-303-KB1 PS416: PS416-ZBK-210



PLC type



PS4-141-MM1/PS4-151-MM1 PS4-201-MM1 from V 05 PS4-271-MM1 PS4-341-MM1 PS416-CPU-300/PS416-CPU-400 from V 04 PS416-NET-400 from V 05 07/01 AWB2700-1305-GB



Programming software Sucosoft S40 from version 2.1



Commissioning



a



b



c



d e



Figure 147: Programming via Suconet K (PS4)



07/01 AWB2700-1305-GB







햲 햳 햴 햵 햶



PC with Sucosoft S40 programming software ZB4-303-KB1 programming cable Master: PS4-201-MM1 from version 05 Station 1: PS4-201-MM1 from version 05 Suconet K, line 1



If the master PLC is a PS4-200 series compact controller, you can only program subordinate PLCs (stations) of the same series, but not PLCs with a different programming protocol, such as PS4-300, PS416-CPU-xxx.



335



Test & Commissioning



a



CPU



c



POW



NET 400



CPU



POW



b



d



e



Figure 148: Programming via Suconet K (PS416)



336



07/01 AWB2700-1305-GB



햲 PC with Sucosoft S40 programming software 햳 PS416-ZBK-210 programming cable 햴 Master PLC: PS416 with PS416-NET-400 Suconet K card from version 05 햵 Station 1: PS416 햶 Suconet K, line 1



Commissioning Including networked PLCs in the connection list Requirements: In order to program PLCs via a Suconet K network, the master CPU must be configured as the network master. Furthermore, a small “dummy” program must be pre-loaded in the master and in all other PLCs to be programmed through Suconet K to ensure that the required, final topology configuration is available (it is embedded in the program code). The master PLC must also be specified in the connection list to allow the programming device to address the subordinate PLCs which are connected to it.



07/01 AWB2700-1305-GB



왘 Use the following procedure: Connect the master PLC to the subordinate PLC or PLCs via Suconet K. 왘 Define the direct connection between the programming device and the master, device “example” in the example below. 왘 Add a new line in the connection list with Device ➞ New. 왘 Select the name of the master from the Interface pop-up list.



337



Test & Commissioning



Figure 149: Including networked PLCs in the connection list



왘 Enter the required name for the subordinate PLC in the Device Name box. 왘 Enter the number of the network line of the master and the station number (address) of the subordinate PLC. To do this click the Line list box. The first time it is clicked the Line box will automatically show a 1, and the Station box a 0 (unaddressed slave). 왘 Choose File ➞ Save to save the connection list.



왘 Make the necessary entries in the Device Name, Line and Station boxes, as described above, and save the connection list. 왘 Connect the new PLC to the network and transfer a small “dummy” program containing a topology configuration with the required final station number for the new PLC. For this read Section “Transferring the program” from Page 352.



338



07/01 AWB2700-1305-GB



Configuring a PLC for the first time via Suconet K In order to make it easier to program a new CPU – such as a replacement for a failed device – from the central programming system via Suconet K, new CPUs are factory set with the station number 0 (unaddressed slave).



Commissioning The station numbers in the connection list are updated automatically after a program has been transferred successfully and the user has confirmed the update. 왘 Save the connection list via File ➞ Save. The following method allows you to configure an entire, new network from a single programming device without loading the final user programs at this stage: Requirements: The master is already defined in the connection list. In addition, the programming device must already have program code with the required final topology configuration for each slave PLC. At this stage, the contents of the Program POUs which are used for program code generation can be small “dummy” programs which do not yet implement the assigned automation task.



07/01 AWB2700-1305-GB



왘 Connect the first slave PLC to the Suconet K network. 왘 Enter the temporary address 0 (unaddressed slave) in the connection list. 왘 Establish the connection between PC and PLC and transfer the dummy program with the associated topology configuration. Repeat the above steps for the remaining slave PLCs.



339



Test & Commissioning







You can physically connect up the next slave controller as soon as the address of the previous slave station has been updated in the connection list. Another method is to use a standard direct programming cable to specify the required final Suconet K station address of each slave controller in advance. This is done by loading a program into each slave controller together with the associated topology configuration which specifies the required final station address before connecting the controller to the network. By using the master controller as a “gateway” between the programming cable and the Suconet K fieldbus, all programming and monitoring functions can be carried out as if each slave controller connected to the fieldbus is directly connected to the programming device. In addition, online services supported by the programming device are executed independently of data communications which may be taking place through the same Suconet K connection simultaneously.



If the master controller is currently in the Ready state, functions such as loading a user program and displaying status information from a slave are about 10 % slower than with a direct connection to the programming device; if the master controller is running a program (Run state), the functions are about 20 % slower than a direct connection.



340



07/01 AWB2700-1305-GB



Programming performance The time response when programming through a master controller and Suconet K depends on the number of connected slave stations and the quantity of program data to be transferred. Accordingly, it is only possible to specify approximate values.



Commissioning Transfer errors, when transferring to slave PLCs If the address of a station has changed during the transfer to a slave PLC, this may cause an error during the transfer. Example: Connect a network station on address 2 Download a program containing the station address changed to 4. After the transfer the PLC can no longer be addressed under address 2. In this case return to the connection list and make the connection using the new address.



Connecting and disconnecting a PLC Connecting a PLC Requirements:







The serial programming cable is fitted between the PC and the PLC. With the PS416 controller, check the correct position of the interface switch on the CPU card: RS 232 ➞ cable PS416ZKB-210 RS 485 ➞ UM1.5 interface converter A connection list is available.



07/01 AWB2700-1305-GB



왘 Select the required connection in the connection list. 왘 Establish the connection between the programming device and the controller by clicking the Connect button. Connect button



341



Test & Commissioning An established connection is displayed by the symbol of a connected plug in front of the device name: “Connection established” symbol.







If the Save Settings on Exit in the Options menu is active, starting the Test & Commissioning tool will automatically cause the reconnection of all devices that were connected during the previous session. The Program and Topology Configuration windows that were active during the last session are also opened. Disconnecting a PLC Requirements: Only the Connection List window must be opened in the main T & C window. 왘 Select the required connection in the connection list. 왘 Terminate the connection by clicking the Disconnect button.



342



07/01 AWB2700-1305-GB



Disconnect button



Commissioning Wiring test Test the correct functioning of sensors and actuators (inputs and outputs) of your system by carrying out a wiring test. Start the wiring test via the Online Topology Configurator. The Online Topology Configurator reads from the PLC the topology configuration that was entered when the project was created and shows this in the Topology Configurator window. You can inspect the input and output values of the different modules, cards and devices, set the outputs of the PLC to defined states and thereby check the reaction of the system. Requirements:



07/01 AWB2700-1305-GB







An operating system must have been loaded beforehand on the PLC (see Page 350). The PLC must be connected and must be provided with a valid configuration with the inputs and outputs to be tested. The topology configuration must have been compiled beforehand with a program POU. The contents of this POU is not important but is used to provide a loadable program code file. The load operation is described in the chapter Transferring the program from Page 352. The wiring test can only be carried out with the CPU in Halt, i.e. no program running. 왘 Activate the Connection List window in the main T & C window and then click the Topology button.



343



Test & Commissioning Topology button







The Online Topology Configurator will open showing the topology stored in the PLC. The optional user descriptions are shown automatically if there is a configuration that matches the one read out. The relevant buttons are made available. The digital I/O cards of the PS416 are not addressed through the slot number. Accordingly, the digital I/O cards may have different slot numbers than those shown in the Topology Configurator, or they may in fact not be inserted in the controller at all.



344



07/01 AWB2700-1305-GB



If the PLC is in Halt, the inputs can be displayed and the outputs forced to defined states irrespective of the user program. In Run status the PS4 controller can display the current status of inputs and outputs, and the PS416 can display the current input states.



Commissioning Displaying I/O Requirements: The Topology Configurator window must be opened. 왘 Select the devices whose input and output values you want to inspect, or to change while the controller is in Halt. To select several components, hold down the Ctrl key and left-click the components required in the Online Topology Configurator. You can select up to 10 components simultaneously irrespective of which line or network they belong to.



Figure 150: Selecting components



In this example the PLC (PS4-341-MM1) and the digital expansion module (EM4) are selected.



07/01 AWB2700-1305-GB



왘 Click the Wiring Test button or choose Component ➞ Display/Force I/O. Executing a wiring test



A window which shows the input and output areas of the selected devices together with the current input values is opened. 345



Test & Commissioning



The example shows addresses I0.0.0.0.2 and I0.0.0.0.4 of the input status byte ISB and the addresses I0.0.0.0.0, I0.0.0.0.3 of the input word IW0. The bits which are set are shown in black. The hex value resulting from the bit pattern is shown alongside each digital input or output word. The top section of the window shows the inputs and outputs of the PS4-341-MM1 master. The values of the analog inputs and outputs are shown in decimal format.



346



07/01 AWB2700-1305-GB



Figure 151: Display/Force Inputs/Outputs dialog



Commissioning Forcing outputs Requirements: The Display/Force I/O window must be open. Warning! The outputs must only be activated under supervision otherwise this will produce uncontrolled switching states in the system controlled. The interlocks in the program have no effect since the program is not being executed at this stage. The configured range of the PLC outputs is displayed. The outputs are initially 0 since the PLC is now halted. 왘 To force outputs select the appropriate bits of the output word concerned and click the Activate button to set the bits. Activate button



Use the Deactivate function to abort the operation. Deactivate button



Use the Delete function to delete the selected bit position again. Delete button



07/01 AWB2700-1305-GB



Set bit positions are indicated as lit LEDs. The hexadecimal value resulting from the bit pattern is shown alongside the output word.



Figure 152: Display of forced outputs



347



Test & Commissioning The example shows the address 0.0.0.0.5 of output word QW0. It is also possible to assign a particular value to analog outputs in the same way as for digital outputs. 왘 For this select the outputs to be forced and enter the required value:



Figure 153: Forcing analog outputs



왘 Accept the value entered by clicking with the mouse in the Display/Force I/O window. 왘 Click the Activate button to transfer the specified value to the PLC.



348



All forced values are automatically reset when leaving the Display/Force I/Os window.



07/01 AWB2700-1305-GB







왘 Click Deactivate if you wish to cancel the forcing, i.e. to cancel the effect of the value on the machine.



Commissioning Transferring the operating system You can only start a transfer to the connected PLC from the Connection List window. Other requirements: The serial programming cable must be fitted between the PC and the PLC. A connection list must be available. The PLC must be connected. Only the Connection List window must be opened in the main T & C window. With PS4-300 or PS416 PLCs you can replace an operating system that is missing or replace an old one. In order to transfer an operating system you must open the Transfer/File Manager dialog: 왘 Click the Transfer/File Manager button.



07/01 AWB2700-1305-GB



Transfer/File Manager button



349



Test & Commissioning Programming Device ➞ PLC 왘 For this select the Programmer tab in the Transfer/File Manager dialog. 왘 Select for the transfer the operating system file (.osf) format in the File Format list box. The name of the relevant operating system file is shown under File Name. The Transfer/File Manager window for PS4-300 and PS416 controllers looks as follows:



Figure 154: Transfer/File Manager dialog



왘 Transfer the selected operating system file by clicking the Transfer to PLC button.



350



07/01 AWB2700-1305-GB



Transfer to PLC button



Commissioning







An operating system can only be downloaded when the PLC is in the Ready state. When you replace an existing operating system in the controller with a new version, all user programs and data are deleted at the same time! Accordingly, you will be prompted to confirm this action before the transfer is started. The transfer can take several minutes, depending on the baud rate of the connection. The Transfer progress indicator will open to show the progress of the load operation. After successful transfer, the green READY lamp lights on the CPU card to show that it is ready.







Programming Device ➞ Memory Card Switching the PLC to Ready instead of Run will enable every operation that affects the memory card, e.g. a transfer or formatting step, to run about ten times faster. 왘 For this select the Programmer tab in the Transfer/File Manager dialog. 왘 Transfer the selected operating system file by clicking the Transfer to Memory Card button.



07/01 AWB2700-1305-GB



Transfer To Memory Card button



351



Test & Commissioning Transferring the program You can only start a transfer to the connected PLC from the Connection list. Other requirements: The serial programming cable is fitted between the programmer and the PLC. A connection list is available. The PLC is connected. In your programming device you have opened the project containing the POUs and the program code file. Only the Connection List window must be opened in the main T & C window. In order to transfer a program you must open the Transfer/File Manager dialog: 왘 Click the Transfer button. Transfer button



352



07/01 AWB2700-1305-GB



Programming Device ➞ PLC 왘 For this select the Programmer tab in the Transfer/File Manager dialog. The File Format list box has the required format Program (*.PCD) as the default setting for transferring the program code file. The names of the executable PCD files are therefore shown under File Name.



Commissioning



Figure 155: Transfer/File Manager dialog



왘 Transfer the selected program code file by clicking the Transfer to PLC button. Transfer to PLC button



07/01 AWB2700-1305-GB







The following file names and extensions are reserved for Sucosoft and must not be used for other files: File names: “416m_” or “341_” followed by numbers, “PS416”, “BOOT”, “Update”, “RSDAT” Extensions: “.DCF”, “.ETC”, “.GAB”, “.GID”, “.ITB”, “.ITC”, “.LAB”, “.LID”, “.PCD”, “.PDF”, “.TID”. Files with these extensions are not displayed in the File format list box when the All Files setting is selected.



353



Test & Commissioning Programmer ➞ Memory Card 왘 Proceed as described above. This time, however, click the Transfer to Memory Card button. Transfer To Memory Card button



Special note with PS416 Defining startup behaviour: The Startup Behaviour window is used to define how the controller starts up when booting from a memory card or when loading programs from the memory card. With SRAM cards, this dialog opens directly after the transfer and with Flash cards after closing the Transfer/File Manager dialog:



Figure 156: Defining the startup behaviour of the memory card



LOAD: The program is loaded and not started. The startup behaviour is not set as active. A program can only be started from the programming device. NOT SET: the program is not loaded after the operating system has been loaded.



354



07/01 AWB2700-1305-GB



AUTOSTART: The progam is automatically started after being loaded.



Commissioning







Further information on this dialog is provided in the hardware description of the relevant controller. PLC ➞ Memory Card To transfer a program from a PS4-300 or PS416 controller to a memory card, select the Controller tab in the Transfer/File Manager dialog. 왘 Then transfer the selected program file by clicking the Transfer from PLC to Memory Card button. Transfer from PLC to Memory Card button



Memory Card ➞ PLC Proceed as follows to transfer a program from a memory card to a PS4-300 or PS416 controller (this operation is not possible with the PS4-200): 왘 For this select the Memory Card tab in the Transfer/File Manager dialog. 왘 Then transfer the selected program file by clicking the Transfer From Memory Card to PLC button.



07/01 AWB2700-1305-GB



Transfer From Memory Card To PLC button



355



Test & Commissioning Formatting the memory card 왘 For this select the Memory Card tab in the Transfer/File Manager dialog. 왘 Then click the appropriate button. Format Memory Card button



Comparing a program on the PC and the PLC Requirements: Only the Connection List window must be opened in the main T & C window. An executable program code file and a connection list must be available on the PC. The programming cable must be connected (or the network connection between the PC and the PLC is present). The connection between the PC and the PLC must be established. 왘 Click the Transfer... button in the main Test and Commissioning window. Open the Transfer/File Manager dialog and select the Programmer tab. 왘 Select the program to be compared in the selection list and click the Program Comparison button. Program comparison between programming device and PLC



왘 Acknowledge the message with OK. 왘 Close the Transfer/File Manager window by clicking on Close.



356



07/01 AWB2700-1305-GB



After a short time, a message will appear indicating whether the program in the PLC matches the program in the PC or not.



Commissioning Comparing a program on the PC and the memory card Proceed as described above, but use instead the button for comparing programs on the PC and memory card. Program comparison between programming device and memory card



Starting programs Starting or stopping programs from Sucosoft Use the Status and Diagnostics dialog to start a program from Sucosoft. Requirements:



07/01 AWB2700-1305-GB



In your programming device you have opened the project containing the POUs and the program code file (pcd file). The PLC is connected. A pcd file (a user program) has already been transferred to the PLC. The CPU operating mode selector switch is in RUN or RUN M-RESET: RUN: a warm start or cold start can be carried out. RUN M-RESET: A cold start is possible. Only the Connection List window must be opened in the main T & C window. 왘 Activate the Connection List window in the main T & C window and then click the Program Status button. Program Status button



The Program Status tab of the following Status and Diagnostics dialog shows the operating status of the



357



Test & Commissioning CPU, program information and the buttons provided for starting and stopping a program. Although the content of this dialog depends on the PLC concerned, the same functions apply for starting and stopping a program. These are therefore explained only using the example of PS4-300:



왘 Click the Warm Start or Cold Start button. The program is started and the Run status will be indicated on the screen and on the CPU. The Halt button will be available. 왘 Click the Halt button to stop the program. The CPU status changes to Ready. The Cold Start and Warm Start buttons will be activated. 358



07/01 AWB2700-1305-GB



Figure 181: Status and Diagnostics dialog



Commissioning 왘 Click Close to close the window. Starting or stopping the program without Sucosoft For PS4 controllers Depending on the position of the operating mode switch, the program will then start automatically as a cold start or warm start. When the operating mode selector switch is set to Run, pressing the Set button can trigger the startup behaviour set under Behaviour after NOT READY (PS4-200) or Startup Behaviour on Warm Start (PS4-300) in Generate ➞ Program Parameters... . For PS416 controllers You can only start a program without Sucosoft S40 (i.e. directly on the PLC) if you have assigned the attribute “active” to the program as the startup behaviour. Sucosoft always assigns this “active” attribute to the last transferred or last cold started program if this operation was carried out later. Depending on the position of the operating mode switch, the program will then start automatically as a cold start or warm start. If a memory card containing user programs has been inserted in the controller, the program startup behaviour when the controller is switched on is defined by the startup information which is stored on the memory card (see also Page 354).



07/01 AWB2700-1305-GB



Booting the controller from the memory card For PS4-200 controllers The program saved on the memory card is transferred to the PLC if the PLC contains no program or a faulty one when the PLC is switched on or started.



359



Test & Commissioning



360



07/01 AWB2700-1305-GB



For PS416/PS4-300 controllers If neither operating system nor program are stored in the PLC and both of these are stored on the memory card, first of all the operating system and then the program are transferred to the PLC before the program is then started. On the PS416 you can define the startup behaviour for booting from the memory card and also define which program should be started (see Page 354).



System diagnostics System diagnostics



CPU status The Test & Commissioning tool offers support in checking the status of the CPU. This can be carried out during the program test or independently of the user program. Requirements: The serial programming cable is fitted between the PC and the PLC. The Test & Commissioning tool has been opened. The PLC is connected. A *.pcd file (a user program) has already been transferred to the PLC. Only the Connection List window must be opened in the main T & C window. 왘 Click the CPU Status button.



CPU Status button



07/01 AWB2700-1305-GB



The Status and Diagnostics dialog will open for the PLC type concerned with the CPU Status tab selected. This dialog provides information about the status of the connected CPU:



361



Test & Commissioning



362



07/01 AWB2700-1305-GB



Figure 157: CPU Status dialog for the PS4-200



System diagnostics



07/01 AWB2700-1305-GB



Figure 158: CPU Status dialog for the PS4-300



363



Test & Commissioning



Figure 159: CPU Status dialog for the PS416



364



07/01 AWB2700-1305-GB



These dialog fields display the following information about the connected CPU:



07/01 AWB2700-1305-GB



System diagnostics CPU status



Information



CPU operating status



Information on the current operating status of the CPU is shown as text and also graphically in the image of the PLC. The states displayed have the following meaning:



RUN



The user program is running in the PLC; LED 2 (PS4) or the green RUN LED (PS416) are lit in the PLC image.



READY:



The CPU is ready for operation but the user program is not being processed. LED 1 (PS4) or the green Ready LED (PS416) are lit on the PLC



NOT READY



The running program or memory test has encountered fatal hardware or software errors. The user program cannot be run; the LED 3 (PS4) or the red Not Ready (PS416) are lit in the PLC image.



BATTERY



Only PS4: The battery on the CPU or the memory card must be fitted or exchanged. LED 4 is lit in the PLC image.



CHANGE



Only PS416: The battery on the CPU or the memory card must be fitted or exchanged. The red CHANGE LED is lit in the PLC image.



ERROR



Only PS416: An error occurred while the user program was running, such as: - Access to a parallel bus station is not possible - Remote I/O has failed - The specified cycle time of the user program was exceeded RUNTIME ERROR. If a RUNTIME ERROR occurs, the RUN or READY LEDs and the red ERROR LED are lit. The appropriate diagnostics bit is set in the program diagnostics status word. Confirming the diagnostics status word via a system cold start or a cold start of the user program will switch the PLC from the error status.



BOOT



Only PS416: The operating system is missing from the CPU; all LEDs flash on the PLC.



Switch position



Shows the position of the operating mode selector switch HALT, RUN or RUN_M_RESET on the CPU: HALT: The operating mode selector switch is set to HLT/Halt. RUN: The operating mode selector switch is set to RUN. RUN MARKER RESET: The operating mode selector switch is set to RUN_M_RESET.



Date/Time



This shows the date and time of the real-time clock in the CPU.



System information



This shows the version and the identification code of the operating system in the CPU.



Memory size



This shows the available CPU memory for the user program and the capacity of the entire CPU memory.



Memory card



This shows information on the CPU's memory card if it is fitted. For PS416: Click the Information... button to get further information on the memory card.



365



Test & Commissioning CPU diagnostics Call up CPU diagnostics as follows: 왘 Activate the Connection List window in the main T & C window and then click the CPU Status button. 왘 Select the Status and Diagnostics dialog and then the CPU Diagnostics tab. The dialog shows the CPU diagnostics status word according to the type of PLC connected. The CPU diagnostics status word encodes events that can be diagnosed as errors. Each diagnostics bit is assigned a counter. In the event of an error, the diagnostics bit is shown in red and the value of the associated diagnostics counter is incremented. Diagnostics bits which are set (red) can be reset by clicking Reset Diagnostics Bits. The diagnostics counter is not incremented while the bit is set. The diagnostics counters can be reset, if required, by clicking Reset Diagnostics Counter. Errors that cause the program to stop (CPU status Not Ready) have the Stop attribute in the Category column on the right. After rectifying the error, the diagnostics bit can be acknowledged by clicking Reset Diagnostics Bits or by pressing the SET/Reset button on the CPU with the operating mode selector switch set to HLT/Halt.



Via the software using the buttons in the Program Status dialog, taking into account the position of the operating mode selector switch and the assigned startup behaviour of the program concerned.



366



07/01 AWB2700-1305-GB



The user program can then be restarted in two ways:



System diagnostics By pressing the SET/Reset button on the CPU with the operating mode selector switch set to RUN or RUN_M_RESET, taking into account the assigned startup behaviour of the program concerned. For more information see Section “Starting programs” on Page 357.



07/01 AWB2700-1305-GB







The second type of error are those that cause the assigned diagnostics bit to set but do not cause a Halt or Ready status. They are shown with the Indication attribute in the Category column. Such errors are not indicated by the LEDs on the CPU. After rectifying the error, the diagnostics bit can be acknowledged by pressing the SET/Reset button on the CPU or by clicking the Reset Diagnostics Bits button, depending on the CPU status. If the CPU is in Run and the operating mode selector switch is set to HLT/Halt when the SET/ Reset Diagnostics Bits button is pressed, the diagnostics bits are not reset but the program is stopped instead.



367



Test & Commissioning CPU diagnostics (PS4) 왘 Display the CPU diagnostics status word via the Status and Diagnostics dialog and the CPU Diagnostics tab.



Figure 160: PS4-200, CPU diagnostics status word



368



07/01 AWB2700-1305-GB



14 errors can be detected on the PS4-200. The CPU diagnostics status word encodes 14 events that can be diagnosed as errors (see following table).



System diagnostics



Figure 161: PS4-300, CPU diagnostics status word



07/01 AWB2700-1305-GB



22 errors can be detected on the PS4-300. The CPU diagnostics status word encodes 22 events that can be diagnosed as errors:



369



Test & Commissioning Table 4: PS4 diagnostics status word PS4-200



ECT



Cycle time exceeds the maximum value: Stop



EDC



DC voltage failure due to short-circuit or overload in the basic unit. The outputs are reset by the hardware: Stop



EWD



The CPU hardware watchdog signalled CPU failure (error category: Stop).



EPM



Program memory error. Error found in the checksum or during plausibility check of the user program. The program must be re-loaded (error category: Stop).



EDR



Data retention of the operating system corrupted. Important control data of the operating system is corrupted or missing following a change of RAM or with a new PLC (error category: Stop). In addition, all memory ranges are cleared and the CPU is re-initialised.



ERT



Run-Time error. Error in the CPU during run time Run-time error. Error in the PLC user program (error category: Stop). during run time. For example, index for array access exceeds the array limits: Stop.



ENR



Restart only possible with retentive marker reset. This message only occurs if the PLC is configured for Halt under Startup Behaviour after NOT READY in the Navigator under Generate ➞ Program Parameters..., and an attempt was made to warm start the CPU after a Stop category error. In this situation, restart is only possible via retentive marker reset.



Restart only possible with retentive marker reset. This message only occurs if an attempt to warm start the PLC was made although the PLC is configured in the Navigator under Generate ➞ Program Parameters... for No Restart under Warm Start Behaviour. It will also occur if an attempt was made to warm start the PLC after a Stop category error. In this situation, restart is only possible via retentive marker reset.



EHM







RAM memory in the PLC faulty (error category: Stop).



ECM







Checksum error of operating system (error category: Stop).



ECL







CPU real-time clock is faulty (error category: Stop).



ETR







Timer failure: The timer on the CPU is faulty (error category: Stop).



EIL







An attempt was made to execute an impermissible operation of the 80C167 microcontroller (error category: Stop).



EOS







Error in current OS40 discovered. Safe processing cannot be ensured (error category: Stop)



ECA







Application destroyed (error category: Stop)



DAC



Supply voltage dip. The supply voltage of the basic unit has failed temporarily (error category: Indication).



370



PS4-300



07/01 AWB2700-1305-GB



Event



System diagnostics DBM



The CPU battery is faulty or empty: Replace the The CPU battery is faulty or empty (error battery: Indication category: Indication) If a battery error is detected during a system cold start, the controller remains in Ready status – the user program is not started. The error category is Indication in all other cases. If a memory card with a valid program cannot be found during the system start, the PLC will stay in Not Ready. Also see Startup behaviour after Not Ready on Section “Starting or stopping the program without Sucosoft” from Page 359.



DMC



Backup not present. The backup automatically saved on the memory card is faulty or a Flash memory card is not fitted (error category: Indication).



DLK



Error in the local configuration. The PLC configuration is not correct or a local expansion module fitted to the basic unit is faulty (error category: Indication).



DLS



Error local status. PLC digital outputs short-circuited or overloaded: Indication



DDK



Error remote configuration. The configuration of one or more network stations is not correct, i.e. the specified type designation does not match the actual device present (error category: Indication).



DDS



SBI or network station error Network station error detected via Suconet K. The error can be localised by checking the diagnostics bytes of the network stations (error category: Indication)



The memory module is not suitable for a program backup or for saving files. It occurs if the ZB4-128-SF1 or ZB4-160-SM1 memory modules are fitted.



07/01 AWB2700-1305-GB



왘 Click Close to close the CPU Diagnostics dialog and return to the main Test and Commissioning window.



371



Test & Commissioning CPU diagnostics (PS416) 왘 Display the CPU diagnostics status word via the Status and Diagnostics dialog and the System Diagnostics tab. The CPU diagnostics status word of the PS416 has 13 diagnostics bits for indicating events that have caused errors.



372



07/01 AWB2700-1305-GB



Figure 162: PS416, CPU diagnostics status word



System diagnostics Table 5: PS416, diagnostics status word DHM



RAM memory in the PLC faulty (error category: Stop).



DCM



Checksum error of operating system (error category: Stop).



DCL



CPU real-time clock is faulty (error category: Stop).



DBM



The CPU battery is faulty or empty (error category: Indication) If a battery error is detected during a system cold start, the controller remains in Ready status – the user program is not started.



DBC



The battery on the memory card is faulty or empty: Indication. If a battery error is detected during a system cold start, the controller remains in Ready status – the user program is not started.



DAC



Supply voltage dip (error category: Indication)



DDC



DC voltage failure due to short-circuit or overload in the basic unit. The outputs are reset by the hardware (error category: Stop)



DAK



Card cannot be found in the slot. No reaction of a card after addressing or addressing of a card which is not fitted (error category: Indication).



DTR



Timer failure: The timer on the CPU is faulty (error category: Stop).



DWA



The CPU hardware watchdog signalled CPU failure (error category: Stop).



DIL



Faulty code (error category: Stop).



DOS



Fatal software error (error category: Stop).



ACE



Checksum error. This error is indicated if the code or data is faulty in the user program before a restart (error category: Stop)



07/01 AWB2700-1305-GB



왘 Click Close to close the CPU Diagnostics dialog and return to the main Test and Commissioning window. 왘 Select another function or leave the Test and Commissioning tool via File ➞ Exit.



373



Test & Commissioning Program status Requirements: In your programming device you have opened the project containing the POUs and the program code file (pcd file). The PLC is connected. A pcd file (a user program) has already been transferred to the PLC, The CPU operating mode selector switch is in RUN or RUN_M_RESET position. Only the Connection List window must be opened in the main T & C window. 왘 Click the Program Status button. Program status button



The Program Status tab of the following Status and Diagnostics dialog shows the operating status of the CPU, program information and the buttons provided for starting and stopping a program.



374



07/01 AWB2700-1305-GB



Program Status (PS4) Although the content of this dialog depends on the PLC concerned, the same functions apply for starting and stopping a program. These are therefore explained only using the example of PS4-300:



System diagnostics



07/01 AWB2700-1305-GB



Figure 163: Program status (PS4-300)



375



Test & Commissioning



Figure 164: Program status (PS416)



CPU operating status



Information This shows the current CPU status as follows:



BOOT



Only PS416: A system cold start is required, i.e. the operating system needs to be loaded in the CPU RAM memory.



RUN



The user program is being processed in the CPU. This status is reached via a cold or warm start.



READY:



The CPU is ready for operation but the user program is not being processed. A cold start or warm start can be started depending on the setting of the operating mode selector switch: a Cold start starts the user program with the initial values of the variables. Any process data that remains in the PLC after the user program was stopped is discarded. With a warm start the user program is resumed at the point where it was stopped.



NOT READY



A fatal error has been detected. The diagnostics status word must be acknowledged so that the Warm Start and Cold Start buttons can be activated.



376



07/01 AWB2700-1305-GB



Program status



System diagnostics Program status



Information



Switch position



This shows the current position of the CPU operating mode switch as follows: - RUN: A warm or cold start is possible. - RUN M-RESET: A cold start with marker reset is possible. - HALT: PLC cannot be switched to RUN.



Program information



The current program execution parameters are shown as follows: PS4 – Name of user program in the PLC – The version number of the program as set in the Code Generation function under Generate ➞ Program Parameters... – Code size: the size of the executable code of the PLC user program – The size of the data area for the user program – The date and time of the program generation – Program execution type: “cyclical” with the maximum permissible cycle time after which the PLC switches to Halt or “periodic” with the selected time interval (PS4-300, PS416) – Startup behaviour after NOT READY – When the PLC is in Run status, this displays the current cycle time – Displays the minimum and maximum cycle time (PS4-300, PS416) – Forcing active or inactive (only PS4-300).



PS416 – Program execution type: cyclical or periodic, with the associated cycle time or interval time – Startup behaviour.



These parameters correspond to the values used for the generation of the program code, i.e. the standard settings or the settings which you made in the Code Generator under Generate ➞ Program Parameters. The parameters cannot be changed here.



07/01 AWB2700-1305-GB



Program list box



Only PS416: The program field contains information on the user program in the controller: – Program name: Name of the user program. – Program status: program status, e.g. “started”. – This indicates whether automatic program startup is possible. The attribute “active” means that the user program can be started with a system cold start using the PS416-CPU operating elements (operating mode selector switch and SET button) and without needing a programming device.



377



Test & Commissioning Program status



Information



Buttons of the Program Depending on the CPU status, the position of the operating mode selector switch Status dialog and the chosen program startup behaviour, the following buttons may be available: Cold start



With a cold start the user program is started with the initialisation values of the variables. A cold start is possible with the operating mode selector switch set to Run or Run_M_Reset. Any process data that remained in the PLC after the user program was stopped is discarded. Only PS4: The values of markers in the recipe marker range defined in the Code Generation tool under Generate ➞ Program Parameters... are retained following a cold start.



Only PS416: When the program cold start takes place for the first time, the CPU is requested to start the user program which is marked as “active”. The status “started” is then displayed in the Program field.



Warm start



With a warm start the user program resumes at the point where it was stopped. A warm start is only possible if the operating mode selector switch is set to RUN and the user program must be in Halt status. The process data is saved if the program is interrupted, and is still available if the program is resumed. A warm start is only possible after an already started program has been stopped, i.e. by setting the operating mode selector switch to Halt and pressing the Set button or by clicking the Halt button. If the program was stopped by switching to Halt, the operating mode selector switch must be set to Run again before it can be warm started.



Halt



This stops a running user program.



Delete



Only PS416: Deletes a deactivated user program from the PLC memory.



Startup behaviour Only PS416: The status “active” means that the user program can be cold started on the memory card without a programming device (for information on the startup behaviour on the memory card also see Page 354).



378



07/01 AWB2700-1305-GB



Starting and stopping Only PS416: the program via the – Select the program name in the program list box and set the operating mode programming device: switch of the CPU to Run. – Click the Cold Start button. The program is started, the RUN status will be indicated on the screen and on the PLC, the message "started" will be shown next to the program name in the Program field. The Halt button will be available. – Click the Halt button to stop the program. The program will be shown to have “halted”, the Cold Start and Warm Start buttons will be activated. – Click Close to close the window.



System diagnostics Network diagnostics







The Online Topology Configurator allows you to carry out network diagnostics in order to check the network status of your system. The network diagnostics function can be used for all Suconet K and AS Interface®lines. Several network lines can be diagnosed and displayed at the same time. For this a program with a topology configuration must be loaded on the PLC and the connection to the PLC must be established. The graphical display of the Topology Configurator now shows additional information which allows you to quickly assess the status of the network communications and provides status messages for each individual component. Unlike the PS4, the digital I/O cards of the PS416 are not addressed through the slot number. Accordingly, the digital I/O cards may have different slot numbers than those shown in the Topology Configurator, or they may in fact not be inserted in the controller at all. Requirements: A *.pcd file with the topology configuration to be tested must be provided in the PLC. The PLC must be connected. 왘 Activate the Connection List window in the main T & C window and then click the Topology button.



07/01 AWB2700-1305-GB



Topology button



The Topology Configurator window ‹ Device Name› will open and the relevant buttons are made available. The Online Topology Configurator will open showing the topology stored in the PLC. The optional user descriptions of the individual components are shown



379



Test & Commissioning automatically if there is a configuration that matches the one read out. 왘 Click the Network Diagnostics button or choose Network Diagnostics in the Display menu to show or hide the display of network diagnostics information. Network Diagnostics button



The graphical display of the topology configuration now includes additional information which indicates the status of the network communications. In the event of a network fault, devices with communication problems are shaded in red. Faulty network lines with communication problems are shown as dotted lines; and the master module which controls the line is marked with a lightning symbol. You can generate a diagnostics status for a network component in the following way: 왘 Select the components. 왘 Start the network diagnostics by clicking the appropriate button or via Component ➞ Diagnostics Status. Diagnostics status button



You can create a text printout of the topology configuration with the network examined by choosing Configuration ➞ Print. The following example configuration for a PS4-300 illustrates the network diagnostics function in Sucosoft S40.



380



07/01 AWB2700-1305-GB



The Diagnostics Status ‹ Device Name› dialog shows the diagnostics bits of the module or device (see Page 383).



System diagnostics Example of a PS4-300 with a Suconet K network Requirements: The PS4-300 must be connected and the Test and Commissioning tool must be started. The topology configuration must be stored on the PLC, and must be read out and displayed in the Online Topology Configurator. Structure of the example configuration: Below is a configuration which was read from the controller. The Topology Configurator window (online) shows the topology configuration, i.e. the hardware configuration which was specified with the Topology Configurator during project development (offline).



Figure 165: Example configuration with PS4-300



07/01 AWB2700-1305-GB



왘 Start the network diagnostics with the PLC connected, as described above.



381



Test & Commissioning



The example shows a topology configuration that was read from the PLC for network diagnostics. The master is marked with a lightning symbol. This means that there is fault in the network line it manages. The network line is shown dotted and the faulty modules (EPC335.1-K, PS4-341-MM1) are highlighted with a red background. Select any device and display the diagnostics status via Component ➞ Diagnostics Status. This will open the Diagnostics Status dialog for the selected device, showing the relevant diagnostics bits in English.



382



07/01 AWB2700-1305-GB



Figure 166: Network diagnostics with PS4-300



System diagnostics



Figure 167: Diagnostics status of EPC335.1-K



Refer to the manual of the device concerned for information on rectifying diagnosed errors.



07/01 AWB2700-1305-GB



Note: The diagnostic bits of all devices in a topology configuration can be displayed even if there is no fault present.



383



Test & Commissioning Program test



Overview A program test can be carried out in Online mode with the POU Editor. This allows you to display a POU in IL, LD, FBD or ST and change it online. Requirements:



384



If the program is to be edited online, the current project must first be selected in Sucosoft. Also, the contents of the individual POUs and the program code must match the program version in the controller. An active process must be running in the PLC. 07/01 AWB2700-1305-GB







The Test & Commissioning tool must be open. The PLC must be connected. A pcd file (a user program) has already been transferred to the PLC. In your programming device you have opened the project containing the POUs and the program code file (pcd file) of the user program to be tested. The CPU operating mode selector switch is in RUN or RUN_M_RESET position. The program must have been started. The program running in the controller can be checked and modified online, i.e. while the program is running. One POU can be displayed together with the changing values of the variables. In addition, selected variables from several POUs can be displayed in a Variables window. The POU Editor is used in Online mode for modifying POUs and for displaying the status of variables.



Program test Switching the POU Editor to online mode 왘 Activate the Connection List in the main Test & Commissioning window and click the Program button or choose Device ➞ Program. Program button



The Program window will appear with the instance tree view.



Figure 168: Program window



The Resource (PLC) is displayed as the highest level of the program instance tree in the left window pane and the name of the Program POU is displayed as the next lower program level in the right pane. You can select the individual program components from the program structure tree (instance tree) via the menu items. You can also select the individual branches by clicking them with the mouse. If a selected program component instantiated function blocks and functions, they are marked with a plus sign next to their name.



07/01 AWB2700-1305-GB



왘 Double-click Resource in the left-hand window. The Program POU will appear in the left window. 왘 Double-click the Program POU button. If function block POUs have been instantiated in a program POU, they are shown as the next level. 왘 Select the POU that you wish to check.



385



Test & Commissioning 왘 Click Display/Change POU Display/Change POU



The POU Editor only opens in Online mode with the selected POU active, i.e. in the foreground. This POU is also indicated by the entry “online” in the title bar, by a red editor icon and a modified editor window with the possibility of displaying variables. The Online menu and the relevant buttons for displaying variable states are available. If you have made a modification to the POU, the button for activating this change will also be made available. Other POUs that may be open in the POU offline Editor are placed in the background and can be accessed via the corresponding file card at the bottom of the editor window. These POUs can be further processed offline, however, only if the following conditions apply.



386



07/01 AWB2700-1305-GB



When moving from offline to online mode or vice versa whilst a POU is being processed, a POU is always opened with the settings that were saved the last time the POU was processed. If, for example, you have created your instructions in ST for a POU and made your declarations in Syntax mode, the POU is also opened with these settings when switching to online mode.



Program test



Figure 169: Online Editor with POU opened



Test POU Depending on the task at hand you can test the POU using:



07/01 AWB2700-1305-GB



the Status display the Zoom window the Variables window



387



Test & Commissioning Status display Requirement: A POU must be opened in online mode. 왘 Choose Online ➞ Status Display in the POU Editor or click the Status Display button to enable or disable the Status display. Status display



The variable states are shown in the declaration and instruction section. The Status display in the declaration section has the advantage that related variables can be shown clearly. In IL and ST the states of variables are shown in the status column of the instruction section.



388



07/01 AWB2700-1305-GB



Figure 170: POU Editor with Online POU in IL



Program test In LD and FBD binary variable states, i.e. current flow TRUE or FALSE are shown in colour. You can set the display colours you require via Options ➞ Settings ➞ Font ➞ Elements. The status of non-binary variables is shown underneath the contacts, output symbols or connection lines:



07/01 AWB2700-1305-GB



Figure 171: POU Editor with Online POU in LD



Figure 172: POU Editor with Online POU in FBD



389



Test & Commissioning The states are updated on the screen if they change while the program is executed. The current values are shown in the format set in the Display menu, e.g. decimal or binary. The memory of the PS 4-200 can show a maximum of 255 bytes of status data. This means that one screen page can only show this number of bytes of status data. If more data can be shown this is indicated by “???”. In this case, reduce the size of the window or scroll to reach an area with less data, so that less status data is requested and only the area required is shown. Displaying strings or time and data variables has a particularly large memory requirement.



In online mode you can also set bookmarks in the same way as in offline mode. For this position the cursor in the appropriate line and click the Set Bookmark button. The Status Display follows the jump from one bookmark to the next thus offering a simpler overview! Zoom window The Zoom window is a separate window of the status display in which you can show the states of complex variables You can also select variables in the instruction section and in the declaration section for displaying in the Zoom window. Unlike the Variables window display, you can only display variables of the currently active POU and cannot force any. Requirements: A textual language such as IL or ST must be selected.



390



07/01 AWB2700-1305-GB







왘 Choose Online ➞ Status Display again if you wish to abort the updating of the variable states. The previously shown states are “frozen” on the screen. Use this possibility for troubleshooting.



Program test A POU must be opened in online mode and the Status Display function must have been switched on.



07/01 AWB2700-1305-GB



All instruction lines containing several variables, e.g. within a complex data type, as function block parameters with assigned operands or in the form of several ST instructions are marked by Sucosoft with a red dot in the Bookmark column. In the Status column only the states of the first variables in this line are shown. The Zoom window is used for showing all variables in this instruction line.



391



Test & Commissioning 왘 Click a red dot. This will open the Zoom window. The variables list will be shown in the left pane in the form of a tree structure. This shows the variables of the selected instruction line. The variable values are continuously refreshed. The right pane of the Zoom window shows the variable value in the Status column and background information such as the type of the individual variables. You can use the Display menu item to change the structure of the Zoom window.



Figure 173: The Zoom window with array type variables



392



The status values will remain frozen in the Status column as long as the window is open. The Zoom window is automatically closed when the Status Display is closed.



07/01 AWB2700-1305-GB







왘 In order to display variables of another instruction line in the Zoom window, simply click on the red dot for this new line. 왘 In order to display variables of other instruction lines in the Zoom window, simply click on the red dot for this new line with the Ctrl key depressed. This is only possible when the instruction section is not scrolled.



Program test Variables window The Variables window is a separate window of the Status Display in which you can show the states of complex variables You can also select variables in the instruction section and in the declaration section for displaying in the Variables window. Unlike the Zoom window, the Variables window allows you to show all project POUs, making the window ideal for troubleshooting tasks. You can thus use the Variables window to extend the variables of the POU shown online. You can also force variable values via the Variables window. Requirement: A POU must be opened in online mode, however, the Status Display function does not have to be active. 왘 Select the variables in the displayed program that you want to display in the Variables window. To do this, double-click a single variable in IL or ST or select one or several lines and then transfer them using the button or via Online ➞ Transfer Variables. Transfer Variables button



07/01 AWB2700-1305-GB



If you are working in LD or FBD, select a variable first and then transfer it to the Variables window as described above. The Variables window opens in the background and can then be viewed after switching to the main Test and Commissioning window. If you have closed the Variables window again: 왘 Activate the Connection List window and then click the Variables window button.



393



Test & Commissioning Variables window



Figure 174: Variables window with array type variables



394



07/01 AWB2700-1305-GB



왘 Select an element that contains variables in the Variables list (left window). These are then displayed in the information section (right pane). 왘 Activate the Status display for the variables in the window via Variables ➞ Status Display or via the button.



Program test Status Display button



The current states of the listed variables are displayed in both panes. Repeating the above step deactivates the Status Display in the Variables window. 왘 If you want to change the display format of one or more variables, first select one or several variables in the information section and then choose the required display format (binary, decimal, hexadecimal or BCD) in the Display menu of the main Test and Commissioning window. For each variable shown it is possible to set a different display format as required. Use the following procedure to delete selected variables from the Variables window: 왘 Select the variable to be deleted and then press the Del key or choose Variables ➞ Delete. Proceed as follows if you wish to transfer variables from other POUs (function blocks) to the Variables window: 왘 Return to the main Test & Commissioning window and then close the Program window. The activated online POU is switched to offline. 왘 Open the Program window again via Device ➞ Program or via the Open Instance Tree button.



07/01 AWB2700-1305-GB



Program button



왘 Select another POU and repeat the steps of the variable transfer. You can use the Display menu to change the layout of the Variables window and the display format of selected variables.



395



Test & Commissioning The Variables window will open with the selected variables every time the Test & Commissioning tool is opened until it has been closed explicitly. 왘 Close the Test & Commissioning tool via File ➞ Exit.



Modifying POUs online Requirement: A POU must be opened in online mode. The following modifications to a POU are possible:



396



07/01 AWB2700-1305-GB



Modifying and adding instructions for existing variables Deleting instructions Modifying and adding comments Modifying jumps and jump targets (jump labels) Inserting and deleting jumps and jump targets (jump labels) Assigning new jump labels Modifying the parameters of function blocks Adding new invocations of existing function block instances



Program test The following modifications are not possible:







Assigning new variable names Deleting existing variables from the declaration blocks Modifying several POUs simultaneously Deleting existing POUs Creating new POUs. The POU Editor allows the entry of special characters (e.g. Ä, ö, ü etc.) in strings. These characters will appear as $ sequences in the Status Display if ASCII format was selected. To display these special characters change the display format to ANSI. 왘 Modify the POU in the same way as in the POU Editor working offline. Once you have modified the POU, the functions Online ➞ Activate and the Activate button in the toolbar become available. Activate button



07/01 AWB2700-1305-GB







왘 Choose Online ➞ Activate or click the corresponding button. The modifications made are updated in the POU, the program and in the PLC. If the message "Online modification could not be executed" is output after a modification has been activated, the cause may be that the program files on the PC and on the PLC are not identical. In this case transfer the PC program to the PLC once more. If the online modification is too big for the program memory of PS 4-200 series controllers, a dialog box will appear in which you can confirm whether the



397



Test & Commissioning existing POUs should be rearranged online in the program memory. 왘 Close the Online Editor. 왘 Select a new POU from the structure tree in the Program window if you wish to check or modify another POU. Repeat the other steps. Forcing variable values With PS416 and PS4-300 controllers, you can assign a defined value to variables of elementary and complex data types while the controller is running (Run state). To do this first create a variable list as described earlier.



Figure 175: Variables window for PS4-300 and PS416



398



07/01 AWB2700-1305-GB



If you want to assign a particular value to a variable while the controller is running, this can be done in the Variables window in two different ways: static forcing and dynamic forcing.



Program test Warning! Take care when you force the values of variables while the controller is running since you directly affect the control of the machine and can cause uncontrolled states. When you force a variable statically, the respective variable is assigned the required value at the beginning of the cycle (for inputs, symbolic variables and markers) or at the end of the cycle (for outputs) and the value is forced repeatedly each cycle until the forcing operation is cancelled again by the user. When a variable is forced dynamically, it is assigned a value once. This can, however, be changed again immediately by the user program. This means that sequences with these forced variables may not be necessarily executed with the forced value within a cycle. The timepoint of the forcing is the same as for static forcing, but in this case forcing takes place once only and not repeatedly. Variables which are assigned to physical inputs are forced with the specified value at the beginning of the next cycle, after the inputs have been read. In contrast, variables which are assigned to physical outputs are forced with the specified value at the end of the cycle.



07/01 AWB2700-1305-GB



You can also transfer Variables of complex data types such as Array or Structure variables to the Variables window in the same way as described above (see Fig. 177 on Page 401). Data structure content will be displayed in a tree, in the same way as in a separate window of the status display. Specific structure elements can be viewed by “opening” the structure or hidden by “closing” it.



399



Test & Commissioning Requirement: There must be a Variables window with a variable in the connection list. 왘 In the right Info section of the Variables window Click the Number fields (left column) of the lines with variables to be forced. With complex data types select the required array or structure element. The chosen entries are shown selected. 왘 Choose Variables ➞ Enter Forced Status or click the corresponding button. Enter Forced Status button



왘 Change the format if necessary. 왘 Position the cursor in the Status field and enter the value to be forced. 왘 Choose the required forcing mode in the “Mode” panel and confirm your entries with “OK”. 왘 Repeat these steps for all the variables that you selected earlier.



400



07/01 AWB2700-1305-GB



Figure 176: Forced status



Program test 왘 Choose Variables ➞ Enter Forced Status or click the Force button. Force button







All selected variables are forced either statically or dynamically in accordance with your settings. With statically forced variables, the fields “Name”, and “Status” are shown with a coloured background and the window’s status line displays the message “Variable forced statically”. In the variable list, these variables or variable elements are shown with a red background. This makes it easy to recognise which variables are forced.



Figure 177: Forcing variables



07/01 AWB2700-1305-GB



왘 To cancel the static forcing of particular variables, select the required lines in the Information section and click on the Cancel Forcing button. Cancel Forcing button



401



Test & Commissioning The Cancel All button is used to cancel the static forcing of all variables in the controller. Cancel All button







402



Online modifications cannot be made while variables in the controller are being forced. Do not change offline parts of a program in which variables are forced, since the Variables window can then no longer be displayed. If you have made an online modification, a warning message will appear if you try to open the Variables window. In this case, the only way to clear the forcing is to deactivate the active process in the controller or to transfer the program to the controller again. Inputs and markers are forced with the specified value at the beginning of the cycle. Accordingly, the value of the variable can become changed by the user program during the cycle even with statically forced variables. Outputs are forced with the specified value at the end of the cycle. If you connect to a controller which has forced variables, you will get the following warning:



07/01 AWB2700-1305-GB



 



왘 Choose Options ➞ Save Settings On Exit to get the variable list which you last created the next time you start the Test and Commissioning tool.



Program test Quitting the online POU Editor 왘 Return to the main Test & Commissioning window via Alt + Tab and then close the Program window. The activated online POU is switched to offline for further processing. Alternatively, you can close the online POU directly in the POU Editor. In order switch from the POU Editor to a different T & C window you must first move to the main T & C window. Configuring the AS-Interface®network online This step is carried out with the Topology Configurator online. This enables you to configure an AS-Interface®network simply. For this the PLC must be connected, must be provided with a valid basic configuration, and the CPU must be in Halt status. Activate the Connection List window in the main T & C window and then click the Topology button. With an AS-Interface®network a complete offline configuration is not necessarily required. Simply a basic configuration is required that contains an AS-Interface®master device. Sucosoft uses this basic dummy configuration to automatically detect online all active slaves on the AS-Interface®network.



07/01 AWB2700-1305-GB



Structure of the example configuration Below is a configuration which was read from a controller. It consists of a master (PS4-201-MM1), an LE slave (LE4-501-BS1) and an AS-Interface®line that is managed by the AS-Interface®master module (LE4-505-BS1).



403



Test & Commissioning



404



07/01 AWB2700-1305-GB



Figure 178: Example configuration with AS-Interface®



Program test Procedure Compared to offline configuration, online configuration saves time in the following two cases: You want to create a topology configuration for an ASI line which is already configured, or you want to extend an existing actual configuration. The starting point in both cases is the so-called “actual configuration” - the configuration currently stored in the PLC. This can be a basic configuration with an expandable PS4 controller and an AS-Interface®master module LE4-505-BS1 or a functioning actual configuration which you want to extend. The basic configuration can be created in the normal way with PLC disconnected using the Topology Configurator. First compile the basic configuration with any (dummy) PLC program in the Code Generation tool and transfer it to the PLC. If all slaves on the AS-Interface®line are addressed already, you can read in directly the new configuration in Configuration mode and save it.



07/01 AWB2700-1305-GB







The new stored configuration is then used as the new permanent configuration in the Code Generation tool and transferred to the PLC together with the program after recompiling. It is transferred from the PLC to the AS-Interface®master. The new permanent configuration is needed by the PLC in RUN mode and for network diagnostics, and ensures that all inputs and outputs of the AS-Interface®devices can be accessed.



405



Test & Commissioning Reading the actual configuration Requirements: The PS4 controller must be connected and the Test and Commissioning tool must be started. A topology which includes the AS-Interface master is already stored in the PLC. The PLC is in HALT mode. 왘 Click the Topology Configurator button or choose Device ➞ Topology in the menu to load the actual topology configuration from the PLC. 왘 Select the AS-Interface®master module and switch to Configuration mode by choosing Component ➞ Actual ASI Configuration. Asi Actual Configuration button



406



07/01 AWB2700-1305-GB



Sucosoft S40 will switch to Configuration mode and will show the AS-Interface®master with an exclamation mark next to it. The associated AS-i line is shown as a dotted green line.



Program test



Figure 179: Configuration mode of an AS-Interface® network



You cannot display online diagnostics information for individual modules when the AS-i master is in Configuration mode. The AS-Interface®master reads the actual configuration cyclically and identifies the AS-i slave types from the combination of I/O code and ID code. Since this combination is not unique, all slaves are shown in Configuration mode as generic symbols together with the number of inputs and outputs.



07/01 AWB2700-1305-GB



If the AS-Interface®line contains slaves which have previously been assigned an AS-Interface®address with a PG2-105-AD1 addressing device, they are shown correctly in the configuration. Only one non-configured slave with a default address “0” must be connected, since otherwise an address conflict will occur.



407



Test & Commissioning If communication to one of the slaves is interrupted, the device is automatically removed from the online display. Analogously, a pre-addressed slave appears in the online display shortly after it is connected to the AS-Interface line provided that no address conflicts with other slaves are present. If a newly connected slave still has the default standard address “0”, the required address and other parameters can be configured afterwards online. When the actual configuration has been modified as required, it should be stored on disk as the new permanent configuration and transferred to the PLC after recompiling the program with the Code Generation tool. Saving the actual configuration Requirements: The actual topology configuration with the configured AS-Interface®line is opened in the Online Topology Configurator window.



408



07/01 AWB2700-1305-GB



왘 Choose Configuration ➞ Save As... in the menu. 왘 Specify a directory in which you wish to save the actual configuration and enter the required filename for the topology configuration in the Filename field. The file is saved with the filename extension “.DCF” as the new permanent configuration for the current project.



Program test Editing the actual configuration Requirements: The PS4 controller must be connected and the Test and Commissioning tool must be started. A topology which includes the AS-Interface® master is already stored in the PLC. The PLC is in HALT mode. 왘 Click the Topology Configurator button or choose Device ➞ Topology in the menu to start the Online Topology Configurator and load the actual topology configuration from the PLC. 왘 Select the AS-Interface®master module and switch to configuration mode by choosing Component ➞ Actual ASi Configuration in the menu. The Online Topology Configurator shows the actual configuration with the individual line slaves shown as generic symbols. The actual configuration of the AS-Interface®line is shown in the Topology window as a green dotted line. 왘 Connect a new slave with the default address “0” to the AS-Interface®line. 왘 Select the new slave displayed and click the ASi Slave Status button or choose Component ➞ ASI Slave Status... .



07/01 AWB2700-1305-GB



ASi Slave Status button



409



Test & Commissioning



Figure 180: AS-Interface®Slave Status



You are automatically prompted with the next unused AS-i address in the New pop-up list in the Station number panel. 왘 If required, you can choose another address for the new station. The Configured Values section shows parameters for the specified station number from the stored (permanent) configuration. The Current Values section shows the current parameters for the specified station number which have been read online from the PLC.



The slave parameters you have stored with the new configuration are only effective after recompiling the program in the Code Generation tool and transferring it to the PLC.



410



07/01 AWB2700-1305-GB



The slave will now be configured with the parameters you entered and will be shown at the corresponding place in the graphical display of the AS-Interface® line.



Program test The AS-Interface®master LE4-505-BS1 parameters are automatically transferred from the configuration currently stored in the PLC. 왘 Select the other slaves in turn and set the parameters using the same procedure. Close the dialog with Exit when you are finished. 왘 Save the completed actual configuration as the new permanent configuration.







Using the new permanent configuration In order to commission the PLC and start the communication on the AS-Interface® line, you must recompile the program with the new permanent configuration using the Code Generation tool and transfer it to the PLC. ASI parameters can only be changed while the PLC is in Run mode by using the “ASI_PARAM” function block. This function block is described in the manual AWB27-1314 GB, which describes the AS-Interface®master LE4-505-BS1. Communication in the AS-Interface® line starts when the PLC changes from “Ready” to “Run” mode. In Run mode, the master LE 4-505-BS1 will automatically switch to Protected mode. The AS-i master status can be displayed in Run and Ready modes as follows:



07/01 AWB2700-1305-GB



왘 Select the AS-Interface®master in the Online Topology Configuration window. 왘 Click the ASi Master Status button or choose Component ➞ ASI Master Status... . ASi Master Status button



411



Test & Commissioning



Figure 181: ASi Master Status dialog



The following dialog then gives information on the operating mode (protected or configuration mode) and the setting of the Autoaddressing option. Network diagnostics with a PS4-300 and AS-Interface®network. The following are required to carry out network diagnostics on an AS-Interface® line An available PLC program which was transferred with a configuration of the AS-Interface® master is loaded in the PLC. The connection has been established to the PLC. 왘 To show or hide the display of network diagnostics information, click the Network Diagnostics button or choose Display ➞ Network Diagnostics in the menu. The diagnostics covers the entire AS-Interface® configuration.



412



07/01 AWB2700-1305-GB



The states of components belonging to two different networks can be diagnosed.



Program test



Figure 182: Network diagnostics



The graphical display of the topology configuration now shows additional information which allows you to quickly assess the status of the network communications in the Suconet K and AS-Interface® lines.



07/01 AWB2700-1305-GB



To display diagnostics information for a particular device, select the device and click the Diagnostics button or choose Component ➞ Diagnostics Status.



413



Test & Commissioning



Figure 183: Status indication



414



07/01 AWB2700-1305-GB







The diagnostics status of individual modules cannot be displayed if an AS-Interface®network is configured online and Sucosoft is in Configuration mode. Diagnostics is only carried out for AS-Interface®lines if the AS-Interface® permanent configuration is displayed.



Program test In Protected mode of the AS-i master and in the event of a network fault, devices with communication problems are shown shaded in red in the permanent configuration. Network lines with communication problems are shown dotted in red and the master CPU which controls the line is marked with a lightning symbol.



Figure 184: Fault in AS-Interface®network line



With the PLC in Run mode, the PLC program can access all devices which are correctly specified in the permanent configuration as long as no device faults are present.



07/01 AWB2700-1305-GB



In Run mode, the Online Topology Configuration window of the Test & Commissioning tool shows the permanent configuration.



415



Test & Commissioning







If more AS-i slaves are connected to the AS-Interface® line than are specified in the permanent configuration, the additional slaves are not shown in the online topology. In this case, data communication is still possible to the devices which are correctly specified in the permanent configuration. However, the master will report a configuration error. If the program is started by changing the PLC mode from “Stop” to “Run” using the Test & Commissioning Tool, the AS-Interface®master will only switch to protected mode automatically if no AS-i devices with the default address “ 0” are attached the line.



416



In contrast to the PLC mode change from “Stop”/ “Run”, the AS-i master will switch to protected mode if the system is switched off and on again even if a slave is present with a default address of “0”.



07/01 AWB2700-1305-GB







If a device is present with a default address “0”, the PLC must be stopped and the slave disconnected. Alternatively, the correct AS-Interface® address for the slave must be assigned in the current configuration in the Test & Commissioning tool by choosing Component ➞ AS-i Slave Status in the menu.



Appendix



Modem operation



Modem requirements Approved for connection to the public telephone network in your country or region, compatible with Hayes AT commands, suitable for asynchronous data communications Memory for a modem configuration. Parameter settings: 8 Data, No Parity, 1 Stop (8N1)



Frequently asked questions and problems relating to modems Dialing is not functioning and the modem is not accepting any AT commands. Make sure that the modem is switched on, modem and PC are connected via a cable, the modem is plugged in to the telephone socket. Make sure that the serial interface (COM Port) set in Sucosoft is the same as the one to which the modem is connected. Make sure that the speed set in Sucosoft is within the range in which the modem can automatically detect the baud rate.



07/01 AWB2700-1305-GB



Make sure that no other program e.g. a FAX software is using the same interface. Make sure that the modem connection cable is not faulty, and that the connection pin assignment is correct. Check this using another communication software.



417



Appendix Dialing is interrupted before dialing is finished. Make sure that “Timeout in s” (the max. time for establishing the connection) is long enough. It is configured in Sucosoft under Interface Parameters. If the modem is connected to a private telephone exchange, check whether the telephone extension is authorised to make the required connection (e. g. authorised for international or long distance calls). Make sure that you have entered the modem telephone number in the correct format: “ () telephone number”. The telephone number you specify can contain hyphens, spaces and periods. The modem does not recognise the dial tone. After each dialing attempt, the modem returns the message “NO DIAL TONE”: In this case, your modem is probably connected to a private telephone exchange (PBX). Most PBX’s require a prefix digit (e.g. “0”) to get an outside line. In this case, your dialing sequence should be ATDT0W for tone dialing or ATDP0W for pulse dialing. Ensure that the modem waits for the dial tone before dialing. For this use the W parameter in the dial string. Example: ATDT 0W



After every dialing attempt the modem returns the message DELAYED CALL or DIAL LOCKED appears. In some countries and depending on the modem settings, in order to protect the telephone network from overloading, the modem blocks redial attempts for a specified period (typically between 30 and 60 seconds) following each unsuccessful dialing 418



07/01 AWB2700-1305-GB



This dial tone is not present with connections within a private telephone exchange (PBX). In this case use ATX3DT or ATX3DP .



Modem operation attempt (e.g. if the party you are dialing is currently busy). The modem does not accept any redial attempts for this period. Furthermore, depending on the country and modem settings, the modem may block redial attempts for two to six hours following 12 unsuccessful attempts to dial. The modem will not dial at all for this period. International calls disabled If the modem is connected to a PBX, make sure that the telephone extension is authorised to make international or long distance telephone calls. The modem is connected to a telephone extension and returns “busy” although the extension is not busy and the party you are dialing is not engaged. In some cases, the modem incorrectly interprets the internal dial tone of the PBX as an engaged tone. In this case, disable busy tone detection for your modem with the command ATX0.



07/01 AWB2700-1305-GB



The connection to the other modem does not function at all or does not function correctly. Make sure that the settings for data bits, parity, stop bits and baud rate are the same as those of the remote modem.



419



Appendix



420



A



Answer incoming call; Example: dialing the Moeller Mailbox: ATA



&C0



DCD always active (carrier detect)



&C1



DCD indicates when carrier is present (important if the Connection check via DCD is enabled).



D



Dial/connection establishment Example “Dial the Moeller mailbox”: ATDT 0W0049 228 602 14 14



&D0



DTR status change is ignored by the modem (important for PLC side).



E



Echo command to host (PC/PLC) Example: “No command echo”: ATE0 (important on PLC side) Command echo: ATE1 (important on PLC side)



H



Abort connection Example “Abort existing connection”: ATH0



L



Set volume Example “Low modem volume”: ATL0



M



Check modem loudspeaker Example “Modem loudspeaker on with connection establishment”: ATM1



P



Pulse dialing Example “Dial the Moeller mailbox”: ATDP 0W0049 228 602 14 14



Q0



Output message codes



\Q0



No handshake for flow control



Q1



Disable message code output



S



Set and read internal modem registers Example “Read the content of register 10”: ATS10



S0=2



Auto Answer Mode, i.e. calls are answered automatically (important on PLC side, here for example after 2 ring tones)



&S0



DSR always active



T



Tone dialing Example “Dial the Moeller mailbox”: ATDT 0W0049 228 602 14 14



V0



Status signal in short form as number



V1



Status signal in plain text



X



Dial tone handling Example “Ignore dial tone/engaged tone”: ATX0



Z



Load modem configuration Example “Load configuration profile 1”: ATZ1



07/01 AWB2700-1305-GB



Overview of the most important Hayes compatible AT commands



Modem operation V.24 interface cable for modem operation The following table shows the pin assignments of the V.24 (RS 232 serial) interface for 9-pin and 25-pin connectors. 9-pole



25-pole



Abbrev iation



CCITT/ ITU-T



Function Direction



U*



1



GND



101



Protective Ground



5



7



SGND



102



Signal Ground



3



2



TxD



103



Transmit Data PC/PLC –> Modem



2



3



RxD



104



Receive Data PC/PLC