LogicPro User’s Guide Watlow Anafaze 314 Westridge Drive Watsonville, CA 95076 Phone: Fax: (831) 724-3800 (831) 724-0320 Part No. 28002-00. Revision 3.
Copyright © 2000 Watlow Anafaze Information in this manual is subject to change without notice. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form without written permission from Watlow Anafaze. Anafaze developed package includes licensed proprietary material of Intellution, Inc. © Intellution, Inc. 1996.
Table of Contents List of Figures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . XI List of Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . XV 1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Where Do I Look? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Conventions Used. . . . . . . . .
Table of Contents LogicPro User’s Guide 3 Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Creating a Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Opening a Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Copying Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Backing Up a Project . . . . . . . . . . . . . . . . . . . .
LogicPro User’s Guide Table of Contents 7 Sequential Function Charts . . . . . . . . . . . . . . . . . . . . 71 About SFC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using SFCs in LogicPro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SFC Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Selector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table of Contents LogicPro User’s Guide 9 Function Block Diagrams . . . . . . . . . . . . . . . . . . . . . 105 FBD Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 Selector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 Straight Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 Inverted Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LogicPro User’s Guide Table of Contents Real to Integer (RTOI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Square Root (SRT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Logical . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Logical And (AND) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Logical Or (OR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table of Contents LogicPro User’s Guide 14 Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 Building a Program for Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 Using the Simulation Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 Simulation Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228 Timer Ticks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LogicPro User’s Guide Table of Contents 17 Dynamic Data Exchange . . . . . . . . . . . . . . . . . . . . . 259 How to Access a Remote Item . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Starting the LogicPro DDE Application . . . . . . . . . . . . . . . . . . . . . . . . . . Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table of Contents X LogicPro User’s Guide Watlow Anafaze Doc.# 28002-00 Rev 3.
List of Figures 1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2 LogicPro Workplace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Figure 2.1—The LogicPro Workplace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Figure 2.2—Two Views of the LogicPro Standard toolbar, showing various active buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3 Projects . . . . . . .
List of Figures LogicPro User’s Guide Figure 6.6—Add Resource Variable Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 Figure 6.7—Program Variables Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Figure 6.8—Find Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 7 Sequential Function Charts . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Figure 7.1—Simultaneous Transition. . . . . .
LogicPro User’s Guide List of Figures 10 Function Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 Figure 10.1—Counter Up Function Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 Figure 10.2—Assign Function Block Symbolic Input/Output Dialog Box. . . . . . . . . . . 117 Figure 10.3—Counter Down Function Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 Figure 10.4—Counter Up Down Function Block . . . . . . . . . . . . .
List of Figures LogicPro User’s Guide Figure 11.3—Edit Symbol Definition Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 Figure 11.4—Build UDFB Library for Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 Figure 11.5—Build UDFB Library for Simulation Dialog Box . . . . . . . . . . . . . . . . . . . . 176 Figure 11.6—Open User Defined Function Block Dialog Box . . . . . . . . . . . . . . . . . . . 177 Figure 11.
List of Tables 1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Table 1.1—Chapter Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Table 1.2—Conventions Used. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2 LogicPro Workplace . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Table 2.1—The File Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Table 2.2—The Edit Menu. . . . . . . .
List of Tables LogicPro User’s Guide 8 Ladder Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 Table 8.1—Ladder Diagrams Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 9 Function Block Diagrams . . . . . . . . . . . . . . . . . . . . . 105 Table 9.1—FBD Toolbar Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 10 Function Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 Table 10.1—Symbol Operation . . . . . . . . . . . . .
1 Introduction Welcome to LogicPro, a Microsoft Windows based graphical programming environment that allows you to create and debug programs, and manage real-time distributed or embedded control systems. LogicPro allows you to graphically write a “C” program without knowing the language. LogicPro use the familiar conventions of typical graphical programming languages like Grafcet, Ladder Logic, etc. These languages have evolved into proven, effective solutions for automation and control projects.
Chapter 1: Introduction LogicPro User’s Guide Table 1.1 Chapter Descriptions Chapter Description 1 Introduction Introduction and general information. 2 The LogicPro Workplace The LogicPro Workplace and screen layout. 3 Projects Creating, using, and changing LogicPro Projects. 4 Resources Creating, using, and changing LogicPro Resources. 5 Programs Creating, using, and changing LogicPro Programs within a resource.
LogicPro User’s Guide Chapter 1: Introduction Chapter Title Description User Defined Function Blocks Information about creating and using User Defined Function Blocks. 12 I/O Drivers Information on input/output drivers, examples, and where to look for more information. 13 Compilers Information about using the Borland C++ compiler. 14 Simulation Information on the simulator function of LogicPro, specifically, how to use it.
Chapter 1: Introduction LogicPro User’s Guide Table 1.2 Conventions Used Convention Explanation Italics Indicates references to Chapters, sections, Figures and Tables. Capitalization Indicates the proper name of an element of LogicPro. Bold Sans Serif Indicates LogicPro menu headings or options. [Bold San Serif in Square Brackets] Indicates the name of a button or tool on the screen. Indicates a specific key or combination of keys on your keyboard.
2 LogicPro Workplace LogicPro uses the Microsoft Windows’ Graphical User Interface (GUI) as its operating environment. By using standard Windows, the LogicPro environment allows you to easily accomplish development tasks in an environment that you are already familiar and comfortable with. To successfully use LogicPro, you should know how to use Windows.
Chapter 2: LogicPro Workplace LogicPro User’s Guide Language Toolbar Menu Bar Standard Toolbar Status Bar Figure 2.1 The LogicPro Workplace Menu Bar There are two ways to choose an item from a menu: • • With the mouse, click a menu then click the item. – or – Press the key, press the underlined letter in the menu’s name, and press the underlined letter in the item’s name.
LogicPro User’s Guide Chapter 2: LogicPro Workplace • • Windows Help LogicPro enables the appropriate menus. Each of these menus allows control of a specific part of LogicPro. File Menu This menu provides easy access to most tools you will need for creating, opening and saving files and printing reports. Additionally, tools for Importing and Exporting variables are available. See Table 2.1 for a detailed listing of menu items. Table 2.
Chapter 2: LogicPro Workplace LogicPro User’s Guide Menu Option Description Creates a backup copy of the chosen type of item: Backup Project… Resource… Import Variable Export Variable Report Setup… Program… Reads data from an ASCII, commadelimited file. Allows you to create and edit resource and program variables externally to LogicPro. Writes data to an ASCII, commadelimited file. Allows you to edit resource and program variables external to LogicPro.
LogicPro User’s Guide Chapter 2: LogicPro Workplace Table 2.2 The Edit Menu Menu Option Description Note: This option is only available while editing UDFB C/C++ source (*.c) and header (*.h) files. Undo Also, note that the Undo buffer is only one level deep: it only contains the last keystroke. Selecting Undo twice will perform a ‘double-undo’, or redo. Cut Restores what you are working on to the way it was before your very last action.
Chapter 2: LogicPro Workplace LogicPro User’s Guide Menu Option Clear Del Variables Description Deletes the selected area from the active window. This operation cannot be undone. Opens a dialog box and allows you to manage the different kinds of variables. Select the variable type from the following list: Project… Resource… Program… Changes the attributes of an object within an existing project.
LogicPro User’s Guide Chapter 2: LogicPro Workplace View Menu This menu allows you to customize the appearance of your workspace. See Table 2.3 for a detailed listing of each menu item. An enabled selection is easily identified by a checkmark to the left of a menu item. Table 2.3 The View Menu Menu Option Zoom… Repaint Grid Comments Monitor Program Monitor On/Off Configuration Description Changes the magnification for the active window from 10% - 200%.
Chapter 2: LogicPro Workplace LogicPro User’s Guide Table 2.4 The Tools Menu Menu Option Description Select the programming language for the active window from the submenu: Language SFC - Grafcet Sequential Function Chart language. This is the LogicPro default language for any program window. You may change the defaults using the Options menu. LD - Ladder This option selects the Ladder Diagram language for the active window.
LogicPro User’s Guide Chapter 2: LogicPro Workplace Table 2.5 The UDFB Menu Menu Option Compile for Execution Build Execution Lib… Compile for Simulation Build Simulation Lib… Description Compiles and error checks a UDFB in the active window for downloading, using the compiler selected for the particular resource. Performs the same function as Compile for Execution (above), but also adds the .OBJ file to the UDFB library for this resource type.
Chapter 2: LogicPro Workplace LogicPro User’s Guide Table 2.7 The Simulation Menu Menu Option Build All and Run Simulation Setup… Simulation Reset Scan Increment Timer Change Variable… Description Compiles and links a program for simulation and runs the simulation. Opens the Simulation Setup dialog box, allowing you to set the number of milliseconds that elapse per scan, as well as establishing the number of logic scans per simulation scan.
LogicPro User’s Guide Chapter 2: LogicPro Workplace Menu Option Description Customize the application workspace using the following submenu: Display Grid by Default - Toggles the default setting for display grid between either on or off. The grid can also be turned on or off independently on a window-by-window basis on the View menu. Program Window Display Comments by Default - Toggles the default setting for display comments between either on or off.
Chapter 2: LogicPro Workplace LogicPro User’s Guide Windows Menu This menu offers additional tools for customizing your LogicPro workspace. Specifically, it provides a list of open windows and allows you to change the dimensions and arrangement of those windows. Refer to Table 2.9. Table 2.9 The Windows Menu Menu Option Cascade Tile Arrange Icons Description Arranges all of the open windows in an overlapping fashion so that the title bars of each are visible, with the currently active window on top.
LogicPro User’s Guide Chapter 2: LogicPro Workplace Help Menu The Help menu gives you access to the online documentation system. This allows you to obtain information about software features and functions while in the middle of a development task. There are three levels of information in the online help system, as described in Table 2.10. Table 2.10 Levels of Help Type of Help Complete online help. Information about the active dialog box or pull-down menu. Information about the selected menu item.
Chapter 2: LogicPro Workplace LogicPro User’s Guide Status Bar The Status bar displays project, resource, and resource type names, from left to right at the bottom of the screen, and is available to the developer within the development environment. The Status bar also provides information about the currently highlighted menu item.
LogicPro User’s Guide Chapter 2: LogicPro Workplace Button Description Print Documentation Save Edit Cut Edit Copy Edit Paste Edit Delete Zoom Ratio Edit Project Variable(s) Edit Resource Variable(s) Edit Program Variable(s) Build All and Run Execution Download and Run Open Program for Monitoring Disabled Status Update Run Execution Terminate Execution Simulation Setup Simulation Reset Scan Simulating Logic Increment Simulation Timer Tick Change Simulation Variable(s) Repaint Window Doc.
Chapter 2: LogicPro Workplace LogicPro User’s Guide Language Toolbars The Language toolbars appear down the right side of the screen. Tools represent each of the language elements used in building a program in a particular language. This Toolbar automatically changes to reflect the current programming language. ToolTips are available on all the buttons so that you can easily identify their functions.
LogicPro User’s Guide Chapter 2: LogicPro Workplace Table 2.14 The Ladder Toolbar Tool Description Selector Normally Open Contact Normally Closed Contact Off to On Transitional Contact (Positive) On to Off Transitional Contact (Negative) Normal Coil Latched Coil (Set) Unlatched Coil (Reset) Function Block Comments Cross Reference Table 2.15 The FBD Toolbar Tool Description Selector Straight Connector Inverted Connector Variable Function Block Cross Reference Doc.# 28002-00 Rev 3.
Chapter 2: LogicPro Workplace LogicPro User’s Guide Using Standard Windows Features LogicPro provides standard Windows features. If you are already familiar with Windows, the Select, Cut, Copy and Paste tasks are familiar. You can access the Cut, Copy or Paste commands from Edit on the Menu Bar, or from the buttons on the Standard toolbar. You can also access these features using the short cut keys (, , and respectively).
LogicPro User’s Guide Chapter 2: LogicPro Workplace Standard Text To Cut, Copy and Paste text from the UDFB editor: 1. Select the text you wish to copy by holding down the left mouse button while dragging it across the desired text. 2. Use the short cut keys or menu options to either Cut or Copy the selection onto the clipboard. Paste the contents of the clipboard into any part of the UDFB editor using either the Edit menu or short cut keys. Doc.# 28002-00 Rev 3.
Chapter 2: LogicPro Workplace 24 LogicPro User’s Guide Watlow Anafaze Doc.# 28002-00 Rev 3.
3 Projects Before you begin it is important that you understand the structure and building blocks of a LogicPro Project. The Project itself resides at the highest level of this hierarchy. The next level is called the Resource level. A Resource is the controller hardware that will run a logic program. A project may consist of many resources, or as few as one. Each resource contains one or more Programs. At the lowest level is the Action. Actions reside within the programs.
Chapter 3: Projects LogicPro User’s Guide The directory’s name corresponds to the project’s name and the contains all of the resource subdirectories. These subdirectories, in turn, contain all the resource and program files. In LogicPro, the project is a receptacle for all related resources and programs. The project contains all the programmable controller elements necessary to describe and implement an automated task. Projects can contain any number of resources and programs.
LogicPro User’s Guide Chapter 3: Projects 4. Select the directory in which you want to store your new project. 5. Enter the name for the New Project. The Project name must conform to standard DOS naming conventions and have no more than eight characters. 6. Click [OK]. LogicPro creates a new directory on your drive. This directory contains all the files related to this Project. LogicPro automatically prompts you to create a New Resource.
Chapter 3: Projects LogicPro User’s Guide 4. Click on a Project in the box. 5. Click [OK]. LogicPro automatically prompts you to open a Resource and then a Program if any exist or to create them. See Chapter 5, Programs. 6. If you cannot find the Project you are looking for, a) Select Build List from the dialog box. The Rebuild Project List dialog box appears, as shown in Figure 3.4. b) Enter a drive in the Start Drive and End Drive fields.
LogicPro User’s Guide Chapter 3: Projects To copy a Project: 1. If a Project is being used by LogicPro, close it. a) Select File. b) Select Close. c) Select Project. 2. Copy the Project directory using any file utility such as Windows Explorer. Copy the entire directory including all files and subdirectories. Do not rename any directory or file name; LogicPro will not recognize a Project in a folder if the name has been changed. 3. Open the Project. a) Select File. b) Select Open.
Chapter 3: Projects LogicPro User’s Guide NOTE! 1. Select the File menu. 2. Select Backup. 3. Select Project. The Copy Project dialog box appears, as shown in Figure 3.5. 4. Select the Project to be backed up from the list of Existing Project(s). Enter the new name for the backup copy of the project. 5. Select the drive and directory in which LogicPro should place the copy.
LogicPro User’s Guide Chapter 3: Projects Closing a Project To close a Project: 1. Select the File menu. 2. Select Close. 3. Select Project. If any of the Programs within the Project you are closing have changed, LogicPro prompts you to save your changes before it closes the Project. Deleting a Project NOTE! A Project must be closed before it will appear on the list of Projects that may be deleted. To delete a Project: NOTE! 1. Select the File menu. 2. Select Delete. 3. Select Project.
Chapter 3: Projects LogicPro User’s Guide Figure 3.6 32 Delete Project Dialog Box Watlow Anafaze Doc.# 28002-00 Rev 3.
4 Resources Resources are the individual controllers that execute the logic you created in a LogicPro Program. Creating a Resource To create a Resource: 1. Select the File menu. 2. Select New. 3. Select Resource. The New Resource dialog box appears, as shown in Figure 4.1. Figure 4.1 4. Doc.# 28002-00 Rev 3.00 New Resource Dialog Box Select PPC_2000 or CPC400 from the Target Environment list.
Chapter 4: Resources LogicPro User’s Guide 5. Enter a Name for the Resource you want to define. LogicPro saves this Resource as a database in the Project subdirectory. 6. Click [OK] to define the Resource. The Attributes dialog box appears. – or – Click [Cancel] to exit the dialog box. Figure 4.2 PPC-2000 Attributes Dialog Box PPC-2000 Attributes The following LogicPro default communications settings will match the PPC-2000’s port 1 when the rotary CONFIG switch is set to position A.
LogicPro User’s Guide Chapter 4: Resources To configure communications with the PPC-2000: 1. Select the correct Communication Port for your PC. 2. Select a Parity of Even, Odd or None. 3. In the Device Address field, enter the controller address for the PPC-2000. 4. In the ROM Size field, enter 128kB. (Controllers with 2.03 and earlier firmware support up to 40 kB. 5. Select a Baud Rate. The PPC-2000 supports 9600 and 19200. 6. In the Time out field, enter 2000 milliseconds. 7.
Chapter 4: Resources LogicPro User’s Guide Editing a Resource To edit the open Resource: NOTE! 1. Select the Edit menu. 2. Select Attributes. 3. Select Resource. The Edit Resource dialog box appears. See Figure 4.3 with the current Resource type highlighted. 4. Click [OK] to open the Attributes dialog box – or – Click [Cancel] to exit the dialog box. 5. Make the desired changes to the settings. This is the same dialog box used when creating a New Resource.
LogicPro User’s Guide Chapter 4: Resources 2. Since the project may contain many different Resources, delete any unnecessary Resources. a) Select File. b) Select Delete. c) Select Resources. The Delete Resources dialog box appears. d) Select the Resources to delete. e) Click [OK]. The temp directories can be deleted to minimize the size of the project. Using any file utility such as Windows Explorer delete the temp directories (1bk~ through 5bk~) located within the Project directory.
Chapter 4: Resources LogicPro User’s Guide Figure 4.4 Copy Resource Dialog Box Deleting a Resource This option irreversibly removes an existing Resource from the current Project. NOTE! 1. Select the File menu. 2. Select Delete. 3. Select Resource. The Delete Resource dialog box appears, as shown in Figure 4.5 on page 39. 4. Select the Resource or Resources you want to delete from the list. You can delete multiple Resources simultaneously.
LogicPro User’s Guide Chapter 4: Resources Figure 4.5 Delete Resource Dialog Box Opening a Resource This option makes the Resource available to you. 1. Select the File menu. 2. Select Open. 3. Select Resource. The Open Resource dialog box appears, as shown in Figure 4.6. 4. Select the Resource you want to open from the list of Resources. 5. Click [OK]. The Resource opens displaying its name on the status line. You are then prompted to open a Program. See “Opening a Program” on page 42.
Chapter 4: Resources 40 LogicPro User’s Guide Watlow Anafaze Doc.# 28002-00 Rev 3.
5 Programs Programs form the base unit of the LogicPro development environment. Programs are defined in IEC 1131-3 as logical assemblies of all the programming language elements and constructs necessary for the intended signal processing needed to control a machine or process by a programmable controller system. One or more Programs can be contained within a Resource. Within each Program, there may be any number (including zero) of steps, actions, relay elements, or function blocks.
Chapter 5: Programs LogicPro User’s Guide Figure 5.1 New Program Dialog Box 4. Enter the name for the new Program. Since the Program name is used as the name of DOS data files, the name must conform to DOS standards for file names. The name cannot be the same as the Resource name. See Appendix A for details on naming conventions. 5. Click [OK]. Opening a Program To open an existing Program: 42 1. Select the File menu. 2. Select Open. 3. Select Program.
LogicPro User’s Guide Chapter 5: Programs Figure 5.2 Open Program Dialog Box Saving a Program When you save a Program, LogicPro creates a backup file that contains the previously saved version of the Program. The Program appears as a .THR file and the backup file appears as a .BAK file in the Resource directory. To save the currently active Program window: 1. Select the File menu. 2. Select Save. Closing a Program To close a Program: Doc.# 28002-00 Rev 3.00 1.
Chapter 5: Programs LogicPro User’s Guide 5. NOTE! Click [Yes] to save the Program and create a backup file of the old Program. – or – Click [No] to close the Program without saving. – or – Click [Cancel] to leave the Program open. Additions and deletions of variable definitions are saved when made and do not depend on saving the Program. Figure 5.3 Verify Dialog Box Copying Programs Programs must be copied within the context of their Projects and resources. To copy a Program: 44 1.
LogicPro User’s Guide Chapter 5: Programs 3. Since the Resource may contain many different Programs, delete any unnecessary Programs. a) Select File. b) Select Delete. c) Select Programs. The Delete Program dialog box appears. d) Select the Programs to delete. e) Click [OK]. The temp directories can be deleted to minimize the size of the Project. Using any file utility such as Windows Explorer delete the temp directories (1bk~ through 5bk~) located within the Project directory.
Chapter 5: Programs LogicPro User’s Guide To backup a Program: 1. Select the File menu. 2. Select Backup. 3. Select Program. The Copy Program dialog box appears, as shown in Figure 5.4. 4. Select the Program you want to backup by clicking on it in the Existing Program(s) list. 5. Enter the new Program name in the New Program Name field. A list of the existing Program names is displayed below this field to help insure that you do not use a name that is already assigned. 6.
LogicPro User’s Guide Chapter 5: Programs Deleting a Program To delete an existing Program: 1. Select the File menu. 2. Select Delete. 3. Select Program. The Delete Program dialog box appears, as shown in Figure 5.5. 4. Select the Program you want to delete. Multiple Programs can be selected by clicking on one Program name after another. To deselect a Program click on its name a second time. 5. NOTE ! Click [OK].
Chapter 5: Programs 48 LogicPro User’s Guide Watlow Anafaze Doc.# 28002-00 Rev 3.
6 Variables A LogicPro Variable is the name tag given to a piece of data used by various execution elements of the Program. Variables are both physical I/O and internally represented data. LogicPro uses several types of Variables, including: • • • Project Variables Resource Variables Program Variables Naming Conventions When naming Variables try to be as descriptive as possible especially if there are more than a few Variables in the Program.
Chapter 6: Variables LogicPro User’s Guide Retentive Variables A Retentive Variable is a Variable that: • • Remembers its last state if power is interrupted. Returns that value after power has been restored. LogicPro forgets all of the Variable values when a power down of a Resource occurs unless they are tagged as Retentive. System Variables System Variables give you access to internal system status and allow you to view items such as I/O Driver and Resource status.
LogicPro User’s Guide Chapter 6: Variables Project Variables Project Variables are available to all elements in a Project. Project Variables are always internal, they cannot be a reference to physical I/O or database registers. To add, edit, and delete Project Variables: 1. Select the Edit menu. 2. Select Variables. 3. Select Project. This will open the Project Variables dialog box, see Figure 6.1 on page 51. 4. To add a Variable, click [Add]. See “Adding a Resource/Program Variable” on page 56.
Chapter 6: Variables LogicPro User’s Guide Adding a Project Variable To add a Project Variable: 1. Click [Add] in the Project Variable dialog box. This dialog box to opens, as shown in Figure 6.2. Figure 6.2 2. Enter the Variable name. This name must follow the Variable naming conventions discussed in “Naming Conventions” on page 49. 3.
LogicPro User’s Guide Chapter 6: Variables 6. 7. Boolean Variables — are 1 bit in length and can have a value of 1 or 0, corresponding to true and false respectively. Integer Variables — are 16-bit numeric Variables ranging in value from –32,768 to 32,767 including zero. Long Integer Variables — are 32-bit (double-word) numeric variables ranging in value from -2,147,483,648 to 2,147,483,647. Real Variables — are numeric variables with floating point decimals ranging in value from -3.4 x 1038 to 3.
Chapter 6: Variables LogicPro User’s Guide Figure 6.3 Edit Project Variable Dialog Box Deleting a Project Variable To delete a single Project Variable: NOTE! 1. Select the Variable you want to delete in the Project Variables dialog box. 2. Click the [Delete] button. The Verify dialog box appears. You are prompted to confirm deletion only if the Options/Variable/Confirm/Deletion choice is selected. 3. Click [Yes] to delete the Variable – or – Click [No] to cancel the deletion.
LogicPro User’s Guide Chapter 6: Variables To select a sequence of Variables: 3. NOTE! Press and hold . d) Click on the last in the sequence of Variables you want to delete. This action highlights the first selection, the last selection, and all of the Variables in between the two. Click [Delete]. The Verify dialog box appears. You are prompted to confirm deletion only if the Options/Variable/Confirm/Deletion choice is selected. 4. NOTE ! c) Click [Yes] to delete the Variables.
Chapter 6: Variables LogicPro User’s Guide However, just like the [OK], all of the information that you entered or changed is confirmed. NOTE ! If you make a mistake, you can use the [Cancel] button to restore all settings to the state in which they existed when you first opened the Project Variables dialog box. Resource Variables A Resource Variable can be internal or can be associated with a physical I/O point or a database register.
LogicPro User’s Guide Chapter 6: Variables Figure 6.4 Resource Variable Dialog Box Figure 6.5 Program Variable Dialog Box 4. Doc.# 28002-00 Rev 3.00 Click [Add] in the Resource/Program Variables dialog box. The Add Resource/Program Variable dialog box appears, as shown in Figure 6.6 on page 58.
Chapter 6: Variables LogicPro User’s Guide Figure 6.6 Add Resource Variable Dialog Box 5. Enter the Variable name in the Name field. This name must follow the Variable naming conventions discussed in “Naming Conventions” on page 49. 6. If you want to create a numbered range of Variables, enter a start and an end number in each of the Increment fields. Otherwise, leave the fields blank. 7.
LogicPro User’s Guide Chapter 6: Variables a) Place a check mark in either the Input or the Output check box. b) Select the I/O driver from the list. The drivers in the list are determined by the Resource you selected. Information on these drivers is located in Chapter 12, “I/O Drivers.” c) Enter the I/O physical address. See Chapter 12, “I/O Drivers,” for addressing information.
Chapter 6: Variables LogicPro User’s Guide Deleting Resource/Program Variables To delete a single Resource/Program Variable: NOTE! 1. Select the Variable you want to delete in the Resource/ Program Variables dialog box. 2. Click [Delete]. The Verify dialog box appears. You are prompted to confirm deletion only if the Options/Variable/Confirm/Deletion choice is selected. 3. Click [Yes] to delete the Variable – or – Click [No] to cancel the deletion. To delete multiple Variables simultaneously: 1.
LogicPro User’s Guide Chapter 6: Variables NOTE! If you make a mistake, you can choose [Cancel], in the Resource/Program Variables dialog box, to restore all Variables to the state in which they existed when you first opened the Resource/Program Variables dialog box. Cloning a Resource or Program Variable Cloning a Variable creates an exact duplicate of that Variable and highlights the symbolic name of the copied Variable. This makes the creation of similar Variables easier.
Chapter 6: Variables LogicPro User’s Guide Edit Variables by clicking [Edit]. See “Editing a Resource/Program Variable” on page 59. -orDelete Variables by clicking [Delete]. See “Deleting Resource/Program Variables” on page 60. 5. Click [OK] to accept the changes. – or – Click [Cancel] to cancel all the changes you made to the Variables. Figure 6.7 Program Variables Dialog Box Finding and Replacing a Variable In a Program You can use the Find or Replace commands to help you edit ladder diagrams.
LogicPro User’s Guide Chapter 6: Variables 4. Select whether you want to start your search at the beginning of the Program at your current location. 5. Click [OK] to find the first instance of the Variable name. Figure 6.8 Find Variable If you click... Then... The first instance of the Variable name is highlighted in the Ladder Diagram. [OK] The Find Variable dialog box closes. A message dialog box appears. 6.
Chapter 6: Variables LogicPro User’s Guide Using the Replace Command When... There are no additional instances of the Variable name. The Variable name does not exist in the Ladder Diagram Then... The dialog boxes closes and the editor window becomes active. A warning box appears with the message Variable not found! Click [OK] to clear the dialog box from the screen.
LogicPro User’s Guide Chapter 6: Variables Click [Yes] to replace the found instance of the Variable and find the next instance, repeat step #5. – or – Click [No] to find the next instance without changing the found instance, repeat step #5. – or – Click [Cancel] to stop searching without replacing the found instance. 6. Import/Export Import/Export is a feature that allows the user to import (load) or export (save) Resource or Program Variables to or from an ASCII file.
Chapter 6: Variables LogicPro User’s Guide If you select... Then... The new Variable data in the ASCII file replaces the Variable data presently in the Resource or Program file. The new Variable data in the ASCII file is ignored and the existing Resource or Program data is unchanged.
LogicPro User’s Guide Chapter 6: Variables Verifying the Import Operation After importing a file, you can verify the result by opening the Resource or Program Variables within LogicPro and observing the Variable list. You can edit each individual Variable to ensure that the Import operation executed correctly and the result is what you expected. Creating or Editing an ASCII file You can create a file for import using any ASCII text editor, such as Microsoft’s MS-DOS Editor.
Chapter 6: Variables LogicPro User’s Guide Table 6.1 Max Size Legal Values 26 1st char must be letter. Others must be alphanumeric or ‘_’. 4 BOOL, INT, LONG, REAL Retentive Flag 1 0, 1 Initial Value Comment 10 26 Digits only ASCII chars Input or Output 1 I, Q Size 1 X, B, W 26 1st char must be letter. Others must be alphanumeric or ‘_’. See Note 4. digits.digits This item must be in the form of moduleaddress.offset or parameternumber.
LogicPro User’s Guide Chapter 6: Variables 4. Variable Type Short, Input or Output, Size and Driver Name are case sensitive. 5. Initial Values: See “Naming Conventions” on page 49. Example of an Import/Export File [RESOURCE:PPC_2000] [] Alarm_Status1,INT,0,,,I,W,Database,95.1 Analog_In1_1,INT,0,,,I,W,Analog_In_202x,1.1 Analog_Out11_1,INT,0,,,Q,W,Encoder_Analog_2030,11.1 Control_Mode_I1,INT,0,,,I,W,Database,1.1 Control_Mode_O1,INT,0,,,Q,W,Database,1.48 Dig_In1,BOOL,0,,,I,X,Processor_2010,0.
Chapter 6: Variables LogicPro User’s Guide Dig_Out25,Bool,0,,,Q, X,Processor_2010,0.25 [END] Variable Name, Variable Type Short, Retentive Flag, Initial Value, Comment, Input or Output, IO Size, Driver Name, IO Address. This is the last line in the ASCII file. Exporting an ASCII file The procedures for exporting Resource or Program Variables to an ASCII file are similar to the procedures for importing and ASCII file.
7 Sequential Function Charts Sequential Function Chart (SFC) is a graphical language using simple graphical objects to diagram any sequential process. SFC enhances communication between the project manager, system architect, programmers, and operators by providing a clear graphical representation of the process state machine. About SFC SFCs provide a way to partition a controller program into a manageable set of Steps and Transitions. These Steps and Transitions are interconnected by directed links.
Chapter 7: Sequential Function Charts LogicPro User’s Guide SFCs allow you to design, program, debug, and document your process in a quick and effective manner. SFC is the default language for LogicPro programs. When SFCs are the active language for the window, LogicPro: • • Displays the SFC toolbar on the right side of the screen. Displays the SFC tools on the Tools menu. SFC Toolbar SFC uses graphic elements to represent Steps, Transitions, and Actions in the program.
LogicPro User’s Guide Chapter 7: Sequential Function Charts Selector You can use the [Selector] tool to choose the elements in the program you want to move, edit, delete, or to which to assign variable names. When you click on any element in the program, handles highlight the object to show it is selected. To select a single element, click on the object with the mouse. You can now move, delete or edit the selected object by using the appropriate tool on the tool bar.
Chapter 7: Sequential Function Charts LogicPro User’s Guide You can insert Steps into your SFCs with the [Step] tool. Select the [Step] tool from the toolbar, click anywhere on the screen, and place the Step into the application work area as needed. Simultaneous Transition Transitions determine when the process flow passes from a preceding Step to the successive Step along the directed link. Simultaneous Transitions are represented by a horizontal line across the vertical directed link.
LogicPro User’s Guide Chapter 7: Sequential Function Charts Parallel (AND) and Single (OR) Transitions To toggle between parallel and single Transitions, using the [Simultaneous Transition] tool, double-click near the directed link on the opposite side of the double horizontal line from the Transition. Parallel horizontal lines indicate that steps occur in parallel. For example, in the SFC as illustrated in Figure 7.2, both Steps 2 and 3 will execute in parallel once condition 1 is met. Figure 7.
Chapter 7: Sequential Function Charts LogicPro User’s Guide Assigning Variables to Transitions Transition conditions must take the form of a single expression. A Transition condition can be a variable that allows the program to continue once the variable value is greater than 0. It could also be one or more variables related by Boolean operators resulting in a Boolean true or false result. Any integer value greater than 0 is considered true. The following list of operators, shown in Table 7.
LogicPro User’s Guide Chapter 7: Sequential Function Charts 5. Select the appropriate checkbox in the Variable Type section of the dialog box and click [Add], [Edit], [Delete], or [Cancel] to define any variables you need. The appropriate dialog box appears and allows you to define the variables. Once a variable is defined, it appears in the Variable List dialog box. See “Project Variables” on page 51 and “Resource Variables” on page 56 for more details adding, editing, deleting and cloning variables.
Chapter 7: Sequential Function Charts LogicPro User’s Guide Action The [Action Tool] allows you to associate Actions with a particular Step in the program window. You can associate zero or more Actions with each Step. A Step with zero associated Actions is considered a Wait function. The Step is waiting for a successor Transition condition to become true. An Action can be a collection of rungs in Ladder language, a Sequential Function Chart or a Function Block Diagram.
LogicPro User’s Guide Chapter 7: Sequential Function Charts To change the Name or Stored/Unstored attribute: 1. Select the [Selector] tool. 2. Double-click on the Action. This opens the Action’s program window. 3. Select Edit. 4. Select Attributes. 5. Selection Action... 6. Edit the Name field, if desired. 7. Select the desired Stored/Unstored option. 8. Click [OK] to save the change. – or – Click [Cancel] to abort changes.
Chapter 7: Sequential Function Charts 80 LogicPro User’s Guide Watlow Anafaze Doc.# 28002-00 Rev 3.
8 Ladder Diagrams The Ladder diagram is an outgrowth of the ‘relay Ladder’ commonly used in the programming of PLCs. This offers you a visual method of creating Boolean expressions. By satisfying the elements of the expression power flows through to a coil at the output of a rung. Simply put, the Ladder diagram symbolizes a circuit with energized left and right power rails.
Chapter 8: Ladder Diagrams LogicPro User’s Guide Ladder Toolbar When you select Ladder diagram as the language for a program window, LogicPro: • • Displays the Ladder toolbar on the right side of the screen. Changes the menu items in the Tools menu. To use any one of these tools, click it on the toolbar or select it from the Tools menu. Table 8.1 contains a list of the available tools. Table 8.
LogicPro User’s Guide Chapter 8: Ladder Diagrams Selector Use the [Selector] tool to select an element within a Ladder program. Once selected you can move, edit, delete or assign Variable names to it. To use the Selector: Select the [Selector] tool. 1. Select any element in the program by clicking once on it. This will cause handles to appear showing that it is selected. Clicking twice on it causes the Variables dialog box to appear. Figure 8.1 illustrates an element without handles. Figure 8.
Chapter 8: Ladder Diagrams LogicPro User’s Guide To use the Normally Open Contact: 1. Select the [Normally Open Contact] tool. 2. Position the pointer where you want the contact placed and click. Normally Closed Contact The [Normally Closed Contact] tool allows you to insert normally closed contacts into the program window. During a single evaluation of the Ladder diagram, if the Variable associated with this contact is True, then the contact will open.
LogicPro User’s Guide Chapter 8: Ladder Diagrams On To Off Transitional Contact The [On to Off Transitional Contact] tool allows you to insert on to off transitional contacts into the program window. The On To Off Transitional Contact is sometimes known as the Negative Transitional Contact. During a single evaluation of the Ladder diagram, if the Variable associated with this contact changes from True to False, then the contact will close for this cycle only.
Chapter 8: Ladder Diagrams LogicPro User’s Guide To use the [Latched Coil]: 1. Select the [Latched Coil] tool. 2. Position the pointer where you want the coil placed and click. Unlatched Coil The [Unlatched Coil] tool allows you to insert unlatched coils into the program window. The Unlatched Coil, sometimes known as a Reset coil, is reset to Off when all of the contacts or Function Blocks on the Ladder rung pass power to the coil from the left power rail.
LogicPro User’s Guide Chapter 8: Ladder Diagrams • • • Note each element present. Define its purpose in the control program. You can view and edit this text as needed. To use Comments: 1. Select the [Comments] tool. 2. Position the pointer within the box formed by the grid points that includes the number of the rung you want to comment, and click. This opens the Comments dialog box. 3. Type your comments. 4. Click [OK] to save your comments.
Chapter 8: Ladder Diagrams LogicPro User’s Guide Creating and Editing Ladder Diagrams LogicPro allows you to use the many editing features available in Windows. Inserting Rungs To insert a rung into a Ladder program between two existing rungs: 1. From the toolbar select the new element type you want to add. 2. Click: Anywhere in the program window to create the first rung - or Between two existing rungs - or Above the first rung - or Below the last rung.
LogicPro User’s Guide Chapter 8: Ladder Diagrams NOTE! The coil must always be the last element on a rung. The editor issues a warning when a user attempts to put the coil anywhere else. Inserting Function Blocks To add a Function Block to a Ladder diagram: 1. Select the [Function Block] tool. The Function Block dialog box appears, as shown in Figure 8.4. 2. Select the type of Function Block you want: Standard - or Vendor Provided - or User Defined 3.
Chapter 8: Ladder Diagrams LogicPro User’s Guide the surrounding rungs and elements shift to accommodate the newly added Function Block. NOTE! Figure 8.5 Rung Before Adding a Function Block Figure 8.6 Rung With a Function Block Added More detailed information on Function Block Diagrams and Function Blocks is available in Chapter 9 and Chapter 10, respectively.
LogicPro User’s Guide Chapter 8: Ladder Diagrams Figure 8.7 Ladder Diagram Before Elements Are Added to Function Block Figure 8.8 Ladder Diagram After Elements Are Added to Function Block Function Blocks with More Than One Input and Output Bit Some Function Blocks have more than one input and output logical bit. For example, the CTUD (Counter Up Down) Function Block has four logic input bits (CU, CD, R, LD) and two logical bits (QU and QD) on the output side, as shown in Figure 8.9 on page 92.
Chapter 8: Ladder Diagrams LogicPro User’s Guide Figure 8.9 Inserting an Input Element on a Function Block Figure 8.10 Element Inserted Between Left Power Rail and Second Input Bit Connecting New Elements To connect a new element, such as a coil, from the second or lower logical output bit to the right power rail: 92 1. Select a coil element type from the toolbar. 2. Click and hold on the Logical Output Bit in the Function Block. 3.
LogicPro User’s Guide Chapter 8: Ladder Diagrams Figure 8.11 Connecting an Element to a Function Block’s Output Figure 8.12 Function Block After Connecting Output Element NOTE! If the Function Block’s first logical input is connected directly from the left power rail without any element in between, a constant True condition is applied during the running of the control program.
Chapter 8: Ladder Diagrams LogicPro User’s Guide NOTE! 2. Click and drag from the left side to the right side of the element you want to parallel. 3. Release the mouse button. A parallel branch is created. When clicking and dragging you must begin or end outside the grid cell that contains the element you want to parallel. Release Click Drag Figure 8.13 Adding the Parallel Branch Figure 8.14 After Adding the Parallel Branch If more parallel branches are needed, as shown in Figure 8.
LogicPro User’s Guide Chapter 8: Ladder Diagrams Release Click Drag Figure 8.15 Adding Another Branch Figure 8.16 Branch Added To create a new parallel branch from the left power rail, as shown in Figure 8.17 on page 96: 1. From the toolbar, select the element type you want to add. 2. Start dragging on the right side of the left power rail and below the rung you to which you want to attach the new branch. 3. End dragging close to the rung. The finished diagram is shown in Figure 8.18 on page 96.
Chapter 8: Ladder Diagrams LogicPro User’s Guide Figure 8.17 Creating a New Parallel Branch from the Left Power Rail Figure 8.18 After Creating a New Parallel Branch from the Left Power Rail If you need to add more parallel branches: NOTE! 1. From the tool bar, select the element type to add. 2. Start dragging on the right side of the left power rail and below the rung you to which you want to attach the new branch. 3. End dragging close to the rung.
LogicPro User’s Guide Chapter 8: Ladder Diagrams NOTE! This procedure is valid only when the selected element type is one of the three output coil types. However, other element types may be placed before the coil in a multiple output coil branches. Figure 8.19 Before Creating Multiple Output Coil Branches Figure 8.20 After Creating Multiple Output Coil Branches NOTE! If the top most coil in a multiple output coil branches is deleted, a horizontal line will remain, as shown in Figure 8.21.
Chapter 8: Ladder Diagrams LogicPro User’s Guide 1. Make sure that the extension you want to add will not get in the way of any existing element. Figure 8.22 shows a Ladder diagram that is ready to accept an extension rail. 2. Select the new element type from the toolbar. 3. Click and hold on the right side of the left power rail. Handles appear to indicate that you selected an existing rail. 4. Drag just to the right of left vertical line of the branch to which you want to attach. 5.
LogicPro User’s Guide Chapter 8: Ladder Diagrams 4. Click [Cut] on the Standard toolbar. – or – Select Edit, then Cut – or – Press + . The Selected Rung(s) disappear(s) from the screen. See “Pasting Rungs” below for directions on pasting the elements elsewhere. Copying Rungs To copy a rung: 1. Select the [Selector] tool. 2. Position the pointer to the left of the Left Power Rail (each Rung has its own unique number). 3. Click on the number of the Rung number that you want to Copy.
Chapter 8: Ladder Diagrams LogicPro User’s Guide Deleting Elements Individual or multiple elements may be deleted. Deleting all the elements on a rung deletes the rung. To Delete an element or group of elements from the programming window: 1. Select the [Selector] tool. 2. Click on the element that you want to Delete. You may select multiple elements by holding down the left mouse button and dragging the “dotted box” around adjacent elements. 3.
LogicPro User’s Guide Chapter 8: Ladder Diagrams Assigning Variable Names To assign a Variable name to an element: 1. Click the [Selector] tool. 2. Double click on the element to which you want to assign a Variable name. The Variables dialog box appears, as shown in Figure 8.24. 3. You can view System, Project, Resource, and Program Variables by checking the appropriate box. 4.
Chapter 8: Ladder Diagrams LogicPro User’s Guide Naming and Assigning Variables to Function Blocks Function Blocks must have unique names and their I/O must be assigned. I/O may be constants, variables or rung connections. Inputs and outputs may be integer or real or Boolean. To assign symbolic Variable names or preset values to a function block: 102 1. Select the [Selector] tool. 2. Double-click on an existing function block.
LogicPro User’s Guide Chapter 8: Ladder Diagrams Figure 8.25 Assign Function Block Symbolic Input/Output Dialog Box 7. Click [OK]. The symbolic names or values appear on the function block in a Ladder diagram program, as shown in Figure 8.26. Figure 8.26 Symbolic Name on Function Block in a Ladder Diagram Program NOTE! Doc.# 28002-00 Rev 3.00 The outputs of a Function Block need not be attached to Ladder elements.
Chapter 8: Ladder Diagrams LogicPro User’s Guide Adding Comments to Ladder Diagrams To add comments to a rung in the Ladder diagram: 1. Select the [Comment] tool. 2. Click on the number of the rung to which you want to add comments. The Rung Comment dialog box appears, see Figure 8.27. 3. Type in the comment. 4. Click [OK] to save the text and close the dialog box – or – Click [Cancel] to terminate the procedure. The comment is displayed immediately above the rung you documented.
9 Function Block Diagrams Function Block diagrams (FBD) is a graphical programming language provided by LogicPro. In the broadest sense, this language allows you to manipulate function blocks in much the same way as in the Ladder programming language. As with the Ladder language, FBD allows you to simply create and edit complex programs using a powerful set of tools. The biggest difference between the Ladder and FBD languages is their focus.
Chapter 9: Function Block Diagrams LogicPro User’s Guide Table 9.1 FBD Toolbar Functions Tool Description Selector Straight Connector Inverted Connector Variables Function Block Cross Reference Selector The [Selector] tool allows you to choose one or more element of your program for editing. Clicking on this button makes the pointer appear as the traditional arrow. Using the pointer, you can either click on a single element or you drag around a group of elements you wish to modify.
LogicPro User’s Guide Chapter 9: Function Block Diagrams Both elements to be connected using this tool must represent Boolean (logical) data. Whatever the state at the source of the connection the data will be inverted at its destination (if it was on/true at the source, it will be off/false at the destination) Selecting this tool makes your pointer look like it does for Straight Connections, except the arrow attached to the bottom of your pointer has a circle at its point.
Chapter 9: Function Block Diagrams NOTE! LogicPro User’s Guide Variable Elements must be connected before values can be assigned to them. Each of these steps are discussed in more detail in the following sections. Inserting Function Blocks To add a function block: 1. Select the [Function Block] tool. The Function Block dialog box appears, as shown in Figure 9.1. 2. Select the check box next to the type of function block you want: 3.
LogicPro User’s Guide Chapter 9: Function Block Diagrams Figure 9.2 shows two function blocks placed in the Program window. Figure 9.2 Placed Function Blocks Inserting Variable Elements To insert Variable elements: NOTE! 1. Select the [Variable] tool. 2. Move the pointer to the location at which you want to place the new Variable element and click the mouse button.
Chapter 9: Function Block Diagrams LogicPro User’s Guide Figure 9.3 Symbolic Name on Function Block in a FBD program NOTE! Branched connections are not currently allowed. Connections can only be made on a one-to-one basis; in other words, a Variable element can only be connected to one input or output. NOTE! Feedback loops to/from a single function block (connections which both originate and terminate on the same element or elements of a common function block) are not allowed.
LogicPro User’s Guide Chapter 9: Function Block Diagrams For more information on creating new Variables, refer to “Adding a Project Variable” on page 52, or “Adding a Resource/Program Variable” on page 56 Assigning Names and Execution Orders to Function Blocks Each function block in an FBD program must be assigned a unique name and execution order. To assign a name to a function block: 1. Select the [Selector] tool. 2. Double-click on the function block you wish to name.
Chapter 9: Function Block Diagrams LogicPro User’s Guide 4. Fill in the Execution Order field. An execution order is automatically assigned to the function blocks (determined by the order in which you created them) but it is also possible to change the execution order of the function blocks at any time. Execution order is not bound by the apparent layout of the program. In the example shown in Figure 9.
LogicPro User’s Guide Chapter 9: Function Block Diagrams Figure 9.6 NOTE! Function Blocks in FBD with Handles When cutting or copying, all inputs and outputs must be attached to something, be it a Variable or the input or output of another function block. When pasting a copy of a function block into the program from which it was copied, LogicPro automatically assigns it a new, unique name as shown in Figure 9.7. Figure 9.
Chapter 9: Function Block Diagrams 114 LogicPro User’s Guide Figure 9.8 Function Block Before Deletion, With Handles Figure 9.9 Function Block After Deletion Watlow Anafaze Doc.# 28002-00 Rev 3.
10 Function Blocks This chapter explains in detail the function and I/O requirements for each of the standard and vendor provided Function Blocks used in FBD and LD programs. For information on writing your own Function Blocks, see Chapter 11, “User Defined Function Blocks.
Chapter 10: Function Blocks LogicPro User’s Guide Counter Up (CTU) The Counter Up function block shown in Figure 10.1, enables an output after a preset number of transitions from False to True occur. The CTU block increments the integer current value (CV) for every False to True transition of the counter up enable bit (CU). The current value continues to increment until it reaches the integer preset value (PV).
LogicPro User’s Guide Chapter 10: Function Blocks Outputs Q is the Counter Up output bit. This bit is enabled and passes power when the current value is equal to the preset value. CV is the Counter Up current value. In Ladder logic, assign this output Variable a symbolic name in the Assign Function Block Symbolic Input/Output dialog box, shown in Figure 10.2. In FBD, assign a variable to this output in the Variable Assignment dialog box.
Chapter 10: Function Blocks LogicPro User’s Guide Figure 10.3 Counter Down Function Block Inputs CD is the Counter Down enable bit. As long as the reset bit is False, each False to True transition of this bit decrements the current value until the current value equals zero. In a program using Ladder logic, the value of CD is determined by the Boolean evaluation of elements placed between the left power rail and CD in the function block.
LogicPro User’s Guide Chapter 10: Function Blocks decrements by one every time a False to True transition of the counter down enable bit occurs until the current value equals zero. The current value retains this value until the reset bit is True. Prior to an initial loading of the preset value, CV has a value of zero. Counter Up Down (CTUD) The Counter Up Down function block, shown in Figure 10.4, is a combination of the counter up and counter down function blocks.
Chapter 10: Function Blocks LogicPro User’s Guide value of CU is determined by the Variable connected to CU. If no contacts are placed on the rung before CU, the value of CU is always True, but a transition never occurs. This bit has higher evaluation priority than the CD bit in this function block. CD is the Counter Down enable bit. As long as the reset bit is False, each False to True transition of this bit decrements the current value until the current value equals zero.
LogicPro User’s Guide Chapter 10: Function Blocks Outputs QU is the Counter Up output bit. When CU passes power, this bit is enabled and passes power once the current value is equal to the preset value if CV counted up to PV (not if LD was used to load CV with the PV value). QD is the Counter Down output bit. This bit is enabled and passes power when the current value is equal to zero if CV counted down to zero (not if “reset” was used to reset CV to zero).
Chapter 10: Function Blocks LogicPro User’s Guide Inputs INP is the Timer Pulse enable bit. A True condition of this bit triggers the elapsed time to start incrementing in thousandths of a second until the elapsed time equals the preset time. In a program using Ladder logic, the value of INP is determined by the Boolean evaluation of elements placed between the left power rail and INP in the function block. In FBD programs, the value of INP is determined by the Variable connected to INP.
LogicPro User’s Guide Chapter 10: Function Blocks INP ET Q Figure 10.6 Relationship between the Input and Output of TP Function Block Timer On-Delay (TON) The Timer On-Delay function block, shown in Figure 10.7, provides a time delay for enabling an event at a preset time interval. Upon a True condition of the enable bit (INP), TON increments the integer elapsed time (ET) value in thousandths of a second until the integer preset time (PT) value is reached.
Chapter 10: Function Blocks LogicPro User’s Guide PT is the timer on-delay preset time. In Ladder logic, assign this input a symbolic name or constant value in the Assign Function Block Symbolic Input/Output dialog box. In FBD, assign a variable to this input in the Variable Assignment dialog box. The range of values this Variable can assume is from 1 to 32,767 for INT type Variables and 1 to 2,147,483,647 for LONG type Variables thousandths of a second.
LogicPro User’s Guide Chapter 10: Function Blocks The output bit (Q) is enabled upon a True condition of the enable bit (INP). When there is a False condition of the enable bit, TOF continues to enable the output bit while it increments the integer elapsed time (ET) value in thousandths of a second until the integer preset time (PT) value is reached. Once the elapsed time value equals the preset time value, the output is disabled.
Chapter 10: Function Blocks LogicPro User’s Guide elapsed time is equal to the preset time. The elapsed time retains this value until the enable bit is True again. Prior to the first initialization of this function block, the elapsed time does not increment even though the enable bit is False. Figure 10.10 illustrates the relationship between the inputs and outputs of the TOF function block and shows how the INP signal and ET (timer) determine the state of the output Q, INP and Q signals are high or low.
LogicPro User’s Guide Chapter 10: Function Blocks Inputs EN is the Greater Than enable bit. A True condition of this bit causes the comparison between A and B to occur. In a program using Ladder logic, the value of EN is determined by the Boolean evaluation of elements placed between the left power rail and EN in the function block. In FBD programs, the value of EN is determined by the Variable connected to EN. If no contacts are placed on the rung before EN, the value of EN is always True.
Chapter 10: Function Blocks LogicPro User’s Guide Figure 10.12 Less Than Function Block Inputs EN is the Less Than (LT) enable bit. A True condition of this bit causes the comparison between A and B to occur. In a program using Ladder logic, the value of EN is determined by the Boolean evaluation of elements placed between the left power rail and EN in the function block. In FBD programs, the value of EN is determined by the Variable connected to EN.
LogicPro User’s Guide Chapter 10: Function Blocks EQ tests whether one value (A) is equal to another value (B) when the enable bit (EN) is True. If the relationship A=B is True, then the output bit (Q) is enabled. The output bit is disabled either when the enable bit is False or the value of A is no longer equal to B. The values of A and B can be preset to a constant or assigned a symbolic name, which allows their value to change dynamically within the program. Figure 10.
Chapter 10: Function Blocks LogicPro User’s Guide Output Q is the Equal To output bit. This bit is enabled and passes power when the enable bit is True and the value of A is equal to the value of B. Arithmetic The following sections contain descriptions of function blocks found in the standard category that perform arithmetic. Add (ADD) The Add (ADD) function block, shown in Figure 10.14, produces the sum of two values.
LogicPro User’s Guide Chapter 10: Function Blocks for INT type Variables and -2,147,483,648 to 2,147,483,647, including 0 for LONG type Variables. If this Variable is assigned a value out of these ranges, unpredictable results will occur. Outputs ENO is the Add enable out bit. This bit is enabled and passes power when the enable bit is True, as long as the value of C does not go out of range. C is the ADD sum. C contains the sum of A and B, as long as the enable bit is True.
Chapter 10: Function Blocks LogicPro User’s Guide of EN is always True. In FBD, all inputs must be connected to a Variable. A is the value to be subtracted from. The range of values this Variable can assume is from -32,768 to 32,767, including 0 for INT type Variables and -2,147,483,648 to 2,147,483,647, including 0 for LONG type Variables. If this Variable is assigned a value out of these ranges, unpredictable results will occur. B is the value to subtract.
LogicPro User’s Guide Chapter 10: Function Blocks Inputs EN is the Multiply enable bit. A True condition of this bit causes the values of A and B to be multiplied and the result stored in C. In a program using Ladder logic, the value of EN is determined by the Boolean evaluation of elements placed between the left power rail and EN in the function block. In FBD programs, the value of EN is determined by the Variable connected to EN.
Chapter 10: Function Blocks LogicPro User’s Guide Figure 10.17 Divide Function Block Inputs EN is the Divide enable bit. A True condition of this bit causes the value of A to be divided by the value of B and the result stored in C. In a program using Ladder logic, the value of EN is determined by the Boolean evaluation of elements placed between the left power rail and EN in the function block. In FBD programs, the value of EN is determined by the Variable connected to EN.
LogicPro User’s Guide Chapter 10: Function Blocks assigned a value out of these ranges, ENO is disabled. C reverts to its last valid value whenever ENO is disabled. Data Manipulation The following section contains a description of the data manipulation function blocks found in the standard category. First In - First Out (FIFO) The First In - First Out (FIFO) function block, shown in Figure 10.18, creates and manipulates a stack of integers.
Chapter 10: Function Blocks LogicPro User’s Guide Inputs LD is the FIFO load bit. As long as the clear bit is False, each False to True transition of this bit loads the input Variable value into the stack until the count value equals the size value. In a program using Ladder logic, the value of LD is determined by the Boolean evaluation of elements placed between the left power rail and LD in the function block. In FBD programs, the value of LD is determined by the Variable connected to LD.
LogicPro User’s Guide Chapter 10: Function Blocks Outputs Q is the FIFO output bit. This bit is enabled and passes power when a False to True transition of the unload bit occurs. This bit remains enabled until there are no more values in the stack to unload and the count Variable equals zero. FUL is the FIFO full bit. This bit is enabled and passes power when the count value is equal to the size value.
Chapter 10: Function Blocks LogicPro User’s Guide integers in the stack is equal to the size of the stack. A False to True transition of the unload bit (UNLD) moves the last integer entered in the stack to the output Variable (OUTP) and causes the output bit (Q) to be True. Every succeeding False to True transition of the unload bit continues to move the newest integer from the stack to the output Variable, and causes the output bit to remain True until the entire stack is unloaded.
LogicPro User’s Guide Chapter 10: Function Blocks FBD programs, the value of UNLD is determined by the Variable connected to UNLD. If no contacts are placed on the rung before UNLD, the value of UNLD is always False. This bit has higher evaluation priority than the LD bit in this function block. CLR is the LIFO clear bit. When this bit is True, the stack is cleared of any values and the count Variable is set to zero.
Chapter 10: Function Blocks LogicPro User’s Guide CNT is the LIFO count Variable. The value of this Variable indicates the number of integers in the stack. OUTP is the LIFO output Variable. This Variable holds the value unloaded from the stack. The range of values this Variable can assume is from -32,768 to 32,767, including 0 for INT type Variables and -2,147,483,648 to 2,147,483,647, including 0 for LONG type Variables. If this Variable is exceeds these ranges, unpredictable results will occur.
LogicPro User’s Guide Chapter 10: Function Blocks lowest evaluation priority of the input bits in this function block. CLR is the SL clear bit. When this bit is True, the register is cleared of all values. In a Ladder Diagram program, the value of CLR is determined by the Boolean evaluation of elements placed between the left power rail and CLR in the function block. In FBD programs, the value of CLR is determined by the Variable connected to CLR.
Chapter 10: Function Blocks LogicPro User’s Guide Scan Time Counter (SCAN) The Scan Time Counter (SCAN) function block, shown in Figure 10.22, calculates the scan time system performance while running a program. SCAN calculates the scan time when the enable bit (EN) is True. The current scan time (TIME) is displayed along with the minimum value (MIN) and the maximum value (MAX) in thousandths of a second.
LogicPro User’s Guide Chapter 10: Function Blocks Ladder Diagrams program, the value of CLR is always False. In FBD, all inputs must be connected to a Variable. Outputs Q is the Scan Time Counter output bit. This bit is enabled and passes power while a True condition of the enable bit occurs. TIME is the scan time Variable. The value of this Variable indicates the scan time in thousandths of a second. MIN is the minimum scan time Variable.
Chapter 10: Function Blocks LogicPro User’s Guide INP is the MOVE input Variable. The range of values this Variable can assume is from -32,768 to 32,767, including 0 for INT type Variables and -2,147,483,648 to 2,147,483,647, including 0 for LONG type Variables. Output Q is the MOVE output bit. This bit is enabled and passes power whenever the enable bit is True. OUTP is the move output Variable. The value of the input Variable is copied to this Variable when the enable bit is True.
LogicPro User’s Guide Chapter 10: Function Blocks Outputs Q is the Boolean output bit. ROUT ROUT is the REAL result of the SCL operation. The value is based on the settings for RMAX and RMIN. ROUT retains its previous value whenever EN is disabled. See Figure 10.25. RMAX RMIN -32768 0 4095 32767 INP Figure 10.25 ROUT as a function of INP Real Number Function Blocks Real function blocks are similar to regular standard function blocks in LogicPro.
Chapter 10: Function Blocks LogicPro User’s Guide Figure 10.26 Real Greater Than Function Block Inputs EN is the Real Greater Than enable bit. A True condition of this bit causes the comparison between RA and RB to occur. In a program using Ladder logic, the value of EN is determined by the Boolean evaluation of elements placed between the left power rail and EN in the function block. In FBD programs, the value of CU is determined by the Variable connected to EN.
LogicPro User’s Guide Chapter 10: Function Blocks Figure 10.27 Real Less Than Function Block Inputs EN is the Real Less Than enable bit. A True condition of this bit causes the comparison between RA and RB to occur. In a program using Ladder logic, the value of EN is determined by the Boolean evaluation of elements placed between the left power rail and EN in the function block. In FBD programs, the value of EN is determined by the Variable connected to EN.
Chapter 10: Function Blocks LogicPro User’s Guide which allows their value to change dynamically within the program. Figure 10.28 Real Equal To Function Block Inputs EN is the Real Equal To enable bit. A True condition of this bit causes the comparison between RA and RB to occur. In a program using Ladder logic, the value of EN is determined by the Boolean evaluation of elements placed between the left power rail and EN in the function block.
LogicPro User’s Guide Chapter 10: Function Blocks Figure 10.29 Real Add Function Block Inputs EN is the Real Add enable bit. A True condition of this bit causes the value of RA to be added to the value of RB and the result stored in RC. In a program using Ladder logic, the value of EN is determined by the Boolean evaluation of elements placed between the left power rail and EN in the function block. In FBD programs, the value of EN is determined by the Variable connected to EN.
Chapter 10: Function Blocks LogicPro User’s Guide RSUB calculates the difference between one value (RA) and another value (RB) and places the result in another Variable (RC) when the enable bit (EN) is True. The values of RA and RB can be preset to a constant or assigned a Variable name, which allows their value to change dynamically within the program. Figure 10.30 Real Subtract Function Block Inputs EN is the Real Subtract enable bit.
LogicPro User’s Guide Chapter 10: Function Blocks Real Multiply (RMUL) The Real Multiply (RMUL) function block, shown in Figure 10.31, produces the product of two values. RMUL calculates the product between one value (RA) and another value (RB) and places the result in another Variable (RC) when the enable bit (EN) is True. The values of RA and RB can be preset to a constant or assigned a Variable name, which allows their value to change dynamically within the program. Figure 10.
Chapter 10: Function Blocks LogicPro User’s Guide RC is the product value. RC contains the product of RA and RB as long as the enable bit is True. The range of values this Variable can assume is from -3.4x1038 to 3.4x1038. If this Variable is assigned a value out of these ranges, ENO is disabled. RC reverts to its last valid value whenever ENO is disabled. Real Divide (RDIV) The Real Divide (RDIV) function block, shown in Figure 10.32, produces the quotient of two real Variable values.
LogicPro User’s Guide Chapter 10: Function Blocks Outputs ENO is the Real Divide enable out bit. This bit is enabled and passes power when the enable bit is True, as long as the value of RC does not go out of range. RC is the quotient. RC contains the quotient of RA and RB as long as the enable bit is True. The range of values this Variable can assume is from -3.4x1038 to 3.4x1038. No remainders are stored in this value; only the whole number value.
Chapter 10: Function Blocks LogicPro User’s Guide Outputs Q is the Real Move output bit. This bit is enabled and passes power when the enable bit is True. Place an output coil on the rung between Q in the function block and the right power rail (in a Ladder Diagram program) or connect an output Variable to it (in a FBD program). ROUT is the Real Move output Variable. The value of the input Variable is copied to this Variable when the enable bit is True.
LogicPro User’s Guide Chapter 10: Function Blocks ROUT is the Integer To Real function block real-number output. This is the value of the integer passed to the IN changed to real-number format. Real to Integer (RTOI) The Real To Integer (RTOI) function block, shown in Figure 10.35, converts values of type real to type integer. The converted real value is then stored in the real Variable assigned to the output. Figure 10.35 Real to Integer Function Block Inputs EN is the Real to Integer enable bit.
Chapter 10: Function Blocks LogicPro User’s Guide a constant or assigned a Variable name, which allows their value to change dynamically within the program. Figure 10.36 Square Root Function Block Inputs EN is the Square Root enable bit. A True condition of this bit causes the square root of RINto be placed in ROUT. In a program using Ladder logic, the value of EN is determined by the Boolean evaluation of elements placed between the left power rail and EN.
LogicPro User’s Guide Chapter 10: Function Blocks Logical The following section describes the logical function blocks found in the standard category. Logical And (AND) The Logical AND function block, shown in Figure 10.37, acts exactly like a logical “and” gate. If both inputs are True, the output is enabled. On the other hand, if even one of the inputs are False, the output is disabled. All inputs and outputs of this function block must be Boolean. Figure 10.
Chapter 10: Function Blocks LogicPro User’s Guide Vendor Provided Function Blocks This section provides information and examples of vendor provided function blocks. In this section, the terms symbol 1, symbol 2, and symbol 3 are used. These terms refer to the labels shown within each of the function blocks as shown in Figure 10.39. Symbol 1 Symbol 2 Symbol 3 Figure 10.
LogicPro User’s Guide Chapter 10: Function Blocks Figure 10.40 The Comparison Function Block Inputs EN-- is the CMP function block’s enable bit. It allows the comparison to be performed if True. A-- is the CMP function’s first argument. B-- is the CMP function’s second argument. Output Q-- is the CMP function’s output bit. The output bit is disabled if the enable bit is False, as well as if the logical operation performed computes to False.
Chapter 10: Function Blocks LogicPro User’s Guide symbol3 = comparison In the CAL function block, this symbol specifies the exact type of calculation to be made and takes on one value as shown in Table 10.1 . Table 10.
LogicPro User’s Guide Chapter 10: Function Blocks A-- is the CAL function’s first argument. B-- is the CAL function’s second argument. Outputs Q-- is the CAL function’s output bit. The output bit is disabled if the enable bit is False; it is enabled as soon as the input enable bit becomes True. C-- is the CAL function’s output destination.
Chapter 10: Function Blocks LogicPro User’s Guide InterLock (IL) InterLock and InterLock-Clear function blocks, shown in Figure 10.43 and Figure 10.44 are designed to act as opening (IL) and closing (ILC) brackets to a segment of logic. The section(s) of a ladder program positioned between IL and ILC rungs can be selectively executed. IL and ILC cannot be nested.
LogicPro User’s Guide Chapter 10: Function Blocks Input EN-- is the InterLock-Clear enable bit. In this Function Block, it has no effect on the program. The ILC FB closes the IL bracket whenever the preceding IL FB is active. Output Q-- is the InterLock-Clear output bit. This bit is always enabled. It does not affect the rest of the program since the ILC function block’s position is always at the end of a rung. Rotation (RROT/LROT) symbol1 = RROT, LROT The rotation function, shown in Figure 10.
Chapter 10: Function Blocks LogicPro User’s Guide D-- is the INT or LONG integer Variable on which the rotation is to be performed (also an output). Outputs Q-- is the rotation function’s output bit. The output bit is disabled if the enable bit is False and is enabled as soon as the enable bit is True. D-- is the rotation function’s output destination (as well as input). The input INT or LONG integer will be replaced with the result of the rotation operation.
LogicPro User’s Guide Chapter 10: Function Blocks N-- is an integer (INT) or long integer (LONG) specifying the number of bits the shift should be done for per scan. D-- is the INT or LONG integer Variable on which the shift is to be performed (also an output). Outputs Q-- is the shift function’s output bit. The output bit is disabled if the enable bit is False and is enabled as soon as the enable bit is True. D-- is the shift function’s output destination (as well as input).
Chapter 10: Function Blocks LogicPro User’s Guide Outputs Q-- is the NEG function’s output bit. The output bit is disabled if the enable bit is False and is enabled as soon as the enable bit is True. B-- is the NEG function’s output destination (as well as input). The INT integer or LONG integer will be replaced with the result of the NEG operation. 166 Watlow Anafaze Doc.# 28002-00 Rev 3.
11 User Defined Function Blocks LogicPro provides comprehensive functionality to create, edit and use User Defined Function Blocks (UDFB). Users can write their own Function Blocks in C and use them within a LogicPro Ladder Program. Overview UDFBs are very powerful tools you can use to handle such tasks as: • • • Support a specific hardware device. Performing an application specific control function. Performing complex math equations.
Chapter 11: User Defined Function Blocks LogicPro User’s Guide When a UDFB is defined, LogicPro generates two associated files: • • A header file. A C code file. The header file contains the definition of a structure for that UDFB and function prototypes. The C file contains four functions: Main Program - called during evaluation of the user Program and performs the task of the UDFB. Initialization - called only once, when the user Program starts to run.
LogicPro User’s Guide Chapter 11: User Defined Function Blocks 6. Define the Variables that will be used as inputs and outputs, as well as internally by the Function Block. Refer to “In’s, Out's and Internals” below. 7. Click [OK] to create the new UDFB – or – [Cancel] to terminate the process. Figure 11.1 New UDFB Dialog Box In’s, Out's and Internals IN's - contains the symbol and type of Inputs to the UDFB. OUT’s - contains the symbol and type of Outputs from the UDFB.
Chapter 11: User Defined Function Blocks LogicPro User’s Guide The symbol must: • • • Use a letter from A to Z for the first character. Be four characters or less in length. Not use a space or other illegal character. The type defines what kind of variable you can assign to the particular input. A UDFB may have up to five inputs or outputs, but the first input and output must be Boolean, and all Boolean inputs must come before any other type of inputs.
LogicPro User’s Guide Chapter 11: User Defined Function Blocks Figure 11.2 Add Symbol Definition Dialog Box To edit an Input, Output, or Internal: NOTE! 1. Select a symbol by clicking on it. 2. Click [Edit]. The Edit Symbol Definition dialog box, shown in Figure 11.3, appears. 3. Edit the name of the symbol in the Name field, if necessary. 4. Edit the type of symbol from the Type field, if necessary. 5. Click [OK] to replace the old symbol with the new symbol in the group.
Chapter 11: User Defined Function Blocks LogicPro User’s Guide UDFB Files As soon as a new UDFB is defined, LogicPro automatically generates two files for the UDFB, one header file and one C file. The header and C file have the short name of the UDFB with a prefix indicating in which resource it has been defined. For example, PPCCNT.h and PPCCNT.c are the names for the header and C files if the UDFB has a short name of CNT and is defined for PPC-2000.
LogicPro User’s Guide Chapter 11: User Defined Function Blocks All Boolean inputs and outputs are passed as parameters. However, Boolean inputs are passed as copies of the variable while Boolean outputs are passed as pointers. This is because the outputs use a pointer to exchange the value from the Function Block to the variable specified by the Ladder diagram. For example, if the UDFB wants to turn on Q, it must reference Q as a pointer.
Chapter 11: User Defined Function Blocks LogicPro User’s Guide Compiling and Building a Library Once the code is written and is ready to test, the user can either: • • Compile the UDFB file. Build a library. To compile the UDFB file from within the editor window: 1. Select the File menu. 2. Select the UDFB menu. 3. Select Compile for Execution -orCompile for Simulation. Either of these options causes LogicPro to compile your UDFB. A DOS screen will appear momentarily as the compiler works.
LogicPro User’s Guide Chapter 11: User Defined Function Blocks The library is stored in the following directory: \logicpro\user\bc After the UDFB library is successfully built up, you can use the UDFB in a Ladder diagram or Function Block Diagram Program as a standard Function Block. When your Program is compiled and linked for execution, the library is automatically linked by LogicPro.
Chapter 11: User Defined Function Blocks LogicPro User’s Guide To build a UDFB in simulation mode: 1. Select the File menu. 1. Select the UDFB menu 2. Select Build Simulation Lib. The Build UDFB Library for Simulation dialog box appears, as shown in Figure 11.5. Figure 11.5 Build UDFB Library for Simulation Dialog Box 3. Select the UDFBs that you want to include in the library. Only those UDFBs which are selected will be in the library. 4. Click [OK].
LogicPro User’s Guide Chapter 11: User Defined Function Blocks Working with UDFB Files The following sections describe how to work with UDFB files. Editing UDFB Files When UDFB header or C files are active on the window, the Undo, Cut, Copy and Paste commands in the Edit menu are enabled. You can use these functions to edit text. Opening UDFB Files To Open UDFB files: 1. Select File. 2. Select Open. 3. Select User Defined Function Block to open the header and C files of the selected UDFB.
Chapter 11: User Defined Function Blocks LogicPro User’s Guide 3. Select User Defined Function Block to close the header and C files of the selected UDFB. 4. Select the UDFB you want to close. You will be prompted to save any files that have changed. 5. Click [OK]. Saving UDFB Files You can save the UDFB header and C files by selecting Save from the File menu. Deleting UDFBs To delete UDFBs: 1. Select File. 2. Select Delete. 3.
LogicPro User’s Guide Chapter 11: User Defined Function Blocks UDFB Tutorial The following section is an example for writing a very simple User Defined Function Block that adds two numbers. This section will give a detailed explanation for each step as the development of the UDFB continues. Selecting a Resource The first step in writing a UDFB is to open a resource. UDFBs are tied to specific resource platforms because of hardware and target operation system specific dependencies.
Chapter 11: User Defined Function Blocks LogicPro User’s Guide Figure 11.8 ADD1 Function Block Use the following steps to define the UDFB: 1. Select File. 2. Select New. 3. Select User Defined Function Block. The Add UDFB dialog box appears. 4. Enter Example 1 Add as the Long Name in the Long field. 5. Enter ADD1 as the Short Name in the Short field. 6. Click [Insert] in the Inputs group. 7. Name the first input EN and set its Type to Bool. 8. Click [OK]. 9.
LogicPro User’s Guide Chapter 11: User Defined Function Blocks functions. The structure and these three functions are listed in the following example as they are generated by LogicPro.
Chapter 11: User Defined Function Blocks LogicPro User’s Guide typedef struct { int A; int B; int C; bool EN; bool Q; }ADD1Struct; This structure holds all variables that are passed to the Function Block. New members can be added to the end of this structure. These new members will then retain their value even after the function exits. Each instance of the UDFB will have its own separate instance of the structure, so interaction between several instances of the same Function Block can be prevented.
LogicPro User’s Guide Chapter 11: User Defined Function Blocks ADD1StructA->Q = *Q; } else { *Q = 0; } } return 0; } void InitADD1(ADD1Struct *ADD1StructA,Int16 A,Int16 B) { ADD1StructA->A = A; ADD1StructA->B = B; } void ResetADD1(ADD1Struct *ADD1StructA) { } void ExitADD1(ADD1Struct *ADD1StructA) { } Doc.# 28002-00 Rev 3.
Chapter 11: User Defined Function Blocks 184 LogicPro User’s Guide Watlow Anafaze Doc.# 28002-00 Rev 3.
12 Input/Output Drivers Logic program variables may be internal or they may hold and set values associated with physical I/O, closed-loop control parameters or other memory registers. Internal variables are not available to the closed-loop control program, AnaWin, an OIT or any other Human Machine Interface (HMI) software. Internal variables are only available to the logic program and the LogicPro programming and monitoring package.
Chapter 12: Function Blocks LogicPro User’s Guide NOTE! If an output Variable in a logic Program sets a value using an IO Driver and IO Physical Address, the associated register in the controller cannot be written to by the closed-loop control program, an HMI, or any other device. Variable Types Variables in a logic program can be declared to be one of four types. Table 12.1 describes the options for Variable Type. Table 12.
LogicPro User’s Guide Chapter 12: Function Blocks Input/Output In order to associate a variable with an I/O point or a closedloop control parameter, you must select either Input or Output in the Add Program/Resource Variable dialog box. Table 12.2 describes these options. Table 12.2 Input and Output Option Description The value of the I/O point or closed-loop control parameter is read but not changed by the logic program.
Chapter 12: Function Blocks LogicPro User’s Guide PPC-2000 IO Drivers IO Driver Choice The IO Driver allows the logic program to examine or set an I/O value or other value stored in the database. Choose the appropriate driver for the value which you want to access. Table 12.4 describes what data can be accessed with each IO Driver. Table 12.
LogicPro User’s Guide Chapter 12: Function Blocks Guide lists the addresses for each I/O point. AnaWin includes the IO Physical Address in the names that appear in the SpreadSheet Overview screen. In general there are three types of I/O drivers. Table 12.5 lists the IO Drivers in the categories that characterize the IO Physical Addresses used with them. Table 12.
Chapter 12: Function Blocks LogicPro User’s Guide The module address is determined by the rotary switch setting on the face of the module with the exception of the processor module which has address zero. The module I/O number is generally the number on the terminal to which the I/O device is attached, but see the PPC-2000 User’s Guide to be certain. The I/O type in the address is a digit that indicates the type of I/O addressed. Used when addressing I/O in modules that handle more than one type.
LogicPro User’s Guide Chapter 12: Function Blocks parameter number and its database offset. See Table 12.9 for a description of this syntax. Table 12.9 Address Syntax for Database Driver Syntax Used with this IO Driver #.D # = Parameter Number D = Database Offset Database The parameter number is a numeric identifier used to address a closed-loop control parameter. Each parameter in the PPC-2000 has a parameter number.
Chapter 12: Function Blocks LogicPro User’s Guide Using the IO Drivers The following sections describe and illustrate the use of each IO Driver. Processor_2010 The Processor_2010 driver supports the digital I/O on board the PPC-2010 Processor module. To associate a variable with a digital I/O point: 1. Open the Add Program/Resource Variable dialog box. 2. Enter a unique variable Name. 3. Select BOOL from the Type list. 4. Select Input or Output by clicking the corresponding check box. 5.
LogicPro User’s Guide Chapter 12: Function Blocks PPC-2010 Processor Module Addressing Example To create a variable named My_Dig_Out that sets the value of the 23rd output on a PPC-2010 module, set the options in the Add Program/Resource Variable dialog box as illustrated below. NOTE! The PPC-2010's module address is 0 (zero). Analog_In_202x The Analog_In_202x driver supports the inputs on the PPC-202x series Analog In modules: To associate a variable with an analog input: Doc.# 28002-00 Rev 3.00 1.
Chapter 12: Function Blocks LogicPro User’s Guide PPC-2020 Analog In Module Addressing Example To create a variable named My_Input_Var that reads the value of the fourth thermocouple on a PPC-2021 module with its rotary address switch set to 3, set the options in the Add Program/Resource Variable dialog box as illustrated below. Encoder_Analog_2030 The Encoder_Analog_2030 driver supports the inputs and outputs on PPC-2030 Encoder In Analog Out Module.
LogicPro User’s Guide Chapter 12: Function Blocks PPC-2030 Encoder In Analog Out Addressing Example To create a variable named CountIn_3 that reads the count on the third input on a PPC-2030 module with its rotary address switch set to 14, set the options in the Add Program/Resource Variable dialog box as illustrated below. Digital_IO_2040 The Digital_IO_2040 driver supports the inputs and outputs on the PPC-2040 Digital IO Module. To associate a variable with a digital I/O point: Doc.# 28002-00 Rev 3.
Chapter 12: Function Blocks LogicPro User’s Guide To associate a variable with a counter input: 1. Open the Add Program/Resource Variable dialog box. 2. Enter a unique variable Name. 3. Select INT from the Type list. 4. Select Input by clicking the check box. 5. Select Digital_IO_2040 from the IO Driver list. 6. Select WORD from the IO Size list. 7. Enter the IO Physical Address. The address is: X.Y.
LogicPro User’s Guide Chapter 12: Function Blocks Analog_Out_205x The Analog_Out_205x driver supports the outputs on the PPC-205x series Analog Output modules. To associate a variable with an analog output: 1. Open the Add Program/Resource Variable dialog box. 2. Enter a unique variable Name. 3. Select INT from the Type list. 4. Select Output by clicking the check box. 5. Select Analog_Out_205x from the IO Driver list. 6. Select WORD from the IO Size list. 7. Enter the IO Physical Address.
Chapter 12: Function Blocks LogicPro User’s Guide Digital_Out_206x The Digital_Out_206x driver supports the relay outputs on the PPC206x Digital Out series modules. To associate a variable with a relay output: 1. Open the Add Program/Resource Variable dialog box. 2. Enter a unique variable Name. 3. Select BOOL from the Type list. 4. Select Output by clicking the check box. 5. Select Digital_Out_206x from the IO Driver list. 6. Select BIT from the IO Size list. 7.
LogicPro User’s Guide Chapter 12: Function Blocks Digital_In_207x The Digital_In_207x driver supports the inputs on the PPC-207x Digital In series modules. To associate a variable with a digital input: 1. Open the Add Program/Resource Variable dialog box. 2. Enter a unique variable Name. 3. Select BOOL from the Type list. 4. Select Input by clicking the check box. 5. Select Digital_In_207x from the IO Driver list. 6. Enter the IO Physical Address. The address is: X.
Chapter 12: Function Blocks LogicPro User’s Guide Setpoint A channel’s setpoint can be used in logic programs by creating a variable in the logic program that points to this controller parameter as if it were physical I/O. This allows the logic program to examine or set value of a setpoint. The I/O address for a setpoint is constructed from the channel number only. To associate a variable with a loop setpoint: 1. Open the Add Program/Resource Variable dialog box. 2. Enter a unique variable Name. 3.
LogicPro User’s Guide Chapter 12: Function Blocks Soft_Input A logic program can generate an analog input to a closed-loop control channel. To do so, output a value to one of the 50 Soft Input registers and select that register as the PV Source for the channel. To associate a variable with a soft input: 1. Open the Add Program/Resource Variable dialog box. 2. Enter a unique variable Name. 3. Select INT from the Type list. 4. Select Output by clicking the check box. 5.
Chapter 12: Function Blocks LogicPro User’s Guide Soft_Bool A Soft Bool can be used in logic programs by creating a variable in the logic program that points to the Soft Bool as if it were physical I/O. This allows the logic program to examine and set values of Soft Bools. For example, an HMI program could allow a user to set a software switch that is read by and affects the operation of a logic Program. The I/O address for Soft Bools is the Soft Bool number. To associate a variable with a Soft Bool: 1.
LogicPro User’s Guide Chapter 12: Function Blocks Soft_Int A Soft Int can be used in logic programs by creating a variable in the logic program that points to the Soft Int as if it were physical I/O. This allows the logic program to examine and set values of Soft Ints. For example, a Soft Int could be used to allow a user to set a timer preset in a logic Program. The I/O address for a Soft Int is the Soft Int number. To associate a variable with a Soft Int: 1.
Chapter 12: Function Blocks LogicPro User’s Guide Database The Database I/O Driver is used to examine or set values for any closed-loop control parameter not supported by one of the other drivers. The specific parameter value is addressed with the parameter number and its database offset. To associate a variable with a value in the database: 1. Open the Add Program/Resource Variable dialog box. 2. Enter a unique variable Name. 3. Select INT or BOOL from the Type list. 4.
LogicPro User’s Guide Chapter 12: Function Blocks Analog Input Parameter Example To create a variable named Filter_PF1 that sets the input filter for the frequency input on the processor module, set the options in the Add Program/Resource Variable dialog box as illustrated below. The parameter number for input filter is 61. The database offset, 162, is found in the PPC-2000 User's Guide. Doc.# 28002-00 Rev 3.
Chapter 12: Function Blocks LogicPro User’s Guide Digital I/O Parameter Example To create a variable named InOrOut_5 that examines the direction parameter setting for the fifth I/O point on the processor module, set the options in the Add Program/Resource Variable dialog box as illustrated below. The parameter number for direction is 132. The database offset, 5, is found in the PPC-2000 User's Guide. 206 Watlow Anafaze Doc.# 28002-00 Rev 3.
LogicPro User’s Guide Chapter 12: Function Blocks Global Parameter Example To create a variable named Ambient_1 that reads the ambient temperature at the first cold junction compensation sensor on the first Analog In module, set the options in the Add Program/ Resource Variable dialog box as illustrated below. The parameter number for ambient temperature is 140. The database offset, 1, is found in the PPC-2000 User's Guide. Doc.# 28002-00 Rev 3.
Chapter 12: Function Blocks LogicPro User’s Guide CPC400 IO Drivers IO Driver Choice The IO Driver allows the logic program to examine or set an I/O value or other value stored in the database. Choose the appropriate driver for the value which you want to access. Table 12.10 describes what data can be accessed with each IO Driver. Table 12.10 Data Accessed by the IO Drivers IO Driver Data Accessed Process variable (scaled analog input) value for any channel. State of any digital input.
LogicPro User’s Guide Chapter 12: Function Blocks The following sections describe the address syntax used with each category of IO Driver. Hardware Specific Drivers The hardware IO drivers are used to access digital I/O states and process variable values. The specific IO value is addressed by number. Table 12.12 lists the hardware specific drivers and the corresponding database offset ranges. Table 12.
Chapter 12: Function Blocks LogicPro User’s Guide Table 12.14 Address Syntax for Database Driver Syntax Used with this IO Driver #.D # = Parameter Number D = Database Offset Database Two types of parameters are accessed using the Database I/O driver: Channel and Global. The following sections describe how to determine the database offsets to be used to access each of these types of parameters.
LogicPro User’s Guide Chapter 12: Function Blocks NOTE ! 3. Select INT from the Type list. 4. Select Input by clicking the check box. A variable using the CPC400_PV driver should always be an input an never an output. To set the input to a loop with a logic program, use a soft input. 5. Select CPC400_PV from the IO Driver list. 6. Select WORD from the IO Size list. 7. In IO Physical Address field, enter the channel number (1 to 5 for CPC404; 1 to 9 for CPC408). 8.
Chapter 12: Function Blocks LogicPro User’s Guide CPC400_Digital_In The CPC400_Digital_In driver allows a logic program to access the state of each of the digital inputs. To read a digital input with a logic program variable: NOTE! 1. Open the Add Program/Resource Variable dialog box. 2. Enter a unique variable Name. 3. Select BOOL from the Type list. 4. Select Input by clicking the check box. A variable using the CPC400_Digital_ln driver should always be an input and never an output. 5.
LogicPro User’s Guide Chapter 12: Function Blocks CPC400_Digital_Out The CPC400_Digital_Out allows a logic program to access the state of each of the digital outputs. To read or set a digital output with a logic program variable: 1. Open the Add Program/Resource Variable dialog box. 2. Enter a unique variable Name. 3. Select BOOL from the Type list. 4. Select Input or Output by clicking the corresponding check box. 5. Select CPC400_Digital_Out from the IO Driver list. 6.
Chapter 12: Function Blocks LogicPro User’s Guide Setpoint A setpoint can be used in a logic program by creating a variable in the logic program that points to the setpoint parameter as if it were physical I/O. This allows the logic program to examine or set the value of a setpoint. The I/O address for Setpoint is constructed from the channel number only. To read or set a setpoint with a logic program variable: 1. Open the Add Program/Resource Variable dialog box. 2. Enter a unique variable Name. 3.
LogicPro User’s Guide Chapter 12: Function Blocks Soft_Input A logic program can generate an analog input to a closed-loop control channel. To do so, output a value to one of the Soft Input registers and enable the soft input for use on the channel. To set a Soft Input with a logic program variable: 1. Open the Add Program/Resource Variable dialog box. 2. Enter a unique variable Name. 3. Select INT from the Type list. 4. Select Output by clicking the check box. 5.
Chapter 12: Function Blocks LogicPro User’s Guide Soft_Bool A Soft Bool can be used in logic programs by creating a variable in the logic program that points to the Soft Bool as if it were physical I/O. This allows the logic program to examine and set values of Soft Bools. The I/O address for Soft Bools is the Soft Bool number. To read or set a Soft Bool with a logic program variable: 1. Open the Add Program/Resource Variable dialog box. 2. Enter a unique variable Name. 3.
LogicPro User’s Guide Chapter 12: Function Blocks Soft_Int A Soft Int can be used in logic programs by creating a variable in the logic program that points to the Soft Int as if it were physical I/O. This allows the logic program to examine and set values of Soft Ints. The I/O address for a Soft Int is the Soft Int number. To read or set a Soft Int with a logic program variable: 1. Open the Add Program/Resource Variable dialog box. 2. Enter a unique variable Name. 3. Select INT from the Type list.
Chapter 12: Function Blocks LogicPro User’s Guide Database The Database I/O Driver is used to examine or set values for any closed-loop control parameter not supported by one of the other drivers. The specific parameter value is addressed with the parameter number and its database offset. To associate a variable with a value in the database: 1. Open the Add Program/Resource Variable dialog box. 2. Enter a unique variable Name. 3. Select INT or BOOL from the Type list. 4.
LogicPro User’s Guide Chapter 12: Function Blocks Channel Parameter Example To create a variable named Mode_5 that sets the control mode for channel 5, set the options in the Add Program/ Resource Variable dialog box as illustrated below. The parameter number for control mode is 7. Control mode is a channel parameter, so the database offset is the channel number, 5. Doc.# 28002-00 Rev 3.
Chapter 12: Function Blocks LogicPro User’s Guide Global Parameter Example To create a variable named Ambient that reads the ambient temperature at the cold junction compensation sensor, set the options in the Add Program/Resource Variable dialog box as illustrated below. The parameter number for ambient temperature is 34. The database offset, 1, is found in the CPC400 User’s Guide. 220 Watlow Anafaze Doc.# 28002-00 Rev 3.
13 Compiler Setup LogicPro uses the Borland C++ 4.0 compiler, both for simulation and for logic programs down loaded to a controller. Setting up the Compiler The compiler configuration tells LogicPro the location (path) of the compiler, linker and library executables along with the Include and Library paths. Installation sets up the compiler paths. Under most circumstances, the default settings are adequate. If the paths need to be modified, use the following procedure to define the compiler paths: 1.
Chapter 13: Understanding Compilers LogicPro User’s Guide 3. Click [Setup]. This causes the Compiler Paths dialog box to open, as shown in Figure 13.2. Figure 13.2 Compiler Paths 4. Click the [Open] button or the [Copy Field] button to the right of the Compiler, Linker or Library field you want to configure. This will cause the corresponding Select Compiler dialog box to open. See Figure 13.3. Figure 13.3 Select Borland Compiler 222 Watlow Anafaze Doc.# 28002-00 Rev 3.
LogicPro User’s Guide Chapter 13: Understanding Compilers 5. Select a new path for the executable from the Files list box. 6. Repeat from Step 4 as necessary for the Linker and Library. 7. You may enter values into the Include Path and Library Path fields by typing them directly into the dialog box. If the same path exists for the Compiler, Linker and Library you can update all of the path fields by clicking the [Copy Field] button. Doc.# 28002-00 Rev 3.
Chapter 13: Understanding Compilers 224 LogicPro User’s Guide Watlow Anafaze Doc.# 28002-00 Rev 3.
14 Simulation LogicPro allows you to simulate your control logic program without the need for a controller. After you have completed writing your application program and before you load to a target resource, Simulation allows you to test it for problems. This is a simple process and does not require you to make changes to any of the I/O assignments, resource definitions, or resource setups. Building a Simulation causes LogicPro to generate and compile code to create a Windows Dynamic Link Library (DLL).
Chapter 14: Simulation LogicPro User’s Guide Building a Program for Simulation The LogicPro Simulation feature allows you to scan, step through and view individual processes in several ways from start to finish. LogicPro allows you to scan your program one time, ten times, one hundred times or in a continuous (free running) mode. You can also toggle all of your Boolean variables, change constants and assign values to all variables.
LogicPro User’s Guide Chapter 14: Simulation Figure 14.1 Compiler Dialog Box Figure 14.2 Borland C++ Compiler DOS window Using the Simulation Tools When in the Simulation mode, LogicPro will enable the Simulation tools on the Standard toolbar. Normally, these buttons are grayed out and unavailable. You must be in a Simulation before these buttons are available to you. Table 14.1 on page 228 lists all of the buttons and their corresponding functions. Doc.# 28002-00 Rev 3.
Chapter 14: Simulation LogicPro User’s Guide Table 14.1 Simulation Tools This Button... Performs This Function... Simulation Setup Increment Simulation Timer Ticks Scan Simulation Logic Simulation Reset Change Simulation Variables Simulation Setup To set up timers and scan rates: 228 1. Select the Simulation menu. 2. Select Simulation Setup – or – Click the [Simulation Setup] tool. This will cause the Simulation Setup dialog box to open, as shown in Figure 14.3 on page 229. 3.
LogicPro User’s Guide Chapter 14: Simulation Figure 14.3 Simulation Setup Dialog Box In the continuous scan mode, your program is free running but not in real time. The Timer Tick increases by the value you choose in the simulation setup. This allows you to multiply how much your program increments in time for each scan. The Timer Tick setting has the same effect on your simulation, regardless of the scan mode selected.
Chapter 14: Simulation LogicPro User’s Guide Increment Simulation Timer Ticks Clicking the [Increment Simulation Timer Ticks] button allows you to multiply the active Timer Ticks setting by a factor of (n+1) where n = the number of times you click the button. This only effects the next Scan cycle. For example, consider a Timer On Function Block.
LogicPro User’s Guide Chapter 14: Simulation Resetting the Simulation During simulation, you may wish to test several scenarios. LogicPro lets you reset the simulation and start over. Recompiling the simulation code is unnecessary. By resetting the simulation all variables and constants will return to their original values. However, the simulation will retain all of the set up characteristics you have already created. To reset the simulation: 1. Select the Simulation menu. 2.
Chapter 14: Simulation LogicPro User’s Guide Variables whose values are determined by the program will not retain values set in the Change Variables dialog box. Logic scans will overwrite these variables’ values. NOTE! If you are not in the continuous scan mode, the logic will not reflect the changes to a variable until a scan takes place. Therefore, to see the effects you must trigger at least one scan cycle.
LogicPro User’s Guide Chapter 14: Simulation Viewing Individual Steps and Actions within a Simulation In an SFC diagram, double-clicking on the Action to the right of the step opens a window displaying this Action in simulation mode. This works regardless of the programming language used in the Action. If the Action is another SFC, you can continue to drill down and see more detail. Each time you double-click on the Action another window opens.
Chapter 14: Simulation 234 LogicPro User’s Guide Watlow Anafaze Doc.# 28002-00 Rev 3.
15 Downloading and Monitoring Executable LogicPro converts your control logic program into a binary executable program. This program is in the form of a DOS “.exe”. This file is converted to a hex file and is then downloaded to the controller and run. Downloading to a controller through an RS-232 Port To download the executable program generated by LogicPro, follow this simple procedure. 1. 2. If downloading to a PPC-2000 controller: a. Set the control mode for each channel to Off. b.
Chapter 15: Downloading & Monitoring NOTE! LogicPro User’s Guide The port is identified when setting up a resource. The port must be set correctly before building and compiling executable code for a resource. See Editing a Resource on page 36 in order to verify or change the communications port selection. 4. Select Execution menu. 5. Select Build All and Run – or – Click on the [Build All and Run] tool.
LogicPro User’s Guide Chapter 15: Downloading & Monitoring 5. You can start and stop the runtime executable by clicking the [Start Executable] tool – or – [Terminate] tool. 6. The Preparing for downloading box will open during the preparation period of the download. Next, the Downloading box will display. See Figure 15.1. Figure 15.
Chapter 15: Downloading & Monitoring NOTE! LogicPro User’s Guide Before you can use the monitor function you need to compile and download your program to a resource. 3. LogicPro displays the most recently downloaded program window. The flashing green dot on the right side of the Status-Bar indicates that LogicPro is actively communicating with the target resource.
LogicPro User’s Guide Chapter 15: Downloading & Monitoring NOTE! Having too many monitoring windows open at the same time can cause performance degradation. If this happens, close some of the monitoring windows or turn Monitoring Off for some of these windows. Monitoring Sequential Function Charts LogicPro identifies the active step in the running SFC by highlighting it in green, see Figure 15.3. Figure 15.
Chapter 15: Downloading & Monitoring LogicPro User’s Guide Function blocks with variables assigned to Inputs or Outputs show the variables' current values. Figure 15.4 Monitoring Ladder Diagrams Monitoring Function Block Diagrams In a Function Block Diagram, only the variables change color to indicate activity. When a Boolean element is true (has a value of 1) that element is highlighted in green. Otherwise, monitoring an FBD program is the same as monitoring a Ladder program.
LogicPro User’s Guide Chapter 15: Downloading & Monitoring [Force On]. The value of 1 is given to the variable, forcing it on. A green square appears around the object. • [Force Off]. The value of 0 is given to the variable, forcing it off. A red square appears around the object. • [Clear Force]. Any forcing that the variable may have is removed. Click [OK]. The changes take effect accordingly. • 3. NOTE! Forcing is not supported in function block diagrams. Figure 15.
Chapter 15: Downloading & Monitoring LogicPro User’s Guide Configuring Variable Watch Variable Watch gets its data from FastLink, a separate communications program. Use LogicPro to configure FastLink. NOTE! 1. If you have made changes or switched communications ports on the PC since you last compiled and downloaded the program, select Build All and Run from the Execution menu. 2. Select FastLink Config from LogicPro’s Option menu. The FastLink Configuration dialog box appears. 3. Enter the .
LogicPro User’s Guide Chapter 15: Downloading & Monitoring 2. Choose Select Grid from the View menu. 3. Select the check box next to each variable whose properties and status that you want to view. A small red check mark appears in each selected box. 4. Select Watch Grid from the View menu. The Variable Watch Window displays the values and other properties of variables that you selected. Changing the Value of a Variable To change the value of a variable: 1.
Chapter 15: Downloading & Monitoring LogicPro User’s Guide 4. Select the check box in the Select column next to the variables you want to monitor in the Watch Grid. 5. Select Watch Grid from the View menu. 6. In the Watch Grid, right click on a variable. 7. Select Force ON to force a variable on, Force OFF to force a variable off, or Clear Force to clear the forcing of the variable.
LogicPro User’s Guide Chapter 15: Downloading & Monitoring Figure 15.6 The Watch Grid in the Variable Watch Window Table 15.1 The Columns in the Watch Grid Column Description The name of the variable. In Variable Watch, the variable name contains the resource name, program name, and name that you gave the variable in your program – each separated by a dot. Variable For example, for the variable SORTER.SIZER.Always_True: SORTER is the resource. SIZER is the program.
Chapter 15: Downloading & Monitoring LogicPro User’s Guide Column Description Input/Output address of the variable. In Variable Watch, the variable I/O address contains the following elements: I/O Address • • • • Type of variable: I for input Q for output Size: X for bit B for byte W for word • • Comments Initial Retained IO Physical Address Driver name For example, an I/O address in Variable Watch could be: IQ.X.0.0.2:Processor_2010.
LogicPro User’s Guide Chapter 15: Downloading & Monitoring 2. Select the variable you want to modify. 3. Enter the new value in the New Value field. 4. Click [OK] to send the new values to the controller – or – [Cancel] to abort these changes. The program window now displays the new constant values. Figure 15.7 On-Line Function Block Variables Change Dialog Box The change to the constant is made temporarily in the runtime program, not in the LogicPro program.
Chapter 15: Downloading & Monitoring 248 LogicPro User’s Guide Watlow Anafaze Doc.# 28002-00 Rev 3.
16 Cross-Referencing Cross-referencing helps you to debug your application Programs. You can also use cross-referencing to document Programs and track the locations of Variables and Program elements. Cross-referencing is the equivalent of a search command for graphical control Programs. You can use both on-line and offline Print Functions. You can customize printed output to show only the information you need. Using Cross-Referencing Cross-referencing is available in all three programming languages.
Chapter 16: Cross-Referencing LogicPro User’s Guide 4. You can minimize and move the Cross Reference dialog box so that you can view and edit portions of the Program. If you change the Program or Variables, the Cross Reference dialog box data is not updated until you close and then reopen the dialog box. 5. Click [Print] to print the on-line cross-reference listing. 6. Click [OK] to close the dialog box. XRF Figure 16.
LogicPro User’s Guide Chapter 16: Cross-Referencing Function Block Diagram On-line Cross-Reference To perform a FBD On-line cross-reference, while in an FBD window: 1. Select the Tools menu. 2. Select Cross Reference - or Click the [Cross Reference] button on the toolbar. The standard pointer changes into a modified pointer, as shown in Figure 16.1 on page 250. 3. Click on a Variable for which you want to view a crossreference. The Cross Reference dialog box appears.
Chapter 16: Cross-Referencing LogicPro User’s Guide Each SFC and Ladder Rung is listed on a separate line. The items on each of the lines are: • • • • The name of the Program in which this Variable is used. The action in which this Variable is used. There may be more than one action on a line. The rung number in which the Variable is located. For Ladder Rungs, LogicPro displays either the type of Element or name of the Function Block for each Variable used.
LogicPro User’s Guide Chapter 16: Cross-Referencing Output Printing You can print the on-line cross-reference display by selecting [Print] in the Cross Reference Display dialog box. This method of printing is discussed in Using Cross-Referencing on page 249. You can also print Program documentation that includes the cross-reference. To print Program documentation including the crossreference: 1. Select the File menu. 2. Select Print. 3. The Print dialog box appears, as shown in Figure 16.2. 4.
Chapter 16: Cross-Referencing LogicPro User’s Guide Report Setup In the Report Setup dialog box, as shown in Figure 16.3 on page 254, you can select: • • • • • • • • • What Variable information is printed in the crossreference Variable codes, by using Variables Setup. Ladder documentation, by selecting Ladder. Specific information included in the Ladder documentation output, by clicking the Ladder Setup button. SFC documentation, by selecting SFC.
LogicPro User’s Guide Chapter 16: Cross-Referencing Variables Setup In the Variables Setup dialog box, as shown in Figure 16.4 on page 255, check the boxes corresponding to the information to be included in the Variable Report: • • • • • • If comments about the Variable are included on the line after the Variable code, by selecting Comment. If the Initial Value for the Variable is included, by selecting Initial Value. If the I/O Address for the Variable is included, by selecting I/O Address.
Chapter 16: Cross-Referencing LogicPro User’s Guide • If Cross Reference is checked, choose whether the All Elements or only Coils are included in the crossreference output. LogicPro automatically resizes Ladder diagrams to fit the page. This results in smaller images. Figure 16.5 Ladder Setup Dialog Box SFC Setup In the SFC Setup dialog box, as shown in Figure 16.6, you can select what information is included in reports for each SFC.
LogicPro User’s Guide Chapter 16: Cross-Referencing FBD Setup In the FBD Setup dialog box, as shown in Figure 16.7, you can select what information is included for each SFC. For example, you can specify: • • If the FBD graphic is output, by selecting Graphic. If a cross-reference of the Variables in the FBD is output, by selecting Cross Reference. Figure 16.7 FBD Setup Dialog Box Doc.# 28002-00 Rev 3.
Chapter 16: Cross-Referencing 258 LogicPro User’s Guide Watlow Anafaze Doc.# 28002-00 Rev 3.
17 Dynamic Data Exchange Dynamic Data Exchange (DDE) is a communication protocol designed to allow Windows applications to send and receive data and instructions to other Windows applications. Dynamic Data Exchange takes place between a client application and a server application. The client initiates the exchange by establishing a conversation with the server so that it can send transactions (requests for data or service) to the server. The server responds by providing the requested data or services.
Chapter 17: Dynamic Data Exchange LogicPro User’s Guide • • Topic name — is a string that identifies a logical data context. For LogicPro, this is a unique name that identifies the resource. The actual resource is defined in the .DDE file. The client application must specify a topic name along with a service name when it attempts to establish a conversation with a server. Item name — is a string that identifies a logical data context. Items can be any pre-defined symbolic Variable name.
LogicPro User’s Guide Chapter 17: Dynamic Data Exchange 3. Enter a time in milliseconds in the Update Interval field. This field sets up an internal timer that acts as the time base for polling the controller for Program status. 4. For example, if the Update Interval is set at 3 milliseconds, the LogicPro DDE Server polls the controller and reads the data every 3 milliseconds. 5. Check the Load Default Topic on Start-up box. 6. Click [Setup].
Chapter 17: Dynamic Data Exchange LogicPro User’s Guide • • • The symbolic name. Type of Variable (BOOL=0, INT=1, REAL=2). A Program index. The Variable names are the same as the item names used by other application Programs to make requests through the DDE Server. NOTE! Do not modify this file. LogicPro will make any corrections as they are needed. For more detailed information, refer to Chapter 6, Variables.
LogicPro User’s Guide Chapter 17: Dynamic Data Exchange Open a Topic To Open a topic: 1. Select the Topic menu. 2. Select Open Topic. The Select DDE Topic dialog box appears. 3. Choose the topic you want to use from the list. 4. Click [OK]. Only one topic can be open at a time. Once the topic is selected, the LogicPro DDE server is ready to run. At this point, the necessary configuration is read from the .FPR file and all hardware is initialized. Close a Topic To Close a topic: 1.
Chapter 17: Dynamic Data Exchange NOTE! LogicPro User’s Guide Once the topic is deleted, it cannot be recovered. Make sure you really want to delete the topic before you do so. Item Point Naming In LogicPro, an item is a symbolically named Variable. Items can be read or written to through the LogicPro DDE server with the exception of real world I/O points. If the values of these points are changed by the LogicPro DDE Server, the scan loop of the controller will overwrite these changes.
LogicPro User’s Guide Chapter 17: Dynamic Data Exchange Figure 17.1 Example 1 NOTE! Before you can open LogicPro, you must close the DDE Server. Before downloading the Example1 Program, make sure that the resource is set to the correct platform. To download the Example 1 Program: Doc.# 28002-00 Rev 3.00 1. Open the LogicPro Development Environment. 2. Select the Execution menu. 3. Select Build All and Run. 4. LogicPro compiles the Program and automatically downloads it to the target platform.
Chapter 17: Dynamic Data Exchange NOTE! LogicPro User’s Guide You must exit LogicPro to free the communication channel or an error box will appear when the LogicPro DDE is started. Setting Up Excel to Read Using the spreadsheet as a sample, the DDE Server reads the Variables and places their values in the specified cells. The spreadsheet reads Variables and shows a chart reflecting those values, as shown in Figure 17.2. Figure 17.
LogicPro User’s Guide Chapter 17: Dynamic Data Exchange The A1 cell will contain the following string: =LP_DDE|TOPIC1!DR1 NOTE! Doc.# 28002-00 Rev 3.00 The topic and server names are delimited by a pipe ( | ). The topic and item name are delimited by an exclamation point ( ! ). For more information on using Microsoft Excel and Dynamic Data Exchange, see your Microsoft Excel documentation.
Chapter 17: Dynamic Data Exchange 268 LogicPro User’s Guide Watlow Anafaze Doc.# 28002-00 Rev 3.
Glossary A ASCII File Action A text file in which each byte is equivalent to a character as defined in ASCII. Sometimes referred to as plain text files. An operation performed in a control process as part of the SFC step. Active Window Associate The window receiving active input from the mouse and keyboard. Linking a data file with an application. In MS-DOS and Windows environments the three letter extension forms the basis for association. For instance the “.
Glossary LogicPro User’s Guide Bitwise Button A logic tool that allows you to apply the principles of Boolean Logic to the individual bits of a byte. Not all programming languages support bitwise logic, but C does support a handful of operators: Item on the toolbar (such as a step or function block) that can be selected for insertion into the process control Program. Toolbar buttons remain active until another button is selected.
LogicPro User’s Guide Glossary Click, Double Compiler Click twice in rapid succession, usually with the left mouse button of your pointing device. Computer program (such as Borland C++) that generates machine language code that is eventually loaded onto the Resource controller. Click, Left COM Port Depressing the left mouse button on your mouse or pointing device. A computer interface used for connecting and communicating with external devices.
Glossary LogicPro User’s Guide Cross Reference Directed Links LogicPro feature that enables the developer to view the settings of variables to help discover logic or Program errors. SFC element which, with transitions, directs the Program flow from one step to another. DLL Current Directory An acronym for Dynamically Linked Library. This is the directory in which you are currently working.
LogicPro User’s Guide Glossary Executable File File Extension The output of compiled source code or object code which can be read and executed directly by a computer processor. In Microsoft Disc Operating System, this refers to the three characters following the “.” in a file name. For example, “txt” is the file extension for the file named “readme.txt.” Executable Path Operating System Path where the Executable File resides.
Glossary LogicPro User’s Guide and Mac-OS are two popular examples of a Graphic User Interface (GUI). Graphical Language IEC The International Electrotechnical Commission. Import Variables A programming language that makes extensive use of graphic symbols for easier programming. This allows you to draw a Program, instead of coding one. LogicPro supports Ladder, SFC and FBD Graphical Language. Retrieving saved Variables from a reusable text file for LogicPro Programs, Projects or Resources.
LogicPro User’s Guide Glossary Language Message Box A system for communicating instructions to a computer using a defined syntax. There are several major types of languages used by computers: machine, programming and fourth-generation are examples of a few of these language types. A small box that appears on the screen to advise you of a problem or potentially dangerous operation. Library MIN SCAN Minimum Value Variable.
Glossary LogicPro User’s Guide O Path Object The location of a file in relationship to the various directories and subdirectories that tie it to the root directory. In a GUI environment, this is an element that you can select and manipulate. Operators A symbol used in an expression to represent an action. For example, in the expression z + 7 the “+” is an operator representing addition, while the “z” and “7” are operands.
LogicPro User’s Guide Glossary Project Variables Resource Variables that are available to all the Resources and Programs in a Project. Hardware controller which operates the process once the C code generated by the LogicPro Program is loaded. Pull-down menu A command menu specific to each major LogicPro function which drops down from the Menu Bar when selected. Resource Variables Variables that are available to all the Programs written for a particular Resource.
Glossary LogicPro User’s Guide Select Standard Toolbar The act of picking (or highlighting) which object you want to manipulate in a GUI environment. Screen item below the menu bar displaying buttons which execute commands. Selection State A highlighted (or picked) object. See Select. A description of the logical time dependent existence of a process.
LogicPro User’s Guide Glossary TCP/IP Address Transition The Transmission Control Protocol/Internet Protocol is a standard for computer network data transmissions developed by the U.S. Department of Defense. The address identifies a unique machine connected to a network. Decision point in an SFC program that determines which step should be active. Text Editor A Program used to edit text files that does not insert characters other than those defined under ASCII.
Glossary LogicPro User’s Guide V Variable The part of a Program that can be used to store data. Variables can represent the state of physical inputs and outputs, user settings or data, or states internal to the Program. W Windows When spelled with a capital “W” Windows refers to any of the Microsoft Windows programs (Windows 3.1, for Workgroups, Win 95 and NT 4.0). Generically, windows are part of a graphical user interface used to display information and accept input from users.