Академический Документы
Профессиональный Документы
Культура Документы
Schneider-Electric Pty Ltd 245 route des Lucioles BP147 Sophia Antipolis Cedex 06903 FRANCE
DISCLAIMER The information provided in this documentation contains general descriptions and/or technical characteristics of the performance of the products contained herein. This documentation is not intended as a substitute for and is not to be used for determining suitability or reliability of these products for specific user applications. It is the duty of any such user or integrator to perform the appropriate and complete risk analysis, evaluation and testing of the products with respect to the relevant specific application or use thereof. Neither Schneider Electric nor any of its affiliates or subsidiaries shall be responsible or liable for misuse of the information contained herein. If you have any suggestions for improvements or amendments or have found errors in this publication, please notify us. No part of this document may be reproduced in any form or by any means, electronic or mechanical, including photocopying, without express written permission of Schneider Electric. All pertinent state, regional, and local safety regulations must be observed when installing and using this product. For reasons of safety and to help ensure compliance with documented system data, only the manufacturer should perform repairs to components. When devices are used for applications with technical safety requirements, the relevant instructions must be followed. Failure to use Schneider Electric software or approved software with our hardware products may result in injury, harm, or improper operating results. Failure to observe this information can result in injury or equipment damage. 2010 Schneider Electric. All rights reserved. TRADEMARKS Schneider Electric SAS has made every effort to supply trademark information about company names, products and services mentioned in this manual. Trademarks shown below were derived from various sources. Windows, Windows NT, Windows 2000, Windows XP, MSSQL Server and Excel are trademarks of Microsoft Corporation. General Notice: Some product names used in this manual are used for identification purposes only and may be trademarks of their respective companies. About Us Members of Schneiders team of Instructional Designers have tertiary qualifications in Education, Educational Course Development and are also experienced trainers in their own right; some are also published authors. Currently, the team is supporting a range of over 70 courses in multiple languages and multiple software environments. Authors Alynda Brown, Bruce Howlett, Eric Pauchet Contributors David Chapman, Michel Beridot
February 2011 Edition for SoMachine Version 3.0 Manual Draft 2 Written, Printed and bound in France
ii
February 2011
Contents
CHAPTER 1: INTRODUCTION TO SOMACHINE........................................................... 1-1
Overview .................................................................................................................... 1-1 Safety Information...................................................................................................... 1-2 Before the Course Begins........................................................................................... 1-4 Course Overview...................................................................................................... 1-10 Conventions Used in this Manual ............................................................................ 1-12 CHAPTER 2: SOMACHINE AT A GLANCE ................................................................... 2-1
Overview .................................................................................................................... 2-1 Introduction to SoMachine......................................................................................... 2-2 System Requirements................................................................................................. 2-3 Features of SoMachine............................................................................................... 2-4 The SoMachine Interface ........................................................................................... 2-6 Home Screen .............................................................................................................. 2-7 General Functions Menu ............................................................................................ 2-9 Project Work Flow ................................................................................................... 2-11 Show Existing Machine ........................................................................................... 2-13 Properties Screen...................................................................................................... 2-17 CHAPTER 3: PROJECT MANAGEMENT ....................................................................... 3-1
Overview .................................................................................................................... 3-1 New Projects .............................................................................................................. 3-2 Create New Machine.................................................................................................. 3-3 Start with Empty Project ............................................................................................ 3-4 Start with Standard Project......................................................................................... 3-8 Archive Projects ....................................................................................................... 3-12 CHAPTER 4: NEW PROJECT CREATION ..................................................................... 4-1
Overview .................................................................................................................... 4-1 The Configuration Screen .......................................................................................... 4-2 Display Manager ........................................................................................................ 4-4 Add a Device to a Project........................................................................................... 4-5 Add an Expansion Module to a Device...................................................................... 4-8
SoMachine
Manual Draft 2
iii
CHAPTER 5:
Overview .................................................................................................................... 5-1 Program Screen .......................................................................................................... 5-2 Tasks .......................................................................................................................... 5-8 PLC Program Execution............................................................................................. 5-9 POU Program Creation ............................................................................................ 5-10 Gateway Configuration ............................................................................................ 5-16 Task Configuration................................................................................................... 5-17 PLC Simulator.......................................................................................................... 5-21 CoDeSys Program Languages.................................................................................. 5-26 Watchdog Mechanisms ............................................................................................ 5-36 Structuring an Application ....................................................................................... 5-37 The POU Function ................................................................................................... 5-38 Sample Project.......................................................................................................... 5-44 Global Variables....................................................................................................... 5-47
iv
February 2011
Chapter 1: Overview
All-in-One Software
Introduction to SoMachine
SoMachine is OEM machine programming software that provides an all-in-one software environment designed specifically for OEM machine builders. SoMachine combines all the necessary elements to: design commission service
This Chapter Covers These Topics: Safety Information................................................................. 1-2 Before the Course Begins...................................................... 1-4 Course Overview ................................................................. 1-10 Conventions Used in this Manual........................................ 1-12
Safety Information
Important Information
NOTICE
Read these instructions carefully, and look at the equipment to become familiar with the device before trying to install, operate, or maintain it. The following special messages may appear throughout this documentation or on the equipment to warn of potential hazards or to call attention to information that clarifies or simplifies a procedure.
The addition of this symbol to a Danger or Warning safety label indicates that an electrical hazard exists, which will result in personal injury if the instructions are not followed.
This is the safety alert symbol. It is used to alert you to potential personal injury hazards. Obey all safety alert messages that follow this symbol to avoid possible injury or death.
DANGER
DANGER indicates an imminently hazardous situation which, if not avoided, will result in death or serious injury.
WARNING
WARNING indicates a potentially hazardous situation which, if not avoided, can result in death or serious injury.
CAUTION
CAUTION indicates a potentially hazardous situation which, if not avoided, can result in minor or moderate injury.
CAUTION
CAUTION, used without the safety alert symbol, indicates a potentially hazardous situation which, if not avoided, can result in equipment damage.
1-2
February 2011
Electrical equipment should be installed, operated, serviced, and maintained only by qualified personnel. No responsibility is assumed by Schneider Electric for any consequences arising out of the use of this material. A qualified person is one who has skills and knowledge related to the construction and operation of electrical equipment and the installation, and has received safety training to recognize and avoid the hazards involved.
SoMachine
Manual Draft 2
1-3
Step
1 2
Action
Go the Schneider Electric home page www.schneider-electric.com In the Search box type the model number of a product or the name of a product range.
Do not type any blank spaces in the model number. To get information on a grouping of similar modules, use asterisks (*). 3
If you entered a model number, go to the Product datasheets search results and click on the model number the interests you. If you entered the name of a product range, to the Product Ranges search results and click on the product range that interests you.
4 5 6
If more than one model number appears in the Products search results, click on the model number that interests you. Depending on the size of your screen, you may need to scroll down to see the data sheet. To save or print a data sheet as a .pdf file, click Download XXX product
datasheet.
The characteristics presented in this manual should be the same as those that appear online. In line with our policy of constant improvement we may revise content over time to improve clarity and accuracy. In the event that you see a difference between the manual and online information, use the online information as your reference.
1-4
February 2011
WARNING
UNINTENDED EQUIPMENT OPERATION Only use software approved by Schneider Electric for use with this equipment. Update your application program every time you change the physical hardware configuration.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
WARNING
LOSS OF CONTROL The designer of any control scheme must consider the potential failure modes of control paths and, for certain critical control functions, provide a means to achieve a safe state during and after a path failure. Examples of critical control functions are emergency stop and overtravel stop, power outage and restart. Separate or redundant control paths must be provided for critical control functions. System control paths may include communication links. Consideration must be given to the implications of unanticipated transmission delays or failures of the link. Observe all accident prevention regulations and local safety guidelines1. Each implementation of this equipment must be individually and thoroughly tested for a proper operation before being placed into service.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
1
For additional information, refer to NEMA ICS 1.1 (latest edition), "Safety Guidelines for the Application, Installation, and Maintenance of Solid State Control" and to NEMA ICS 7.1 (latest edition), "Safety Standards for Construction and Guide for Selection, Installation and Operation of Adjustable-Speed Drive Systems" or their equivalent governing your particular location.
SoMachine
Manual Draft 2
1-5
WARNING
REGULATORY INCOMPATIBILITY Be sure that all equipment applied and systems designed comply with all applicable local, regional and national regulations and standards. Failure to follow these instructions can result in death, serious injury, or equipment damage.
The use and application of the information contained herein require expertise in the design and programming of automated control systems. Only the user or integrator can be aware of all the conditions and factors present during installation and setup, operation, and maintenance of the machine or process, and can therefore determine the automation and associated equipment and the related safeties and interlocks which can be effectively and properly used. When selecting automation and control equipment, and any other related equipment or software, for a particular application, the user or integrator must also consider any applicable local, regional or national standards and/or regulations.
1-6
February 2011
CAUTION
EQUIPMENT INCOMPATIBILITY Read and thoroughly understand all device and software documentation before attempting any component substitutions or other changes related to the application examples provided in this document. Failure to follow these instructions can result in injury or equipment damage.
SoMachine
Manual Draft 2
1-7
CAUTION
EQUIPMENT OPERATION HAZARD Verify that all installation and set up procedures have been completed. Before operational tests are performed, remove all blocks or other temporary holding means used for shipment from all component devices. Remove tools, meters and debris from equipment.
Verify that the completed system, including the functional safety system, is free from all short circuits and grounds, except those grounds installed according to local regulations. If high-potential voltage testing is necessary, follow the recommendations in equipment documentation to help prevent injury or equipment damage.
1-8
February 2011
WARNING
UNGUARDED MACHINERY CAN CAUSE SERIOUS INJURY Do not use this software and related automation equipment on equipment which does not have point-of-operation protection. Do not reach into machinery during operation.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
Ensure that appropriate safeties and mechanical/electrical interlocks related to point-of-operation protection have been installed and are operational before placing the equipment into service. All interlocks and safeties related to point-of-operation protection must be coordinated with the related automation equipment and software programming.
Note:
Coordination of safeties and mechanical/electrical interlocks for point-of-operation protection is outside the scope of the examples and implementations suggested in this training documentation. It is sometimes possible to adjust the equipment incorrectly and may produce unsatisfactory or unsafe operation. Always use the manufacturer instructions as a guide to functional adjustments. Personnel who have access to these adjustments must be familiar with the equipment manufacturer instructions and the machinery used with the electrical equipment.
SoMachine
Manual Draft 2
1-9
Course Overview
Course Objectives By the completion of this training course you will: Be able to create a new SoMachine project Be able to connect to a Controller Be able to create a simple Programmable Organisation Unit Target Audience The SoMachine training course is an integral part of the complete Schneider Electric curriculum. This course is designed for: Users who are new to SoMachine
1-10
February 2011
Day 1
Topics
Introduction to SoMachine SoMachine at a Glance Project Management Controller I/O Configuration Controller Programming
SoMachine
Manual Draft 2
1-11
Example The SoMachine configuration environment consists of several toolbars, browser windows and programming editors. This chapter introduces the user to the configuration environment using an example project with pre-defined elements.
Exercises
After a concept is explained you will be given exercises that practise the skills you just learned. These exercises begin by explaining the general concept of each exercise and then step-by-step procedures are listed to guide you through each procedure.
Example Paste a genie from a library in the Include project onto a test page called Utility.
1 Run the Milk_Upgrade project then trigger and view some alarms. i. Use the following template settings:
User Input
Whenever information is to be typed into a field or dialog box it will be written in this font:
Example KETTLE_TEMP/25 Note that some exercises will show a fragment of information already typed into a SoMachine screen and then ask students to add extra lines of configuration. In this instance, the previously entered material will be given to the student as pale grey italic text: KETTLE_TEMP/25 OVEN_TEMP/5
1-12
February 2011
Example Hints & Tips To go to the next field, use the mouse cursor or press the TAB key.
Note
A note will refer to a feature which may not be obvious at first glance but something that always should be kept in mind.
Example Note:
Any events named GLOBAL are enabled automatically when events are enabled. Menus and Menu Options Text separated by the double arrow symbol indicates that you are to select a menu
Open a menu File then select the menu option New Horizontal and Vertical Tabs Text written this way indicates the Horizontal then the (Vertical) tab you are to select.
SoMachine
Manual Draft 2
1-13
For further information about Templates, see SoMachine Help - Using Page Templates. Further Training This heading describes topics that are covered in more advanced courses.
Trend Table Maths is a topic in the SoMachine Customisation and Design Course. Caution This heading describes situations where the user needs to be careful.
Example -
CAUTION
UNINTENDED EQUIPMENT OPERATION Verify that all installation and set up procedures have been completed. Failure to follow these instructions can result in equipment damage.
1-14
February 2011
Chapter 2: Overview
Introduction
SoMachine at a Glance
SoMachine is a professional, efficient and open OEM software solution that develops, configures and commissions the entire machine in a single environment including logic, motor control, HMI and related network automation functions.
This Chapter Covers These Topics: Introduction to SoMachine .................................................... 2-2 System Requirements ............................................................ 2-3 Features of SoMachine .......................................................... 2-4 The SoMachine Interface ...................................................... 2-6 Home Screen ......................................................................... 2-7 General Functions Menu ....................................................... 2-9 Project Work Flow .............................................................. 2-11 Show Existing Machine....................................................... 2-13 Properties Screen ................................................................. 2-17
Introduction to SoMachine
OEM Solution Software
2-2
February 2011
System Requirements
Before the Installation of SoMachine Hardware Requirements Before installing SoMachine the computer that will be used as the Server needs to be configured. SoMachine has been designed for machines with the following specifications: The computer equipment may need to be upgraded to run SoMachine Version 3.0, as the minimum hardware requirements have changed:
Description
Processor Random Access Memory (RAM) Available Disk Space
Minimum Specification
Pentium V, 1.8 GHz, Pentium M, 1.0 GHz or equivalent 2 GB
Recommended
Pentium V, 3.0 GHz, Pentium M, 1.5 GHz or equivalent 3 GB
3.5 GB including the memory 4 GB space for the software installation, temporary space for execution and space for saving applications DVD Reader Resolution: 1024 x 786 pixels Mouse or compatible pointing device USB interface DVD Reader Resolution: 1280 x 1024 pixels
Web Access
Software Requirements
SoMachine Component
Operating System
Microsoft Windows XP Professional Service Pack 2 and Service Pack 3 Microsoft Windows Vista Home Basic Microsoft Windows Vista Service Pack 1
SoMachine
Manual Draft 2
2-3
Features of SoMachine
Standard Languages SoMachine includes, as standard, 6 IEC (International Electrotechnical Commission) languages which are compliant with IEC 61131-3. Depending on requirements, the application may use any mixture of these different languages. Function Block Diagram (FBD) Sequential Functional Chart (SFC) Structured Text (ST) Instruction List (IL) Ladder (LD) Continous Function Chart (CFC) Controller Programming Services User Created Function Blocks (FBs) User Created Functions Data Unit Type (DUTs) On-line changes Watch windows Graphical monitoring of variables (trace) Breakpoints, step-by-step execution Simulation Visualization for application and machine set-up HMI Based Services Graphics libraries containing more than 4000 2D and 3D objects. Simple drawing objects (points, line, rectangles, ellipses, etc ) Preconfigured objects (button, switch, bar graph, etc ) Recipes (32 groups of 256 recipes with max. 1024 ingredients) Action tables Alarms Printing Java scripts Multimedia file support: wav, png, jpg, emf, bmp Variable trending Motion Services Embeded devices configuration and commissioning CAM profile editor Sample application trace Motion and drive function blocks libraries for inverters, servos and steppers Visualization screens
2-4
February 2011
Connectivity:
General: PLCopen function blocks for Motion control Packaging function blocks Conveying function blocks Hoisting function blocks Segment Solutions:
SoMachine
Manual Draft 2
2-5
To start SoMachine:
Select the SoMachine item from the Windows start menu:
Start Programs Schneider Electric SoMachine SoMachine
2-6
February 2011
Home Screen
Visual Graphical User Interface Navigation within SoMachine is intuitive and highly visual. The GUI is optimised in such a way that the appropriate tools become available as you enter different development stages of your project. The user interface ensures nothing is overlooked, and suggests the tasks to be performed throughout the project development cycle. The workspace has been streamlined, so that only that which is necessary and relevant to the current task is featured, without any superfluous information. After successful startup SoMachine displays the main selection screen with the open Home screen that provides access to the functions.
1 2 3 4 5 6 7
General Functions Menu Hide/View Handle Task Selection Pane Work Area Online Help Language Selection Menu Information Pane
SoMachine
Manual Draft 2
2-7
Commands Provided
This folder provides commands for opening an already existing SoMachine project Locate a project previously created in SoMachine This folder provides commands for creating a new SoMachine project either from scratch or by using a template project This folder provides commands that are especially dedicated to commissioning a machine. Further commands that are beyond commissioning tasks are not available from this folder This folder provides further information on SoMachine. This information includes:
Machine workflow
Learning Center
2-8
February 2011
SoMachine
Manual Draft 2
2-9
Command
Home Save Save As
Description
Execute this command to return to the Home screen, that is the main selection screen. Execute this command to save the changes to the current project. Execute this command to save the current project to a different location or under a different name. A standard Windows Save Project dialog box is displayed that allows users to browse to the new folder and / or enter the new file name. Execute this command to create an archive file of the SoMachine project that is currently open and:
Save/Send archive
to save the archive file to a connected drive by using the Save button of the Project Archive dialog box
or
to create a temporary archive file that is attached to an empty e-mail by using the Send button of the Project Archive dialog box. This e-mail is automatically created by SoMachine if the Messaging Application Programming Interface (MAPI) is correctly installed. Preferences
Execute this command to define:
the Preferred Path where SoMachine projects are saved the Online Polling Interval (ms) that is the time span that has to elapse between 2 attempts to poll the connected devices Advanced Options including Autosave Help About Exit
Execute this command to open the SoMachine online help. Execute this command to open the About dialog box that provides information about the currently installed SoMachine. Execute this command to close SoMachine.
2-10
February 2011
After starting a project the user is asked to fill in the Properties with useful information for project identification.
After defining the scope of the project the user creates a Configuration with at least one controller. The graphical configuration screen makes it easy to establish the hardware with additional modules, e.g. an additional controller, an HMI or fieldbus communication.
SoMachine
Manual Draft 2
2-11
The Commissioning tab provides online access to the controller and the connected devices for monitoring device status and the user is able to download the application(s) or update the firmware.
2-12
February 2011
SoMachine
Manual Draft 2
2-13
Search the directory tree in the left pane for the folder that contains the existing project then double click the project icon in the Work area or Select the project in the Work area and click the Open button in the Project Information pane
2-14
February 2011
iii.
Search the directory tree in the left pane for the folder that contains the existing project examples. If the default path has been installed this will be
v.
SoMachine
Manual Draft 2
2-15
2-16
February 2011
Properties Screen
Additional Project Information The Properties screen allows users to enter additional project information. The textual and graphical information entered here is optional. As this information is always displayed in the information pane for the project selected in the work area, it helps to identify the individual projects, avoiding the need to open them. This screen is only displayed after a project has been opened.
The Properties screen provides the following tasks: General Description Custom Information
SoMachine
Manual Draft 2
2-17
Commands Provided
The General task allows users to save the project file to a different location or under a different name and provides the option to add author information. The work area provides the following sections:
Author Information
2-18
February 2011
The work area provides the Add button to add a preferred Customer Image to the SoMachine project and displays the Configuration View corresponding to the settings in the Configuration screen. After an image has been added to the project Change and Remove buttons are provided.
SoMachine
Manual Draft 2
2-19
Many actions have more than one way of being invoked. For example, a typical action will be invoked by: Click a tool on a toolbar Select a menu item from the main menu Use a keyboard shortcut Right click inside a window and select an item from a context sensitive menu This manual, frequently demonstrates only one method of performing an action. This is not because this is necessarily best method, but because it is too time consuming and unnecessary to show all possible methods. Your instructor will encourage the use of a variety of methods.
2-20
February 2011
iv.
Double click the 04-Traffic lights thumbnail then the Traffic lights.project thumbnail.
v. vi.
When the Save Project As dialog appears save the project as MyTraffic then click the Save button. Save the project as MyTraffic in the C:\Class directory.
SoMachine
Manual Draft 2
2-21
ii.
Click the Configuration tab then select the device in the Work area to display the description in the Information pane.
2-22
February 2011
Navigate the Devices pane. i. If the tree branches are closed they may be expanded by clicking the plus (+) sign next to each object. Double click the Library Manager item. This opens the Library Manager Editor which displays all the defined libraries in this PLC.
SoMachine
Manual Draft 2
2-23
ii.
The toolbars are context sensitive. When the Visualisation is the focus window a graphic editor toolbar will appear underneath the main toolbar.
iii.
Click the Library Manager tab and the graphic toolbar will disappear.
2-24
February 2011
ii. iii.
Select Online Login to log in to the simulator. Since there is no program in the simulator, the following message will appear. Click Yes.
iv.
SoMachine
Manual Draft 2
2-25
vii.
2-26
February 2011
ix. 6
Examine all of the objects in the Devices pane. Shutdown the runtime.
i. ii. iii. 7
Select Online Stop. Select Online Logout. Select Online Simulation to disable Simulation Mode.
SoMachine
Manual Draft 2
2-27
Chapter 3: Overview
Introduction
Project Management
SoMachine allows the user to perform fundamental tasks such as creating, exporting and importing projects. There are also other project management tools such as archiving which create a highly compressed version of the project. The implemented project management principle allows users to browse the existing projects quickly getting the relevant information without the need to open them before selection. The user can create a new project, starting from several means: using Tested Validated and Documented Architectures, using the provided examples, using an existing project or from scratch. There is quick access to the most recently-used projects.
This Chapter Covers These Topics: New Projects.......................................................................... 3-2 Create New Machine ............................................................. 3-3 Start with Empty Project ....................................................... 3-4 Start with Standard Project.................................................... 3-8 Archive Projects .................................................................. 3-12
New Projects
First Step in the Configuration The first step when configuring SoMachine is to create a new project. The project is where all information is stored. SoMachine facilitates project creation by providing different project templates. The project templates are categorised in four groups:
Description
Empty project, empty library and projects with a predefined controller Generic project shells, including controller, HMI, field devices and functions - tested, validated and documented Project shells dedicated to conveying, including controller, HMI, field devices and application functions tested, validated and documented controller, HMI, field devices and applied functions tested, validated and documented
Configure Projects
SoMachine provides tools that assist users in creating new projects quickly and easily. It provides for project startup: a variety of preferred implementations. A dedicated TVDA Finder tool (Tested Validated Documented Architectures) assists users in selecting the preferred implementation that best suits individual projects. a variety of application projects for conveying, hoisting, and packaging that provide basic configurations for these applications. some examples that provide basic projects for making yourself familiar with SoMachine. Once the project is created, SoMachine provides extensive possibilities to add textual and graphical information to each project file. This additional information enables users to distinguish projects avoiding the need to open them when they have to select the suitable project out of those that are available on the computer. For easy configuration of the project, SoMachine provides a graphical configuration editor that allows users to add and configure the requested devices in a comfortable way.
3-2
February 2011
It includes the following commands: Start with empty project Start with standard project Start with TVD architecture Start with application Start with existing project Start with example
SoMachine
Manual Draft 2
3-3
When the Save Project As dialog opens browse for a location using the Save in: field Create a name for the project in the Filename: field then click Save.
3-4
February 2011
iii.
When the Save Project As dialog appears use the Save in: field to navigate to the C:\Class folder. Use the File name: field to name the project Empty.project then click the Save button.
SoMachine
Manual Draft 2
3-5
3-6
February 2011
ii.
Click the Program tab. The Devices pane is also empty. When a device is added to the project the devices pane will be populated with standard references.
SoMachine
Manual Draft 2
3-7
Select the device from the Device: drop down list then click the Create Project button.
3-8
February 2011
iii.
Select the device TM238LFDC24DT from the Device: drop down list. Change the default name of the POU Name: to MyPOU. Click the Create Project button.
SoMachine
Manual Draft 2
3-9
Examine the project settings. i. Open the Configuration tab. Select the controller to display the description in the Information tab.
3-10
February 2011
SoMachine
Manual Draft 2
3-11
Archive Projects
Save the Compiled Project A project Archive is a very compressed version of the project. The compression rate can result in a file that is more than one fiftieth the size of the project file. Archiving is similar to exporting except that it saves the compiled application. The consequences of this is that the user cannot archive a project until a successful compile can be completed. Until this is possible it is necessary to export. A project Archive is saved with the extension .ProjectArchive. The ProjectArchive file contains: The PLC binary The Upload information, i.e. Comments and Animation tables The Operator Screens How to Create an Archive
Archive Properties
To create an archive:
Select File Project Archive Save/Send Archive from the main menu. Enter desired path for the archive file when prompted.
Note:
Archiving is possible only if the project was compiled and when the Upload information has been included, when it contains at least the comments.
3-12
February 2011
ii.
Save the file as .projectarchive. Open Windows Explorer and compare the size of the two files
SoMachine
Manual Draft 2
3-13
Chapter 4: Overview
Introduction
The Configuration screen is only displayed after a SoMachine project has been opened. The screen consists of a graphical configuration editor that provides necessary functions to perform the entire hardware and network configuration of the machine. The configuration settings performed here will also be available in the controller and Vijeo Designer Program screen
This Chapter Covers These Topics: The Configuration Screen...................................................... 4-2 Display Manager ................................................................... 4-4 Add a Device to a Project...................................................... 4-5 Add an Expansion Module to a Device................................. 4-8
1 2 3 4 5 6 7
General Functions Menu Hide/View Handle Task Selection Pane Work Area Online Help Display Manager Information Pane
4-2
February 2011
When a new project is created from scratch, the work area of the graphical Configuration Editor will be empty. The work area will display a prompt for the user to drag a device from the list in the left pane into this empty area.
SoMachine
Manual Draft 2
4-3
Display Manager
Functions of the Display Manager To simplify the use of the graphical Configuration Editor a Display Manager is provided at the bottom of the pane.
The Exp Last button expands the subdevices (expansion modules) of the last device that was selected
The Exp All button expands all subdevices that are expansion modules
Exp All
4-4
February 2011
To add a device:
Select the device in this list and drag it to the work area. Notice the device description on the right, designed to help you make the correct selection.
When the device has been added to the work area a graphical representation of the device is displayed.
SoMachine
Manual Draft 2
4-5
SoMachine will return a list of devices meeting the search phrase that was entered or will display a message indicating that no devices were found.
4-6
February 2011
iv.
Drag and Drop the controller TM238LFDC24DT into the work area.
v.
When the device has been added to the work area a graphical representation of the device is displayed.
SoMachine
Manual Draft 2
4-7
Select a module from the Add object dialog then click Add and close. Notice the Information panel displays information on the selected device. This helps the user to select the correct device
4-8
February 2011
iii.
iv.
When the hot spot is clicked the Add Object dialog will open.
SoMachine
Manual Draft 2
4-9
vi.
Click the Add and close button to add the module to the device
Save the project. i. Open the Devices tab and click the Save Project button.
4-10
February 2011
Chapter 5: Overview
Introduction
Controller Programming
Over a period of ten to fifteen years PLC Programming languages developed independently from each other. Control applications developed their own proprietary languages based on Ladder programming, C, BASIC and many others. Since all of these languages were different the people who needed to use these languages had to spend a great deal of time learning each language. During the early 1990s the International Electrotechnical Commission (IEC) developed a standard for all PLCs called IEC 61131. IEC 61131-3 (Part 3) was developed in 1993. This part of the standard is concerned with the PLC programming languages. SoMachine is able to use the five IEC standard languages. These are Sequential Function Chart (SFC) language and four inter-operable programming languages:, Ladder Diagram (LD), Function Block Diagram (FBD), Structured Text (ST) and Instruction List (IL). SoMachine is also able to use the programming language Continuous Function Chart (CFC) SFC is mainly used to control highly sequential processes, like repetitive machine operations. This is properly referred to as a state machine. It can also be used as a supervisory control mechanism.
This Chapter Covers These Topics: Program Screen ..................................................................... 5-2 Tasks...................................................................................... 5-8 PLC Program Execution........................................................ 5-9 POU Program Creation........................................................ 5-10 Gateway Configuration ....................................................... 5-16 Task Configuration.............................................................. 5-17 PLC Simulator ..................................................................... 5-21 CoDeSys Program Languages............................................. 5-26 Watchdog Mechanisms ....................................................... 5-36 Structuring an Application .................................................. 5-37 The POU Function............................................................... 5-38 Sample Project..................................................................... 5-44 Global Variables.................................................................. 5-47
Program Screen
Devices Window The Program screen is displayed when a SoMachine project is opened. It provides access to the CoDeSys programming environment. Any configuration settings that were already performed in the Configuration screen are displayed in the Devices view and can be modified, deleted and / or added here. Any changes performed in this view will also be available in the Configuration screen.
The Devices window consists of four main nodes. Configuration screens are accessed by double clicking on the node in the device tree. The four main nodes are:
Area
Controller Program Embedded Functions
Description
PLC type and PLC configuration All parts of the PLCs program functions built into the M238
I/O (fast & normal I/O), HSC high speed counter, PTO and PWM (pulse train output, pulse width modulation)
Communication
Communication ports to external devices
5-2
February 2011
Item
Applications PLC Settings
Description
Displays list of applications on the PLC Name of application running IO, output behavior when in STOP mode Set time in PLC. Firmware rev, Boot version Real time in the PLC can be set
Services
Status Information
Status of PLC and expansion bus Information about connected PLC model
SoMachine
Manual Draft 2
5-3
Application All parts of the PLCs program Declaration of global variables. Variables visible between all programs in project. 3 GVL lists per project is the maximum allowed Add optional libraries to current project or create your own custom library Libraries provide the following items that are executed in the runtime system of the automation device: Functions and function blocks Datatype definitions Global variables Visualization objects GVL (Global Variable List)
Library Manager
Programs (PRG) and Functions(FUN) Named POU (Program Organizational Unit). User created program sections or functions in the current project. May be created in any of the six IEC supported languages. Controls the execution of the programs in the project. MAST created by system when you start a new project
Task Configuration -
5-4
February 2011
IO Configuration of the M238s internal I/O. The M238 has 6 discrete inputs, 8 fast inputs, 6 discrete outputs, 4 fast outputs
HSC Configuration of the built-in high speed counter. The HSC function can execute fast counts of pulses from sensors, encoders, switches, etc. The HSC is independent of the M238 scan time.
SoMachine
Manual Draft 2
5-5
The PTO function provides a square wave output for a specified number of pulses and a specified cycle time. The PTO function can be implemented in two different modes: one train of pulses a pulse profile (multiple trains of pulses).
Two PTO channels are available on the Modicon M238 controller. Each PTO channel is associated to 2 fast outputs and 1 standard input:
PWM uses a square wave whose duty cycle is modulated resulting in the variation
5-6
February 2011
Depending on the M238 model, there are either: One serial port, no Can Master or Two Serial ports, one Can Master
By default, the TM238LFDC24DT device is preconfigured as follows: Serial Line 1: Modbus manager Serial Line 2: SoMachine - Network manager
Serial1/Serial2 RS232/485, RTU/ASCII Program download, HMI interface, other services are possible connect remote CANopen devices 16 remote devices are possible
CANbus
SoMachine
Manual Draft 2
5-7
Tasks
Task Basics A Task is a group of sections and subroutines, executed cyclically or periodically for the MAST task, and periodically for the FAST task (cyclic task with a periodicity smaller than that of the MAST task).
Task Configuration allows the definition of one or several tasks to control the execution of an application program. Tasks control the execution of the application.
The M238 allows the configuration of up to seven tasks with the restrictions listed below. There are Five types of tasks: Cyclic (3 max) - executed on a time scheduleevery 50ms Event (2 Max) - executed on L -> H transition of trigger on event tag Freewheeling (1 Max) starts with program and cycles, no specific time External Event (4 Max) (not in menu) executed when designated system event is TRUE. Example - embedded input = ON or OFF or Both
See Also:
For further information about Maximum Number of Tasks for each platform, see SoMachine Help - and search for Maximum Number of Tasks. Task Triggering
Tasks may be triggered by:
a time (cyclic, freewheeling) an internal or external event the rising edge of a global project variable an interrupt event of the controller
the combination of priority and condition determine the order that the tasks will be executed
5-8
February 2011
The diagram above describes a PLC Program cycle. Local I/O - processed by the tasks which use them (Task MAST, Task Namexxx,). Expansion Module I/O - processed by the MAST task only, not by other tasks if they exist
SoMachine
Manual Draft 2
5-9
POU Type
Program
Description
Returns one or several values during operation. All values are retained from the last time the program was run until the next. It can be called by another POU. Provides one or more values during the processing of a program. As opposed to a function, the values of the output variables and the necessary internal variables shall persist from one execution of the function block to the next. So invocation of a function block with the same arguments (input parameters) need not always yield the same output values. Yields exactly one data element (which can consist of several elements, such as fields or structures) when it is processed. The call in textual languages can occur as an operator in expressions.
Function Block
Function
5-10
February 2011
To create a POU:
Right click Application and select Add Object POU from the menu.
SoMachine
Manual Draft 2
5-11
All POUs are created in this manner. When finished, they must be scheduled to run by assigning them to a Task.
5-12
February 2011
SoMachine
Manual Draft 2
5-13
v.
The Devices pane will display the new POU and the Work area will be open ready for the user to enter the new program.
vi.
5-14
February 2011
iii.
SoMachine
Manual Draft 2
5-15
Gateway Configuration
How to Add a USB Gateway
If no gateway is present, you can use the Add gateway... button to add one. You can also configure multiple gateways but only one can be active at a time. When the Set active path button is pressed, the path visualisation changes from normal to bold.
Use the Set active path button to select the active gateway. When the Set active path button is pressed, the path visualisation changes from normal to bold.
5-16
February 2011
Task Configuration
How to Configure a Task
To Configure a Task:
A POU_ST is added to MAST Function.
Priority Define the priority of the current task (0 is the highest priority, 31 is the
lowest priority).
Type Define the type of task
Cyclic - execute cyclically according to the period defined. Event start on rising edge of the variable associated to trigger the event External Event start on rising edge of the trigger input for the event. Freewheeling - execute at start program. At the end of a cycle run, the task
is automatically restarted in a continuous loop, after a delay that is 30%proportional to the duration of the last task cycle. There is no cycle time defined but T#: 1...1000 ms.
Watchdog Enable the watchdog, enter the watchdog time and the sensitivity. The Sensitivity field defines the number of times a watchdog overrun can occur
SoMachine
Manual Draft 2
5-17
5-18
February 2011
ii.
Click Add POU in the POUs section of the Configuration tab. This will open the Input Assistant.
iii.
OK.
SoMachine
Manual Draft 2
5-19
v.
Check the lower left corner of the SoMachine window under the Messages section to see that the message Precompile OK has appeared.
vi.
5-20
February 2011
PLC Simulator
Offline PLC Simulator SoMachine provides an Offline PLC Simulator. Applications may be downloaded to the simulator and run offline for: How to Start the Simulator Program development Program debugging
SoMachine
Manual Draft 2
5-21
5-22
February 2011
ii.
iii.
Since there is no program in the simulator, the following message will appear. Click Yes.
SoMachine
Manual Draft 2
5-23
Test the running project i. ii. Select Online Start to start the Controller. Open the POU and observe its operation. variables currently have a value of zero. Notice that all the
5-24
February 2011
iv.
Press <CTRL> + W on the keyboard or Online Write Values from the menu to force the values into the variables. Confirm the action.
The values are written into the variables and the average is calculated.
SoMachine
Manual Draft 2
5-25
Note:
5-26
February 2011
ii.
iii.
Right click to the left of Network 1 in the lower pane of the Work area and select Insert Box from the menu.
SoMachine
Manual Draft 2
5-27
v.
The ADD operator will be inserted into the editor. ADD block and select Insert Input from the menu.
5-28
February 2011
vii.
This will open the Input Assistant. Select var1 then click OK. In the same manner add variables var2 and var3 to the second and third inputs respectively.
viii.
Right click the Output pin and select Insert Box to open the Input Assistant. Select Keywords from the Categories: pane then select DIV from the Items: pane. Click OK. Add 3 to the lower input pin (denominator).
SoMachine
Manual Draft 2
5-29
x.
Use the Input Assistant to add the avg variable. program will look like this:
The completed
5-30
February 2011
iii. iv.
Enter values into the variables in the same manner as before. Check the display to see whether the program is functioning correctly.
v. 3
Select Online Logout to log out of the program. Log out of the application and save the project.
SoMachine
Manual Draft 2
5-31
POU LD
and coils.
5-32
February 2011
Note:
FBD, LD and IL formats can be converted from one format to another. SFC and CFC cannot be converted.
2 Log out of the application and save the project.
SoMachine
Manual Draft 2
5-33
Note:
5-34
February 2011
ii.
iii.
Create this POU by following the program below. Ask the instructor if additional help is needed.
iv. 2
Save, Login, and test this POU. Log out of the application and save the project.
SoMachine
Manual Draft 2
5-35
Watchdog Mechanisms
M238 Watchdog Operation A Watchdog is a device used to protect a system from specific software or hardware failures that may cause the system to stop responding. There are two types of Watchdog in SoMachine: Application (configured) watchdog - Each task cycle can be monitored by a watchdog timer (a maximum duration of the task cycle). This helps debugging certain application conditions (such as infinite loops, etc.) and provides a maximal duration for refreshing outputs. A watchdog can be defined for each task. System Watchdog - System Overload is reached when all the user tasks use more than 80% of system resources. This is computed on a 1 second window, each second. This system overload mechanism cannot be disabled, so that system tasks can be executed properly.
In Online mode, task processing can be monitored by clicking on the task . Monitoring the task shows you how long the task is taking to execute Monitoring the actual task execution time helps determine the correct WDT setting
5-36
February 2011
Structuring an Application
POU Program Structure
A POU can call other POUs (nesting) No limits to number of calls Could affect Watchdog limits if not taken into account
Program structuring is possible Conditional execution may be added Watchdog issues are possible Called POUs can be in any language
SoMachine
Manual Draft 2
5-37
Function Creation
Normally used when you need repeat the same calculation with different vars. Number crunching Returns the result of the calculation to the calling POU Arguments are passed to the function, returns a single result
Example -
5-38
February 2011
Values 10, 20, 15 passed to function CalcAvg. Result of 15 is returned POU Function in Three Languages The same POU Function is shown in three different programming languages
SoMachine
Manual Draft 2
5-39
5-40
February 2011
iv.
Save and Build the application. Fix any errors that appear.
The next steps will call the function from a new program POU. Create a new POU program call the function i. Open the POU_FBD program. Right click the left margin, and select Insert Network from the menu.
SoMachine
Manual Draft 2
5-41
iii.
When the Input Assistant opens select the item Module Calls in the Categories pane. Expand the Application branch and select the function CalcAvg. Click OK.
5-42
February 2011
v.
Save, login and download this application to your controller. Test the operation by entering values into the Prepared Value fields and using the CNTRL + <W> keys to enter values into the Value field.
SoMachine
Manual Draft 2
5-43
Sample Project
Escalator Project The Escalator project is a simple project that is designed to start and run an escalator. This project will be used to consolidate all of the features of SoMachine that have been demonstrated in this tutorial.
5-44
February 2011
iii.
Select the device TM238LFDC24DT from the Device: drop down list. Name the POU Escalator_Mgt and select Continuous Function Chart as the Implementation Language. Click the Create Project button.
SoMachine
Manual Draft 2
5-45
vi.
5-46
February 2011
Global Variables
Global Variable List (GVL) A Global Variable List (GVL) is a list of variables that are available to all parts of the application. The fact that all POUs as well as other sections of the application, have access to these variables is what makes them global. A maximum of three GVL lists may be created per application
Note: Global Variables are declared in the same manner as local variables but are located in a GVL file.
SoMachine
Manual Draft 2
5-47
ii.
Double click the GVL item in the Devices tree. The GVL Tab will open in the right pane.
iii.
5-48
February 2011
iii.
Add the CFC Diagram to the lower pane. Note that the comments are not necessary.
iv.
Notice that the AND function block has a little circle on the lower left pin.
This is a Negated pin. To negate the pin right click the pin and select Negate from the menu. v. vi. vii. Add the Escalator_Mgt POU to the MAST task. Save and build the project. Run the project in Simulation mode to test the logic.
SoMachine
Manual Draft 2
5-49
iii.
5-50
February 2011
iii.
Add the Actions to the POU. i. Add boxes to the program to add the two Actions to the program.
ii.
SoMachine
Manual Draft 2
5-51