Document No. 9720064-001 Rev. 1.1 Printed in the United States of America.
CONTENTS
Chapter 1
Introduction ................................................................................ 17 About This Manual ....................................................................................... 18 Summary of Chapters .............................................................................. 18 Document Conventions ............................................................................... 20 User Experience Requirements .................................................................. 21 How to Contact Triconex ............................................................................. Regional Offices ....................................................................................... Triconex Corporate Headquarters ........................................................... Sales Department .................................................................................... Technical Support .................................................................................... Telephone ......................................................................................... Fax .................................................................................................... 24-Hour Bulletin Board System (BBS) ............................................... Triconex Internet Web Page ..............................................................
Chapter 2
22 22 22 22 23 23 23 23 24
A TriStation 1131 Project ........................................................... 25 Programming Languages ............................................................................ Function Block Diagram (FBD) Language ............................................... Ladder Diagram (LD) Language .............................................................. Structured Text (ST) Language ...............................................................
26 26 27 28
Elements of a Project ................................................................................... Projects for TRICON Systems ................................................................. Programs ................................................................................................. Program Instances ............................................................................ Multiple Programs within a Project .................................................... Function Blocks ........................................................................................ Functions ................................................................................................. Data Types ............................................................................................... Elementary Data Types ..................................................................... Generic Data Types .......................................................................... Shared Libraries ....................................................................................... Configuration ............................................................................................ Program Instances ............................................................................ TRICON Point Connections .............................................................. TRICON Hardware Configuration ......................................................
29 29 31 31 31 32 33 34 34 35 36 36 37 37 37
iv
TriStation 1131 Tools ................................................................................... The Project Directory ............................................................................... Language Editors .................................................................................... Multiple Languages in a Project ........................................................ Properties Dialog Box .............................................................................. Basic Editing Tools .................................................................................. Pop-up Menu .................................................................................... Main Menu & Project Toolbar ........................................................... Shortcut Keys .................................................................................... Table of Editing Tools ....................................................................... Enlarged View of Elements ............................................................... Options Menu for Lists ...................................................................... Help System ............................................................................................ TRICON Configuration Editor .................................................................. Control Panels ......................................................................................... TRICON Diagnostic Panel .......................................................................
38 38 39 39 40 40 40 42 42 44 48 49 50 51 51 52
Developing a TriStation 1131 Project ......................................................... Typical Development Approach .............................................................. Partitioning the Project ............................................................................ Sample Project Diagrams ................................................................. Determining the Number of Programs .............................................. Program Instances versus Program Copies ..................................... When to Create Function Blocks ...................................................... When to Create Functions ................................................................ Writing the Logic for Executable Elements .............................................. Selecting Elements & Connecting Wires .......................................... Assigning Properties to Elements ..................................................... Giving Instance Names to Function Blocks ...................................... Including Comments & Annotation .................................................... The Completed Logic ........................................................................ Declaring the Project Configuration ......................................................... Basic Methods .................................................................................. Configuring the TRICON System ...................................................... Declaring Program Instances ............................................................ Declaring TRICON Point Connections .............................................. Using the Connections Wizard .......................................................... Building, Testing & Downloading ......................................................
Function Block Diagram (FBD) ................................................. 71 Basic Methods for Writing Logic ................................................................ 72 FBD Editing Tools ........................................................................................ Pop-up Menu ........................................................................................... For A Selected Element .................................................................... For Any Empty Area .......................................................................... Size/Alignment Commands ............................................................... Main Menu Commands ............................................................................ Shortcut Keys .................................................................................... Table of FBD Tools .................................................................................. Enlarged View of Elements ......................................................................
73 73 73 73 74 75 75 77 82
Manipulating Logic Sheets .......................................................................... 83 Assigning Sheet Properties ...................................................................... 84 Declaring Input, Output & Local Variables ................................................ Properties under the Selected Tab .......................................................... Naming .............................................................................................. Width ................................................................................................. Annotation ......................................................................................... Automatic Naming ............................................................................. Properties under the Declaration Tab ...................................................... Data Type .......................................................................................... Variable Type .................................................................................... Initial Value ........................................................................................ Description ........................................................................................ Declaration Dialog Box ...................................................................... Properties under the Annotation Tab .......................................................
85 85 86 86 86 87 88 89 90 91 91 92 94
Declaring Constants .................................................................................... Properties under the Constant Tab .......................................................... Value, Type & Validate ...................................................................... Width Field ........................................................................................ Annotate Checkbox ........................................................................... Auto Name Feature ........................................................................... Properties under the Annotate Tab ..........................................................
95 95 95 96 96 96 96
Declaring Functions & Function Blocks .................................................... 97 Declaring the Properties of Functions ...................................................... 98 Inputs List .......................................................................................... 98 Output of a Function .......................................................................... 99 Negating Inputs or Outputs ............................................................... 99 Width ............................................................................................... 100 Double-space Option ....................................................................... 100 EN/ENO Parameters ....................................................................... 101 Declaring the Properties of a Function Block ......................................... 102 Fields under the Selected Tab ........................................................ 102 Fields of the Declaration Tab .......................................................... 104
vi
Wire Properties .......................................................................................... 105 Network Dividers ........................................................................................ 106 Comments, Variable Annotation & Macros ............................................. Including Comments .............................................................................. Comment Tab ................................................................................. Style Tab ......................................................................................... Pickup-Drop Tab ............................................................................. Edit Fields Tab ................................................................................ Using Variable Annotation ..................................................................... Annotation for the Entire Project ..................................................... Annotating Individual Variables ....................................................... Using Instance Views ...................................................................... Using Macros ........................................................................................ Inserting Macros into Comments or Annotations ............................ Working with User-Modifiable Macros ............................................ Default Macros for Annotation Boxes .............................................
Ladder Diagram (LD) ............................................................... 121 Basic Methods for Writing Logic .............................................................. 122 LD Editing Tools ........................................................................................ Pop-up Menu ......................................................................................... For A Selected Element .................................................................. For Any Empty Area ........................................................................ Size/Alignment Commands ............................................................. Main Menu Commands ......................................................................... Shortcut Keys .................................................................................. Table of LD Tools .................................................................................. Enlarged View of Elements ...................................................................
123 123 123 123 124 124 125 126 131
Manipulating Logic Sheets ....................................................................... 132 Assigning Sheet Properties ................................................................... 133 Links ............................................................................................................ 134 Power Rails ................................................................................................. 135 Declaring Contacts & Coils ....................................................................... Properties under the Selected Tab ........................................................ Naming ............................................................................................ Width ............................................................................................... Annotation ....................................................................................... Contact Type ................................................................................... Coil Type ......................................................................................... Automatic Naming ...........................................................................
136 136 137 137 137 138 139 140
vii
Properties under the Declaration Tab .................................................... Variable Type .................................................................................. Description ...................................................................................... Declaration Dialog Box .................................................................... Properties under the Annotation Tab .....................................................
141 141 142 143 145
Declaring Local, Input & Output Variables .............................................. Properties under the Selected Tab ........................................................ Naming ............................................................................................ Width ............................................................................................... Annotation ....................................................................................... Contact or Coil Type ........................................................................ Automatic Naming ........................................................................... Properties under the Declaration Tab .................................................... Data Type ........................................................................................ Variable Type .................................................................................. Initial Value ...................................................................................... Description ...................................................................................... Declaration Dialog Box .................................................................... Properties under the Annotation Tab .....................................................
Declaring Constants .................................................................................. Properties under the Constant Tab ........................................................ Value, Type & Validate .................................................................... Width Field ...................................................................................... Annotate Checkbox ......................................................................... Auto Name Feature ......................................................................... Properties under the Annotate Tab ........................................................
156 156 156 157 157 157 157
Declaring Functions & Function Blocks .................................................. Declaring the Properties of Functions .................................................... Inputs List ........................................................................................ Extensible Functions ....................................................................... Output of a Function ........................................................................ Negating Inputs or Outputs ............................................................. Width ............................................................................................... Double-space Option ....................................................................... EN/ENO Parameters ....................................................................... Declaring the Properties of a Function Block ......................................... Fields under the Selected Tab ........................................................ Fields of the Declaration Tab ..........................................................
Structured Text (ST) ................................................................ 181
Chapter 6
Configuration Editor ................................................................ 183 Configuration Tools ................................................................................... Main Menu Commands ......................................................................... Shortcut Keys .................................................................................. Table of Configuration Tools ................................................................. Options Menu for Lists ..........................................................................
184 184 184 186 188
Setting System Parameters ...................................................................... Network Node ........................................................................................ Scan Rate .............................................................................................. Password Required for Download All .................................................... Disable STOP on Operator Keyswitch .................................................. Disable Remote Changes ..................................................................... Note about Time Synchronization .........................................................
Using the Connections Wizard ................................................................. Overview ................................................................................................ Manual Connection ................................................................................ Steps to Follow ................................................................................ Automatic Connection ............................................................................ Automatic Naming .................................................................................. Manual Naming with Automatic Connection .......................................... Viewing Points for Selected Modules ..................................................... Undoing TRICON Point Names & Connections .....................................
213 213 215 215 216 217 217 218 218
Connecting Individual Program Variables ............................................... 219 Building the Configuration ........................................................................ 220 Testing & Downloading .......................................................................... 220 Compare to Last Download ....................................................................... 221 Details Display ....................................................................................... 222 Configuration Differences Report ........................................................... 223 Exporting TRICON Point Properties ......................................................... Selecting Point Type(s) for Export ......................................................... Exporting to a Database or Excel File .................................................... Exporting to a Text File .......................................................................... Sample Steps to Follow .........................................................................
224 225 225 227 228
Importing TRICON Point Properties ......................................................... Rules for Database or Excel Files .......................................................... Rules for Text Files ................................................................................ Required Values for TRICON Point Properties ......................................
229 230 230 232
x
Chapter 7
Sample Steps to Follow ......................................................................... Import Status Messages ................................................................. Linking & Unlinking Import Records ................................................ Import Record Processing ..................................................................... Updating Existing TRICON Points .................................................. Adding New TRICON Points ........................................................... Other Imports ..................................................................................
234 236 237 238 238 239 239
Configuring the TRICON for Event Collection ........................................ Estimating Available Memory ................................................................ Setting Up SOE Blocks ......................................................................... Assigning Event Variables to SOE Blocks ............................................ Designating a Trip Variable (Optional) .................................................. Selecting Monitor Display Options (Optional) ........................................
240 241 242 243 244 245
Control Panels ......................................................................... 247 Control Tools .............................................................................................. Pop-up Menu ......................................................................................... For A Selected Element .................................................................. For Any Empty Area ........................................................................ Main Menu Commands ......................................................................... Shortcut Keys .................................................................................. Table of Control Tools ...........................................................................
248 248 248 248 249 250 251
Operating a Control Panel ......................................................................... Setting up a Monitor Sheet .................................................................... Setting Values for Testing ..................................................................... Enlarging Your View of Elements ................................................... Using the Program Instance Monitor ..................................................... Power Flow in an LD Program Instance ......................................... Sample Steps for Set-up & Use ............................................................
256 257 258 259 260 261 262
Downloading a Project .............................................................................. Download All ......................................................................................... Steps to Follow ............................................................................... Configuration Mismatch .................................................................. Download Change ................................................................................. Guidelines ....................................................................................... Steps to Follow ............................................................................... Allowable Changes ......................................................................... Additional Tips ................................................................................ Controlling & Changing an Existing Project ........................................... Download States ................................................................................... Compare to Last Download ................................................................... Details Display ................................................................................ Configuration Differences Report ....................................................
TRICON Diagnostic Panel ........................................................ 289 Diagnostic Tools ........................................................................................ Main Menu Commands .......................................................................... Shortcut Keys .................................................................................. Table of Diagnostic Tools ......................................................................
290 290 290 292
Overview ..................................................................................................... 294 Sample Steps ......................................................................................... 294 TRICON System Configuration Window .................................................. 297 Chassis Windows ....................................................................................... States of TRICON Slots ......................................................................... Logical & Physical Slot Numbers ..................................................... Status Indicators .................................................................................... OVD State ..............................................................................................
298 299 300 300 301
Fault Identification ..................................................................................... Field Faults ............................................................................................ Alarm Behavior for Load or Fuse Errors .......................................... Power Faults .......................................................................................... Voter Faults ............................................................................................
302 303 303 304 304
System Performance & Project Information ............................................ 305 Output Voter Diagnostics (OVD) ............................................................... 308 Firmware Version Numbers ....................................................................... 309 Collecting TRILOG Events ......................................................................... 310
Chapter 9
System Administration ............................................................ 311 Elements of a Security System ................................................................. Initial Log-in ............................................................................................ Users ...................................................................................................... Privileges ............................................................................................... TRICON Operations ........................................................................ TriStation 1131 Operations ............................................................ Level Names ..........................................................................................
Libraries .................................................................................... 335 Overview ..................................................................................................... 335 Automatically Attached Libraries ............................................................. Standard Library Functions ................................................................... TRICON Library Functions .................................................................... Printing Messages to an EICM Port ................................................
336 336 340 342
Exporting Elements to a Library ............................................................... 344 Importing Libraries to a Project ................................................................ 345 Verifying Library Versions ..................................................................... 345 Deleting Libraries .................................................................................. 345
TRISTATION MSW Corollaries ................................................ 371 Arithmetic & Logic Operators ................................................................... 372 Conditional Statements & Operators ....................................................... 373 Math Functions .......................................................................................... 374 Process Control Functions ....................................................................... 375 TRICON Clock Functions .......................................................................... 376 Fire & Gas Function Blocks ...................................................................... 377 SOE Function Blocks ................................................................................ 378 Gated Access Functions ........................................................................... 378 Peer-to-Peer Communication Functions ................................................. 379 Modbus Functions ..................................................................................... 379 Utility Functions ......................................................................................... 380 Printer Control Functions ......................................................................... 380 System Control Functions ........................................................................ 381 Coils & Contacts in RLL ............................................................................ 382 System Variables ....................................................................................... 385
Appendix D
Appendix E
TÜV Restrictions & Requirements ......................................... 387 General Restrictions .................................................................................. All Safety Systems ................................................................................ ESD Systems ........................................................................................ Fire & Gas Systems ..............................................................................
387 387 389 389
TRICON-Specific TÜV Restrictions .......................................................... Safe Shutdown ...................................................................................... When All I/O Modules in System are Critical .................................. When Some I/O Modules in System are Critical ............................. Disabled Points ..................................................................................... Scan Time & Response Time ................................................................ OVDDISABLE Function Not Allowed .................................................... Download All at Completion of Project .................................................. Use of Peer-to-Peer Function Blocks .................................................... Sending Node ................................................................................. Receiving Node ............................................................................... Class 1 through 5 Restrictions .............................................................. Class 6 Restrictions ............................................................................... Fire & Gas Restrictions .........................................................................
Maintenance Log-on to TRICON ............................................. 401
xv
Appendix F
Peer-to-Peer Communication .................................................. 403 Introduction ................................................................................................ 403 Description of Peer-to-Peer Function Blocks .......................................... TR_USEND Function Blocks ................................................................. TR_USEND Parameters .................................................................. TR_URCV Function Blocks .................................................................... TR_URCV parameters .................................................................... TR_PEER_STATUS for Peer-to-Peer Paths ......................................... TR_PORT_STATUS for NCM Ports ......................................................
404 405 406 411 412 414 415
TR_USEND/TR_URCV Restrictions .......................................................... 417 TR_USEND/TR_URCV Relationship ......................................................... 417 Rules for Correct Usage ............................................................................ 418 Setting the Number of Sends and Receives ............................................ 418 Selecting TRICON Nodes ........................................................................... 420 Precautions ............................................................................................ 420 Rules for Downloading .............................................................................. 421 Data Transfer Time ..................................................................................... 422 Summary of Peer-to-Peer Runtime Errors ............................................... 424 Examples of Peer-to-Peer Applications ................................................... Fast Send to One TRICON Node .......................................................... Sending Data Every Second to One TRICON Node .............................. Controlled Use of TR_USEND/TR_URCV Function Blocks .................. Using TR_USEND/TR_URCV Function Blocks for Safety-Critical Data Sending Node #1 Parameters: ...................................................... Receiving Node #3 Parameters: ...................................................
426 426 426 426 427 427 427
Index ..................................................................................................................... 429
xvi
CHAPTER 1
Introduction
TriStation 1131 is a Windows NT-based programmer’s workbench for developing, testing and documenting process-control applications that execute in the TRICON controller. Three languages which comply with the IEC 1131-3 standard are available for programming in TriStation 1131: • Function Block Diagram (FBD) • Ladder Diagram (LD) • Structured Text (ST) Using the features of TriStation 1131, you can perform the following tasks: • Develop programs and other executable elements such as functions, function blocks, and data types using any of three language editors • Select functions and function blocks from IEC-compliant libraries (which include process control and fire-and-gas functions) and/or custom libraries • Graphically configure the I/O modules and points for each chassis in your TRICON system • Configure your TRICON system for use with the integrated Sequence of Events (SOE) capability • Apply password protection to projects and programs according to user names and security levels • Debug your program logic by emulating execution • Print sheets of your program logic, hardware configuration, variable lists, and Main Processor performance data • Download as many as 250 program instances to a single TRICON • Display diagnostic information about system performance and fault details
18
About This Manual
About This Manual This manual is a user’s guide which provides the following types of information: • High-level programming concepts • Detailed information about TriStation 1131 features and tools • Reference information for occasional use
Summary of Chapters The manual is organized into the following chapters and appendixes: • Chapter 1, “Introduction” — Summarizes TriStation 1131 capabilities; lists documentation conventions and user experience requirements; and tells how to contact Triconex. • Chapter 2, “A TriStation 1131 Project” — Briefly describes the elements of a TriStation 1131 project, the languages and tools you can use, and basic methods for developing a project. • Chapter 3, “Function Block Diagram (FBD)” — Describes basic methods of writing logic in FBD and provides details on the use of FBD editing tools. • Chapter 4, “Ladder Diagram (LD)” — Describes basic methods of writing logic in LD and provides details on the use of LD editing tools. • Chapter 5, “Structured Text (ST)” — Will describe basic methods of writing logic in ST and provides details on the use of ST editing tools. • Chapter 6, “Configuration Editor” — Explains how to allocate TRICON hardware; set system parameters; declare program instances; connect program variables to TRICON points using the Connections Wizard; build the configuration and compare it to the last download; import and export TRICON point properties; and configure the TRICON for event collection. • Chapter 7, “Control Panels” — Explains how to operate the Emulator and TRICON Control Panels; disable and enable points; and monitor the behavior of variables and power flow in program instances; and use the Download All and Download Change capabilities. • Chapter 8, “TRICON Diagnostic Panel” — Explains how to use the TRICON Diagnostic Panel for on-line monitoring of a downloaded project and fault identification within a TRICON system; how to display the
Chapter 1
Introduction
About This Manual 19
firmware version numbers of modules in a TRICON system; and how to collect TRILOG events. • Chapter 9, “System Administration” — Describes the TriStation 1131 security system; element attributes; project options for languages, variable annotation and communication; and options for TriStation 1131’s graphical interface features. • Chapter 10, “Printing” — Explains how to use the print-screen capability, generate standard reports, and create custom reports. • Chapter 11, “Libraries” — Explains how to add, update and remove libraries; and how to create shared libraries. • Appendix A, “Configurable Modules” — Describes the configurable parameters of TRICON communication modules and basic facts about time synchronization. • Appendix B, “Keyboard & Mouse Shortcuts” — Describes keyboard and mouse shortcuts for tasks like editing, scrolling and selecting. • Appendix C, “TRISTATION MSW Corollaries” — Lists the TRISTATION features that have a corollary feature in TriStation 1131. • Appendix D, “TÜV Restrictions & Requirements” — Provides general and TRICON-specific restrictions for safety shutdown systems that meet TÜV Class 5 and Class 6 requirements. • Appendix E, “Maintenance Log-on to TRICON” — Explains how to log on to any active TRICON for read-only diagnostic monitoring. • Appendix F, “Peer-to-Peer Communication” — Explains how to use peerto-peer protocol to send and receive small amounts of critical data among several TRICON systems on an IEEE 802.3 network.
Chapter 1
Introduction
20
Document Conventions
Document Conventions This manual adheres to the following conventions: Example of convention
Description
Select TRICON as the target platform. Type UpDown1 and press enter. Click OK.
Bold type indicates buttons, menu commands, names of dialog boxes, windows, functions and function blocks; and text that must be entered exactly as shown.
Select the desired Project Name from the Project Directory.
Words in italics indicate placeholders for information you must supply, such as a filename. Italic type is also used occasionally for emphasis within text.
SIN(A) * COS(B)
Examples of Structured Text language appear in the Courier fixed-pitch font.
CTRL+ ENTER
Keyboard keys are in small caps. When a plus sign (+) appears between two key names, press both keys at the same time.
Sequence of Events (SOE)
If a term has an acronym, the term is spelled out only the first time it occurs within a chapter, with its acronym shown in parenthesis. Thereafter, only the acronym is used in that chapter.
Note Instructions or selections can be undone at any step. ! CAUTION
Notes contain supplementary information.
Cautions contain information about potential data loss
Sample use of caution format. ! WARNING
Sample use of warning format.
Chapter 1
Introduction
Warnings contain information about potential damage to equipment or harm to personnel.
User Experience Requirements
21
User Experience Requirements To effectively use the TriStation 1131 Developer’s Workbench, you should be familiar with Microsoft Windows. It is helpful, though not required, to have experience with the following: • Windows-based software development platforms • Programming languages that comply with the IEC-1131 standard, particularly Function Block Diagram, Ladder Diagram and Structured Text • Programming of Programmable Logic Controllers (PLCs)
Chapter 1
Introduction
22
How to Contact Triconex
How to Contact Triconex Sales information and technical support for TriStation 1131 is available at any of the following regional offices, as well as the Triconex World Headquarters:
Regional Offices
Americas Sales & Service Phone:+1-409-935-3555 Fax: +1-409-935-3881
Middle East Sales & Service Phone: +971-4-314-949 Fax: +971-4-314-780
Asia-Pacific Sales & Service Phone:+65-738-5488 Fax: +65-738-5188
Holland Office, c/o IMHOFF SYSTEMS Phone:+31-79-360-05-98 Fax: +31-79-363-64-65
Triconex Corporate Headquarters Triconex Corporation 15091 Bake Parkway Irvine, CA 92618 USA 800-325-2128 714-699-2100
Sales Department Sales hours are 08:30 to 17:00 Pacific Standard Time (PST). Sales Phone: 714-699-2107 Sales Fax: 714-768-6601
Chapter 1
Introduction
How to Contact Triconex
23
Technical Support Before contacting Technical Support, please try to solve your problem by using this manual or the on-line Help system.
Telephone You can reach Triconex Technical Support by phone between 08:30 a.m. and 17:00 PST, Monday through Friday. Technical support phone numbers: 800-325-2128 and 714-699-2100 When you call, you should be at your computer and have your documentation with you. Be prepared to provide the following information: • Product serial number—found on the software key, the TriStation 1131 box, and/or the About TriStation 1131 selection in the Help menu • Product version number—found by selecting About TriStation 1131 in the Help menu) • Type of computer • Software version number of Windows NT • Exact wording of any messages that have appeared on the screen • What you were doing when the problem occurred • How you tried to solve the problem
Fax You can fax questions or comments regarding technical support to 714-768-6601.
24-Hour Bulletin Board System (BBS) Use the Triconex Bulletin Board to download customer reference documents or upload diagnostic files for evaluation. BBS Numbers: 714-768-4383 or 768-4425 Protocol: BPS, 8, N, 1 (where BPS = 9600 or 14400)
Chapter 1
Introduction
24
How to Contact Triconex
Triconex Internet Web Page Use the Triconex Internet Web page to read and download the latest information on Triconex Corporation, Triconex products and TriStation 1131. Web page address: http://www.triconex.com
Chapter 1
Introduction
CHAPTER 2
A TriStation 1131 Project
This chapter describes the elements of a TriStation 1131 project and the languages and tools you can use, and discusses methods for developing a project. The following topics are covered: • Programming languages • Elements of a project • TriStation 1131 tools • Developing a TriStation 1131 project
26
Programming Languages
Programming Languages The TriStation 1131 programmer’s workbench supports three programming languages for developing, testing and documenting process control applications that execute in the TRICON controller. These three languages comply with the IEC 1131-3 International Standard on Programming Languages for Programming Controllers and reflect the guidelines documented in the IEC 65A Type 3 Report: • Function Block Diagram (FBD) • Ladder Diagram (LD) • Structured Text (ST) This section provides basic information about the available programming languages. Refer to Chapter 3, Chapter 4, and Chapter 5 for detailed information about the language editors.
Function Block Diagram (FBD) Language FBD is a graphically oriented language that corresponds to circuit diagrams. The elements used in this language appear as blocks wired together to form circuits. The wires can communicate binary and other types of data between FBD elements. In FBD, a group of elements visibly interconnected by wires is known as a network. An FBD diagram may contain one or more networks. The following is an example of a switch debounce algorithm block written in the FBD language:
Chapter 2
A TriStation 1131 Project
Programming Languages
27
Ladder Diagram (LD) Language LD is a graphically oriented language that uses a standard set of symbols to represent relay logic. The basic elements are coils and contacts which are connected by links. Links are different from the wires used in FBD, in that they transfer only binary data between LD symbols. This is in keeping with the power flow characteristics of relay logic. Function blocks and function elements may be used in LD diagrams as long as they have at least one binary input and output to facilitate binary data flow. Chapter 4 provides more detail on this topic. The following is an example of a switch debounce algorithm consisting of two networks written in the LD language:
Chapter 2
A TriStation 1131 Project
28
Programming Languages
Structured Text (ST) Language ST is a high-level programming language, similar to PASCAL or C. ST allows you to create Boolean and arithmetic expressions as well as structured programming constructs such as conditional statements (IF...THEN...ELSE). Functions and function blocks may be invoked in ST. The following is an example of a switch debounce algorithm written in the ST language:
Chapter 2
A TriStation 1131 Project
Elements of a Project 29
Elements of a Project When you use TriStation 1131 to develop an application for process control, the first step is to create a new project—this is a database file that contains all of the elements you create during application development. Each project file has the extension PT2. The main elements of a project include the following: • Programs • Function blocks • Functions • Data types • Shared libraries • Configuration Upcoming sections in this chapter provide brief definitions and other useful information about these elements. Refer to the diagram on the following page for an overview of the main elements found in a TriStation 1311 project.
Projects for TRICON Systems A TriStation 1131 project is targeted for a single TRICON system. If a safety control system uses more than one TRICON, there will be a TriStation 1131 project for each. For example, the control strategy for an oil refinery might be implemented as five TriStation 1131 projects, each executed by a different TRICON system to control the following processes: • Distilling • Platforming • Oil transportation • Power-generating utilities • Fire & gas detection/suppression
User-Derived Functions & Function Blocks Create your own Functions and Function Blocks
Structured Text Editor Ladder Diagram Editor Function Block Diagram Editor
Configuration Editor - Declare Program Instances - Declare TRICON Points - Connect Program Variables to TRICON Points/Tag Names - Configure the TRICON system
Create and edit Programs, Functions and Function Blocks
User-Derived Programs
TRICON Diagnostic Panel Monitor the operational status of the TRICON to the fault detail level
Serial/Network Interface
Program Instance Declarations
Create Programs with userderived elements and/or Shared Library elements
For each Program, declare one or more Program Instances (required for downloading)
TRICON Controller
TRICON Point Connections Declare TRICON points & assign properties to them
TRICON System Configuration - Allocate TRICON chassis & modules - Allocate memory for point types - Set system parameters
TRICON SOE Configuration
Configuration
Emulator Application
Emulator Control Panel DDE Interface
Control and monitor Program Instances downloaded to the Emulator for testing
TRICON Control Panel Control and monitor Program Instances downloaded to the TRICON for real-time execution
Overview of a TriStation 1131 Project
Chapter 2
A TriStation 1131 Project
Serial/Network Interface
Elements of a Project 31
Programs A program is the highest-level logic element within a TriStation 1131 project. It is an assembly of programming language elements and constructs that work together to allow a programmable control system to achieve control of a machine or process. In each program, you can define a maximum of 400 variables (inputs, outputs and locals). A program can invoke functions or function blocks but cannot invoke another program, as shown in the following chart for order of evaluation:
PROGRAMS Invoke
Functions
Function Blocks
Invoke Invoke
Function Blocks
Functions
Functions
Program Instances In TriStation 1131, programs are not executed directly. In this regard, it helps to think of a program as a program type. To download and execute a program type, you declare one or more executable copies of the program which are known as program instances. Each program instance must have a unique instance name. For a TriStation 1131 project, you can download as many as 250 program instances to the TRICON controller. For more information, refer to “Program Instances” under the upcoming section called “Configuration.”
Multiple Programs within a Project A typical TriStation 1131 project is partitioned into multiple programs based on the operation of particular units in the controlled process. For example, the control strategy for a common process area within an oil refinery could be partitioned into separate programs that control crude oil distillation towers, furnaces, hydrodesulphurization areas, and redistillation areas. Refer to the section called “Partitioning the Project” later in this chapter for more information.
Chapter 2
A TriStation 1131 Project
32
Elements of a Project
Function Blocks A function block is an executable logic element which yields one or more values and is identified by an instance name. A function block retains the values calculated during one evaluation for use in the next evaluation. Therefore a given set of input values to a function block will not always yield the same output values, as shown in the following example. This example uses the Standard Library’s TP (Time Pulse) function block and is based on a scan time of 50 milliseconds. The transition of output Q is a function of the input IN and the pulse duration PT, based on the calculated elapsed time ET which is incremented and retained from scan to scan until its expiration. Evaluation 1:
Evaluation 99:
Evaluation 3:
Evaluation 100:
Like programs, function blocks are not directly executed. When you want a program to invoke a function block, you must give the function block an instance name that is unique within the program or function block in which it is being invoked. Creating a function block can be helpful when you are writing logic to control a number of identical process units, especially if the amount of logic required is small. You can declare a maximum of 400 variables (inputs, outputs and locals) in each function block. Function blocks can be used to implement standard or repetitive algorithms that yield more than one result, such as the Proportional Integral Derivative (PID). In another example, you may need to comply with a standard for processing First-Out Alarms. In this case, you could consolidate the logic for alarm processing into a function block to ensure that the alarm sequencing is performed identically for each group of alarms. Refer to the section called “Partitioning the Project” later in this chapter for more information.
Chapter 2
A TriStation 1131 Project
Elements of a Project 33
Functions A function is a logic element which yields exactly one result. Unlike a function block, the values in a function are not retained from one evaluation to the next— they only exist during each evaluation. The Standard Library’s AND function (shown below) provides examples of various evaluations. For each evaluation, the output value of the AND function depends solely on the current values of the inputs.
A function is directly executed and does not need to be instanced. You can declare a maximum of 400 variables (inputs, outputs and locals) in each function. Note Creating a function and invoking it each time it is needed can reduce the amount of memory required for your logic as well as making it easier to read.
Chapter 2
A TriStation 1131 Project
34
Elements of a Project
Data Types Two kinds of data types are applicable to TriStation 1131 projects: • Elementary • Generic
Elementary Data Types An elementary data type defines the size and characteristics of most data used in a program, function or function block and the operations that can be applied to the data. The following data types are available to TriStation 1131 users: Data Type
Chapter 2
Size & Characteristics
BOOL
A Boolean, 1 bit in length
DATE
A specific date, in the format D#CCYY-MM-DD
DINT
A double integer, 32 bits in length
DT
A specific date and time, in one of the following formats: – DT#CCYY-MMDD-HH-HH:MM:SS – DATE_AND_TIME#CCYY-MM-DD-HH:MM:SS
DWORD
A double word, 32 bits in length
INT
An integer, 16 bits in length
LREAL
A long real number, 64 bits in length
REAL
A real number, 32 bits in length
STRING
A sequence of up to 132 alphanumeric characters delimited by single quotes
TIME
A period of time (duration) measured in milliseconds.
TOD
A specific time of day, in one of the following formats: – TOD#HH:MM:SS – TIME_OF_DAY#HH:MM:SS
A TriStation 1131 Project
Elements of a Project 35
Of the data types listed above, only variables of the following types can be declared as TRICON points. These variables point to hardware addresses in the TRICON and are accessible to all programs in a TriStation 1131 project. • BOOL • DINT • REAL Refer to the upcoming section called “Declaring the Project Configuration” for more information.
Generic Data Types Generic data types, identified by the prefix ANY, are used exclusively in functions and function blocks available in the TriStation 1131 shared library. The hierarchy of generic data types recognized by the IEC 1131-3 standard and used by TriStation 1131 is as follows:
For more information, refer to the sections on declaring the properties of functions and function blocks in the FBD and LD chapters.
Chapter 2
A TriStation 1131 Project
36
Elements of a Project
Shared Libraries For every project, TriStation 1131 provides two standard libraries which contain functions and function blocks you can use for application development: • The Standard Library (STDLIB) which complies with the IEC 1131-3 standard • The TRICON Library (TR1LIB) for the TRICON platform In addition, you can share the programs, functions and function blocks that you develop with other projects by using TriStation 1131’s shared library feature. For more information, refer to Chapter 11, “Libraries.”
Configuration A configuration is the element of a TriStation 1131 project that supports the installation of your process control application into the TRICON controller. A configuration consists of the following elements, as shown in the diagram that follows: • One or more program instance declarations • TRICON point connections • TRICON hardware configuration TriStation 1131 Project CONFIGURATION
Program
Program Instance 1
Program Instance 2
Program Instance 3
Chapter 2
A TriStation 1131 Project
Input Variable
Instrument Tag Name
Hardware Input Address
Output Variable
Instrument Tag Name
Hardware Output Address
TRICON Point Connections
TRICON Chassis and Modules
Elements of a Project 37
Methods for developing a configuration are described in an upcoming section called “Creating the Project Configuration.”
Program Instances In TriStation 1131, program instances are executable copies of a program type which are downloaded to the TRICON. For example, if your project needs to control several Firewater Deluge Pumps, using program instances could help. The operation of the pumps is simple and unlikely to change as time goes by, and the amount of logic needed to control each one is small. Therefore it would make sense to create one program type and declare an instance of that type for each pump being controlled. The maximum number of program instances you can declare in a TRICON configuration is 250.
TRICON Point Connections Whereas a local variable can only be accessed within the logic element in which it is declared, a TRICON point is accessible to all program instances in the configuration. Each TRICON point is associated with an Input point, Output point or Memory address in the TRICON. Every input and output variable in a program instance must be connected to a TRICON point. The Configuration editor provides the Connections Wizard for making these connections, either manually or automatically.
TRICON Hardware Configuration Configuration of the TRICON hardware includes the following elements, accessible from the directory tree on the left side of the Configuration Editor window: • System parameters such as the network node, scan time, passwords, and memory allocation • TRICON chassis • I/O and communication modules installed within TRICON chassis
Chapter 2
A TriStation 1131 Project
38
TriStation 1131 Tools
TriStation 1131 Tools This section describes the main tools available for developing and downloading a TriStation 1131 project: • Project Directory • Language editors • Properties box • Options menu for lists • TRICON Configuration editor • Control panels • TRICON Diagnostic Panel • Help system
The Project Directory The Project Directory, accessible from TriStation 1131’s Project menu, allows you to access the various elements of your project.
Chapter 2
A TriStation 1131 Project
TriStation 1131 Tools
39
With the Project Directory open, you can add, copy and delete various elements of your project. Four categories of elements are accessible by means of the tabs in the Project Directory: • User Defined — for opening, adding, copying or deleting programs, functions or function blocks • Shared Libraries — for viewing elements in your project library, exporting elements to a new library, importing libraries to your project, and verifying the version numbers of libraries attached to your project • Platform — provides access to the Configuration editor, TRICON Control Panel, Emulator Control Panel and TRICON Diagnostic Panel • Other — for viewing project engineering drawing templates (currently, templates cannot be added or modified)
Language Editors After opening a TriStation 1131 project, you can choose to create programs, function blocks and functions using any of three IEC-compliant languages: • Ladder Diagram (LD) • Function Block Diagram (FBD) • Structured Text (ST) When you select New Project from the File menu, you select a primary language for the project. When you are in the Project Directory and decide to create a new element, you can accept the default language (FBD) or select another language for that particular element.
Multiple Languages in a Project In most cases, it makes sense to develop an entire project using only one language—but it is possible to use multiple languages within a single project. For example, while you are writing logic in the FBD language you may come upon the need to include a complex mathematical calculation which is not easily written in FBD. In this case, you could decide to create a function or function block in the ST language which resembles a high-level programming language such as Pascal, thus making the calculation easier to read.
Chapter 2
A TriStation 1131 Project
40
TriStation 1131 Tools
Properties Dialog Box The Properties dialog box is used to specify the attributes of most elements in TriStation 1131 programs, functions, function blocks, configurations and control panels. When you are working with program logic, just double-click on the desired element to display the Properties box for that type of element, as shown below for the AND function. In the TRICON configuration editor, double-clicking on an element in the directory tree displays the Properties box for the selected element.
Properties boxes for certain elements include more than one tab page, as shown in the example above for a function block in the FBD language. Click on the desired tab to move it to the front. If you click on the push pin icon in the upper left corner, the Properties box will stay on top of all other displays and reflect each successive element you select, as long as the push pin appears pressed down (as shown above).
Basic Editing Tools To help you create projects, TriStation 1131 provides tools that you can select from pop-up menus, main menus and toolbars. The menus and toolbars are not identical for all of TriStation 1131’s editors and control panels, but they do share several commonalities which are described in the following pages.
Pop-up Menu Pressing the right mouse button while using a TriStation 1131 control panel or editor displays a pop-up menu either for a selected element or for any empty area. All of the commands in the pop-up menu are accessible from the toolbar and main menu as well, with certain exceptions which are explained in the chapters about control panels and editors.
Chapter 2
A TriStation 1131 Project
TriStation 1131 Tools
41
For A Selected Element For a selected element, TriStation 1131 displays commands that apply to that element, as shown in this example (below left) for the SR function block found in an FBD logic sheet:
Pop-up menu for a selected function block
Pop-up menu for any empty area
For Any Empty Area If you press the right mouse button from any empty area, the pop-up menu displays a different set of commands as shown in the example from an FBD logic sheet (above right). The first command, called Select Arrow Key, is useful when you are in the middle of an operation but decide not to complete the operation. At such a time, you can press the right mouse button and choose Select Arrow Key to terminate the unwanted operation and return the cursor to the arrow key.
Chapter 2
A TriStation 1131 Project
42
TriStation 1131 Tools
Main Menu & Project Toolbar The main menu for an editor or control panel appears above the toolbar as shown in the following example from the FBD editor. The toolbar has two parts: the project toolbar which is common to all views of a TriStation 1131 project, and the toolbar for a specific control panel or editor, as indicated in this example: Project Toolbar
Toolbar for Editor or Control Panel
The diagram on the following page lists the main menu commands which are common to all TriStation 1131 views. Refer to other chapters for information about main menu commands which are unique to specific editors and control panels.
Shortcut Keys In all of TriStation 1131’s main menus, underlined characters are shortcut keys to be used in the typical manner of Windows applications: • For a menu item, use ALT+ to open the menu • For a command within a menu, type the of the desired command
Chapter 2
A TriStation 1131 Project
TriStation 1131 Tools
43
Common Menus & Commands for All TriStation 1131 Views File
Edit
TRICON
New Project... Open Project... Save Project... Save As... Close Project... 1 2 Print... Print Preview... Print Reports... Print Setup... Exit
Commands differ for each editor and control panel.
Edit Configuration Build Configuration Rebuild Configuration Compile All Project Elements Emulator Control Panel TRICON Control Panel TRICON Diagnostic Panel View Download History... Change State to Download All
View
Tools
Sheets
Window
Help
Commands differ for each editor and control panel.
New Window Cascade Tile Horizontal Tile Vertical Close All Arrange Icons Show Properties Sheet Show Message Bar (Vertical Message Bar) (Horizontal Message Bar) Hide Message Bar 1 PROGRAM:
TriStation 1131Help Tip of the Day... Keyboard Shortcuts Sample Projects Technical Support About TriStation 1131... TriStation 1131 Logo...
Commands differ for each editor and control panel.
Commands differ for each editor and control panel.
Commands differ for each editor and control panel.
A TriStation 1131 Project
44
TriStation 1131 Tools
Table of Editing Tools The table that follows describes the main menu commands which are common to all TriStation 1131 views and the tools in the project toolbar which correspond to these commands.
As noted earlier, the underlined characters shown in the menu and command names are shortcut keys to be used in the typical manner of Windows applications. Note On any TriStation 1131 toolbar, the tooltip (name of a tool) is displayed if you place the cursor inside the icon for the tool. File Menu
Chapter 2
Command
Description
New Project
Creates a new project. Allows you to select the primary language editor to be used for the project.
Open Project
Opens existing projects. Displays all elements in the project.
Save Project
Saves open project and any project elements (programs, functions, function blocks) that have been opened and/or edited.
Save As
Saves a project under another filename.
Close Project
Closes the current project.
Print
Prints the sheet(s) displayed in the current window.
Print Preview
Previews the printing of the sheet(s) displayed in the current window.
Print Reports
Allows you to generate a report database and select reports for printing.
Print Setup
Lets you select a printer and document properties.
Exit
Closes the current project and exits TriStation 1131.
A TriStation 1131 Project
TriStation 1131 Tools
45
TRICON Menu Command
Description
Edit Configuration
Opens the TRICON Configuration screen where you allocate hardware, create program instances, and define TRICON point connections for program variables.
Build Configuration
Compiles and links all configured programs and any dependent elements.
Rebuild Configuration
Re-compiles and links all configured programs and any dependent elements.
Compile All Project Elements
Compiles all elements of a project.
Emulator Control Panel
Opens the Emulator Control Panel for off-line testing of a project.
TRICON Control Panel
Opens the TRICON Control Panel for on-line monitoring of live data as a project executes in the TRICON.
TRICON Diagnostic Panel
Opens the Diagnostic Panel, which displays all TRICON status indicators and fault detail windows for faulting points.
View Download History
Displays version information for each download of the current project.
Change State to Download All
Allows you to do an off-line comparison of the current configuration with the last configuration that was downloaded to the TRICON.
Project Menu Command
Description
Directory
Opens the Project Directory dialog box which allows you to open existing elements of the project or create new elements.
Description
Displays the Project Description dialog box for viewing or editing.
Chapter 2
A TriStation 1131 Project
46
TriStation 1131 Tools
Project Menu Command
Description
Security
Opens the Project Security dialog box for viewing or editing of users, privileges and level names.
History
Displays the Project History (audit trail) of user access and modification. Automatically generated by TriStation 1131 during project development.
Project Options
Opens the Project Options dialog box for selection of the default language, variable annotations and hardware communication parameters.
TriStation 1131 Options
Opens the TriStation 1131 Options dialog box for selection of directory pathnames, message bar specifications, drawing colors, and options for FDB and LD editors.
Window Menu
Chapter 2
Command
Description
New Window
Opens a new window of the current element.
Cascade
Cascades all open windows and displays the title bar for each. To bring a window to the top, select it from the list of open windows on the menu or click on the window’s title bar.
Tile Horizontal
Displays any open windows horizontally on the screen. Useful for showing several windows simultaneously.
Tile Vertical
Displays any open windows vertically on the screen. Useful for showing several windows simultaneously.
Close All
Closes all open windows. Prompts you to save any elements that have been changed since they were opened.
Arrange Icons
Arranges any minimized windows.
Show Properties Box
Displays the Properties dialog box which allows you to declare or view the properties of the selected element. Click on the push pin in the dialog box to continuously display the Properties box.
A TriStation 1131 Project
TriStation 1131 Tools
47
Window Menu Command
Description
Show Message Bar
Displays compiler messages in a rectangular box during the building of elements. By default, the message bar is displayed horizontally across the bottom of the screen.
Vertical Message Bar
If the message bar is displayed horizontally across the bottom of the screen, you can choose to display it vertically along the right side of the screen.
Horizontal Message Bar
If the message is displayed vertically along the right side of the screen, you can choose to display it horizontally across the bottom of the screen.
Hide Message Bar
Closes the message bar which displays compiler messages during the building of elements.
Help Menu Command
Description
TriStation 1131 Help
Opens the TriStation 1131 Help System.
Tip of the Day
Displays a tip for effective use of TriStation 1131, randomly selected from a database based on users’ suggestions.
Keyboard Shortcuts
Provides keyboard information and shortcuts for the tasks involved in writing logic, such as placing, selecting and editing logic elements.
Sample Projects
Displays a dialog box that shows the sample projects included with TriStation 1131, which you can duplicate and edit.
Technical Support
Provides information on how to contact Triconex for technical support.
About TriStation
Displays the current version number of TriStation 1131 and registered owner information.
1131 TriStation 1131 Logo
Displays the splash screen that appears when you start up TriStation 1131.
Chapter 2
A TriStation 1131 Project
48
TriStation 1131 Tools
Enlarged View of Elements There are two ways to enlarge your view of selected elements in the logic sheet of any language editor or the monitor sheet of the Emulator Control Panel or TRICON Control Panel. One way is to use the Zoom... command in the View menu to select a percentage of enlargement. A quicker way to change the Zoom is to double-click the left mouse button in any empty area to see a “Zoom Selection” view. As shown in the Control Panel example below, this is a full view of the drawing sheet with the contents of the current view area highlighted in a rectangle. You can move the current view rectangle by clicking the left mouse button in a different area of the drawing sheet or by drawing a new view rectangle, holding down the left mouse button while drawing.
Current View Rectangle
Chapter 2
A TriStation 1131 Project
TriStation 1131 Tools
49
Options Menu for Lists In TriStation 1131, the attributes of lists with column headings can be altered in two ways: • Change the order of appearance of the columns displayed across the screen by clicking and dragging each column to the desired position. • Sort the columns alphanumerically by pointing to the heading of the desired column, clicking on the right mouse button, and choosing a sort option from the pop-up menu. In the following example, the cursor was pointing to the Tag Name column in the TRICON Point Connections list when the right mouse button was clicked, so the pop-up menu is displayed with the Tag Name column selected for sorting.
The upper two options in the sort menu apply to the alphanumeric order of the fields in a selected column. The choices are ascending order or descending order. The lower four options apply to saving and resetting the attributes of each column. The default option is Auto Save, which automatically saves the position and sort order of each column when you close the view. As long as Auto Save is on, the columns will be in the same position and sort order the next time you open the window.
Chapter 2
A TriStation 1131 Project
50
TriStation 1131 Tools
Use Save Now to save the attributes of the columns manually at any time. If Auto Save is off, you must remember to use Save Now before exiting the window if you want to preserve the attributes of your columns. Use Reset to Last Save to return the lists to their previously saved order. Reset to Original returns the columns to the default attributes they had the first time you opened a particular list for a new project. Lists with sortable columns and fields can be found in the following TriStation 1131 dialog boxes or views: • Project Directory • Project Security • Project History • Sheet Template • Program Instance Declarations • TRICON Point Connections • All tabs in the Variable Declarations window except Graphic View
Help System TriStation 1131’s easy-to-use Help System provides on-line information about the following topics: • TriStation 1131 features and capabilities • Language editors • Standard Library functions and function blocks • IEC 1131-3 reference • Sample projects • Configuration, downloading and diagnostics for the TRICON platform • Error messages You can access the Help system from the Help menu or: • Press the F1 key when a menu item is highlighted • Press the F1 key or choose Help when in a dialog box
Chapter 2
A TriStation 1131 Project
TriStation 1131 Tools
51
TRICON Configuration Editor The TRICON Configuration editor, accessible from the TRICON menu or the Platform tab in the Project Directory, performs the following functions: • Program instancing • Naming of TRICON points • Connection of program variables to TRICON points • System configuration (TRICON hardware allocation & system parameters) Various views of elements in the Configuration editor are opened and closed by means of the directory tree on the left side of the window. The Configuration editor provides access to the Connections Wizard for manual or automatic connection of program variables to TRICON points.
Control Panels TriStation 1131 provides two kinds of control panels for monitoring the behavior of variables as your application runs: • Emulator Control Panel • TRICON Control Panel The control panels are accessible from the TRICON menu or the Platform tab in the Project Directory. The operation of both control panels is identical—but the Emulator Control Panel helps you test your application off-line, while the TRICON Control Panel lets you download, control and monitor an application in the TRICON. A control panel has a tree panel on the left and a monitor panel on the right. You can drag variables from the tree to the monitor panel for viewing during execution of the application, using the Run, Single Step, Pause and Halt commands to control execution.
Chapter 2
A TriStation 1131 Project
52
TriStation 1131 Tools
TRICON Diagnostic Panel The TRICON Diagnostic Panel, accessible from the TRICON menu or the Platform tab in the Project Directory, has the following purposes: • Displays the status of all I/O modules and other system components of the TRICON system, including the current project • Helps you diagnose faults in the TRICON system so you can replace faulty modules or take other corrective actions • Enables/disables and monitors Output Voter Diagnostics (OVD) for output modules
Chapter 2
A TriStation 1131 Project
Developing a TriStation 1131 Project
53
Developing a TriStation 1131 Project This section provides general guidelines for the main tasks entailed in developing a TriStation 1131 project. The following topics are covered: • Typical development approach • Partitioning the project • Writing the logic for executable elements • Creating the project configuration • Downloading the configuration
Typical Development Approach One of the main benefits that TriStation 1131 offers is flexibility of development methods. Beyond basic limitations such as having to write the logic and configure the hardware before downloading, you can do most development tasks in any order that turns out to be effective. However, the following steps constitute a typical approach to developing a TriStation 1131 project: 1 Partition the project. 2 Write the logic for executable elements. 3 Configure the system. 4 Declare program instances. 5 Declare TRICON point connections. 6 Connect program variables to TRICON points. 7 Build the configuration. 8 Test the configuration. 9 Download the configuration.
The chart on the following page shows which TriStation 1131 component or components correspond to each functional step. Upcoming sections discuss each step in more detail.
Chapter 2
A TriStation 1131 Project
54
Developing a TriStation 1131 Project
Functional Steps for Creating an IEC-1131-Compliant Control Application
TriStation 1131 Components Used
Partition the Project
Project Directory
Write Logic for Executable Elements
FBD Editor LD Editor ST Editor
Configuration Editor System Parameters Configure the System
Hardware Configuration
Memory Allocation
Chapter 2
Declare Program Instances
Program Instance Declarations
Declare TRICON Point Connections
TRICON Point Connections
Connect Program Variables to TRICON Points
Connections Wizard
Test the Configuration
Emulator Control Panel
Download the Configuration
TRICON Control Panel
A TriStation 1131 Project
Developing a TriStation 1131 Project
55
Partitioning the Project TriStation 1131 provides many options for project development, which differ slightly depending on the language you are using. But there are three executable elements which are building blocks for all of the languages: • Programs • Function blocks • Functions These elements are the main ones you need to consider when designing a control strategy for your project. A control strategy always involves the concept of partitioning—that is, organizing your program logic into a combination of executable elements which is effective for your application and maintainable by your field technicians. The following sections introduce the sample project called FURNACE and discuss concepts which can help you make informed decisions about project partitioning: • Sample project diagrams • Determining the number of programs • Program instances versus program copies • When to create function blocks • When to create functions
Chapter 2
A TriStation 1131 Project
56
Developing a TriStation 1131 Project
Sample Project Diagrams This section introduces the sample project called FURNACE which will be used to illustrate TriStation 1131 concepts from this point onward. The following is a simplified Process & Instrumentation Diagram for the FURNACE project: TO BURNER 2 TO BURNER 3 TO BURNER 4
COMBUSTION SUPPLY
AIR HEADER DAMPER TO BURNER 2 TO BURNER 3 TO BURNER 4 BURNER 1 AIR DAMPER
FUELGAS VIA HEADER
FUELGAS CONTROL VA;VE
FUELGAS HEADER A TSOV
BURNER 1 TSOV
FUELGAS HEADER B TSOV
IGNITER HEADER
IGNITER 1 TSOV
TO IGNITER 2 TO IGNITER 3 TO IGNITER 4
Chapter 2
A TriStation 1131 Project
Developing a TriStation 1131 Project
57
A TriStation 1131 project can be partitioned into as many as 250 program instances. The logic for the sample project called FURNACE has been partitioned into several different programs, as indicated by the following diagram: Program 1: Safe_Atmosphere Instance 1: Safe_Atmosphere
Program 2: Start_Condition Instance 1: Start_Conditions
Determining the Number of Programs A program is the highest-level executable logic element in a project. A typical project is partitioned into multiple programs based on the operation of particular units in the controlled process. For example, the control strategy for the FURNACE project has been partitioned into ten separate programs: Program 1: Program 2: Program 3: Program 4: Program 5: Program 6: Program 7: Program 8: Program 9: Program 10:
The partitioning of a project into different programs is reflected by the program names displayed in the Project Directory when you have used the New option to create new programs:
Chapter 2
A TriStation 1131 Project
Developing a TriStation 1131 Project
59
Program Instances versus Program Copies If you have identical process units whose operation is simple and unlikely to change as time goes by, you can create one program with multiple instances. Simple operation means that the amount of logic needed is small, which helps you avoid complications with memory usage if unexpected modifications become necessary in the future. If you have several process units whose operation is similar but not identical, you can create one program, copy it and modify it for each unit. This method is also appropriate if the process units are identical at the present time, but might change in the foreseeable future.
When to Create Function Blocks A function block can invoke several functions or function blocks found in the Standard Library or TRICON Library, or in some cases, user-derived functions or function blocks. Function blocks can be used to implement standard or repetitive algorithms that yield more than one result, such as the Proportional Integral Derivative (PID). In another example, you may need to comply with a standard for processing First-Out Alarms. In this case, you could consolidate the logic for alarm processing into a function block to ensure that the alarm sequencing is performed identically for each group of alarms. You must create a function block (rather than a function) when your algorithm returns more than one result and/or needs to retain data from one scan to the next. If you develop a number of standardized function blocks, you could then create your own shared library—a convenient way to make these functions available company-wide.
When to Create Functions A function, like a function block, can be used to implement standard, repetitive algorithms. However, a function can only return one result, and does not retain data from one scan to the next. To retain the output value of a function for use elsewhere in your logic, you have to store it in a variable.
Chapter 2
A TriStation 1131 Project
60
Developing a TriStation 1131 Project
Writing the Logic for Executable Elements In this section, methods for writing the logic are described in terms of a program called AIR_DAMPER from the FURNACE project. The following topics are covered: • Selecting elements and connecting wires • Assigning properties to elements • Including comments and annotation • The completed logic
Selecting Elements & Connecting Wires When you name a new program in the Project Directory, TriStation 1131 automatically displays a sheet template for the logic. To begin writing your program logic, select the elements you need from the tool bar and place them onto to the sheet template, as shown in this example for the AIR_DAMPER program. (In actual practice, newly placed elements do not have any names, but the example uses placeholder names so you can tell what types of elements these are.) After placing elements on your sheet, you need to connect them with appropriate wires. Refer to Chapter 3, “Function Block Diagram (FBD)” and the on-line Help system for more information about connecting logic elements with wires.
Chapter 2
A TriStation 1131 Project
Developing a TriStation 1131 Project
Chapter 2
61
A TriStation 1131 Project
62
Developing a TriStation 1131 Project
Assigning Properties to Elements To assign properties such as the name, variable type, data type, or initial value of an element, double-click on the element to bring up the Properties box. The following graphic gives an example of assigning properties to an input variable called AIR_DAMPER_STATUS:
Chapter 2
A TriStation 1131 Project
Developing a TriStation 1131 Project
63
Giving Instance Names to Function Blocks Each function block invoked by an executable element requires a unique instance name, which you assign by double-clicking on the function block to bring up the Properties box. The instance name field appears under the Selected tab. After you have typed in the instance name and closed the Properties box, the name appears at the top of the function block.
Chapter 2
A TriStation 1131 Project
64
Developing a TriStation 1131 Project
Including Comments & Annotation TriStation 1131 provides two means of documenting your program logic: comments and variable annotation. Comments A comment consists of descriptive text and selected macros for the project, element or sheet. Place a comment box on the page by using the Comment tool on the toolbar or the Insert Comment command in the Tools menu. A comment box is sizable for width and height and can be positioned in various ways with regard to your program variables. For more information, refer to the sections on comments in Chapter 3, Chapter 4, and Chapter 5 about the language editors. Variable Annotation An annotation is a special kind of comment box that is attached to the bottom of an input, output or input/output variable. The annotation box contains selected information about the TRICON point to which a program input or output variable is attached. In the FBD or LD editor, the Configuration editor and the Control Panel, you can display an annotated view of any program instance. The example below shows variable annotation in an FBD logic sheet. The annotation box is sizable for width and height and moves wherever the associated variable is moved. For more information, refer to the sections about variable annotation in either.
Chapter 2
A TriStation 1131 Project
Developing a TriStation 1131 Project
65
The Completed Logic The completed logic for the AIR_DAMPER program written in the FBD language (shown below) includes the following elements: • Functions and function blocks from the IEC and TRICON Standard Libraries • Input and output variables and constants • Wires that interconnect the various elements • Comments and annotation
Chapter 2
A TriStation 1131 Project
66
Developing a TriStation 1131 Project
Declaring the Project Configuration Before you can download a project to the TRICON controller, you have to declare the project configuration. This entails several tasks, which can be done at various times during project development. This section describes typical steps performed in a typical order: • Configure the system • Declare program instances • Declare TRICON point connections • Connect program variables to TRICON points • Build the configuration Refer to Chapter 6, “Configuration Editor” for more detailed information about the topics listed above. The immediately following section describes basic methods for handling the mechanics of project configuration.
Basic Methods To begin configuring a project, go to the Configuration editor (accessible from the TRICON menu or the Platform tab in the Project Directory). There you will find a directory tree on the left side of the screen which looks similar to directory trees in the Windows File Manager. Click on the plus (+) and minus (-) icons of the tree to open and close the various subdirectories of elements. Double-click on particular elements to access the screens where you actually specify configuration information. In many cases, double-clicking on an element in the tree displays the Properties box, which prompts you to select or enter pertinent information. Some Properties boxes have two or more tabs which you click on to access various aspects of configuration. Note If you are following the typical steps for developing a TriStation 1131 project, you should do a syntax check on your program logic with the Build command before attempting project configuration. If there are no errors or warnings, proceed to the Configuration editor.
Chapter 2
A TriStation 1131 Project
Developing a TriStation 1131 Project
67
Configuring the TRICON System One of the top-level nodes in the configuration tree is called TRICON System Configuration, and it allows you to: • Specify system parameters • Allocate necessary memory for various data types • Allocate your TRICON hardware (chassis and modules) Specifying System Parameters Double-clicking on the TRICON System Configuration node in the directory tree allows you to set these system parameters: • Network node • Scan rate • Password required for download • Disable stop on operator keyswitch • Disable remote changes Respond to the prompts on the TRICON System Configuration screen as needed, and refer to Chapter 6, “Configuration Editor” for more information. Memory Allocation Click on one of the following point types under the Memory Allocation node of System Configuration to allocate additional memory if needed: • Memory point • Input points • Output points Clicking on the desired point type displays graphs that provide several categories of information about the memory allocation. Double-clicking on a graph brings up a dialog box that allows you to change the memory allocation. Refer to Chapter 6, “Configuration Editor” for more information.
Chapter 2
A TriStation 1131 Project
68
Developing a TriStation 1131 Project
Hardware Allocation The Hardware Allocation node of the configuration tree allows you to configure the following aspects of the TRICON hardware: • Chassis Power Usage • Chassis configuration • Module configuration Double-clicking on Hardware Allocation allows you to view the chassis power usage and access the Properties boxes that let you add and delete chassis. Chassis & Module Configuration
Double-click on a chassis or empty-module node in the configuration tree to view the Properties box that lets you add and delete modules from a chassis. Select the Chassis or Module tab and use the Add/Delete options for chassis or the Insert/ Remove options for modules (slots) as needed. Refer to Chapter 6, “Configuration Editor” for more information about hardware allocation. Chassis Power Usage
Clicking on the Hardware Allocation node in the configuration tree displays the Chassis Power Usage screen. This screen includes a separate graphic for each chassis in your TRICON system, and provides the following information about the logic power1 used by each chassis: • Total Power Used • Total Power Supply • (Total Power) Available A typical procedure is to add I/O and communication modules to a chassis, then check to see whether the chassis power usage is viable. If it is not, you can delete modules from this chassis, add another chassis to accommodate these modules, then check on the power usage again. For more information, refer to Chapter 6, “Configuration Editor.”
1.
Chapter 2
Logic power refers to the number and kinds of modules that the Power Modules of a chassis can support without being overloaded.
A TriStation 1131 Project
Developing a TriStation 1131 Project
69
Declaring Program Instances Program instances define which programs will be downloaded and executed and which TRICON points will interact with these programs. A program may have more than one instance, and can have up to 250 instances. Suppose you have four identical pieces of equipment in your plant. If you use program instancing, you will not have to write the program logic four times. Later, you connect the input and output variables in each program instance to TRICON points which represent particular hardware addresses in the TRICON. You declare program instances in the Configuration editor by double-clicking on Program Instance Declarations in the configuration tree and adding an instance name to the Instance List in the Properties box. The order of the programs listed in Program Instance Declarations is the order in which they will be executed. Refer to Chapter 6, “Configuration Editor” for more detailed information about declaring program instances.
Declaring TRICON Point Connections After allocating your hardware and declaring your program instances, you need to declare TRICON point connections, also known as global variables in IEC-1131 standard terminology. Each TRICON point connection has two main characteristics: • It references an input, output or memory point in the TRICON • It is accessible to all program instances within a TriStation 1131 project Input and output variables in each program instance must be connected to TRICON points before downloading. The Configuration editor provides the Connections Wizard for connecting program variables to TRICON points—refer to the next section for more information about the Connections Wizard. In TriStation 1131, your program logic is independent of physical points in the TRICON. If your physical connections change, you can easily change the TRICON point connections for each program instance without having to modify the logic or recompile the program. Refer to Chapter 6, “Configuration Editor” for more detailed information about declaring TRICON point connections.
Chapter 2
A TriStation 1131 Project
70
Developing a TriStation 1131 Project
Using the Connections Wizard The Connections Wizard allows you to connect program variables to TRICON points of the Input, Output and Memory types. Making these connections is a necessary step before you can test your configuration with the Emulator or download it for execution in the TRICON. To use the Connections Wizard, you must first declare at least one program instance for each program in your project that you intend to download. The Wizard is accessible from the Commands menu and from the Instance Properties box which is displayed when you double-click on a program instance name. You can enter the Wizard as many times as you like to fine-tune the settings of selected points or all points in one or more program instances. Upon entering the Wizard, the main choice you make is whether to manually connect your program variables to TRICON points or automatically connect them using various parameters that you select. Manual connection is a very precise way to connect program variables to TRICON points. With this method, the Connections Wizard lets you select a specific program variable and connect it to a specific TRICON point. Automatically connecting your program variables to TRICON points is a quick way to prepare for testing when some of the information you need to complete your project is temporarily missing. Refer to Chapter 6, “Configuration Editor” for more detailed information about using the Connections Wizard.
Building, Testing & Downloading When you have finished making all of the necessary TRICON point connections for your program variables, it is time to build (compile) the configuration. During a build, TriStation 1131 displays a message bar which describes any configuration errors and lets you jump to the error sources from a menu command. For details, refer to the section called “Building the Configuration” in Chapter 6, “Configuration Editor”. After you have corrected all errors and successfully built your configuration, your application is ready for testing with the Emulator Control Panel. When your test results prove that the application operates effectively, you are ready to download it for real-time execution using the TRICON Control Panel. For guidelines, refer to Chapter 7, “Control Panels.”
Chapter 2
A TriStation 1131 Project
CHAPTER 3
Function Block Diagram (FBD)
This chapter describes basic methods of writing logic in the FBD language and provides details on the use of FBD editing tools. The following topics are covered: • Basic methods of writing logic • FBD editing tools • Using sheet templates • Declaring variables • Declaring functions & function blocks • Declaring constants • Wire properties • Network dividers • Comments, variable annotation and macros • Printing capabilities
72
Basic Methods for Writing Logic
Basic Methods for Writing Logic Many of the methods used for writing logic are the same for the FBD and Ladder Diagram (LD) programming languages. This section briefly mentions the basic methods as they apply to the FBD language, while upcoming sections supply details about the FBD tools and features. The basic methods, which require extensive use of the FBD toolbar and/or menus, are as follows: • In the Project Directory, choose New to create a new program, function block or function with the Function Block Diagram option checked. • TriStation 1131 automatically displays a sheet for your logic in the default sheet style. Change the sheet style if desired, give the sheet a title, and complete other fields in the sheet description. • Place your logic elements on the sheet using the FBD toolbar and/or menus. The elements can include variables, constants, functions and function blocks. • Connect the logic elements with normal or feedback wires and add horizontal or vertical network dividers if needed. • Declare the properties of each logic element by double-clicking on each to display its associated Properties box. Respond to the prompts and select the appropriate options within the Properties box. • Add comment boxes with macros and/or text that you type in, and turn on variable annotation to document your logic if desired. • Use the Build command in the Element menu to compile the logic. Correct any errors displayed in the Message Bar and build again until there are no errors. • Test your logic in the Emulator Control Panel, returning to the logic sheet to make any necessary modifications. • When testing of the logic is finished, it is time to create your project configuration, as explained in Chapter 6, “Configuration Editor.”
Chapter 3
Function Block Diagram (FBD)
FBD Editing Tools
73
FBD Editing Tools To help you write and edit logic in the FBD language, TriStation 1131 provides tools that you can select from a pop-up menu, main menu and toolbar.
Pop-up Menu Pressing the right mouse button while viewing an FBD logic sheet displays a popup menu either for a selected element or when no particular element is selected. All of the commands in the pop-up menu are accessible from the FBD toolbar and main menu as well, except for the Size/Alignment commands described below.
For A Selected Element For a selected element, TriStation 1131 displays commands that apply to that element, as shown in this example (below left) for the SR function block:
Pop-up menu for a selected function block
Pop-up menu for any empty area
For Any Empty Area If you press the right mouse button from any empty area, the pop-up menu displays a different set of commands as shown in the example (above right). The first command, called Select Arrow Key, is useful when you are in the middle of an operation but decide not to complete the operation. At such a time, you can press the right mouse button and choose Select Arrow Key to terminate the unwanted operation and return the cursor to the arrow key.
Chapter 3
Function Block Diagram (FBD)
74
FBD Editing Tools
Size/Alignment Commands The pop-up menu’s Size/Alignment commands help you arrange multiple elements on an FBD logic sheet, as shown in the example below. ▼ Take these steps to re-arrange multiple elements: 1 Select all of the elements you want to re-arrange. 2 Rest the cursor on the reference element for the size or alignment operation you
are planning to perform. 3 Press the right mouse button to display the pop-up menu. 4 Select the size or alignment operation from the Size/Alignment sub-menu.
Chapter 3
Function Block Diagram (FBD)
FBD Editing Tools
75
Main Menu Commands The FBD main menu appears above the toolbar as follows, and the diagram on the following page shows the commands which are accessible from the it. (Menus and commands which are common to all TriStation 1131 views are described in the section called “Basic Editing Tools” in Chapter 2, “A TriStation 1131 Project.”)
Shortcut Keys In the FBD main menu, underlined characters are shortcut keys to be used in the typical manner of Windows applications: • For a menu item, use ALT+ to open the menu. • For a command within a menu, type the of the desired command.
Chapter 3
Function Block Diagram (FBD)
76
FBD Editing Tools
Menus & Commands of the FBD Editor (grayed-out commands are common to all TriStation 1131 views)
File
Edit
TRICON
Project
New Project... Open Project... Save Project... Save As... Close Project... 1 2 Print... Print Preview... Print Reports... Print Setup... Exit
Edit Configuration Build Configuration Rebuild Configuration Compile All Project Elements Emulator Control Panel TRICON Control Panel TRICON Diagnostic Panel View Download History... Change State to Download All
New Window Cascade Tile Horizontal Tile Vertical Close All Arrange Icons Show Properties Sheet Show Message Bar (Vertical Message Bar) (Horizontal Message Bar) Hide Message Bar 1 PROGRAM:
Grid Display Zoom... Zoom to Fit... Zone Display Network Numbers IEC Display Mode
Save Description... Comment Macros... Variable Declarations... Build Intermediate Code
Help
TriStation 1131 Help Tip of the Day Keyboard Shortcuts Sample Projects Technical Support About TriStation 1131... TriStation 1131 Logo...
FBD Editing Tools
77
Table of FBD Tools The table that follows describes the main menu commands which are specific to FBD and the tools in the FBD toolbar which correspond to these commands.
As noted earlier, the underlined characters shown in the menu and command names are shortcut keys to be used in the typical manner of Windows applications. Edit Menu Command
Description
Undo
Reverses the last action performed when editing a project element (program, function, or function block).
Redo
Reverses the last Undo command. This must be done before any other editing is done.
Edit Session Journal
Opens a dialog box which displays a sequential list of actions undertaken during the most recent edit session. Any previous state during the current edit session can be recovered and displayed by selecting from the list.
Cut
Cuts (deletes) selected items from the current sheet and places them on the clipboard, erasing the previous contents.
Copy
Copies selected items from the current sheet and places them on the clipboard, erasing the previous contents.
Paste
Pastes the current contents of the clipboard into the current element.
Find
Finds specific text within the current program, function or function block. An options menu lets you select names and types of various elements, text in comments and captured elements, and sensitivity.
Replace
Replaces specific text within the logic elements of the current project element.
Chapter 3
Function Block Diagram (FBD)
78
FBD Editing Tools
Edit Menu (continued) Command
Description
Select Network Contents
Selects all logic elements within a network for the current project element. At least one element (input, output, variable) must already be selected.
Select Sheet Contents
Selects all elements on the current sheet.
Element Menu
Chapter 3
Command
Description
Save Element
Saves the open element but not the entire project.
Description
Gives identifying information about the project creator, creation date, etc. and allows you to select read/write status and enter descriptive text.
Comment Macros
Allows you to select macros for use in comments for your logic.
Variable Declarations
Lists all of the variables on your logic sheet and allows you to manipulate them in various ways. Can also be used to declare variables before you place the variable elements on the logic sheet.
Build Element
Updates and compiles the current project element (program, function, function block) without linking it to the project.
Intermediate Code
Displays source code that is generated in the Structured Text language when the current element is compiled.
Function Block Diagram (FBD)
FBD Editing Tools
79
View Menu Command
Description
Grid Display
Changes the background of the active window to display or not display an editing grid for precise placement of program elements.
Zoom
Allows you to select the zoom view of your logic sheet from preset and custom views.
Zoom to Fit
Displays the entire logic sheet within the current window.
Zone Display
Changes the background of the active window to show the zone grid on the sheet.
Network Numbers
Displays network numbers in the upper left corner for each network on the current sheet.
IEC Display Mode
Changes the display characteristics of elements in the current sheet to IEC format.
Tools Menu Command
Description
Update Selected Blocks
Updates selected out-of-date elements marked with a red X in the active window.
Automatic Naming
Allows you to select a numeric pattern for the automatic naming of program elements.
Annotate Instance
Allows you to select an instance of a program for viewing of annotations, including the values of variables during execution either in the Emulator or the TRICON.
Select Tool (Arrow)
Changes the mouse cursor into an arrow when positioned over the active window to allow you to select items.
Insert: Function Block
Opens the Select Element dialog box and allows you to select a function block of your choice and place it on the logic sheet.
Chapter 3
Function Block Diagram (FBD)
80
FBD Editing Tools
Tools Menu (continued) Command
Description
Local Variable
Allows you to place a Local variable element on your logic sheet.
Input Variable
Allows you to place an Input variable element on your logic sheet.
Output Variable
Allows you to place an Output variable element on your logic sheet.
Constant
Allows you to place a Constant element on your logic sheet.
Wire
Allows you to connect your logic elements with the wire tool.
Comment
Allows you to place a comment box on the logic sheet.
Horizontal Network Divider
Allows you to position a horizontal network divider on your logic sheet.
Vertical Network Divider
Allows you to position a vertical network divider on your logic sheet.
Sheets Menu
Chapter 3
Command
Description
Sheet Title
Allows you to edit the title of the current sheet (displayed in the title block, window caption bar and Window Menu list).
Next Sheet
Displays the next sheet (for logic elements with multiple sheets).
Previous Sheet
Displays the previous sheet (for logic elements with multiple sheets).
Find Sheet
Allows you to find and select sheets by sheet title and provides access to dialog boxes for insertion, deletion, and appending of sheets.
Append Sheet
Adds a new sheet to the end of the current project element.
Function Block Diagram (FBD)
FBD Editing Tools
81
Sheets Menu (continued) Command
Description
Insert Sheet
Inserts a new sheet before the current sheet or before a horizontal network boundary (if selected).
Delete Sheet
Deletes the sheet that is currently displayed.
Sheet Template
Selects a sheet template for the current sheet from a list of available templates.
Chapter 3
Function Block Diagram (FBD)
82
FBD Editing Tools
Enlarged View of Elements There are two ways to enlarge your view of selected elements in an FBD logic sheet. One way is to highlight the desired elements and use the Zoom... command in the View menu to select a percentage of enlargement. A quicker way to change the Zoom is to double-click the left mouse button in any empty area to see a “Zoom Selection” view. This is a full view of the logic sheet with the contents of the current view area highlighted in a rectangle. You can move the current view rectangle by clicking the left mouse button in a different area of the drawing sheet or by drawing a new view rectangle, holding down the left mouse button while drawing.
Current View Rectangle
Chapter 3
Function Block Diagram (FBD)
Manipulating Logic Sheets
83
Manipulating Logic Sheets When you open a new program, function or function block in the Project Directory, TriStation 1131 automatically displays a default template for your logic sheet. If desired, you can select a different template, give the logic sheet a title, complete other fields in the sheet description, and insert and append additional sheets. The Sheets command in the FBD main menu offers these commands for manipulating logic sheets: • Sheet Title • Next Sheet (also found in toolbar) • Previous Sheet (also found in toolbar) • Find Sheet... (also found in toolbar) • Append Sheet • Insert Sheet • Delete Sheet • Sheet Template... Sheet Title allows you to edit the title of the current sheet. The sheet title is displayed in the title block, the window caption bar and the Window Menu list. Append Sheet adds a new sheet after an existing sheet. Insert Sheet adds a new sheet before an existing sheet. Find Sheet allows you to find and select sheets by sheet title in a multi-sheet program or function block. This command also provides access to dialog boxes for insertion, deletion, and appending of sheets. The Sheet Template command allows you to apply a different template to the current sheet. (The default template is called Sheet Template B.) Select from the following standard-size drafting sheets in either landscape or portrait orientation: Sheet A — 8.5" x 11" Sheet B — 11" x 17" Sheet C — 17" x 22" Sheet D — 22" x 34"
Chapter 3
Function Block Diagram (FBD)
84
Manipulating Logic Sheets
Assigning Sheet Properties When you open a new program, function or function block, some of the fields in the sheet description are automatically filled by TriStation 1131. To modify these fields or fill in other fields, double-click on the sheet description in the lower right corner of the screen and select the desired field, as shown in the following example:
Chapter 3
Function Block Diagram (FBD)
Declaring Input, Output & Local Variables
85
Declaring Input, Output & Local Variables Input, output and local variables can be declared in a number of ways. A typical approach is to place the variables on your worksheet using the tools or the menu commands. (Refer to the section called “Table of FBD Tools” earlier in this chapter for details.) Once you have placed a variable of each type you need, you can copy and paste these multiple times as needed using menu commands or keyboard shortcuts. Then you can bring up the Properties box by double-clicking on a variable element. Click on the push pin, and begin assigning properties to the variables. Another approach is to use the Declarations dialog box to declare several variable names, then use the Name menu in the Properties box to apply these names to each variable element on the worksheet. A third approach is to apply a naming convention to several selected variable elements using the Auto Name feature. The Properties box for variables has three tab pages: Selected, Declaration and Annotation, as shown in the example below. This section covers the options for variable declaration in their order of appearance in the tab pages.
Properties under the Selected Tab The Selected tab of the Properties box for local, input and output variables allows you to name your variables (manually or automatically), adjust the width of variable symbols, and turn on variable annotation.
Chapter 3
Function Block Diagram (FBD)
86
Declaring Input, Output & Local Variables
Naming Use the Properties box to name a selected variable as shown in the example above, or name several variables automatically using the Auto Name feature. A variable name or identifier can have up to 31 alphanumeric and underscore characters. All identifiers must begin with an alpha character (A to Z) and must not include any imbedded spaces. Identifiers are not case-sensitive.
Width The plus (+) and minus (-) icons of the Selected tab expand or shrink the width of the selected variable symbol so you can use a longer name or fit the symbol into a smaller space.
Annotation The Annotation checkbox of the Selected tab allows you to apply variable annotation on a per-variable basis. A variable annotation is a special kind of comment box attached to the bottom of a variable which can display the value of the variable during execution, macros and descriptive text. The values of the variable and the macros are displayed only in an instance view of your program logic. Refer to the section called “Comments, Variable Annotation & Macros” for more information.
Chapter 3
Function Block Diagram (FBD)
Declaring Input, Output & Local Variables
87
Automatic Naming The Auto Name feature, accessible from the Selected tab, is helpful when you have several similar variables and want to name them according to a convention. For example, you have 50 gas detector inputs, and you want to call them GAS_DETECT_1, GAS_DETECT_2, GAS_DETECT_3, etc. Automatic naming lets you select the desired prefix and the increment you wish to use. In this example, you would enter GAS_DETECT_%0 to start the automatic names at 1.
Chapter 3
Function Block Diagram (FBD)
88
Declaring Input, Output & Local Variables
Properties under the Declaration Tab The Declaration tab of the Properties box (shown below) for variables allows you to: • Select the data type and variable • Apply an initial value and description • Access the Variable Declarations window
Chapter 3
Function Block Diagram (FBD)
Declaring Input, Output & Local Variables
89
Data Type An elementary data type defines the size and characteristics of a variable. Use the Data Type drop-down list under the Declarations tab of the Properties box to select an appropriate data type for a variable. The list below describes all available data types. See the next section called “Restrictions” for applicability. Data Type
Size & Characteristics
BOOL
A Boolean, 1 bit in length
DATE
A specific date, in the format D#CCYY-MM-DD
DINT
A double integer, 32 bits in length
DT
A specific date and time, in one of the following formats: – DT#CCYY-MMDD-HH-HH:MM:SS – DATE_AND_TIME#CCYY-MM-DD-HH:MM:SS
DWORD
A double word, 32 bits in length
INT
An integer, 16 bits in length
LREAL
A long real number, 64 bits in length
REAL
A real number, 32 bits in length
STRING
A sequence of up to 132 alphanumeric characters delimited by single quotes
TIME
A period of time (duration) measured in milliseconds.
TOD
A specific time of day, in one of the following formats: – TOD#HH:MM:SS – TIME_OF_DAY#HH:MM:SS
Chapter 3
Function Block Diagram (FBD)
90
Declaring Input, Output & Local Variables
Restrictions In functions and function blocks, you can select any data type from the list above for any variable type (Input, Output, In/Out and Local). In programs, you can select any data type for Local variables, but your selection for Input, Output and In/Out variables is restricted to the following data types: • BOOL • DINT • REAL This limitation applies because Input, Output and In/Out variables must be connected to TRICON points (hardware addresses).
Variable Type Use the Var Type field under the Declarations tab of the Properties box to select one of the following variable types: • Input • Output • In/Out • Local An Input is a variable used to supply a value to program, function block or function. An Output is a variable used to return the result of an evaluation by a program, function block or function. An Input/Output is a variable that serves as both an Input and an Output. A Local is a variable for internal logic only which cannot be connected to a TRICON point. After placing a variable on your logic sheet, you can change its type through the Properties box by selecting the desired variable type. For example, there is no tool or command that allows you to place a variable of type In/Out on the logic sheet. So you have to place another type of variable on the sheet, then go to the Declarations tab of the Properties box and change the variable’s type to In/Out.
Chapter 3
Function Block Diagram (FBD)
Declaring Input, Output & Local Variables
91
Initial Value The Initial Value field under the Declarations tab is enabled for all variable types in functions and function blocks, but only for local variables in programs. During a Download All, the TRICON sets the values of all variables either to zero or to the initial value you have declared as a property of the variable.
Description The Description field under the Declarations tab allow you to enter descriptive text about a selected variable. Copy the %DESCRIPTION macro to the text box under the Annotation tab if you want this descriptive text to be displayed in a comment or annotation. For details, refer to the section called “Inserting Macros into Comments or Annotations” later in this chapter.
Chapter 3
Function Block Diagram (FBD)
92
Declaring Input, Output & Local Variables
Declaration Dialog Box The Declaration dialog box (shown in the example below), accessible from the Declaration tab, provides a graphic display of all the variables in your logic and allows you to manipulate the variables in the following ways: • Adding, modifying and deleting • Moving up and down • Sorting • Grouping
Chapter 3
Function Block Diagram (FBD)
Declaring Input, Output & Local Variables
93
Adding New Variables The Add feature of the Declarations dialog box lets you declare variables you have not yet placed on your logic sheet. Later, when you do place the variable elements on the logic sheet and bring up the Properties box, any declared variables appear for your selection under the Name field of the Selected tab, as shown in the following example:
Chapter 3
Function Block Diagram (FBD)
94
Declaring Input, Output & Local Variables
Properties under the Annotation Tab If you have checked the Annotate checkbox of the Selected tab in the Properties box for a selected variable, the Annotation tab allows you to: • Display the value of the variable during execution • Select and/or modify macros for the variable annotation • Type descriptive text for the variable annotation
As shown in the example above, a variable annotation is a special kind of comment box attached to the bottom of a variable which can display the value of the variable during execution, macros and descriptive text. The values of the variable and the macros are displayed only in an instance view of your program logic. Refer to the section called “Comments, Variable Annotation & Macros” for more information.
Chapter 3
Function Block Diagram (FBD)
Declaring Constants
95
Declaring Constants Constants are usually limited to a single data type within a program, function block or function. Place a constant symbol on your logic sheet using either the Constant button in the Tools menu or the Constant command in the Tools...Insert menu. Then double-click on the constant symbol to display the Properties box, which has two tabs: Constant and Annotation. This section covers the properties of a constant in the order of their appearance in the tab pages.
Properties under the Constant Tab Value, Type & Validate The constant value you enter in the Value field must agree with the elementary data type you select from the list under the Type field. Click on Validate to ensure value/type agreement. Data types that apply to constants are as follows: • BOOL • DATE • DINT • DT • DWORD • INT • LREAL • REAL • STRING • TIME • TOD
Chapter 3
Function Block Diagram (FBD)
96
Declaring Constants
Width Field The plus (+) and minus (-) icons expand or shrink the width of the constant symbol so you can use a longer name or fit the symbol into a smaller space.
Annotate Checkbox Click on the Annotation checkbox of the Constant tab to turn on the annotation feature for a selected constant. Refer to the section below called “Properties under the Annotate Tab” for more information.
Auto Name Feature The Auto Name feature may be useful for applying consecutive values to multiple constants, but it is primarily used for the automatic naming of several similar variables according to a convention you select. For more information, refer to “Automatic Naming” in the section called “Declaring Input, Output & Local Variables.”
Properties under the Annotate Tab If you have clicked on the Annotate checkbox under the Constant tab for a selected constant, the Annotation tab allows you to: • Select and/or modify macros for the annotation • Type descriptive text for the annotation In general, an annotation is a special kind of comment box attached to the bottom of a logic element which can display its TRICON Point Connection (Tag Name), its value during execution, macros and descriptive text. Because a constant always has the same value and does not have a TRICON Point Connection, there is no question of displaying various values during execution. However, macros and descriptive text can be used if desired.
Chapter 3
Function Block Diagram (FBD)
Declaring Functions & Function Blocks
97
Declaring Functions & Function Blocks Clicking on the Select FBlock Tool or using the Tools...Insert...Function (Block) command displays the following menu, which allows you to select a function or function block from the project library:
To search for a desired function or function block, you can: • Use the Find field to search for similar names. • Sort the Element Name or Category column alphabetically by clicking on the column heading, then look for the desired functionality. After placing a function or function block on your logic sheet, that same element remains selected in the library menu in case you want to add more elements of the same type. Or you can copy and paste a function or function block multiple times as needed using menu commands or keyboard shortcuts.
Chapter 3
Function Block Diagram (FBD)
98
Declaring Functions & Function Blocks
To declare the properties of a function or function block, double-click on the element to bring up the Properties box and click on the push pin. This will keep the Properties box displayed on top as you move from element to element declaring properties.
Declaring the Properties of Functions The Properties box for a function has only one tab with several user-modifiable fields, as shown in the following example:
The properties of functions can be understood in terms of the rules that govern them: • The inputs of most functions have a generic data type called ANY_NUM according to the IEC-1131 standard. • All of the inputs to a function must have the same data type. • A function has only output, which must have the same data type as the inputs. • Some functions are extensible, which means you can add as many as 50 inputs to the function.
Inputs List The names and data type of the inputs to a function are displayed in the Inputs list of the function’s Properties box. All of the inputs to a function must have the same data type. If they do not, TriStation 1131 generates a type mismatch error when you use the Build Element (compile) command.
Chapter 3
Function Block Diagram (FBD)
Declaring Functions & Function Blocks
99
Some functions have inputs of type BOOL, but most inputs have the generic data type called ANY_NUM according to the IEC-1131 standard. The ANY_NUM data type includes ANY_REAL and ANY_INT data types. For more information about generic data types, refer to the “Data Types” section in Chapter 2, “A TriStation 1131 Project.” Extensible Functions Some functions are extensible, which means you can add as many as 50 inputs to the function in one of two ways: • Enter the desired number in the Number of Inputs field of the function’s Properties box and press Confirm. • Click and drag on the double line at the bottom of the function symbol until the desired number of inputs appears. The example on the preceding page shows the ADD function with the number of inputs extended from two (the default) to seven. If the number of inputs for a particular function cannot be changed, TriStation 1131 displays a message to this effect in place of the Number of Inputs field on the function’s Properties box.
Output of a Function A function has only one output which must have the same data type as the inputs to the function.
Negating Inputs or Outputs The negation feature inverts the value of a BOOL input or output that is connected to a function. When you select a BOOL variable name from the Inputs or Outputs list in the Properties dialog box, and click on Negate Selected Input or Negate Output, a small circle appears on the corresponding terminal of the function, as shown in the example that follows. If the Negate Selected Input and/or Negate Output options are grayed out, then negation is not available for the inputs and outputs of this function.
Chapter 3
Function Block Diagram (FBD)
100
Declaring Functions & Function Blocks
A circle on an input terminal means that the ON or OFF value of the input will be inverted before being processed by the function. A circle on an output terminal creates a NOT condition—in other words, the ON or OFF output value resulting from processing by the function is inverted as it exits.
Width The plus (+) and minus (-) icons expand or shrink the width of the function symbol as desired.
Double-space Option Clicking on the Double-space option under the Terminals field makes the function symbol twice as long and spaces the terminals for connecting variables further apart. This makes room for additional inputs, variable annotation or comments.
Chapter 3
Function Block Diagram (FBD)
Declaring Functions & Function Blocks
101
EN/ENO Parameters Note The use of EN and ENO parameters is optional for the FBD language and required for the LD language. EN and ENO are type BOOL input and output parameters that detect and isolate errors in LD and FBD logic. The EN (enable) input parameter enables invocation of the function and carries power from the left power rail. The ENO (enable out) output parameter indicates whether the function has detected an error and connects either to the EN input of the next function or to the ground rail. When you click on the EN/ENO option in the Terminals field of a function’s Properties box, EN and ENO parameters are displayed on either side of the function, as shown in the following example:
If EN is False (0), the function has not been called, and the value of ENO is reset to False (0). If EN is True (1), the function has been called, and ENO indicates whether the function has detected an error. If ENO is True, the function has not detected any errors. If ENO is False, the function has detected an error, and evaluation of the network stops—the return value is not written to any variable. If EN/ENO is visible on any function in a network, then EN/ENO must be visible on every function in the network. If there is more than one function with EN/ENO visible in a network, then for every function except the last function, you must connect the ENO output directly to the EN input of the next function. You must not connect an ENO output to more than one EN input. The ExENO.pt2 sample project on the TriStation 1131 CD demonstrates the use of EN/ENO to detect and isolate errors in LD and FBD logic.
Chapter 3
Function Block Diagram (FBD)
102
Declaring Functions & Function Blocks
Declaring the Properties of a Function Block The Properties box for a function block has two tabs: Selected and Declaration. This section covers the function block properties in their order of appearance in the tab pages.
Fields under the Selected Tab Most of the modifiable characteristics of a function block are found under the Selected tab of its Properties box. Instance Name The Instance Name field of the Selected tab is used to identify each instance of a function block as a separate variable in your program. When you place a function block from the library onto the logic sheet, three asterisks (***) appear at the top of the function block and in the Instance Name field, as shown in the example above. You must replace the asterisks with a name or identifier which has up to 31 alphanumeric and underscore characters. All identifiers must begin with an alpha character (A to Z) and must not include any imbedded spaces. Identifiers are not case-sensitive. Inputs List A function block selected from the TriStation 1131 library can have multiple inputs. The names and data type of the inputs are displayed in the Inputs list of the function block’s Properties box. The only property of a function block input that
Chapter 3
Function Block Diagram (FBD)
Declaring Functions & Function Blocks
103
you can modify is the polarity, if the input is of type BOOL. Refer to the upcoming section called “Negating Inputs or Outputs” for more information. Outputs List A function block selected from the project library can have multiple outputs. The names and data type of the outputs are displayed in the Outputs list of the function block’s Properties box. The only property of a function block output that you can modify is the polarity, if the output is of type BOOL. Refer to the upcoming section called “Negating Inputs or Outputs” for more information. Negating Inputs or Outputs The negation feature inverts the value of a BOOL input or output that is connected to a function block. When you select a BOOL variable name from the Inputs or Outputs list, and click on the Negate Terminal checkbox, a small circle appears on the corresponding terminal of the function block. A circle on an input terminal means that the ON or OFF value of the input will be inverted before being processed by the function block. A circle on an output terminal creates a NOT condition—in other words, the ON or OFF output value resulting from processing by the function block is inverted as it exits. In the following example, the Outputs option and a BOOL variable called Q are selected. Clicking the Negate Terminal checkbox causes a circle to appear on Q, the output terminal of the TOF function, to indicate that inversion of the output value will take place.
Width The plus (+) and minus (-) icons expand or shrink the width of the function block symbol so you can use a longer name or fit the symbol into a smaller space.
Chapter 3
Function Block Diagram (FBD)
104
Declaring Functions & Function Blocks
EN/ENO Parameters The option for EN (enable input) and ENO (enable output) parameters is not active for function blocks in the FBD language. Double-space Option Clicking on the Double-space option under the Terminals field makes the function symbol twice as long and spaces the terminals for connecting variables further apart. This makes room for additional inputs, variable annotation or comments.
Fields of the Declaration Tab The Declaration tab of the Properties box for a function block tells the Data Type of the function block instance and provides a Description field for text, as shown in the following example. The Var Type field indicates that a function block instance always has a variable type of Local.
Chapter 3
Function Block Diagram (FBD)
Wire Properties
105
Wire Properties In an FBD program, wires for interconnecting your logic elements are accessible by means of the Wire tool or the Wire command in the Tools...Insert menu. There are two kinds of wires: Normal and Feedback (represented by a dashed line). Normal wires are the default. To change a Normal wire into a Feedback wire, double-click on the wire to bring up the Properties box and select the Feedback Wire option, as shown in this example:
Chapter 3
Function Block Diagram (FBD)
106
Network Dividers
Network Dividers In FBD, you can divide the logic on your sheet into various networks by means of horizontal and vertical network dividers, as shown in the following example. These dividers are accessible by means of the Horiz. Network Divider tool and the Vert. Network Divider tool on the FBD toolbar, or commands of the same names in the Tools...Insert menu.
Chapter 3
Function Block Diagram (FBD)
Comments, Variable Annotation & Macros
107
Comments, Variable Annotation & Macros TriStation 1131 offers two methods for documenting FBD program logic: comments and variable annotation. Both methods allow you to type in descriptive text and make use of macros that describe various characteristics of the project, its elements and the logic sheet. A comment box can be placed anywhere on the logic sheet, but a variable annotation is attached to the bottom of a variable and is meant to be used in an instance view of your program logic. This section covers the following topics: • Including comments • Using variable annotation • Using macros
Including Comments Comments are used to describe specific operations or tasks performed by a program, function block or function within a project. There is no limitation on the number of comment boxes per program or their placement on a logic sheet. You can even draw comment boxes around, or on top of, any logic element. Place a comment box on your logic sheet with either the Comment Tool on the toolbar or the Insert...Comment command in the Tools menu. Double-click on the comment box to bring up the Properties dialog box where you can enter comment text, select macros for inclusion in the comment, and adjust the placement of the comment box with regard to your logic elements. Resize the comment box by clicking on the edge of the box, holding down the mouse button and dragging, as you would resize any window in a Windows application. The Properties dialog box for comments has four tabs whose features are described in the following sections.
Chapter 3
Function Block Diagram (FBD)
108
Comments, Variable Annotation & Macros
Comment Tab The Comment tab, as shown below, lets you adjust comment text in three ways: • Left, right or center alignment • Text size from 3 points to 24 points • Single, double or no border around the comment box
Inserting Macros into Comments The Comment tab also allows you to access macros for the project, element or sheet. To insert a macro into your comment box, click on the Macros field to bring up a list of available macros. Select the one you want, then use CTRL+C to copy it. Close the macro list, place the cursor in your comment text, and use CTRL+V to paste in the macro. Refer to the upcoming section called “Using Macros” for more detailed information.
Style Tab There are three fields under the Style tab that allow you to edit a comment in various ways: Expand Macros Click on this option to display the actual values of the macros you have included in the selected comment box.
Chapter 3
Function Block Diagram (FBD)
Comments, Variable Annotation & Macros
109
Enable Macro Editing Click on this option and take the following steps to create your own macro by combining other, existing macros: • Add one or more modifiable macros to your comment text (under the Comment tab). Modifiable macros are identified by a pencil icon in the Current Value column of the Edit Macros dialog box. • Click on the Enable Macro Editing option. • Go to the Edit Fields tab and select a modifiable macro from the list that is displayed. Click on Modify to edit the text of the macro. • Refer to the upcoming section called “Using Macros” for more detailed information about macros. Move Behind Logic Elements Click on this option to move a selected comment box behind a logic element. This creates the effect of enclosing or surrounding the element with descriptive text. Click the option off if you later want to remove the comment box from behind the logic element.
Pickup-Drop Tab This feature allows a comment box to capture logic elements so that they become part of the comment. To “pickup” one or more elements, move the comment box so that it entirely covers the elements to be captured (resizing the comment box if necessary), then press Pickup. Press Drop to release the logic element from the comment box. Logic elements captured in a comment box are not executable, but if you later release them from the comment box, they can be made executable.
Edit Fields Tab This tab is used in conjunction with the Enable Macro Editing option found under the Style tab. If you have included modifiable macros in your comment text, their names will be listed for selection under the Edit Fields tab. Refer to the upcoming section called “Using Macros” for more detailed information about macros.
Chapter 3
Function Block Diagram (FBD)
110
Comments, Variable Annotation & Macros
Using Variable Annotation A variable annotation is a special kind of comment box that is attached to the bottom of an input, output, input/output or local variable. The annotation box is sizable for width and height and moves wherever the associated variable is moved. An annotation can consist of any of the following types of information: • the monitor value (value of the variable as the configuration executes) • the default macro for the particular type of variable • other standard macros • user-modified macros • text that you type in The values of the macros and the variables themselves are displayed only in an instance view of your program logic. From the FBD editor, the Configuration editor or a Control Panel, you select an instance view by pressing the Annotation Instance button on the toolbar and selecting a program instance name from the dialog box, as shown below. Annotation Instance button
Chapter 3
Function Block Diagram (FBD)
Comments, Variable Annotation & Macros
111
The following is an example of an instance view with the monitor value turned on and the default macro displayed for an input and output variable respectively:
There are two main ways to use variable annotation in a program or function block: • Turn on the feature for your entire project as soon as you open a new project • Turn on the feature for individual variables in your logic, one at a time
Annotation for the Entire Project Variable annotation works in an “automatic” sense if you turn on the feature as soon as you open a new project, before creating any programs or function blocks. Do this by opening the Project Options menu, selecting the Variable Annotations tab (shown below), and checking one or both of the following options in the General box: • Annotation on by default • Monitor value on by default The Annotation on by default option causes variable annotation boxes to appear automatically every time you place a variable on the logic sheet for a program or function block. The Monitor value on by default option displays, in the upper left corner of the annotation box, the value of each variable during execution.
Chapter 3
Function Block Diagram (FBD)
112
Comments, Variable Annotation & Macros
The Style box allows you to adjust the alignment of text in annotation boxes and the borders around them, as well as the text size for each of the sheet template styles (Sheet Template A, B, C or D). The Default Macros or Text box allows you to set default macros for each class of variable which automatically display information about the variables when you select an instance view. Program Variables are variable classes in programs whereas Non-program Variables are variable classes in functions and function blocks. Refer to “Default Macros for Annotation Boxes” under the upcoming section called “Using Macros” for more information. Note Annotation boxes underneath variables require extra space, depending on how many macros and how much text you include. So turning on the annotation capability at the beginning of a project is an advantage in terms of designing your program logic for maximum readability.
Chapter 3
Function Block Diagram (FBD)
Comments, Variable Annotation & Macros
113
Annotating Individual Variables Even if you have not turned on annotation for all program variables using the Variable Annotations menu, you can turn it on for individual variables by doing the following: • Double-click on a variable to bring up the Properties box. • Click on the Annotate checkbox in the lower right corner of the Selected tab. • If desired, go to the Annotation tab and click on the box for Include monitor value in annotation. • The default macro for the variable is already present. To insert an additional macro, click on the Macros field (in the Annotation dialog box) to bring up a list of available macros. Select the one you want, then use CTRL+C to copy it. Close the macro list, place the cursor in your annotation text, and use CTRL+V to paste in the macro.
Using Instance Views An instance view of an FBD program looks similar to the editing view, except that it depicts a specific instance of the program and the macros in the variable annotations are expanded. There are three ways to invoke an instance view: • From the FBD Editor — While viewing a program in the FBD editor, click on the Annotation Instance tool to display a list of the program instances. Select an instance name, click OK, and the variable annotations will be expanded. • From the TRICON Configuration editor — Select an instance name from the Program Instance Declarations node in the configuration tree. Click on the Annotation Instance tool and a read-only instance view of the program logic will be displayed, with the variable annotations expanded. • From the Control Panel — Select an instance name from the program instance variable tree. Click on the Annotation Instance tool and a readonly instance view of the program logic will be displayed, with the variable annotations expanded. The actual monitor value (value of the variable during program execution) is displayed only in an instance view invoked from the Control Panel.
Chapter 3
Function Block Diagram (FBD)
114
Comments, Variable Annotation & Macros
The sample instance view below was invoked from the FBD editor. The variable annotations include the monitor value and expanded values of the default macro called %PGM_INPUT which includes the: • Tag Name • I/O module type • TRICON point connection (hardware address) and Alias number
Chapter 3
Function Block Diagram (FBD)
Comments, Variable Annotation & Macros
115
Using Macros Macros, used in comments and variable annotations, are placeholders for the insertion of text defined or calculated elsewhere in TriStation 1131. There are two types of macros, all of which begin with a percent (%) sign: • A system macro has expanded values supplied by TriStation 1131 and cannot be modified. • A user-modifiable macro has expanded values supplied by the user—it can include one or more system macros that you copy into it. Examples of the two types of macros are shown in the Edit Macros dialog box that follows. The sample dialog box also shows some default macros for variable annotation and some platform descriptor macros. The default macros for variable annotation are user-modifiable, whereas the platform descriptor macros are system macros. All of these types of macros are described in the upcoming sections: • Inserting macros into comments or annotations • Working with user-modifiable macros • Default macros for variable annotation
Chapter 3
Function Block Diagram (FBD)
116
Comments, Variable Annotation & Macros
Inserting Macros into Comments or Annotations You can access a complete list of macros for the project, element and sheet by means of the Edit Macros dialog box (shown on the preceding page). To insert a macro into a comment on annotation box, follow these steps: • In the Properties box for a comment, click on the Macros field (under the Comment tab) to bring up the list of available macros in the Edit Macros dialog box. • In the Properties box for an annotation, click on the Macros field (under the Annotation tab) to bring up the list of available macros in the Edit Macros dialog box. • Select the macro you want, then use CTRL+C on the keyboard to copy it. • Close the Edit Macros dialog box. • Place the cursor in your comment or annotation box, and use CTRL+V to paste in the macro. Add text if desired to explain what kind of information the macro is showing you, as in the following example. (In this example, the macros are expanded because the Expand Macros box is checked under the Style tab of the comment’s Properties box.)
Chapter 3
Function Block Diagram (FBD)
Comments, Variable Annotation & Macros
117
Working with User-Modifiable Macros User-modifiable macros are identified by the presence of a pencil icon in the Current Value column of the Edit Macros dialog box (shown below during the process of macro modification). To modify a macro, follow these steps: • Copy any system macro you wish to include by selecting that macro and pressing CTRL+C on the keyboard. In the example below, the copied macro is %CREATED_BY. • Select the desired user-modifiable macro and click on Modify to bring up an editing box. The example below uses %PGM_INPUT, the default macro for annotating a program variable of the input class. • In the Edit Macro Text dialog box, paste in the previously-copied system macro (%CREATED_BY) by pressing CTRL+V and/or enter text. Click OK. • If you wish to add more than one system macro to the user-modifiable macro, repeat the above process as many times as needed. • When the user-modifiable macro is ready, close the macro list. You can then copy and paste the user-modified macro into comment boxes and annotation boxes as needed, using CTRL+C and CTRL+V on the keyboard.
Chapter 3
Function Block Diagram (FBD)
118
Comments, Variable Annotation & Macros
Note When you change the value of a macro, you are changing it for all comments and annotations in which the macro is used throughout your project.
Default Macros for Annotation Boxes The default contents of annotation boxes are macros that vary with the class of the variable, as shown in the following table: Default Macros for Variable Classes Element Type
Variable Class
Program
Function/Function Block
Default Macro
Input
%PGM_INPUT
Output
%PGM_OUTPUT
Input/Output
%PGM_IO
Local
%PGM_LOCAL
Input
%FB_INPUT
Output
%FB_OUTPUT
Input/Output
%FB_IO
Local
%FB_LOCAL
When a new project is created, these default macros for variable annotation are set to the default values shown in the table below. You can modify the default values of these macros to meet your specific requirements using the Edit Macros dialog box. After the default values are modified, they will appear under the Variable Annotations tab of the Project Options menu. Default Values of Annotation Macros Macro
Chapter 3
Default Value
Sample Expanded Macro
%PGM_INPUT
%PPD_TAGNAME%PPD_CLASS %PPD_LOCATION%PPD_ALIAS
P1.WATER_LOW DI 03.04.13 10018
%PGM_OUTPUT
%PPD_TAGNAME%PPD_CLASS %PPD_LOCATION%PPD_ALIAS
P1.VALVE_ON DO 02.03.07 00016
Function Block Diagram (FBD)
Comments, Variable Annotation & Macros
119
Default Values of Annotation Macros (continued) Default Value
Sample Expanded Macro
%PGM_IO
%PPD_TAGNAME%PPD_CLASS %PPD_LOCATION%PPD_ALIAS
P1.PROCESS_STATUS MI 40252
%PGM_LOCAL
%WHERE_USED
PROCESS_COUNT 1(C7) 3(D5) 4(A2)
%FB_INPUT
%FB_OUTPUT
%FB_IO
%FB_LOCAL
Macro
There are four macros beginning with %PPD which are expanded by the TRICON platform descriptor and are not user-modifiable: TRICON Platform Descriptor Macros Macro
Expanded Value
%PPD_TAGNAME
The name of the TRICON point to which the program variable is connected.
%PPD_CLASS
The class of the TRICON point to which the program variable is connected. For example, “MI” for Memory Integer or “DO” for Digital Output.
%PPD_LOCATION
The location of the TRICON point to which the program variable is connected. This only applies to physical input and output points and is displayed in the format CC.SS.PP where CC is the chassis, SS is the slot and PP is the point. For memory points, an empty string is returned.
%PPD_ALIAS
The Modbus alias of the TRICON point to which the program variable is connected. If the point has no alias, an empty string is returned.
Chapter 3
Function Block Diagram (FBD)
120
Printing Logic Sheets
Printing Logic Sheets From the FBD editor, TriStation 1131 allows you to print the logic sheets you have developed for programs, functions and function blocks. Adjust the view of a logic sheet using commands in the View menu, then use the following File menu commands as desired: • Print Preview • Print Setup • Print... Printing of the following items, which are not specific to FBD, is covered in Chapter 10, “Printing”: • Standard reports • Custom reports designed with Crystal Reports software
Chapter 3
Function Block Diagram (FBD)
CHAPTER 4
Ladder Diagram (LD)
This chapter describes basic methods of writing logic in the LD language and provides details on the use of LD editing tools. The following topics are covered: • Basic methods for writing logic • LD editing tools • Manipulating logic sheets • Links • Power Rails • Declaring contacts & coils • Declaring local, input and output variables • Declaring constants • Declaring functions & function blocks • Network dividers • Comments, variable annotation and macros • Printing logic sheets
122
Basic Methods for Writing Logic
Basic Methods for Writing Logic Many of the methods used for writing logic are the same for the LD and FBD programming languages. This section briefly mentions the basic methods as they apply to the LD language, while upcoming sections supply details about the LD tools and features. The basic methods, which require extensive use of the LD toolbar and/or menus, are as follows: • In the Project Directory, choose New to create a new program, function block or function with the Ladder Diagram option checked. • TriStation 1131 automatically displays a sheet for your logic in the default sheet style. Change the sheet style if desired, give the sheet a title, and complete other fields in the sheet description. • Place your logic elements on the sheet using the LD toolbar and/or menus. The elements can include variables, constants, functions and function blocks. • Connect the logic elements with normal or feedback wires and add horizontal or vertical network dividers if needed. • Declare the properties of each logic element by double-clicking on each to display its associated Properties dialog box. Respond to the prompts and select the appropriate options within the Properties box. • Add comment boxes with macros and/or text that you type in, and turn on variable annotation to document your logic if desired. • Use the Build command in the Element menu to compile the logic. Correct any errors displayed in the Message Bar and build again until there are no errors. • Test your logic in the Emulator Control Panel, returning to the logic sheet to make any necessary modifications. • When testing of the logic is finished, it is time to create your project configuration, as explained in Chapter 6, “Configuration Editor.”
Chapter 4
Ladder Diagram (LD)
LD Editing Tools
123
LD Editing Tools To help you write and edit logic in the LD language, TriStation 1131 provides tools that you can select from a pop-up menu, main menu and toolbar.
Pop-up Menu Pressing the right mouse button while viewing an LD logic sheet displays a pop-up menu either for a selected element or when no particular element is selected. All of the commands in the pop-up menu are accessible from the LD toolbar and main menu as well, except for the Size/Alignment commands described below.
For A Selected Element For a selected element, TriStation 1131 displays commands that apply to that element, as shown in this example (below left) for the NE function block:
Pop-up menu for a selected function block
Pop-up menu for any empty area
For Any Empty Area If you press the right mouse button from any empty area, the pop-up menu displays a different set of commands as shown in the example (above right). The first command, called Select Arrow Key, is useful when you are in the middle of an operation but decide not to complete the operation. At such a time, you can press the right mouse button and choose Select Arrow Key to terminate the unwanted operation and return the cursor to the arrow key.
Chapter 4
Ladder Diagram (LD)
124
LD Editing Tools
Size/Alignment Commands The pop-up menu’s Size/Alignment commands help you arrange multiple elements on an LD logic sheet, as shown in the example below. Take these steps to re-arrange multiple elements: 1 Select all of the elements you want to re-arrange. 2 Place the cursor on the reference element for the size or alignment operation you
are planning to perform. 3 Press the right mouse button to display the pop-up menu. 4 Select the size or alignment operation from the Size/Alignment sub-menu.
Main Menu Commands The LD main menu appears above the toolbar as follows, and the diagram on the following page shows the commands which are accessible from the it. (Menus and commands which are common to all TriStation 1131 views are described in the section called “Basic Editing Tools” in Chapter 2, “A TriStation 1131 Project.”)
Chapter 4
Ladder Diagram (LD)
LD Editing Tools
125
Shortcut Keys In the LD main menu, underlined characters are shortcut keys to be used in the typical manner of Windows applications: • For a menu item, use ALT + to open the menu. • For a command within a menu, type the of the desired command. Menus & Commands of the LD Editor (grayed-out commands are common to all TriStation 1131 views)
File
Edit
TRICON
Project
Element
New Project... Open Project... Save Project... Save As... Close Project... 1 2 Print... Print Preview... Print Reports... Print Setup... Exit
Edit Configuration Build Configuration Rebuild Configuration Compile All Project Elements Emulator Control Panel TRICON Control Panel TRICON Diagnostic Panel View Download History... Change State to Download All
New Window Cascade Tile Horizontal Tile Vertical Close All Arrange Icons Show Properties Sheet Show Message Bar (Vertical Message Bar) (Horizontal Message Bar) Hide Message Bar 1 PROGRAM:
Grid Display Zoom... Zoom to Fit... Zone Display Network Numbers IEC Display Mode
Function (Block)... Contact Coil Right Power Rail Local Variable Input Variable Output Variable Constant Link Comment Horizontal Network Divider Vertical Network Divicer
Save Description... Comment Macros... Variable Declarations... Build Intermediate Code
Help
TriStation 1131 Help Tip of the Day Keyboard Shortcuts Sample Projects Technical Support About TriStation 1131... TriStation 1131 Logo...
Ladder Diagram (LD)
126
LD Editing Tools
Table of LD Tools The table that follows describes the main menu commands which are specific to LD and the tools in the LD toolbar which correspond to these commands.
As noted earlier, the underlined characters shown in the menu and command names are shortcut keys to be used in the typical manner of Windows applications. Edit Menu
Chapter 4
Command
Description
Undo
Reverses the last action performed when editing a project element (program, function, or function block).
Redo
Reverses the last Undo command. This must be done before any other editing is done.
Edit Session Journal
Opens a dialog box which displays a sequential list of actions undertaken during the most recent edit session. Any previous state during the current edit session can be recovered and displayed by selecting from the list.
Cut
Cuts (deletes) selected items from the current sheet and places them on the clipboard, erasing the previous contents on the clipboard.
Copy
Copies selected items from the current sheet and places them on the clipboard, erasing the previous contents on the clipboard.
Paste
Pastes the current contents of the clipboard into the current element.
Find
Finds specific text within the current program, function or function block. An options menu lets you select names and types of various elements, text in comments and captured elements, and sensitivity.
Replace
Replaces specific text within the logic elements of the current project element.
Ladder Diagram (LD)
LD Editing Tools
127
Edit Menu (continued) Select Network Contents
Selects all logic elements within a network for the current project element. At least one element (input, output, variable) must already be selected.
Select Sheet Contents
Selects all elements on the current sheet.
Element Menu Command
Description
Save
Saves the open element but not the entire project.
Description
Gives identifying information about the project creator, creation date, etc. and allows you to select read/write status and enter descriptive text.
Comment Macros
Allows you to select macros for use in comments within your logic.
Variable Declarations
Lists all of the variables on your logic sheet and allows you to manipulate them in various ways. Can also be used to declare variables before you place the variable elements on the logic sheet.
Build Element
Updates and compiles the current project element (program, function, function block) without linking it to the project.
Intermediate Code
Displays source code that is generated in the Structured Text language when the current element is compiled.
Chapter 4
Ladder Diagram (LD)
128
LD Editing Tools
View Menu Command
Description
Grid Display
Changes the background of the active window to display or not display an editing grid for precise placement of program elements.
Zoom
Allows you to select the zoom view of your logic sheet from preset and custom views.
Zoom to Fit
Displays the entire logic sheet within the current window.
Zone Display
Changes the background of the active window to show the zone grid on the sheet.
Network Numbers
Displays network numbers in the upper left corner for each network on the current sheet.
IEC Display Mode
Changes the display characteristics of elements in the current sheet to IEC format.
Tools Menu Command
Description
Update Selected Blocks
Updates selected out-of-date elements marked with a red X in the active window.
Automatic Naming
Allows you to select a numeric pattern for the automatic naming of program elements.
Annotate Instance
Allows you to select an instance of a program for viewing of annotations, including the values of variables during execution either in the Emulator or the TRICON.
Select Tool (Arrow)
Changes the mouse cursor into an arrow when positioned over the active window to allow you to select items.
Insert: Function Block
Chapter 4
Ladder Diagram (LD)
Opens the Select Element dialog box and allows you to select a function block of your choice and place it on the logic sheet.
LD Editing Tools
129
Tools Menu (continued) Command
Description
Contact
Allows you to place a Contact element on the logic sheet. A contact represents the status of an Input variable.
Coil
Allows you to place a Coil element on the logic sheet. A coil represents the assignment or status of an Output variable.
Right Power Rail
Allows you to place a delimiter called a power or ground rail at the right end of an LD network. Left power rails are considered on at all times, while right power rails may be explicit or implied.
Local Variable
Allows you to place a Local variable element on your logic sheet.
Input Variable
Allows you to place an Input variable element on your logic sheet.
Output Variable
Allows you to place an Output variable element on your logic sheet.
Constant
Allows you to place a Constant element on your logic sheet.
Link
Allows you to connect your logic elements with the link tool.
Comment
Allows you to place a comment box on the logic sheet.
Horizontal Network Divider
Allows you to position a horizontal network divider on your logic sheet.
Vertical Network Divider
Allows you to position a vertical network divider on your logic sheet.
Chapter 4
Ladder Diagram (LD)
130
LD Editing Tools
Sheets Menu
Chapter 4
Command
Description
Sheet Title
Allows you to edit the title of the current sheet (displayed in the title block, window caption bar and Window Menu list).
Next Sheet
Displays the next sheet (for logic elements with multiple sheets).
Previous Sheet
Displays the previous sheet (for logic elements with multiple sheets).
Find Sheet
Allows you to find and select sheets by sheet title and provides access to dialog boxes for insertion, deletion, and appending of sheets.
Append Sheet
Adds a new sheet to the end of the current project element.
Insert Sheet
Inserts a new sheet before the current sheet or before a horizontal network boundary (if selected).
Delete Sheet
Deletes the sheet that is currently displayed.
Sheet Template
Selects a sheet template for the current sheet from a list of available templates.
Ladder Diagram (LD)
LD Editing Tools
131
Enlarged View of Elements There are two ways to enlarge your view of selected elements in an LD logic sheet. One way is to use the Zoom... command in the View menu to select a percentage of enlargement. A quicker way to change the Zoom is to double-click the left mouse button in any empty area to see a “Zoom Selection” view. This is a full view of the logic sheet with the contents of the current view area highlighted in a rectangle. You can move the current view rectangle by clicking the left mouse button in a different area of the drawing sheet or by drawing a new view rectangle, holding down the left mouse button while drawing.
Current View Rectangle
Chapter 4
Ladder Diagram (LD)
132
Manipulating Logic Sheets
Manipulating Logic Sheets When you open a new program, function or function block in the Project Directory, TriStation 1131 automatically displays a default template for your logic sheet. If desired, you can select a different template, give the logic sheet a title, complete other fields in the sheet description, and insert and append additional sheets. The Sheets command in the LD main menu offers these commands for manipulating logic sheets: • Sheet Title • Next Sheet (also found in toolbar) • Previous Sheet (also found in toolbar) • Find Sheet... (also found in toolbar) • Append Sheet • Insert Sheet • Delete Sheet • Sheet Template... Sheet Title allows you to edit the title of the current sheet. The sheet title is displayed in the title block, the window caption bar and the Window Menu list. Append Sheet adds a new sheet after an existing sheet. Insert Sheet adds a new sheet before an existing sheet. Find Sheet allows you to find and select sheets by sheet title in a multi-sheet program or function block. This command also provides access to dialog boxes for insertion, deletion, and appending of sheets. The Sheet Template command allows you to apply a different template to the current sheet. (The default template is called Sheet Template B.) Select from the following standard-size drafting sheets in either landscape or portrait orientation: Sheet A — 8.5" x 11" Sheet B — 11" x 17" Sheet C — 17" x 22" Sheet D — 22" x 34"
Chapter 4
Ladder Diagram (LD)
Manipulating Logic Sheets
133
Assigning Sheet Properties When you open a new program, function or function block, some of the fields in the sheet description are automatically filled by TriStation 1131. To modify these fields or fill in other fields, double-click on the sheet description in the lower right corner of the screen and select the desired field, as shown in the following example:
Chapter 4
Ladder Diagram (LD)
134
Links
Links In an LD program, links for interconnecting your logic elements are accessible by means of the Link tool or the Link command in the Tools...Insert menu. Links may be horizontal or vertical, as shown in the example below. The state of a link is either ON or OFF (1 or 0), depending on power flow and its position within the logic.
A horizontal link transmits the state of the element on its immediate left to the element on its immediate right. A vertical link intersects one or more horizontal link elements on each side, as shown above. The state of a vertical link represents the Inclusive OR of the ON states of the horizontal links on its left side: • A vertical link is OFF if the states of all attached horizontal links to its left are OFF. • A vertical link is ON if the state of one or more attached horizontal links to its left is ON. The state of a vertical link is copied to all attached horizontal links on its right, but is not copied to any attached horizontal links on its left.
Chapter 4
Ladder Diagram (LD)
Power Rails 135
Power Rails Left and right power rails are the delimiters of LD networks. Whenever TriStation 1131 presents you with a blank logic sheet for an LD element, the left power rail is automatically supplied on the left side of the sheet. As shown in the example below, the first element in every network must be linked to the left power rail, which is considered ON at all times. The right power rail has an undefined status, and may be explicit or implied. To create an explicit right power rail, use the Right Power Rail Tool on the LD toolbar or select the Right Power Rail command under the Tools...Insert menu.
Chapter 4
Ladder Diagram (LD)
136
Declaring Contacts & Coils
Declaring Contacts & Coils Contacts and coils are specialized elements for the LD language which can be declared in a number of ways. A typical approach is to place contacts and coils on your worksheet using the appropriate tools or menu commands. (Refer to the section called “Table of LD Tools” earlier in this chapter for details.) Once you have placed the desired elements, you can copy and paste them multiple times as needed using menu commands or keyboard shortcuts. Then you can bring up the Properties box by double-clicking on a contact or coil. Click on the push pin, and begin assigning properties to individual elements. Another approach is to use the Declarations dialog box to declare several variable names, then use the Name menu in the Properties box to apply these names to contacts and coils on the worksheet. A third approach is to apply a naming convention to several selected contacts or coils using the Auto Name feature. The Properties box for contacts and coils has three tab pages: Selected, Declaration and Annotation, as shown in the example below. This section covers the options for property declaration in their order of appearance in the tab pages.
Properties under the Selected Tab The Selected tab of the Properties box for a contact or coil allows you to assign a variable name (manually or automatically), adjust the width of the contact or coil symbol, and turn on variable annotation.
Chapter 4
Ladder Diagram (LD)
Declaring Contacts & Coils
137
Naming Use the Properties box to give a variable name to a selected contact or coil as shown in the example above, or name several contacts or coils automatically using the Auto Name feature. A variable name or identifier can have up to 31 alphanumeric and underscore characters. All identifiers must begin with an alpha character (A to Z) and must not include any imbedded spaces. Identifiers are not case-sensitive.
Width The plus (+) and minus (-) icons of the Selected tab expand or shrink the width of the selected contact or coil symbol so you can use a longer name or fit the symbol into a smaller space.
Annotation The Annotation checkbox of the Selected tab allows you to apply annotation on to an individual contact or coil. An annotation is a special kind of comment box attached to the bottom of a contact or coil which can display the value of its variable name during execution, macros and descriptive text. The values during execution and the macros are displayed only in an instance view of your program logic. Refer to the section called “Comments, Variable Annotation & Macros” later in this chapter for more information.
Chapter 4
Ladder Diagram (LD)
138
Declaring Contacts & Coils
Contact Type If you are declaring properties for a contact, the Selected tab of the Properties dialog box will include a field for Contact Type. The following types of contacts are available for selection in a drop-down list (pictured below): Contact Type
The state of the left link is copied to the right link if the state of the Boolean variable is ON.
—|
Normally Closed
—| / |—
The state of the left link is copied to the right link if the state of the Boolean variable is OFF.
—| P |—
The state of the right link is ON from one evaluation to the next when the associated variable transitions from OFF to ON while the state of the left link is ON.
—| N |—
The state of the right link is ON from one evaluation to the next when the associated variable transitions from ON to OFF while the state of the left link is ON.
Negative Transition
Ladder Diagram (LD)
|—
Description
Normally Open
Positive Transition
Chapter 4
Symbol
Declaring Contacts & Coils
139
Coil Type If you are declaring properties for a coil, the Selected tab of the Properties dialog box will include a field for Coil Type. The following types of coils are available for selection in a drop-down list (pictured below): Coil Type
Symbol )
Description The state of the left link is copied to the associated Boolean variable and to the right link.
Normal (Momentary
(
Negated (Momentary)
( / )
The inverse of the left link’s state is copied to the associated Boolean variable and to the right link.
Positive Transition
(P)
The state of the associated Boolean variable is ON from one evaluation to the next when the left link transitions from OFF to ON.
Negative Transition
(N)
The state of the associated Boolean variable is ON from one evaluation to the next when the left link transitions from ON to OFF.
Set (Latch)
(S)
The associated Boolean variable is set to ON when the left link is in the ON state and remains ON until reset by the RESET coil.
Reset (Unlatch)
(R)
The associated Boolean variable is reset to OFF when the left link is in the ON state and remains OFF until set by the SET coil.
Chapter 4
Ladder Diagram (LD)
140
Declaring Contacts & Coils
Automatic Naming The Auto Name feature, accessible from the Selected tab, is helpful when you have several similar contacts or coils and want to name them according to a convention. For example, you have 50 gas detector inputs, and you want to call them GAS_DETECT_1, GAS_DETECT_2, GAS_DETECT_3, etc. Automatic naming lets you select the desired prefix and the increment you wish to use. In this example, you would enter GAS_DETECT_%0 to start the automatic names at 1.
Chapter 4
Ladder Diagram (LD)
Declaring Contacts & Coils
141
Properties under the Declaration Tab The Declaration tab of the Properties dialog box for a contact or coil (shown below) allows you to: • View the data type—all contacts and coils are of type BOOL • Select the variable type—Input, Output, In/Out or Local • Include a written description • Access the Declarations dialog box for variable manipulation
Variable Type Use the Var Type field under the Declarations tab to select one of the following types for the variable name associate with a contact or coil: • Input • Output • In/Out • Local An Input is a variable used to supply a value to program, function block or function. An Input variable must be connected to a TRICON point. An Output is a variable used to return the result of an evaluation by a program, function block or function. An Output variable must be connected to a TRICON point.
Chapter 4
Ladder Diagram (LD)
142
Declaring Contacts & Coils
An Input/Output is a variable that serves as both an Input and an Output. An Input/ Output variable must be connected to a TRICON point. A Local is a variable for internal logic only which cannot be connected to a TRICON point. Changing Variable Types After placing a variable on your logic sheet, you can change its type through the Properties box by selecting the desired variable type. For example, there is no tool or command that allows you to place a variable of type In/Out on the logic sheet. So you have to place another type of variable on the sheet, then go to the Declarations tab of the Properties box and change the variable’s type to In/Out.
Description The Description field under the Declarations tab allow you to enter descriptive text about a selected contact or coil. Copy the %DESCRIPTION macro to the text box under the Annotation tab if you want this descriptive text to be displayed in a comment or annotation. For details, refer to the section called “Inserting Macros into Comments or Annotations” later in this chapter.
Chapter 4
Ladder Diagram (LD)
Declaring Contacts & Coils
143
Declaration Dialog Box The Declarations dialog box (shown in the example below), accessible from the Declaration tab, provides a graphic display of all the variables in your logic and allows you to manipulate the variables in the following ways: • Adding, modifying and deleting • Moving up and down • Sorting • Grouping
Chapter 4
Ladder Diagram (LD)
144
Declaring Contacts & Coils
Adding New Contacts or Coils The Add feature of the Declarations dialog box lets you declare variable names for contacts or coils you have not yet placed on your logic sheet. Later, when you do place the contact or coil elements on the logic sheet and bring up the Properties box, any previously declared variable names appear for your selection under the Name field of the Selected tab, as shown in the following example:
Chapter 4
Ladder Diagram (LD)
Declaring Contacts & Coils
145
Properties under the Annotation Tab If you have checked the Annotate checkbox of the Selected tab in the Properties box for a selected variable, the Annotation tab allows you to: • Display the value of the variable during execution • Select and/or modify macros for the variable annotation • Type descriptive text for the variable annotation
As shown in the example above, a variable annotation is a special kind of comment box attached to the bottom of a variable which can display the value of the variable during execution, macros and descriptive text. The values of the variable and the macros are displayed only in an instance view of your program logic. For more information, refer to the section called “Comments, Variable Annotation & Macros.”
Chapter 4
Ladder Diagram (LD)
146
Declaring Local, Input & Output Variables
Declaring Local, Input & Output Variables Local, input and output variables can be declared in a number of ways. A typical approach is to place the variables on your worksheet using the tools or menu commands. (Refer to the section called “Table of LD Tools” earlier in this chapter for details.) Once you have placed a variable of each type you need, you can copy and paste these multiple times as needed using menu commands or keyboard shortcuts. Then you can bring up the Properties box by double-clicking on a variable element. Click on the push pin, and begin assigning properties to the variables. Another approach is to use the Declarations dialog box to declare several variable names, then use the Name menu in the Properties box to apply these names to each variable element on the worksheet. A third approach is to apply a naming convention to several selected variable elements using the Auto Name feature. The Properties box for variables has three tab pages: Selected, Declaration and Annotation, as shown in the example below. This section covers the options for variable declaration in their order of appearance in the tab pages.
Properties under the Selected Tab The Selected tab of the Properties box for local, input and output variables allows you to name the variable (manually or automatically), adjust the width of variable symbols, and turn on variable annotation.
Chapter 4
Ladder Diagram (LD)
Declaring Local, Input & Output Variables
147
Naming Use the Properties dialog box to name a selected variable as shown in the example above, or name several variables automatically using the Auto Name feature. A variable name or identifier can have up to 31 alphanumeric and underscore characters. All identifiers must begin with an alpha character (A to Z) and must not include any imbedded spaces. Identifiers are not case-sensitive.
Width The plus (+) and minus (-) icons of the Selected tab expand or shrink the width of the selected variable symbol so you can use a longer name or fit the symbol into a smaller space.
Annotation The Annotation checkbox of the Selected tab allows you to apply variable annotation on a per-variable basis. A variable annotation is a special kind of comment box attached to the bottom of a variable which can display the value of the variable during execution, macros and descriptive text. The values of the variable and the macros are displayed only in an instance view of your program logic. Refer to the section called “Comments, Variable Annotation & Macros” later in this chapter for more information.
Contact or Coil Type If you are declaring properties for a contact or coil, the Selected tab will include a field for Contact Type or Coil Type respectively. Refer to the section called “Declaring Contacts & Coils” for more information.
Chapter 4
Ladder Diagram (LD)
148
Declaring Local, Input & Output Variables
Automatic Naming The Auto Name feature, accessible from the Selected tab, is helpful when you have several similar variables and want to name them according to a convention. For example, you have 50 gas detector inputs, and you want to call them GAS_DETECT_1, GAS_DETECT_2, GAS_DETECT_3, etc. Automatic naming lets you select the desired prefix and the increment you wish to use. In this example, you would enter GAS_DETECT_%0 to start the automatic names at 1.
Chapter 4
Ladder Diagram (LD)
Declaring Local, Input & Output Variables
149
Properties under the Declaration Tab The Declaration tab of the Properties dialog box for variables (shown below) allows you to: • Select the data type and variable • Apply an initial value and description • Access the Declarations dialog box for variable manipulation
Chapter 4
Ladder Diagram (LD)
150
Declaring Local, Input & Output Variables
Data Type An elementary data type defines the size and characteristics of a variable. Use the Data Type drop-down list under the Declarations tab of the Properties dialog box to select an appropriate data type for a variable. The list below describes all available data types. See the next section called “Restrictions” for applicability. Data Type
Chapter 4
Size & Characteristics
BOOL
A Boolean, 1 bit in length.
DATE
A specific date, in the following format: D#CCYY-MM-DD.
DINT
A double integer, 32 bits in length.
DT
A specific date and time, in one of the following formats: – DT#CCYY-MMDD-HH-HH:MM:SS – DATE_AND_TIME#CCYY-MM-DD-HH:MM:SS
DWORD
A double word, 32 bits in length.
INT
An integer, 16 bits in length.
LREAL
A long real number, 64 bits in length.
REAL
A real number, 32 bits in length.
STRING
A sequence of up to 132 alphanumeric characters delimited by single ( ' ) quotes.
TIME
A period of time (duration) in days, hours, minutes, seconds, or milliseconds.
TOD
A specific time of day, in one of the following formats: – TOD#HH:MM:SS – TIME_OF_DAY#HH:MM:SS
Ladder Diagram (LD)
Declaring Local, Input & Output Variables
151
Restrictions In functions and function blocks, you can select any data type from the list above for any variable type (Input, Output, In/Out and Local). In programs, you can select any data type for Local variables, but your selection for Input, Output and In/Out variables is restricted to the following data types: • BOOL • DINT • REAL This limitation applies because Input, Output and In/Out variables must be connected to TRICON points (hardware addresses).
Variable Type Use the Var Type field under the Declarations tab of the Properties box to select one of the following variable types: • Input • Output • In/Out • Local An Input is a variable used to supply a value to program, function block or function. An Output is a variable used to return the result of an evaluation by a program, function block or function. An Input/Output is a variable that serves as both an Input and an Output. A Local is a variable for internal logic only which cannot be connected to a TRICON point. Changing Variable Types After placing a variable on your logic sheet, you can change its type through the Properties dialog box by selecting the desired variable type. For example, there is no tool or command that allows you to place a variable of type In/Out on the logic sheet. So you have to place another type of variable on the sheet, then go to the Declarations tab of the Properties box and change the variable’s type to In/Out.
Chapter 4
Ladder Diagram (LD)
152
Declaring Local, Input & Output Variables
Initial Value The Initial Value field under the Declarations tab is enabled for all variable types in functions and function blocks, but only for local variables in programs. During a Download All, the TRICON sets the values of all variables either to zero or to the initial value you have declared as a property of the variable.
Description The Description field under the Declarations tab allow you to enter descriptive text about a selected variable. Copy the %DESCRIPTION macro to the text box under the Annotation tab if you want this descriptive text to be displayed in a comment or annotation. For details, refer to the section called “Inserting Macros into Comments or Annotations” later in this chapter.
Chapter 4
Ladder Diagram (LD)
Declaring Local, Input & Output Variables
153
Declaration Dialog Box The Declaration dialog box (shown in the example below), accessible from the Declaration tab, provides a graphic display of all the variables in your logic and allows you to manipulate the variables in the following ways: • Adding, modifying and deleting • Moving up and down • Sorting • Grouping
Chapter 4
Ladder Diagram (LD)
154
Declaring Local, Input & Output Variables
Adding New Variables The Add feature of the Declarations dialog box lets you declare variables you have not yet placed on your logic sheet. Later, when you do place the variable elements on the logic sheet and bring up the Properties box, any declared variables appear for your selection under the Name field of the Selected tab, as shown in the following example:
Chapter 4
Ladder Diagram (LD)
Declaring Local, Input & Output Variables
155
Properties under the Annotation Tab If you have checked the Annotate checkbox of the Selected tab in the Properties box for a selected variable, the Annotation tab allows you to: • Display the value of the variable during execution • Select and/or modify macros for the variable annotation • Type descriptive text for the variable annotation
As shown in the example above, a variable annotation is a special kind of comment box attached to the bottom of a variable which can display the value of the variable during execution, macros and descriptive text. The values of the variable and the macros are displayed only in an instance view of your program logic. For more information, refer to the section called “Comments, Variable Annotation & Macros.”
Chapter 4
Ladder Diagram (LD)
156
Declaring Constants
Declaring Constants Constants are usually limited to a single data type within a program, function block or function. Place a constant symbol on your logic sheet using either the Constant button in the Tools menu or the Constant command in the Tools...Insert menu. Then double-click on the constant symbol to display the Properties box, which has two tabs: Constant and Annotation. This section covers the properties of a constant in the order of their appearance in the tab pages.
Properties under the Constant Tab Value, Type & Validate The constant value you enter in the Value field must agree with the elementary data type you select from the drop-down list under the Type field. Click on Validate to ensure value/type agreement. Data types that apply to constants are: • BOOL • DATE • DINT • DT • DWORD • INT • LREAL • REAL • STRING • TIME • TOD
Chapter 4
Ladder Diagram (LD)
Declaring Constants
157
Width Field The plus (+) and minus (-) icons expand or shrink the width of the constant symbol so you can use a longer name or fit the symbol into a smaller space.
Annotate Checkbox Click on the Annotation checkbox of the Constant tab to turn on the annotation feature for a selected constant. Refer to the section below called “Properties under the Annotate Tab” for more information.
Auto Name Feature The Auto Name feature may be useful for applying consecutive values to multiple constants, but it is primarily used for the automatic naming of several similar variables according to a convention you select. For more information, refer to “Automatic Naming” in the section called “Declaring Local, Input & Output Variables.”
Properties under the Annotate Tab If you have clicked on the Annotate checkbox under the Constant tab for a selected constant, the Annotation tab allows you to: • Select and/or modify macros for the annotation • Type descriptive text for the annotation In general, an annotation is a special kind of comment box attached to the bottom of a logic element which can display its TRICON Point Connection (Tag Name), its value during execution, macros and descriptive text. Because a constant always has the same value and does not have a TRICON Point Connection, there is no question of displaying various values during execution. However, macros and descriptive text can be used if desired.
Chapter 4
Ladder Diagram (LD)
158
Declaring Functions & Function Blocks
Declaring Functions & Function Blocks Clicking on the Select FBlock Tool or using the Tools...Insert...Function (Block) command displays the following menu, which allows you to select a function or function block from the project library:
To search for a desired function or function block, you can: • Type a few characters into the Find field to search for similar names. • Sort the Element Name or Category column alphabetically by clicking on the column heading, then look for the desired functionality. After placing a function or function block on your logic sheet, that same element remains selected in the library menu in case you want to add more elements of the same type. Or you can copy and paste a function or function block multiple times as needed using menu commands or keyboard shortcuts.
Chapter 4
Ladder Diagram (LD)
Declaring Functions & Function Blocks
159
To declare the properties of a function or function block, double-click on the element to bring up the Properties dialog box and click on the push pin. This will keep the Properties box displayed on top as you move from element to element declaring properties.
Declaring the Properties of Functions The Properties dialog box for a function has only one tab with several usermodifiable fields, as shown in the following example:
The properties of functions can be understood in terms of the rules that govern them: • The inputs of most functions have a generic data type called ANY_NUM according to the IEC-1131 standard. • All of the inputs to a function must have the same data type. • A function has only output, which must have the same data type as the inputs. • Some functions are extensible, which means you can add as many as 50 inputs to the function. • The EN and ENO parameters must be connected to enable inputs and outputs to and from the function.
Inputs List The names and data type of the inputs to a function are displayed in the Inputs list of the Properties dialog box. All of the inputs to a function must have the same data type. If they do not, TriStation 1131 generates a type mismatch error when you use the Build Element (compile) command.
Chapter 4
Ladder Diagram (LD)
160
Declaring Functions & Function Blocks
Some functions have inputs of type BOOL, but most inputs have the generic data type called ANY_NUM according to the IEC-1131 standard. The ANY_NUM data type includes ANY_REAL and ANY_INT data types. For more information about generic data types, refer to the “Data Types” section in Chapter 2, “A TriStation 1131 Project.”
Extensible Functions Some functions are extensible, which means you can add as many as 50 inputs to the function in one of two ways: • Enter the desired number in the Number of Inputs field of the function’s Properties box and press Confirm. • Click and drag on the double line at the bottom of the function symbol until the desired number of inputs appears. The example on the preceding page shows the ADD function with the number of inputs extended from two (the default) to seven. If the number of inputs for a particular function cannot be changed, TriStation 1131 displays a message to this effect in place of the Number of Inputs field on the function’s Properties box.
Output of a Function A function has only one output which must have the same data type as the inputs to the function.
Negating Inputs or Outputs The negation feature inverts the value of a BOOL input or output that is connected to a function. When you select a BOOL variable name from the Inputs or Outputs list in the Properties dialog box, and click on Negate Selected Input or Negate Output, a small circle appears on the corresponding terminal of the function, as shown in the example that follows. If the Negate Selected Input and/or Negate Output options are grayed out, then negation is not available for the inputs and outputs of this function.
Chapter 4
Ladder Diagram (LD)
Declaring Functions & Function Blocks
161
A circle on an input terminal means that the ON or OFF value of the input will be inverted before being processed by the function. A circle on an output terminal creates a NOT condition—in other words, the ON or OFF output value resulting from processing by the function is inverted as it exits.
Width The plus (+) and minus (-) icons expand or shrink the width of the function symbol as desired.
Double-space Option Clicking on the Double-space option under the Terminals field makes the function symbol twice as long and spaces the terminals for connecting variables further apart. This makes room for additional inputs, variable annotation or comments.
Chapter 4
Ladder Diagram (LD)
162
Declaring Functions & Function Blocks
EN/ENO Parameters Note In FBD logic, the use of EN and ENO is optional. To display the EN/ENO parameters of a function in FBD, click the checkbox labeled EN/ENO in the Properties dialog box. EN and ENO are type BOOL input and output parameters that detect and isolate errors in LD and FBD logic. The EN (enable) input parameter enables invocation of the function and carries power from the left power rail. The ENO (enable out) output parameter indicates whether the function has detected an error and connects either to the EN input of the next function or to the ground rail. The EN and ENO parameters are displayed on the left and right sides of a function respectively, as shown in this example:
If EN is False (0), the function has not been called, and the value of ENO is reset to False (0). If EN is True (1), the function has been called, and ENO indicates whether the function has detected an error. If ENO is True, the function has not detected any errors. If ENO is False, the function has detected an error, and evaluation of the network stops—the return value is not written to any variable. If EN/ENO is visible on any function in a network, then EN/ENO must be visible on every function in the network. If there is more than one function with EN/ENO visible in a network, then for every function except the last function, you must connect the ENO output directly to the EN input of the next function. You must not connect an ENO output to more than one EN input. The ExENO.pt2 sample project on the TriStation 1131 CD demonstrates the use of EN/ENO to detect and isolate errors in LD and FBD logic.
Chapter 4
Ladder Diagram (LD)
Declaring Functions & Function Blocks
163
Declaring the Properties of a Function Block The Properties dialog box for a function block has two tabs: Selected and Declaration. This section covers the function block properties in their order of appearance in the tab pages.
Fields under the Selected Tab Most of the modifiable characteristics of a function block are found under the Selected tab of its Properties box. Instance Name The Instance Name field of the Selected tab is used to identify each instance of a function block as a separate variable in your program. When you place a function block from the library onto the logic sheet, three asterisks (***) appear at the top of the function block and in the Instance Name field, as shown in the example above. You must replace the asterisks with a name or identifier which has up to 31 alphanumeric and underscore characters. All identifiers must begin with an alpha character (A to Z) and must not include any imbedded spaces. Identifiers are not case-sensitive. Inputs List A function block selected from the TriStation 1131 library can have multiple inputs. The names and data type of the inputs are displayed in the Inputs list of the function block’s Properties dialog box. The only property of a function block
Chapter 4
Ladder Diagram (LD)
164
Declaring Functions & Function Blocks
input that you can modify is negation, if the input is of type BOOL. Refer to the upcoming section called “Negating Inputs or Outputs” for more information. Outputs List A function block selected from the project library can have multiple outputs. The names and data type of the outputs are displayed in the Outputs list of the function block’s Properties dialog box. The only property of a function block output that you can modify is negation, if the output is of type BOOL. Refer to the upcoming section called “Negating Inputs or Outputs” for more information. Negating Inputs or Outputs The negation feature inverts the value of a BOOL input or output that is connected to a function block. When you select a BOOL variable name from the Inputs or Outputs list, and click on the Negate Terminal checkbox, a small circle appears on the corresponding terminal of the function block. A circle on an input terminal means that the ON or OFF value of the input will be inverted before being processed by the function block. A circle on an output terminal creates a NOT condition—in other words, the ON or OFF output value resulting from processing by the function block is inverted as it exits. In the following example, the Outputs option and a BOOL variable called Q are selected. Clicking the Negate Terminal checkbox causes a circle to appear on Q, the output terminal of the AIR function, to indicate that inversion of the output value will take place.
Width The plus (+) and minus (-) icons expand or shrink the width of the function block symbol so you can use a longer name or fit the symbol into a smaller space.
Chapter 4
Ladder Diagram (LD)
Declaring Functions & Function Blocks
165
Double-space Option Clicking on the Double-space option under the Terminals field makes the function symbol twice as long and spaces the terminals for connecting variables further apart. This makes room for additional inputs, variable annotation or comments.
Fields of the Declaration Tab The Declaration tab of the Properties dialog box for a function block tells the Data Type of the function block instance and provides a Description field for text, as shown in the following example. The Var Type field indicates that a function block instance always has a variable type of Local.
The Declaration... dialog box, accessible from the Declaration tab, allows you to manipulate variables in a number of different ways. For more information, refer to the section called “Declaration Dialog Box” earlier in this chapter.
Chapter 4
Ladder Diagram (LD)
166
Network Dividers
Network Dividers In LD, you can divide the logic on your sheet into various networks by means of horizontal and vertical network dividers, as shown in the following example. These dividers are accessible by means of the Horiz. Network Divider tool and the Vert. Network Divider tool on the LD toolbar, or commands of the same names in the Tools...Insert menu.
Chapter 4
Ladder Diagram (LD)
Comments, Variable Annotation & Macros
167
Comments, Variable Annotation & Macros TriStation 1131 offers two methods for documenting LD program logic: comments and variable annotation. Both methods allow you to type in descriptive text and make use of macros that describe various characteristics of the project, its elements and the logic sheet. A comment box can be placed anywhere on the logic sheet, but a variable annotation is attached to the bottom of a variable and is meant to be used in an instance view of your program logic. This section covers the following topics: • Including comments • Using variable annotation • Using macros
Including Comments Comments are used to describe specific operations or tasks performed by a program, function block or function within a project. There is no limitation on the number of comment boxes per program or their placement on a logic sheet. You can even draw comment boxes around, or on top of, any logic element. Place a comment box on your logic sheet with either the Comment Tool on the toolbar or the Insert...Comment command in the Tools menu. Double-click on the comment box to bring up the Properties dialog box where you can enter comment text, select macros for inclusion in the comment, and adjust the placement of the comment box with regard to your logic elements. Resize the comment box by clicking on the edge of the box, holding down the mouse button and dragging, as you would resize any window in a Windows application. The Properties dialog box for comments has four tabs whose features are described in the following sections.
Chapter 4
Ladder Diagram (LD)
168
Comments, Variable Annotation & Macros
Comment Tab The Comment tab, as shown below, lets you adjust comment text in three ways: • Left, right or center alignment • Text size from 3 points to 24 points • Single, double or no border around the comment box
Inserting Macros into Comments The Comment tab also allows you to access macros for the project, element or sheet. To insert a macro into your comment box, click on the Macros field to bring up a list of available macros. Select the one you want, then use Ctrl-C to copy it. Close the macro list, place the cursor in your comment text, and use Ctrl-V to paste in the macro. Refer to the upcoming section called “Using Macros” for more detailed information.
Style Tab There are three fields under the Style tab that allow you to edit a comment in various ways: Expand Macros Click on this option to display the actual values of the macros you have included in the selected comment box.
Chapter 4
Ladder Diagram (LD)
Comments, Variable Annotation & Macros
169
Enable Macro Editing Click on this option and take the following steps to create your own macro by combining other, existing macros: • Add one or more modifiable macros to your comment text (under the Comment tab). Modifiable macros are identified by a pencil icon in the Current Value column of the Edit Macros dialog box. • Click on the Enable Macro Editing option. • Go to the Edit Fields tab and select a modifiable macro from the list that is displayed. Click on Modify to edit the text of the macro. • Refer to the upcoming section called “Using Macros” for more detailed information about macros. Move Behind Logic Elements Click on this option to move a selected comment box behind a logic element. This creates the effect of enclosing or surrounding the element with descriptive text. Click the option off if you later want to remove the comment box from behind the logic element.
Pickup-Drop Tab This feature allows a comment box to capture logic elements so that they become part of the comment. To “pickup” one or more elements, move the comment box so that it entirely covers the elements to be captured (resizing the comment box if necessary), then press Pickup. Press Drop to release the logic element from the comment box. Logic elements captured in a comment box are not executable, but if you later release them from the comment box, they can be made executable.
Edit Fields Tab This tab is used in conjunction with the Enable Macro Editing option found under the Style tab. If you have included modifiable macros in your comment text, their names will be listed for selection under the Edit Fields tab. Refer to the upcoming section called “Using Macros” for more detailed information about macros.
Chapter 4
Ladder Diagram (LD)
170
Comments, Variable Annotation & Macros
Using Variable Annotation A variable annotation is a special kind of comment box that is attached to the bottom of an input, output, input/output or local variable. The annotation box is sizable for width and height and moves wherever the associated variable is moved. An annotation can consist of any of the following types of information: • The monitor value (value of the variable as the configuration executes) • The default macro for the particular type of variable • Other standard macros • User-modified macros • Text that you type in The values of the macros and the variables themselves are displayed only in an instance view of your program logic. From the LD editor, the Configuration editor or a Control Panel, you select an instance view by pressing the Annotation Instance button on the toolbar and selecting a program instance name from the dialog box, as shown below. Annotation Instance button
Chapter 4
Ladder Diagram (LD)
Comments, Variable Annotation & Macros
171
The following is an example of an instance view with the monitor value turned on and the default macro displayed for an input and output variable respectively:
There are two main ways to use variable annotation in a program or function block: • Turn on the feature for your entire project as soon as you open a new project • Turn on the feature for individual variables in your logic, one at a time
Annotation for the Entire Project Variable annotation works in an “automatic” sense if you turn on the feature as soon as you open a new project, before creating any programs or function blocks. Do this by opening the Project Options menu, selecting the Variable Annotations tab (shown below), and checking one or both of the following options in the General box: • Annotation on by default • Monitor value on by default The Annotation on by default option causes variable annotation boxes to appear automatically every time you place a variable on the logic sheet for a program or function block. The Monitor value on by default option displays, in the upper left corner of the annotation box, the value of each variable during execution. The Style box allows you to adjust the alignment of text in annotation boxes and the borders around them, as well as the text size for each of the sheet template styles (Sheet Template A, B, C or D).
Chapter 4
Ladder Diagram (LD)
172
Comments, Variable Annotation & Macros
The Default Macros or Text box allows you to set default macros for each class of variable which automatically display information about the variables when you select an instance view. Program Variables are variable classes in programs whereas Non-program Variables are variable classes in functions and function blocks. Refer to “Default Macros for Annotation Boxes” under the upcoming section called “Using Macros” for more information. Note Annotation boxes underneath variables require extra space, depending on how many macros and how much text you include. So turning on the annotation capability at the beginning of a project is an advantage in terms of designing your program logic for maximum readability.
Chapter 4
Ladder Diagram (LD)
Comments, Variable Annotation & Macros
173
Annotating Individual Variables Even if you have not turned on annotation for all program variables using the Variable Annotations menu, you can turn it on for individual variables by doing the following: • Double-click on a variable to bring up the Properties box. • Click on the Annotate checkbox in the lower right corner of the Selected tab. • If desired, go to the Annotation tab and click on the box for Include monitor value in annotation. • The default macro for the variable is already present. To insert an additional macro, click on the Macros field (in the Annotation dialog box) to bring up a list of available macros. Select the one you want, then use Ctrl-C to copy it. Close the macro list, place the cursor in your annotation text, and use Ctrl-V to paste in the macro.
Using Instance Views An instance view of an LD program looks similar to the editing view, except that it depicts a specific instance of the program and the macros in the variable annotations are expanded. There are three ways to invoke an instance view: • From the LD Editor — While viewing a program in the LD editor, click on the Annotation Instance tool to display a list of the program instances. Select an instance name, click OK, and the variable annotations will be expanded. • From the TRICON Configuration editor — Select an instance name from the Program Instance Declarations node in the configuration tree. Click on the Annotation Instance tool and a read-only instance view of the program logic will be displayed, with the variable annotations expanded. The sample instance view below was invoked from the TRICON Configuration editor. • From the Control Panel — Select an instance name from the program instance variable tree. Click on the Annotation Instance tool and a readonly instance view of the program logic will be displayed, with the variable annotations expanded. The actual monitor value (value of the variable during program execution) is displayed only in an instance view invoked from the Control Panel.
Chapter 4
Ladder Diagram (LD)
174
Comments, Variable Annotation & Macros
Instance View in TRICON Configuration Editor
Chapter 4
Ladder Diagram (LD)
Comments, Variable Annotation & Macros
175
Using Macros Macros, used in comments and variable annotations, are placeholders for the insertion of text defined or calculated elsewhere in TriStation 1131. There are two types of macros, all of which begin with a percent (%) sign: •
A system macro has expanded values supplied by TriStation 1131 and cannot be modified.
• A user-modifiable macro has expanded values supplied by the user—it can include one or more system macros that you copy into it. Examples of the two types of macros are shown in the Edit Macros dialog box that follows. The sample dialog box also shows some default macros for variable annotation and some platform descriptor macros. The default macros for variable annotation are user-modifiable, whereas the platform descriptor macros are system macros. All of these types of macros are described in the upcoming sections: • Inserting macros into comments or annotations • Working with user-modifiable macros • Default macros for variable annotation
Chapter 4
Ladder Diagram (LD)
176
Comments, Variable Annotation & Macros
Inserting Macros into Comments or Annotations You can access a complete list of macros for the project, element and sheet by means of the Edit Macros dialog box (shown on the preceding page). To insert a macro into a comment or annotation box, follow these steps: • In the Properties dialog box for a comment, click on the Macros button (under the Comment tab) to bring up the list of available macros in the Edit Macros dialog box. • In the Properties box for an annotation, click on the Macros button (under the Annotation tab) to bring up the list of available macros in the Edit Macros dialog box. • Select the macro you want, then use Ctrl-C on the keyboard to copy it. • Close the Edit Macros dialog box. • Place the cursor in your comment or annotation box, and use Ctrl-V to paste in the macro. Add text if desired to explain what kind of information the macro is showing you, as in the following example. In the example below, the macros are expanded because the Expand Macros box has been checked under the Style tab of the comment’s Properties box.
Note The Edit Macros dialog box is accessible from the Comment tab of the Properties dialog box for comments, or from the Comment Macros command under the Elements menu.
Chapter 4
Ladder Diagram (LD)
Comments, Variable Annotation & Macros
177
Working with User-Modifiable Macros User-modifiable macros are identified by the presence of a pencil icon in the Current Value column of the Edit Macros dialog box (shown below during the process of macro modification). To modify a macro, follow these steps: • Copy any system macro you wish to include by selecting that macro and pressing Ctrl-C on the keyboard. In the example below, the copied macro is %CREATED_BY. • Select the desired user-modifiable macro and click on Modify to bring up an editing box. The example below uses %PGM_INPUT, the default macro for annotating a program variable of the input class. • In the Edit Macro Text dialog box, paste in the previously-copied system macro (%CREATED_BY) by pressing Ctrl-V and/or enter text. Click OK. • If you wish to add more than one system macro to the user-modifiable macro, repeat the above process as many times as needed. • When the user-modifiable macro is ready, close the macro list. You can then copy and paste the user-modified macro into comment boxes and annotation boxes as needed, using Ctrl-C and Ctrl-V on the keyboard.
Chapter 4
Ladder Diagram (LD)
178
Comments, Variable Annotation & Macros
Note When you change the value of a macro, you are changing it for all comments and annotations in which the macro is used throughout your project.
Default Macros for Annotation Boxes The default contents of annotation boxes are macros that vary with the class of the variable, as shown in the following table: Default Macros for Variable Classes Element Type
Variable Class
Program
Function/Function Block
Default Macro
Input
%PGM_INPUT
Output
%PGM_OUTPUT
Input/Output
%PGM_IO
Local
%PGM_LOCAL
Input
%FB_INPUT
Output
%FB_OUTPUT
Input/Output
%FB_IO
Local
%FB_LOCAL
When a new project is created, these default macros for variable annotation are set to the default values shown in the table below. You can modify the default values of these macros to meet your specific requirements using the Edit Macros dialog box. After you modify the default values, they will appear in their modified state under the Variable Annotations tab of the Project Options menu. Default Values of Annotation Macros Macro
Chapter 4
Default Value
Sample Expanded Macro
%PGM_INPUT
%PPD_TAGNAME%PPD_CLASS %PPD_LOCATION%PPD_ALIAS
P1.WATER_LOW DI 03.04.13 10018
%PGM_OUTPUT
%PPD_TAGNAME%PPD_CLASS %PPD_LOCATION%PPD_ALIAS
P1.VALVE_ON DO 02.03.07 00016
Ladder Diagram (LD)
Comments, Variable Annotation & Macros
179
Default Values of Annotation Macros (continued) Macro
Sample Expanded Macro
Default Value %PPD_TAGNAME%PPD_CLASS %PPD_LOCATION%PPD_ALIAS
P1.PROCESS_STATU S MI 40252
%WHERE_USED
PROCESS_COUNT 1(C7) 3(D5) 4(A2)
%FB_INPUT
%FB_OUTPUT
%FB_IO
%FB_LOCAL
%PGM_IO %PGM_LOCAL
There are four macros beginning with %PPD which are expanded by the TRICON platform descriptor and are not user-modifiable: TRICON Platform Descriptor Macros Macro
Expanded Value
%PPD_TAGNAME
The name of the TRICON point to which the program variable is connected.
%PPD_CLASS
The class of the TRICON point to which the program variable is connected. For example, “MI” for Memory Integer or “DO” for Digital Output.
%PPD_LOCATION
The location of the TRICON point to which the program variable is connected. This only applies to physical input and output points and is displayed in the format CC.SS.PP where CC is the chassis, SS is the slot and PP is the point. For memory points, an empty string is returned.
%PPD_ALIAS
The Modbus alias of the TRICON point to which the program variable is connected. If the point has no alias, an empty string is returned.
Chapter 4
Ladder Diagram (LD)
180
Printing Logic Sheets
Printing Logic Sheets From the LD editor, TriStation 1131 allows you to print the logic sheets you have developed for programs, functions and function blocks. Adjust the view of a logic sheet using commands in the View menu, then use the following File menu commands as desired: • Print Preview • Print Setup • Print... Printing of the following items, which are not specific to LD, is covered in Chapter 10, “Printing”: • Standard reports • Custom reports designed with Crystal Reports software
Chapter 4
Ladder Diagram (LD)
CHAPTER 5
Structured Text (ST)
Note The Structured Text (ST) language is fully functional and projects can be developed with complete confidence using the ST editor. However, documentation of the ST editor is still in progress and will be included in a future edition of this manual. This chapter will describe basic methods of writing logic in the ST language, covering the following topics: • Basic methods of writing logic • ST editing tools • Using sheet templates • Declaring variables • Invoking functions • Invoking function blocks • Using constants • Dividing logic into networks • Comments, variable annotation and macros • Printing logic sheets
CHAPTER 6
Configuration Editor
To create a configuration for a TriStation 1131 project, you must use the TRICON Configuration editor to allocate TRICON hardware, set system parameters and connect program variables to TRICON points. This chapter provides details and examples about these tasks, covering the following topics: • Configuration tools • Setting system parameters • Hardware allocation • Changing memory allocation • Declaring program instances • Declaring TRICON point connections • Using the Connections Wizard • Connecting individual program variables • Building the configuration • Exporting TRICON point properties • Importing TRICON point properties • Configuring the TRICON for event collection
184
Configuration Tools
Configuration Tools To help you set up your TRICON configuration, the Configuration editor provides tools you can select from: • The main menu • The toolbar • The options menu for lists The upcoming sections describe the Configuration tools in detail. (Menus and commands which are common to all TriStation 1131 views are described in the section called “Basic Editing Tools” in Chapter 2, “A TriStation 1131 Project.”)
Main Menu Commands The main menu of the TRICON Configuration editor appears above the toolbar as follows, and the diagram on the following page shows the commands which are accessible from the it.
Shortcut Keys In the TRICON Configuration menu, underlined characters are shortcut keys to be used in the typical manner of Windows applications. • For a menu item, use ALT + to open the menu. • For a command within a menu, type the of the desired command
Chapter 6
Configuration Editor
Configuration Tools
185
Menus & Commands of TRICON Configuration Editor (grayed-out commands are common to all TriStation 1131 views)
File
Edit
New Project... Open Project... Save Project... Save As... Close Project... 1 2 Print... Print Preview... Print Reports... Print Setup... Exit
Expand One Level Expand Branch Expand All Collapse Branch
Program Instances Memory Points Input Points Output Points Memory Allocation Hardware Allocation SOE Blocks
TRICON
Edit Configuration Build Configuration Rebuild Configuration Compile All Project Elements Emulator Control Panel TRICON Control Panel TRICON Diagnostic Panel View Download History... Change State to Download All
Save Configuration Description... Comment Macros... Build Intermediate Code
Tools
Window
Help
Instance View Connections Wizard
New Window Cascade Tile Horizontal Tile Vertical Close All Arrange Icons Show Properties Box Show Message Bar (Vertical Message Bar) (Horizontal Message Bar) Hide Message Bar 1 PROGRAM:
TriStation 1131 Help Tip of the Day Keyboard Shortcuts Sample Projects Technical Support About TriStation 1131... TriStation 1131 Logo...
Chapter 6
Configuration Editor
186
Configuration Tools
Table of Configuration Tools The table that follows describes the main menu commands which are specific to the TRICON Configuration editor and the corresponding tools in the toolbar.
Note On any TriStation 1131 toolbar, the name of a tool is displayed if you place the cursor inside the icon for the tool. Edit Menu
Chapter 6
Command
Description
Undo
Reverses the last edit of a variable, function or function block.
Redo
Reverses the last Undo command. This must be done before any other editing is done.
Edit Session Journal
Opens a dialog box which displays a sequential list of actions undertaken during the most recent edit session. Any previous state during the current edit session can be recovered and displayed by selecting from the list.
Cut
Cuts (deletes) selected items from the current configuration and places them on the clipboard, erasing the previous contents.
Copy
Copies selected items from the current configuration and places them on the clipboard, erasing the previous contents.
Paste
Pastes the current contents of the clipboard into the selected element.
Find
Finds TRICON points in the current configuration by looking for their Alias, Location or Tag Name properties. Can Go To a selected found point.
Import TRICON Points
Allows you to import TRICON point properties from database, Excel and text files.
Configuration Editor
Configuration Tools
187
Edit Menu Export TRICON Points
Allows you to export TRICON point properties from TriStation 1131 to database, Excel and text files.
Element Menu Command
Description
Save Configuration
Saves the current configuration.
Description...
Provides access to the Element Description dialog.
Comment Macros...
Provides access to the Edit Macros dialog.
Build
Updates and compiles the current configuration and links it to all other elements of the project.
Intermediate Code
Displays source code that is generated in the Structured Text language when the current configuration is compiled.
Tree Menu Command
Description
Expand One Level
Expands a selected tree node by one level.
Expand Branch
Expands a selected tree node to all levels.
Expand All
Expands the whole tree to all levels.
Collapse Branch
Collapses a selected branch of the tree.
View Menu Command
Description
Program Instances
Displays the Program Instance window.
Memory Points
Displays the TRICON Point Connections window for Memory points.
Input Points
Displays the TRICON Point Connections window for Input points.
Output Points
Displays the TRICON Point Connections window for Output points.
Chapter 6
Configuration Editor
188
Configuration Tools
View Menu Command
Description
Memory Allocation
Displays the Memory Allocation window.
Hardware Allocation
Displays an image of a TRICON chassis in the Hardware Allocation window.
SOE Blocks
Displays the TRICON SOE Configuration window.
Commands Menu Command
Description
Compare to Last Download
Allows you to do an off-line comparison of the current configuration with the last configuration that was downloaded to the TRICON.
Tools Menu Command
Description
Instance View
Opens a read-only view of the program logic for a selected program instance. The tooltip for this tool is called Annotated Instance.
Connections Wizard
Opens the Connections Wizard which allows you to connect program instance variables to TRICON points with Tag Names and other properties.
Options Menu for Lists In the Program Instance Declarations window and the TRICON Point Connections window, the attributes of lists with column headings can be altered in two ways: • Change the order of appearance of the columns displayed across the screen by clicking and dragging each column to the desired position. • Sort the columns alphanumerically by pointing to the heading of the desired column, clicking on the right mouse button, and choosing a sort option from the pop-up menu.
Chapter 6
Configuration Editor
Configuration Tools
189
In the following example, the cursor was pointing to the Tag Name column in the TRICON Point Connections list when the right mouse button was clicked, so the pop-up menu is displayed with the Tag Name column selected for sorting.
The upper two options in the sort menu apply to the alphanumeric order of the fields in a selected column. The choices are ascending order or descending order. The lower four options apply to saving and resetting the attributes of each column. The default option is Auto Save, which automatically saves the position and sort order of each column when you close the view. As long as Auto Save is on, the columns will be in the same position and sort order the next time you open the window. Use Save Now to save the attributes of the columns manually at any time. If Auto Save is off, you must remember to use Save Now before exiting the window if you want to preserve the attributes of your columns. Use Reset to Last Save to return the lists to their previously saved order. Reset to Original returns the columns to the default attributes they had the first time you opened a particular list for a new project.
Chapter 6
Configuration Editor
190
Setting System Parameters
Setting System Parameters Double-click on the TRICON System Configuration icon in the configuration tree to set the system parameters in the dialog shown below.
Network Node The Network Node parameter specifies the TRICON node where you will download or monitor a TriStation 1131 project. The Network Node names available for selection can be either of these types: • Default names in the form TRINODE, where ranges from 01 to 32 • Unique names that you create for any of 32 nodes using the Communications tab of the Project Options dialog box If you are using a single-node TRICON network (one TRICON system and one PC running TriStation 1131), the default node names and their associated default TCP/
Chapter 6
Configuration Editor
Setting System Parameters
191
IP addresses are sufficient for your needs. However, if you are using a multi-node TRICON network, you will have to modify the default TCP/IP addresses that TriStation 1131 provides when you install it. First you need to obtain the actual TCP/IP addresses from your System Administrator or IS department, then to go to the Communications tab of the Project Options dialog box to add or modify TCP/IP addresses. For details, refer to the “Project Options” section of Chapter 9, “System Administration.” Note When you use the Connect command in the TRICON Control Panel to connect a TriStation 1131 application with a TRICON, you must choose either a serial port or the same TRICON node name that you selected for the Network Node parameter described above.
Scan Rate The scan rate is the interval, in milliseconds, that you designate for evaluations (in other words, scans) of the TriStation 1131 project as it executes in the TRICON. The time it actually takes to do the evaluation may be less that the scan rate. To avoid scan-rate overrun problems, you must select a scan rate which includes execution time for all networks. The default scan rate is 200 milliseconds. Note The measured scan rate is 2-20 milliseconds more than the selected scan rate, depending on the number of active I/O modules and active Main Processors in the TRICON system.
Password Required for Download All If you check this box and enter a password here, then you must specify this password before doing a Download All of your configuration.
Disable STOP on Operator Keyswitch This parameter is used to logically disable the STOP position of the keyswitch on the TRICON Main Chassis for security purposes. By default, the STOP position is logically disabled, so that physically setting the TRICON keyswitch to STOP will not halt the control program. If the STOP position is logically enabled, physically setting the TRICON keyswitch to STOP will halt the control program.
Chapter 6
Configuration Editor
192
Setting System Parameters
Disable Remote Changes If you check this box, Modbus Masters and TCP/IP hosts will not be able to change the value of a TRICON controller’s outputs. Leaving this box unchecked means that Modbus Masters and TCP/IP hosts will be able to make changes to outputs.
Note about Time Synchronization If you have selected time synchronization with the TRICON Master Node on an NCM NET1 port or an ACM NET2 port, TriStation 1131 displays the following note at the bottom of the System Configuration dialog: Note Time synchronization of this TRICON node with the TRICON Master Node has been enabled by one of the communication modules. To select a time synchronization option for an ACM, NCM or SMM port, refer to instructions in Appendix A, “Configurable Modules.” The EICM and HIM do not support time synchronization. For further information about the use of time synchronization in a multi-node installation, please contact a Triconex Customer Support Engineer and/or your System Administrator. ! WARNING
In a TRICON system with multiple communication modules, you should select only one to perform time synchronization.
Chapter 6
Configuration Editor
Hardware Allocation 193
Hardware Allocation The following information is accessible from the Hardware Allocation node of the configuration tree: • Chassis Power Usage • Chassis configuration • Slot configuration Double-click on Hardware Allocation to view the chassis power usage and access the Properties boxes that let you add and delete chassis. Click on a chassis or slot icon in the tree to view the Properties box that lets you add and delete modules from a chassis. A typical procedure is to add I/O and communication modules to a chassis, then check to see whether the chassis power usage is viable. If it is not, you can delete modules from this chassis, add another chassis to accommodate these modules, then check on the power usage again. Note If you click on the push pin icon in the upper left corner, the Properties box will stay on top of all other displays and reflect each successive element you select as you perform the various tasks required for your project configuration.
Adding & Deleting Chassis Every TRICON system begins with a Main Chassis, so you will find an element called “Chassis 1:HD_MAIN” the first time you open the Hardware Allocation directory. Double-click on this element to display the Properties box which allows you to add and delete chassis from your TRICON system. You must select the Chassis tab from the Properties box to do this task—this Properties box also has a Module tab.
Adding & Deleting Modules When you open a Chassis : directory of the configuration tree, a list of the available slots is shown. (The presence of Main Processors and Power Modules is assumed, so you cannot modify the slots containing them.) Doubleclick on the desired slot to display the Properties box which allows you to add and delete modules from the selected TRICON chassis. You must select the Module tab from the Properties box to do this task—this Properties box also has a Chassis tab. The Configuration editor displays the TRICON chassis and the Properties box as shown below to help you select chassis and modules:
Chapter 6
Configuration Editor
194
Hardware Allocation
When you click on the Insert option of the Properties box, a list of all available module types is displayed. For the following modules, you need to use the Setup option in the Properties box to configure additional parameters: • Enhanced Intelligent Communication Module (EICM) — model 4119 • Pulse Input Module (PI) — model 3510 • Safety Manager Module (SMM) — model 4409 • Advanced Communication Module (ACM) — model 4609 • Network Communication Module (NCM) — model 4329 • Hiway Interface Module (HIM) — model 4509 For details, refer to Appendix A, “Configurable Modules.”
Chapter 6
Configuration Editor
Hardware Allocation 195
Chassis Power Usage When you click on the Hardware Allocation icon in the configuration tree, the Chassis Power Usage is displayed, as shown in the example below. A separate display is provided for each chassis in your TRICON system.
Power usage or logic power refers to the number and kinds of modules that the Power Modules of a TRICON chassis can support without being overloaded. Total Power Used shows how much logic power is being used by the current configuration of modules in a chassis. Total Power Supply is the maximum logic power that the chassis can support. The pie chart graphically represents these proportions. If the number given for Available is negative, this chassis is using too much logic power. This means you have to delete one or more modules from this chassis and add them to another chassis instead. After doing this, you should look at the Chassis Power Usage screen again to make sure that the logic power for each chassis falls within acceptable limits. For more information about logic power, refer to the TRICON Planning & Installation Guide.
Chapter 6
Configuration Editor
196
Changing Memory Allocation
Changing Memory Allocation The Memory Allocation node of the configuration tree allows you to change the memory allocation for the following point types if necessary: • Memory points • Input points • Output points Click on the desired point type in the tree to display color-coded graphs that provide the following categories of information about memory allocation, as shown in the example below:
Chapter 6
Maximum
Maximum number of points available
Allocated
Number of points allocated
Forecast
Estimated number of points referenced after next Download Change
Current
Number of points currently referenced
Configuration Editor
Changing Memory Allocation
197
To change the memory allocation, double-click on the graph for a particular point type, such as Read Aliased BOOL Input points. A dialog box comes up with a slider bar that moves up and down to increase or decrease the memory allocation, as shown in the following graphic. You can also use the arrow keys or the Page Up and Page Down keys to move the slider bar.
Chapter 6
Configuration Editor
198
Changing Memory Allocation
Application Data The selection called Application Data under the Memory Allocation icon displays two graphs, as shown in the example below: • PROGRAM shows the amount of space allocated for local variables in program instances • LIBRARY shows the amount of space allocated for externally compiled libraries
As a user, you cannot directly change the memory allocation for Application Data. However, if you rebuild a project after updating its shared libraries, TriStation 1131 may change the memory allocation for Application Data.
Downloading Considerations When you do a Download All of your configuration, TriStation 1131 freezes the memory allocation for all point types. You cannot change the memory allocation when you do Download Changes of the configuration, so any changes you make will have to fit within the limits of your existing memory allocation.
Chapter 6
Configuration Editor
Declaring Program Instances
199
Declaring Program Instances Program instances define which programs will be downloaded and executed and which TRICON Input, Output or Memory points will interact with these programs. In order to download and execute a program, you must first declare an instance of the program using the TRICON Configuration editor. A program may have more than one instance, and can have up to 250 instances. The input and output variables of each program instance must be connected to TRICON Input, Output or Memory points. In the FURNACE project that serves as an example, there is an identical air damper unit for each of four burners. Therefore it is feasible to declare four instances of the AIR_DAMPER program, so you will not have to write the program logic four times. Later, the variables in each instance of AIR_DAMPER will be connected to TRICON points which represent particular hardware addresses in the TRICON.
Steps to Follow ▼ To declare a new program instance, follow these steps: These steps are based on the example shown on the next page.
1 Go to the TRICON Configuration editor. 2 Double-click on the Program Instance Declarations icon in the configuration
tree to bring up the Properties dialog box. 3 To declare another instance of the AIR_DAMPER program as shown in the
example, select the Instance List tab in the Properties box. 4 Select the Add option to bring up a dialog box that lets you select the
AIR_DAMPER program and enter a name for your new instance. The order of the programs listed under the Program Instance Declarations icon is the order in which they will be executed.
Instance View To display a read-only view of a program instance with expanded variable annotations, select the instance name in the configuration tree and click on the Annotated Instance tool or select the Instance View command on the Tools menu.
Chapter 6
Configuration Editor
200
Declaring Program Instances
Declaring a Program Instance in the TRICON Configuration Editor
Chapter 6
Configuration Editor
Declaring TRICON Points
201
Declaring TRICON Points This section covers the following topics concerning TRICON points: • Overview • Naming methods • Rules that apply • Property fields for TRICON points • Aliases for TRICON points • MinSpan and MaxSpan fields • Monitor display options
Overview After you have allocated your TRICON hardware using the TRICON Configuration editor, you need to declare TRICON point connections, also known as global variables in IEC-1131 standard terminology. Each TRICON point has two main characteristics: • It references an Input, Output or Memory point in the TRICON • It is accessible to all program instances within a TriStation 1131 project Input and Output variables in each program instance must be connected to TRICON points before downloading. The TRICON Configuration editor provides the Connections Wizard for connecting program variables to TRICON points. For more information, refer to the upcoming section called “Using the Connections Wizard” on page 213. In TriStation 1131, your program logic is independent of physical points in the TRICON. If your physical connections change, you can easily change the TRICON point connections for each program instance without having to modify the logic or recompile the program. TRICON points can have the following point types and data types: • Memory points—BOOL, DINT, or REAL data types • Input points—BOOL, DINT, or REAL data types • Output points—BOOL or DINT data types
Chapter 6
Configuration Editor
202
Declaring TRICON Points
Examples An example of a TRICON point that is accessible to all program instances within a project is an Input point that represents a general alarm in the plant. In each program instance, you could declare an Input called GENERAL_ALARM, and connect it to the TRICON point which is also called GENERAL_ALARM. All of the program instances can be connected to the same TRICON point, but for safety reasons, you should place restrictions on which program instances can write to the TRICON point. However, TRICON point connections do not necessarily refer to physical points on the I/O modules. For example, you could declare an Aliased Memory point whose sole purpose is to make certain values accessible to an external host computer. The variable in your program logic that provides these values would be connected to the TRICON point using the Connections Wizard.
Naming Methods When you connect program variables to TRICON points, naming of the relevant TRICON points is always a consideration. There are three basic ways to name TRICON points: • Manually one-by-one using the Declaration Properties dialog box • Using the Auto Tag Names feature for multiple selected points • Automatically using the Connections Wizard Note You can give TRICON points any names that support your control strategy, but using the instrument tag names associated with the points is a good technique.
Manual Naming Manual naming of a TRICON point is precise because you individually assign a unique name to a specific hardware address in the TRICON. This method is valuable if your project has been finely partitioned down to the module and point level. To manually name a TRICON point, open the TRICON Point Connections window of the configuration tree and select the type of I/O points found on the modules you installed in your chassis. For installed modules, a {not yet named} placeholder for each point is displayed, as shown on the following page. Double-
Chapter 6
Configuration Editor
Declaring TRICON Points
203
click on the desired placeholder and use the Properties box to assign a name and other properties. As shown in the example below, the BOOL Outputs icon under Output Points is selected in the configuration tree. Clicking on BOOL Outputs displays dozens of placeholders for BOOL variables in the {not yet named} state. If you double-click on a {not yet named} variable, the Properties box is displayed. There you can enter a Tag Name for the TRICON point and describe its other properties.
Chapter 6
Configuration Editor
204
Declaring TRICON Points
Using Auto Tag Names The Auto Tag Names feature is helpful when you want to apply similar tag names to several TRICON points. For example, you have 50 gas detector inputs, and you want to call them GASDTCT1, GASDTCT2, GASDTCT3, etc. First you would select 50 {not yet named} points in the TRICON Point Connections list, then click on Auto Tag Names in the Properties box. (The Auto Tag Names option is only displayed when you have selected multiple points in the TRICON Point Connections list.) The Auto Tag Names dialog lets you select the desired prefix and the increment you wish to use. In this example, you would enter GASDTCT%0 to start the automatic names at 1.
Chapter 6
Configuration Editor
Declaring TRICON Points
205
Automatic Naming in the Connections Wizard Automatic naming of TRICON points in the Connections Wizard is a quick way to prepare for testing your program logic when some of the information you need to complete your project is temporarily missing. However, with automatic naming you cannot control exactly which TRICON points are connected to which program variables. Refer to the upcoming section called “Using the Connections Wizard” on page 213 for more information about automatic naming and related concerns.
Deleting TRICON Point Names To return a single TRICON point to the {not yet named} state, double-click on the Tag Name field, delete the Tag Name (and other properties if desired) in the Properties box, and select Confirm Name. To return multiple TRICON points to the {not yet named} state, select the required points and double-click to display the Properties box. Enter the Auto Tag Names dialog, leave the Formatted Name field blank, and click OK.
Rules that Apply The TRICON Configuration editor enforces the following rules about TRICON Point Connections: • All input and output variables in a program instance must be connected to TRICON points. • TRICON Input Points must be connected to program variables of the VAR_INPUT type. • A TRICON point cannot be connected to both input and output variables of the same program instance. • A TRICON Output Point cannot be modified by more than one program instance. • A TRICON Memory Point cannot be modified by more than one program instance.
Chapter 6
Configuration Editor
206
Declaring TRICON Points
Property Fields for TRICON Points This section explains the purpose of each field in the TRICON Point Connections list. The particular fields which are active for a selected TRICON point depend on the point type and data type. You can change the order of the fields as they are displayed across the screen, and you can sort the columns for each field alphanumerically in ascending or descending order. Refer to the section called “Options Menu for Lists” on page 188 for more information about sorting. Property Fields for TRICON Point Connections Field
Chapter 6
Description of Use
Tag Name
This field is normally used for the tag names of instruments to which TRICON points are connected, although you could decide to use the field for other types of names.
Retentive
A property you can specify for an Output or Memory point. (All points default to Non-Retentive.) If a power failure occurs, a Retentive point retains, upon power-up, the value it had prior to the power failure. The value of a Non-Retentive point is zero or its default initial value upon power-up following a power failure.
Type
The data type of the selected point—choices are BOOL, DINT and REAL.
Location
The hardware address of the TRICON point to which the program variable is connected. For Input and Output points, the address is displayed in the format CC.SS.PP where CC is the chassis, SS is the slot and PP is the point. For memory points, see the upcoming section called “Addresses of Memory Points” on page 207.
Alias
The five-digit code associated with an Aliased point. For unaliased points, this field is blank.
Group 1
A field you can use to identify a point as a member of a certain group. For example, in the FURNACE project you could identify certain points as members of the BURNER_1 group, the BURNER_2 group, and so on.
Group 2
A field you can use to identify a point as a member of a certain group.
Description
A field you can use to make a comment about a point or the function it performs.
Configuration Editor
Declaring TRICON Points
207
Property Fields for TRICON Point Connections Field
Description of Use
Initial Value
The value assigned to a variable at the time of system initialization or start-up.
MinSpan
For a Memory Real or Input Real variable, the MinSpan sets the lower limit of a selected variable in engineering units.
MaxSpan
For a Memory Real or Input Real variable, the MaxSpan sets the upper limit of a selected variable in engineering units.
DP
Specifies how many decimal points are displayed for a selected Real point. The maximum number of decimal points is eight.
Addresses of Memory Points In the TRICON Configuration editor, the addresses of Memory points are displayed according to their data type, variable type and position in TRICON memory. Examples are: MBW.0013 — the thirteenth Memory BOOL Read/Write point MIN.0007 — the seventh Memory Integer Non-Aliased point The following table lists the acronyms that apply to Memory point displays: Complete Description
Acronym
Memory BOOL (Unaliased)
MBN
Memory BOOL (Read Aliased)
MBR
Memory BOOL (Read/Write Aliased)
MBW
Memory DINT (Unaliased)
MIN
Memory DINT (Read Aliased)
MIR
Memory DINT (Read/Write Aliased)
MIW
Memory REAL (Unaliased)
MRN
Memory REAL (Read Aliased)
MRR
Memory REAL (Read/Write Aliased)
MRW
Chapter 6
Configuration Editor
208
Declaring TRICON Points
Aliases for TRICON Points This section describes the use of Alias numbers for TRICON points whose values must be accessible to external hosts. TriStation 1131 automatically supplies Aliases for all types of TRICON points which you need to connect to your program variables. The following sections provide more information about the use of Aliases in your project configuration.
What are Aliases? When you use TriStation 1131 to create a project for the TRICON, you normally use alphanumeric names as identifiers for program variables and TRICON points. However, you also need to use numeric identifiers called Aliases if your TriStation 1131 project communicates with external host computers by means of the ACM, HIM, ICM, NCM or SMM. Each TRICON point whose value will be read by an external host must have an Alias. An Alias is a five-digit number—the leftmost digit defines the point’s data type and the other four digits define its hardware address in the TRICON. The values of the addresses fall within ranges defined by the TRICON, as shown in the following table: Alias Ranges for TRICON Points Data Type
Message Type
Available Points
Aliased Points1
Alias Range
Input
Discrete
Read Only
4096
2000
10001 - 12000
Input
Integer
Read Only
1024
1000
30001 - 31000
Input
Real
Read Only
120
120
32001 - 32120
Output
Discrete
Read/Write
2048
2000
00001 - 02000
Output
Integer
Read/Write
512
250
40001 - 40250
Memory
Discrete
Read/Write
2016
2000
02001 - 04000
Memory
Discrete
Read Only
2016
2000
12001 - 14000
Memory
Integer
Read/Write
750
750
40251 - 41000
Memory
Integer
Read Only
1000
1000
31001 - 32000
Memory
Real
Read/Write
1000
1000
41001 - 42000
Memory
Real
Read Only
1000
1000
33001 - 34000
Point Type
1. For certain point types, some of the available points have no Aliases. These unaliased points can be used in your project, but can’t be accessed by external hosts.
Chapter 6
Configuration Editor
Declaring TRICON Points
209
Note TriStation 1131 projects operate with 32-bit integer (DINT or Double Integer) and real values, and an Alias always occupies the least significant 16 bits of a 32-bit word. However, when an external host requests Aliased values, the TRICON transfers these values as 16-bit integers. The highest integer value that the TRICON can transfer in 16 bits is 32,767. If the value is higher, the TRICON transfers only the least significant 16 bits of the integer. Real values are scaled as integers according to the lower and upper limits you specify in the desired engineering units.
Fixed Aliases for Input & Output Points When you open the TRICON Point Connections window, a column called Alias displays all of the Aliases, if any, associated with the point type you have selected. For Input and Output points, TriStation 1131 automatically provides a fixed Alias for each hardware address. If you decide to assign a Tag Name and other properties to an Input or Output point located on a particular I/O module within a certain TRICON chassis, you must use the Alias that TriStation 1131 has provided for that address. This is true whether you assign the Tag Names manually one-by-one, or automatically using the Connections Wizard. If you add a new I/O Module to an existing configuration, new Aliases are added sequentially from the available range—existing Aliases for other modules are not disturbed. If you move an I/O Module to another slot, the existing Alias numbers move with the module.
Selecting Aliases for Memory Points For Memory points, the TRICON Point Connections window displays a partial range of available Aliases for the selected point type (see note below). If you know which Aliases you need to use for particular points, select the {not yet named} rows where the desired Aliases are displayed and bring up the Properties box so you can assign Tag Names and other properties to the points. Note By default, the TRICON Point Connections window displays only a partial range of the Aliases you can use for Memory points. To access additional Aliases, increase the memory allocation for the desired Memory point type using the Memory Allocation window of the TRICON Configuration editor.
Chapter 6
Configuration Editor
210
Declaring TRICON Points
If you do not know which Aliases you will be using for particular Memory points, you can use the Connections Wizard to automatically connect program variables of the Memory type to Aliased Memory points. To accomplish this, select one of the following options, as appropriate, in the Wizard’s Auto-Create dialog box: • New Read Aliased Memory global variables • New Read/Write Aliased Memory global variables For more information about automatic connection of program variables to TRICON points, refer to the upcoming section called “Using the Connections Wizard” on page 213.
System Aliases for External Hosts System Aliases are predefined Aliases which external hosts must use to access status information about the TRICON system. Refer to the Reference Manual for TRICON System Aliases for a list of System Aliases that provide status information about the following system components: • Main Processors • EICM • Chassis
Chapter 6
Configuration Editor
Declaring TRICON Points
211
• Slots • Network nodes • Miscellaneous
MinSpan & MaxSpan Fields The MinSpan and MaxSpan fields in the TRICON Point Connections screen are used to rescale the span of values for a selected Memory Real or Input Real point. MinSpan sets the lower limit and MaxSpan sets the upper limit in the desired engineering units. Double-click on the desired Real point and go to the Conversion tab of the Properties box to set the Minimum Value (MinSpan) and Maximum Value (MaxSpan) in the Span Calibration field, as shown in the screen capture below:
MinSpan and MaxSpan can help you convert Real values into Integers if you are using a 16-bit integer protocol which does not support Real values. Examples are Modbus protocol used with the EICM and Honeywell protocol used with the HIM. If you are communicating over an EICM port configured for Modbus protocol, you may have set the Min and Max limits for the Modbus Range in the Setup dialog for the EICM. In this case, it may not be necessary to use the MinSpan and MaxSpan fields for individual Real points in the TRICON Point Connections screen. For more information, refer to the section called “EICM Configuration” in Appendix A, “Configurable Modules”and to the ICM User’s Guide. MinSpan and MaxSpan values are not required for communication with external hosts by means of the ACM, NCM or SMM modules.
Chapter 6
Configuration Editor
212
Declaring TRICON Points
Monitor Display Options With TriStation 1131 V1.1, these options apply only to event variables used with SOE.
For each TRICON point, TriStation 1131 provides options for displaying the points’s state both alphanumerically and in color. The display options can help an operator identify alarm conditions at a glance—for example, when the SOE Data Retrieval Application is used to retrieve and analyze TRICON data. ▼ Follow these steps to apply display options to TRICON points: 1 Go to the TRICON Configuration editor and click any icon that displays the
TRICON point(s) you want to modify. 2 Select the desired point name and double-click to open the Properties dialog
box. If you select multiple point names, click on the Properties Box tool in the toolbar. 3 Click the Monitor tab to access the Monitor Display Options. 4 Enter the desired TRUE and FALSE State Names and select the desired
TRUE and FALSE Colors from the drop-down lists, as shown below:
Click the Default button to set all display parameters back to their default values.
Chapter 6
5 Click the Confirm button to apply the changes. 6 Repeat Steps 1 through 4 to set display options for other TRICON points.
Configuration Editor
Using the Connections Wizard
213
Using the Connections Wizard This section covers the following topics: • Overview • Manual connection • Automatic connection • Automatic naming • Manual naming with automatic connection • Disconnecting TRICON points
Overview For connecting program variables to TRICON points of the Input, Output and Memory types, TriStation 1131 provides the Connections Wizard. Making these point connections is a necessary step before you can test your configuration with the Emulator Control Panel or download it for execution in the TRICON. To use the Connections Wizard, you must first declare at least one program instance for each program in your project that you intend to download. The Wizard is accessible from the Commands menu and from the Instance Properties box which is displayed when you double-click on a program instance name. See page 219 for instructions.
Note The Connect tab in the Properties dialog box for program instances allows you to directly connect individual program variables to TRICON points. You can enter the Wizard as many times as you like to fine-tune the settings of selected points or all points in one or more program instances. Upon entering the Wizard, the main choice you make is whether to manually connect your program variables to TRICON points or automatically connect them using various parameters that you select. Manual connection is straightforward, but as shown in the options table on the following page, automatic connection involves a number of choices in the following areas: • Using another program instance as a pattern for making connections • Naming the TRICON points with prefixes or suffixes • Preserving or removing existing TRICON point connections • Automatically creating new TRICON points of a selected type
Chapter 6
Configuration Editor
214
Using the Connections Wizard
CONNECTIONS WIZARD
All program variables in All instances
All program variables in One instance
Selected program variables only*
Manually connect each program variable
Automatically connect each program variable
Use another program instance as a pattern
Manual connections dialog Prefix with instance name
Prefixed with:
Suffixed with:
No prefix or suffix
PRESERVE/REMOVE CONNECTIONS Preserve connections & existing global variables Preserve connections & auto-rename global variables. Remove existing connections. Remove existing connections and global variable names.
AUTO-CREATE: New Unaliased Memory global variables. New Read Aliased Memory global variables. New Read/Write Aliased Memory global variables. New I/O global variables. Do not create any new global variables (Leave disconnected).
Finish
* This option is available only if you select one or more variables from a Program Instance display before opening the Connections Wizard.
Table of Options for the Connections Wizard
Chapter 6
Configuration Editor
Using the Connections Wizard
215
Manual Connection Manual connection is a very precise way to connect program variables to TRICON points. With this method, the Connections Wizard lets you select a specific program variable and connect it to a specific TRICON point. This is the method you would normally use when testing is done and you are preparing to download your project for real-time execution in the TRICON. See the upcoming section called “Automatic Connection” for a quick method you can use when preparing for testing. When you enter the Wizard for the first time after declaring your program instances, TRICON points will be available for manual connection only if you have manually named them first by double-clicking on {not yet named} points in the TRICON Point Connections window. If you have used the Wizard before to automatically name and connect TRICON points, these connected points will automatically display in the manual connection window from that time onward. You can then decide whether to connect more than one program variable to already-connected TRICON points, or disconnect the previously existing connections.
Steps to Follow This section is based on the AIR_DAMPER_4 instance of the AIR_DAMPER program in the FURNACE project, as shown in the illustration that follows. Take these steps to manually connect a program variable to a TRICON point: • Enter the Connections Wizard from the Commands menu or by doubleclicking on a program instance name to display the Instance Properties dialog box. • Select the option called All program variables in One instance. • Select the option called Manually connect each program variable. The Wizard displays a dialog which lists the program variables from AIR_DAMPER_4 on the left and named TRICON points on the right. • Select the program variable AIR_DAMPER_4.AIR_DAMPER_ALARM in the scroll box at the left. Text underneath the scroll box tells you that the variable is “not connected.” • Select the Output variable type in the upper right corner (Memory, Inputs or Outputs) to display available named TRICON points of the Output type. • Select the TRICON point name called DO-01.04.08 in the scroll box on the right.
Chapter 6
Configuration Editor
216
Using the Connections Wizard
• Select Connect at the top middle of the dialog box. Note the change in status by reading the text underneath the program variable scroll box.
Manual Connection of TRICON Points
Automatic Connection Automatically connecting your program variables to unaliased TRICON memory points is a quick way to prepare for testing with the Emulator Control Panel when some of the information you need to complete your project is temporarily missing. For example, you may have to begin a project without knowing the instrument tag names or Alias numbers for communication over the DCS. But you can still write the logic, declare program instances, and use the Connections Wizard to connect your program variables to TRICON points which are automatically named according to parameters you select.
Chapter 6
Configuration Editor
Using the Connections Wizard
217
With automatic connection, you cannot control exactly which TRICON points are connected to which program variables. The Connections Wizard simply selects points sequentially from the relevant I/O modules. In many cases, this is acceptable for the purpose of testing your logic. Later, when you have received all of the information needed to complete your project, you can fine-tune your TRICON point connections using the manual method.
Automatic Naming Even if you have not manually named any TRICON points in the TRICON Point Connections window, the Wizard can automatically name these points according to a naming convention you select. To do this, the Wizard uses your program variable names and attaches a prefix or suffix of your choice. The choices for automatic naming conventions are: • Prefixing with the instance name • Prefixing with characters of your choice • Suffixing with characters of your choice • No prefix or suffix Prefixing is useful mainly when you have multiple instances of programs, because the TRICON points for the various instances need to have identifiers. Another option related to automatic naming is to Preserve connections and autorename TRICON points. This is useful if your TRICON point names currently have prefixes but you want to have suffixes instead, or vice versa. Prefixing is usually just an intermediate step in project development, when you don’t yet know which physical points you will actually be connecting to. When your instructions for point connection become available, chances are you will want to re-name the TRICON points as the instrument tag names they correspond to.
Manual Naming with Automatic Connection With automatic connection, usually you cannot control exactly which TRICON points are connected to which program variables. But you can exert this control by manually naming the TRICON points first, then using the Connections Wizard to automatically connect them to program variables. However, this method works only if you give the TRICON points the same names as the program variables you want to connect them to. Then, in the Wizard, you must decide to use the program instance name as a prefix or suffix. For example, if your program instance is called
Chapter 6
Configuration Editor
218
Using the Connections Wizard
P1, then your TRICON point names would be called P1_, P1_, P1_, etc. after they are connected to the program variables. To use this method, the first step is to manually name your TRICON points using in the TRICON Point Connections window. Then enter the Connections Wizard and select the following options: • All program variables in One instance • Automatically connect each program variable • Prefixed with the instance name • Do not create any TRICON points (Leave disconnected)
Viewing Points for Selected Modules After you have declared a number of TRICON point connections for various I/O modules in your system, there is an easy way to display all of the TRICON points which have been declared for a particular module. To do this, follow these steps: • Click the Hardware Allocation icon in the configuration tree. • Select the desired module and double-click on it to bring up the Properties box. • Select the View Points option under the Module tab to display all TRICON points (named and un-named) declared for this module.
Undoing TRICON Point Names & Connections If in the course of project development you choose to undo all existing TRICON point names and connections, the Connections Wizard allows you to do this automatically by selecting these options in sequence: • All variables in all instances • Automatically connect each program variable • Any naming convention • Remove existing connections and TRICON point names • Do not create any new TRICON points (Leave disconnected)
Chapter 6
Configuration Editor
Connecting Individual Program Variables
219
Connecting Individual Program Variables This section describes direct manual connection of individual program variables using the Connect tab in the Properties box. Doing this is an alternative to using the Connections Wizard when you only need to connect one or two program variables to TRICON points. Before using the Connect tab, you must have declared your Tag Names and at least one program instance. ▼ Follow these steps to use the Connect tab in the Properties dialog box: 1 Go the TRICON Configuration editor. 2 Expand the list of program instances under the Program Instances
Declaration icon and select a specific program instance. 3 Display the Properties dialog box and make sure the pushpin is tacked down. 4 Select a program variable that you would like to connect. 5 Click on the Connect tab of the Properties dialog box and select a TRICON
point from the list in the dialog box, as shown in this example:
6 Repeat steps 4 and 5 for each program variable you want to connect.
Chapter 6
Configuration Editor
220
Building the Configuration
Building the Configuration Note Building the configuration is a mandatory step before you can test it in emulation mode or download it to the TRICON for real-time execution. When you have finished making all of the necessary TRICON point connections, select Build Configuration or Rebuild Configuration from the TRICON menu. TriStation 1131 will compile the current configuration and display all relevant messages in the Message Bar, as shown below.
If there are any error messages in the Message Bar, double-click on each one and TriStation 1131 will highlight the areas where the errors have occurred so you can begin debugging. Click on the right mouse button to display a menu (shown at right above) of options for dealing with errors, including the Jump to Source command which jumps directly to an error source.
Testing & Downloading After your configuration is successfully built, your project is ready for testing with the Emulator Control Panel. When your test results prove that the project operates effectively, you are ready to download it for real-time execution using the TRICON Control Panel. Refer to Chapter 7, “Control Panels” for details.
Chapter 6
Configuration Editor
Compare to Last Download
221
Compare to Last Download When you download a configuration to the TRICON, TriStation 1131 automatically saves a snapshot of this configuration in your project. The Compare to Last Download command on the Commands menu allows you to compare your current configuration to the snapshot that was saved during the last download. Note To do an on-line comparison to the last downloaded configuration, use Compare to Last Download in the TRICON Control Panel. See page 277. The Compare Configurations dialog box provides the following tabs: • System parameters • Modules installed in TRICON chassis • Elements of the project • Instances of programs and function blocks • TRICON Points In each tab, there is a column of Current information beside a column of Last Download information, as shown in the TRICON Points tab below. For any item that is different from the last download, an asterisk (“*”) is displayed in the red asterisk column on the far left.
Chapter 6
Configuration Editor
222
Compare to Last Download
Details Display Four of the tabs in the Compare Configurations dialog box include a Details button that displays the following types of information: Tab Name
Details About
Modules
Configuration of ACM, EICM, NCM, Pulse Input and SMM. See sample below.
Elements
Changes to project elements: programs, functions, function blocks, standard libraries and user-written libraries.
Instances
Current list of instances and Last Downloaded list of instances.
TRICON Points
Current Definition and Previous Definition of TRICON points associated with the selected TRICON Point.
Details display for the Network Communication Module (NCM) in the Modules tab
Chapter 6
Configuration Editor
Compare to Last Download
223
Configuration Differences Report From any tab in the Compare Configurations dialog box, you can click on the Print button to see a print preview of the Configuration Differences Report. The following illustration shows part of a Configuration Differences Report for a TriStation 1131 project:
In the print preview, standard Crystal Report tools are available for page scrolling, enlargement and reduction of the view, and printing.
Chapter 6
Configuration Editor
224
Exporting TRICON Point Properties
Exporting TRICON Point Properties The Export TRICON Points command on the Edit menu allows you to export TRICON point properties to any database or text file that has one of the following formats: Database or File Format
Filename Extension
dBASE
.dbf
Microsoft Access
.mdb
Microsoft Excel
.xls
Comma-delimited ASCII text records
*.txt *.csv
Note You must limit the export filename (excluding the extension) to eight characters if you are going to modify this file and use it to import TRICON point properties back into TriStation 1131. The upcoming sections give the facts you need to know to export TRICON point properties efficiently, covering the following topics: • Selecting point types for export • Exporting to a database or Excel file • Exporting to a text file • Sample steps to follow
Chapter 6
Configuration Editor
Exporting TRICON Point Properties
225
Selecting Point Type(s) for Export With each export operation, you can choose to export any of the following point types from the current configuration of your TriStation 1131 project: • All TRICON points • All Memory points • All Input points • All Output points • One type of points only, such as: – BOOL Inputs (Read Unaliased) – DINT Inputs (Read Aliased)
Exporting to a Database or Excel File When TriStation 1131 exports TRICON point properties to a database or Excel file, it always creates tables with the same column headings and number of characters, as shown in the list that follows. When you open a table to which you have exported TRICON point properties, you will always find these 16 columns, even if some of the columns contain no data. TRICON Point Property
Required Value
TAGNAME
TRICON point’s Tag Name (valid IEC 1131 identifier)—must be 31 or fewer characters
DESCRIP
TRICON point’s Description
GROUP1
TRICON point’s Group1 description
GROUP2
TRICON point’s Group2 description
ALIASTYPE
TRICON point’s Alias type: U = Unaliased R = Read-only aliased W = Read/Write aliased
ALIASNUM
Tricon point’s Alias number from 0 - 42000
Chapter 6
Configuration Editor
226
Exporting TRICON Point Properties
TRICON Point Property
Required Value
TAGTYPE
Data type: D = Discrete (BOOL) I = Integer R = Real
TAGCLASS
Data class: I = Input O = Output M = Memory
INITVALUE
Initial value - TRUE or FALSE for BOOL data type - Integer value for DINT data type - Real value for REAL data type
RETENTIVE
Retentive flag: N = Non-retentive R = Retentive
CHASSIS
Chassis number (0 - 15)
SLOT
Slot number (0 - 8)
POINT
Point number (0 - 64)
MINSPAN
Lower limit for REAL in Engineering Units—0.00 - 32767.00
MAXSPAN
Upper limit for REAL in Engineering Units—0.00 - 32767.00
DECPL1
Decimal places for displaying Real variables
1. Corresponds to the DP (Decimal Place) field in the TRICON Point Connections window and the Min/Max Accuracy field in the Format Data Source dialog box of the Import Wizard.
Chapter 6
Configuration Editor
Exporting TRICON Point Properties
227
Exporting to a Text File When TriStation 1131 exports TRICON point properties to a text file, the export data consists of text fields separated by commas, as shown in the example below. Each text field represents a separate column of data, whereas commas and quotes represent blank columns according to the following conventions: • Two commas (no spaces in between) represent a blank numeric field. • Two quotes (no spaces in between) represent a blank string field. Every column, whether blank or not, is delimited by a comma.
Chapter 6
Configuration Editor
228
Exporting TRICON Point Properties
Sample Steps to Follow The steps below show how to export TRICON point properties from TriStation 1131 to a Microsoft Access database (.mdb) file, using the ExSOE.pt2 sample project found on the TriStation 1131 CD. Later, the sample steps for importing TRICON point properties from a database file will use the export file created here. ▼ To export TRICON point properties to a database file, follow these steps: 1 In TriStation 1131, use the Open Project command on the File menu to open
the sample project called ExSOE.pt2. 2 Go the TRICON Configuration editor. 3 In the directory tree, select the icon for TRICON Point Connections, as shown
below:
4 Select the Export TRICON Points command from the Edit menu. 5 Use the Windows dialog box to select the .mdb filetype and type in the name
“All_Pnts” for the export file. Click the Export button. 6 Open your export file in Microsoft Access to verify the presence of the desired
TRICON point properties from the ExSOE.pt2 project.
Chapter 6
Configuration Editor
Importing TRICON Point Properties
229
Importing TRICON Point Properties The Import TRICON Points command on the Edit menu allows you to import properties for TRICON points from any database or text file that has one of the following formats: Database or File Format
Filename Extension
dBASE
.dbf
Microsoft Access
.mdb
Microsoft Excel
.xls
Comma-delimited ASCII text records
*.txt *.csv
Note The name of an import file must be eight or fewer characters in length. If the filename exceeds eight characters, TriStation 1131 will generate an error message when you select the file for an import. The upcoming pages explain how to import TRICON point properties effectively, covering the following topics: • Rules for database or Excel files • Rules for text files • Required values for TRICON point properties • Sample steps to follow • Input record processing
Chapter 6
Configuration Editor
230
Importing TRICON Point Properties
Rules for Database or Excel Files A database or Excel file that you import to TriStation 1131 consists of at least one table of data that will be mapped to TRICON point properties in the TRICON Configuration editor. The following rules apply to the columns of TRICON point properties in your import table: • A table may contain as many columns of data as you like, but there are only 16 TRICON point properties to which you can map imported data. • The columns in the table may have any column headings that you want. • A table must contain a minimum of three columns of data, which you must map to these TRICON point properties: – Tag Name – Tag Type – Tag Class • Data in the columns must meet the requirements described in “Required Values for TRICON Point Properties” on page 232, or they must be blank.
Rules for Text Files When you set up text files of TRICON point properties to be imported into TriStation 1131, the following rules apply: • Every line of text must have a consistent format, that is, the same number of fields. • Every field must be delimited by a comma (no spaces before or after). • A line of text may contain as many fields as you like, but there are only 16 TRICON point properties to which you can map the imported data. • Each line of text must contain a minimum of three fields, which you must map to these TRICON point properties: – Tag Name – Tag Type – Tag Class • Each field must meet the requirements described in “Required Values for TRICON Point Properties” on page 232.
Chapter 6
Configuration Editor
Importing TRICON Point Properties
231
• A line of text may include blank fields, but these are not required. If you want to include blank fields, then follow these conventions: – Use two commas (no spaces between) to represent a blank numeric field. – Use two quotes (no spaces between) to represent a blank string field. When you import TRICON point properties from a text file, TriStation 1131 automatically applies the default column headings F1, F2, etc. up to the maximum number of fields defined in the text file. These default column headings appear in the Format Data Source dialog box of the Import Wizard, as shown in this example for 16 fields:
For more information, see the upcoming section called “Sample Steps to Follow” on page 234.
Chapter 6
Configuration Editor
232
Importing TRICON Point Properties
Required Values for TRICON Point Properties The following table describes the required values for the 16 TRICON point properties to which you will map your imported data. These requirements apply to all TRICON point properties, whether they come from database, Excel or ASCII text files. Note The property names listed in this table are displayed in the Format Data Source dialog box of the Import Wizard, described on page 234. :
TRICON Point Property
Chapter 6
Required Value
Tag Name
TRICON point’s Tag Name (valid IEC 1131 identifier)—must be 31 or fewer characters
Description
TRICON point’s Description
Group1
TRICON point’s Group1 description
Group2
TRICON point’s Group2 description
Alias Type
TRICON point’s Alias type: U = Unaliased R = Read-only aliased W = Read/Write aliased
Alias Number
Tricon point’s Alias number from 0 - 42000
Tag Type
Data type: D = Discrete (BOOL) I = Integer R = Real
Tag Class
Data class: I = Input O = Output M = Memory
Initial Value
Initial value: - TRUE or FALSE for BOOL data type - Integer value for DINT data type - Real value for REAL data type
Configuration Editor
Importing TRICON Point Properties
TRICON Point Property
233
Required Value
Retentive Flag
Retentive flag: N = Non-retentive R = Retentive
Chassis
Chassis number (0 - 15)
Slot
Slot number (0 - 8)
Point
Point number (0 - 64)
Min Span
Lower limit for REAL in Engineering Units—0.00 - 32767.00
Max Span
Upper limit for REAL in Engineering Units—0.00 - 32767.00
Min/Max Accuracy
Decimal places for displaying the values of Real variables
Note The MinSpan, MaxSpan and Min/Max Accuracy fields are for REAL values only. These fields are left blank for data types other than REAL, such as DINT or BOOL.
Chapter 6
Configuration Editor
234
Importing TRICON Point Properties
Sample Steps to Follow These steps are based on a sample database file called “All_Pnts.mdb” which was created by following the sample steps for export in the preceding section. This database file has one table containing sixteen columns of TRICON point properties. ▼ To import TRICON point properties, follow these steps: 1 In TriStation 1131, create a new project. 2 Go the TRICON Configuration editor. 3 Select the Import TRICON Points command from the Edit menu to start up
the Import Wizard. 4 In the Select Data Source dialog box, click the Select Import Data File button. An import filename must have eight or fewer characters
5 Use the Windows dialog box to select the .mdb file type and locate the
For details on the Link and Unlink commands, see page 237.
7 In the Format Data Source dialog box (shown below), select the Link All
Chapter 6
“All_Pnts.mdb” file. Click the Open button. 6 Select the All_Pnts table from the Select Table list and click the Next button.
command to map the import data to TRICON point properties.
Configuration Editor
Importing TRICON Point Properties
235
After the Link All, the Import Wizard displays the mapped items in the right side of the Format Data Source dialog box, as shown below:
For details about updates and adds, see “Import Record Processing” on page 238.
8 In the Select Import Options dialog box, select these options and click the
Next button: • Do validation only. • Update existing TRICON points as well as add new entries. 9 Review your import options, then click the Finish button. 10 Examine your results in the Data Import Validation Result dialog box:
If the import results in errors, the Show Errors Only option is selected by default. See “Import Status Messages” on page 236 for details.
11 To check an individual import record for errors or warnings, click on the record
and read the messages in the Detailed Errors/Warnings box, as shown above.
Chapter 6
Configuration Editor
236
Importing TRICON Point Properties
12 Ensure that the desired Show... option is selected (Show All in the example
above), then click the View Details button to see a report of errors or warnings for the selected TRICON points, as shown in this example: Print and save the View Details report to help document the development of your project.
13 Click the Close box in the upper right corner of the report file display to return
to the Data Import Validation Result dialog box. 14 Click the Commit Records button in the lower left corner of the dialog box to
complete the import of the validated TRICON point properties. 15 Click the Close button to exit the Import Wizard. 16 On the directory tree of the TRICON Configuration editor, click the TRICON
Point Connections icon to view the TRICON point properties you just imported.
Import Status Messages In the Import Status column of the Data Import Validation Result dialog box, one of four messages is displayed for each import record: IGNORED The import record is mapped to an existing TRICON point that has the same properties, so the import record is being ignored. ADDED
A new record is being added to the configuration.
ERROR
The import record has been rejected due to one or more errors.
UPDATED The import record is updating properties of an existing TRICON point.
Chapter 6
Configuration Editor
Importing TRICON Point Properties
237
Linking & Unlinking Import Records In the Format Data Source dialog box of the Import Wizard, you have a chance to link or unlink your import records to TRICON point properties. Four linking commands are available: Link
See instructions below.
Unlink
See instructions below.
Link All
Applies only when you have 16 fields in the Source Field list which will be mapped one-for-one to the TRICON Point Property list.
Unlink All
Applies to all set-ups of linked entries that need to un-linked.
▼ To use the Link command, follow these steps: Hold down the CTRL key to select multiple fields.
1 Select one or more fields in the Source Field list on the left. 2 For each field you have selected, you must select a corresponding TRICON
Point Property on the right, as shown in this example:
3 Click the Link button to map the selected fields to the properties on the right. ▼ To use the Unlink command, follow these steps: 1 Select one or more fields from the Source Field list on the right. 2 Click the Unlink button.
Chapter 6
Configuration Editor
238
Importing TRICON Point Properties
Import Record Processing The Import Wizard offers three choices when importing TRICON points: • Update existing TRICON points only • Add new TRICON points only • Update existing TRICON points and add new TRICON points The following sections explain how TriStation 1131 handles updates and adds.
Updating Existing TRICON Points The import operation can easily update an existing TRICON point that matches an import record. A matching point is one whose Tag Name, Tag Type and Tag Class properties match the corresponding values in the import record. If an import record matches an existing TRICON point and meets TriStation 1131’s validation requirements, the following properties of the existing point will be updated from the input record if they are different: • Description • Group1 • Group2 • Initial value • Retentive Flag • MinSpan • MaxSpan • Min/Max Accuracy (Decimal Place) The following properties will not be updated by the import operation: • Alias Type • Alias Number • Tag Type • Tag Class • Chassis • Slot • Point
Chapter 6
Configuration Editor
Importing TRICON Point Properties
239
Adding New TRICON Points A new TRICON point is one whose Tag Name does not currently appear in the TRICON Points table. New entries are automatically posted to the TRICON Points table if they meet the validation requirements. TRICON points with Aliases (Read Aliased or Read/Write Aliased) are treated as follows when an input record is processed. Input/Output Points: • The input record must contain an Alias number and/or a Chassis.Slot.Point address. • If only the Alias number is provided, Tristation 1131 looks for an allocated point whose Alias matches the one supplied. If no match is found or the point is already being used, the import record is rejected. • If only the Chassis/Slot/Point address is provided, Tristation 1131 looks for an allocated point whose address matches the one supplied. If no match is found or the point is already being used, the import record is rejected. • If both the Alias and Chassis/Slot/Point address are provided, Tristation 1131 looks for an allocated point with matching properties. If no match is found or the point is already being used, the import record is rejected. Aliased Memory Points: • If the input record contains an Alias number, Tristation 1131 looks for an allocated point whose Alias matches the one supplied. If no match is found or the point is already being used, the import record is rejected. • If the input record does not contain an Alias number, Tristation 1131 uses the first available point location that matches the data type and Alias type (Read or Read/Write). If no location is found, the import record is rejected.
Other Imports Imported data that does not meet the criteria specified in the preceding sections is rejected as an error.
Chapter 6
Configuration Editor
240
Configuring the TRICON for Event Collection
Configuring the TRICON for Event Collection This section explains how to configure your TriStation 1131 project for use with the TRICON’s Sequence of Events (SOE) capability, which can help with system maintenance and shutdown analysis. During each scan of the control program, the TRICON’s Main Processors examine selected BOOL variables for state changes known as events. These event variables are assigned to SOE blocks using the TRICON Configuration editor. To prepare your system for event collection, you need to do the following tasks as you develop your TriStation 1131 application: • Estimate available memory • Set up SOE blocks • Assign event variables to the blocks • Designate a trip variable (optional) • Set up monitor options (optional) Instructions for these tasks are provided in the upcoming pages. TriStation 1131 is also used to program four function blocks that allow you to control event collection for SOE blocks: SOESTRT — Starts event collection for a specified SOE block SOESTOP — Stops event collection for a specified SOE block SOESTAT — Checks status of a specified SOE block SOECLR — Clears a specified SOE block Refer to the User’s Guide for the Sequence of Events Data Retrieval Application for details about using the SOE function blocks, and complete information about other aspects of SOE.
Chapter 6
Configuration Editor
Configuring the TRICON for Event Collection
241
Estimating Available Memory The maximum SOE block size you can define is 20,000 events (320,000 bytes), and there is a maximum size of 60,000 events (1 Mbyte) allowed across all blocks. ▼ Follow this procedure in TriStation 1131 to determine how much memory is available for SOE blocks: 1 Write the logic for your process control application (including SOE block
control functions), but don’t configure the SOE blocks. 2 Go to the TRICON Control Panel and download your application to the
TRICON by using the Download All command. 3 Run your application by using the Run command in the Commands menu. 4 Go to the TRICON Diagnostic Panel and look at the TRICON System
Configuration window to find the amount of Free Memory in the TRICON. Free memory = _____________ 5 Determine how much memory you want to reserve for future modifications to
your application. Reserved memory = _____________ 6 Compute the amount of memory available for SOE blocks by subtracting the
Reserved Memory (step 5) from the Free Memory (step 4). SOE block memory = _____________ 7 To compute the maximum number of events, divide the reserved memory by 16.
Events (maximum) = _____________ 8 Use the TRICON Configuration editor to define your SOE blocks and then use
the Download All command again.
Chapter 6
Configuration Editor
242
Configuring the TRICON for Event Collection
Setting Up SOE Blocks ▼ Follow these steps in TriStation 1131 to set up SOE blocks: 1 In the TRICON Configuration editor, click on the TRICON SOE
Configuration icon to display the placeholders for Blocks 1 through 16. 2 Double-click on a block number to open the Properties box called SOE Block
Definition, as shown in this example:
3 Select a Block Type other than UNASSIGNED from the drop-down list. The
choices are EXTERNAL, FIRST OUT and HISTORY. For descriptions of the block types, see the User’s Guide for the SOE Data Retrieval Application. 4 Enter a Title and a Buffer Size. 5 Press the Confirm button.
Note You can change the type of an SOE block or the variables assigned to it using the Download Change command, but you must use the Download All command to add new SOE blocks or change the buffer size of existing blocks. For more information, go to the section called “Download Change” on page 267. 6 Repeat Steps 2 through 5 for other blocks that you want to set up.
Chapter 6
Configuration Editor
Configuring the TRICON for Event Collection
243
Assigning Event Variables to SOE Blocks Note Assigning event variables to SOE blocks is possible only after you have set up the blocks using the SOE Block Definition dialog box in the TRICON SOE Configuration window, as explained in the preceding section. ▼ After setting up your SOE blocks, you can assign event variables to them by following these steps: 1 In the TRICON Configuration editor, click the TRICON SOE Configura-
tion icon to display all of the Tag Names (variables) defined for TRICON points which are SOE-configurable. These include BOOL Inputs and BOOL Aliased Memory variables. 2 Select the desired variables and double-click to open the Properties dialog box.
If you select multiple variables, click on the Properties box tool in the toolbar. 3 On the SOE Block Select tab, check the block numbers to which you want to
assign the selected variables, as shown in this example:
4 Repeat Steps 2 and 3 to assign other event variables to SOE blocks.
Chapter 6
Configuration Editor
244
Configuring the TRICON for Event Collection
Designating a Trip Variable (Optional) A trip snapshot is a file of events that occurred x minutes before a trip and y minutes after a trip.
A trip variable is an aliased Tag Name of type BOOL whose state transition causes the SOE application to automatically create a trip snapshot. A TriStation 1131 project can have only one trip variable defined for one block, but the trip variable may apply to all of the blocks. Your TriStation 1131 logic may contain several variables related to trip conditions, but you should OR them all into one BOOL variable that is designated as the trip variable. Note You can designate a trip variable only after you have set up at least one SOE block and assigned event variables to the block. 1 Go to the TRICON Configuration editor and click the TRICON SOE
Configuration icon. 2 Double-click to open the Properties dialog box called SOE Trip Variable, as
shown in this example.
The drop-down list contains variables only if you have assigned variables to SOE blocks.
Chapter 6
3 Select the Trip Tag Name from the drop-down list of event variable names and
choose a Trip State of TRUE or FALSE. 4 Set the Time Before Trip and Time After Trip in minutes. The minimum time
for both parameters is two minutes; the maximum for both parameters is ten minutes. This is the window of time that the SOE application will use to create a trip snapshot.
Configuration Editor
Configuring the TRICON for Event Collection
245
Selecting Monitor Display Options (Optional) For each TRICON point, TriStation 1131 provides options for displaying the points’s state both alphanumerically and in color. When you have defined TRICON points as event variables for use with SOE, the display options can help you identify alarm conditions at a glance. The display options are applied using the Monitor tab of the Properties dialog for one or more selected event variables. For instructions, see the section called “Monitor Display Options” on page 212. Note With TriStation 1131 V1.1, the monitor display options apply only to event variables used with SOE.
Chapter 6
Configuration Editor
CHAPTER 7
Control Panels
This chapter covers the following topics: • Control tools • Operating a control panel • Downloading a project • Disabling & enabling points • TRICON operational modes
248
Control Tools
Control Tools To help you test and monitor your project with the Emulator Control Panel and TRICON Control Panel, TriStation 1131 provides control tools in a pop-up menu, main menu and toolbar. The same tools are available for both control panels, although the main purpose of each control panel differs. Refer to the section called “Operating a Control Panel” on page 256 for more information.
Pop-up Menu Press the right mouse button while viewing a control panel to display a pop-up menu, either for a selected element or for any empty area. All of the commands in the pop-up menu are accessible from the control panel’s toolbar and main menu as well, except for the Size/Alignment commands described below.
For A Selected Element For a selected element, TriStation 1131 displays commands that apply to that element, as shown in this example (below left) for a variable:
For Any Empty Area If you press the right mouse button from any empty area, the pop-up menu displays a different set of commands as shown above right. The first command, called Select Arrow Key, is useful when you are in the middle of an operation but decide not to complete the operation. At such a time, you can press the right mouse button and choose Select Arrow Key to terminate the unwanted operation and return the cursor to the arrow key.
Chapter 7
Control Panels
Control Tools 249
Size/Alignment Commands The pop-up menu’s Size/Alignment commands help you arrange multiple elements on the monitor sheet in a control panel, as shown in the example below. Take these steps to re-arrange multiple elements: 1 Select all of the elements you want to re-arrange. 2 Rest the cursor on the reference element for the size or alignment operation you
are planning to perform. 3 Press the right mouse button to display the pop-up menu. 4 Select the size or alignment operation from the Size/Alignment sub-menu.
Main Menu Commands A control panel’s main menu appears above the toolbar as follows, and the diagram on the following page shows the commands which are accessible from the it. (For menus and commands which are common to all TriStation 1131 views, see “Basic Editing Tools” on page 40.)
Chapter 7
Control Panels
250
Control Tools
Menus & Commands of Emulator/TRICON Control Panel (grayed-out commands are common to all TriStation 1131 views)
Edit Configuration Build Configuration Rebuild Configuration Compile All Project Elements Emulator Control Panel TRICON Control Panel TRICON Diagnostic Panel View Download History... Change State to Download All
New Window Cascade Tile Horizontal Tile Vertical Close All Arrange Icons Show Properties Sheet Show Message Bar (Vertical Message Bar) (Horizontal Message Bar) Hide Message Bar 1 PROGRAM:
Tristation 1131 Help Tip of the Day... Keyboard Shortcuts Sample Projects Technical Support About TriStation 1131... TriStation 1131 Logo...
Commands
Connect... Disconnect Download All Download Changes Run Single Step Pause Halt Set Scan Rate Set Calendar Clock Enable All Disabled Points List Disabled Points Compare to Last Download Continous Refresh
Shortcut Keys In all TriStation 1131 menus, underlined characters are shortcut keys to be used in the typical manner of Windows applications: • For a menu item, use ALT + to open the menu. • For a command within a menu, type the of the desired command.
Chapter 7
Control Panels
Control Tools 251
Table of Control Tools The table that follows describes the main menu commands which are specific to the control panels and the tools in the control panel toolbar which correspond to these commands.
As noted earlier, the underlined characters shown in the menu and command names are shortcut keys to be used in the typical manner of Windows applications. Note On any TriStation 1131 toolbar, the name of a tool is displayed if you place the cursor inside the icon for the tool. Edit Menu Command
Description
Undo
Reverses the last edit of a variable, function or function block.
Redo
Reverses the last Undo command. This must be done before any other editing is done.
Edit Session Journal
Opens a dialog box which displays a sequential list of actions undertaken during the most recent edit session. Any previous state during the current edit session can be recovered and displayed by selecting from the list.
Cut
Cuts (deletes) selected items from the current control panel and places them on the clipboard, erasing the previous contents.
Copy
Copies selected items from the current control panel and places them on the clipboard, erasing the previous contents.
Paste
Pastes the current contents of the clipboard into the selected element.
Find
Finds specific text within the logic elements of the current control panel.
Chapter 7
Control Panels
252
Control Tools
Element Menu Command
Description
Save
Saves the open control panel but not the entire project.
Description
Identifies the creation and modification dates of the control panel. Lets you select ownership, dependencies and read/write status; and enter descriptive text.
Comment Macros
Allows you to select macros for use in comments about control panel elements.
Tree Menu Command
Description
Expand One Level
Expands a selected tree node by one level.
Expand Branch
Expands a selected tree node to all levels.
Expand All
Expands the whole tree to all levels.
Collapse Branch
Collapses a selected branch of the tree.
View Menu Command
Description
Grid Display
Changes the background of the control panel to display or not display an editing grid for precise placement of logic elements.
Zoom
Select the zoom view of your control panel from preset and custom views.
Zoom to Fit
Displays the entire control panel within the current window.
IEC Display Mode
Changes the display characteristics of elements in the control panel to IEC format.
Tools Menu
Chapter 7
Command
Description
Delete Red X Elements This Sheet
Deletes invalid elements (each marked with a red X) on the current sheet that may be left over from previous builds or editing.
Control Panels
Control Tools 253
Tools Menu Command
Description
Delete All Red X Elements
Deletes all invalid elements (each marked with a red X) that may be left over from previous builds or editing. Applies to all sheets that have been defined for the control panel.
Instance View
Allows you to select an instance of a program for viewing of variable values and annotations during execution. For details, see the section called “Using the Program Instance Monitor” on page 260.
Select Tool (Arrow)
Changes the mouse cursor into an arrow so you can select the desired item.
Insert Comment
Places a comment box on the current control panel sheet so you can enter descriptive text.
Commands Menu Command
Description
Connect...
For the Emulator Control Panel, establishes communication between TriStation 1131 and the Emulator. For the TRICON Control Panel, establishes communication between TriStation 1131 and a TRICON controller, assuming that the PC is physically connected to the TRICON.
Disconnect
Logically disconnects TriStation 1131 from the Emulator or a TRICON node with which communication was previously established.
Download All
Downloads the entire configuration for your project to the Emulator or TRICON, totally rebuilding the configuration first.
Download Changes
Makes on-line changes to a project that is already executing in the Emulator or TRICON following a Download All.
Run
Starts continuous scanning (execution) of your project in the Emulator or the TRICON.
Chapter 7
Control Panels
254
Control Tools
Commands Menu
Chapter 7
Command
Description
Single Step
Causes your project to execute for one scan only in the Emulator or the TRICON.
Pause
Pauses execution of the project in the Emulator or TRICON after completion of the current scan.
Halt
Halts execution of the project that is currently running in the Emulator or TRICON and re-initializes variables to their first-scan state.
Set Scan Rate
Sets the scan rate in units of milliseconds. The minimum scan rate is 20 milliseconds and the maximum scan rate is 500 milliseconds.
Set Calendar Clock
Sets the TRICON calendar clock to your current Windows time.
Enable All Disabled Points
Enables all TRICON points that you have previously disabled using the Disable button in the Properties box for selected program variables.
List Disabled Points
Displays a list of all TRICON points that you have previously disabled using the Disable button in the Properties box for selected program variables.
Compare to Last Download
After you connect your project to the TRICON where it was previously downloaded, this command compares the project’s current configuration to the last downloaded configuration.
Continuous Refresh
Continuously displays the current values of variables in your monitor window. Toggles on or off each time you click the button.
Control Panels
Control Tools 255
Sheets Menu Command
Description
Sheet Title
Allows you to edit the title of the current sheet (displayed in the title block, window caption bar and Window Menu list).
Next Sheet
Displays the next sheet (for logic elements with multiple sheets).
Previous Sheet
Displays the previous sheet (for logic elements with multiple sheets).
Find Sheet
Allows you to find and select sheets by sheet title and provides access to dialog boxes for insertion, deletion, and appending of sheets.
Append Sheet
Adds a new sheet to the end of the current project element.
Insert Sheet
Inserts a new sheet before the current sheet or before a horizontal network boundary (if selected).
Delete Sheet
Deletes the sheet that is currently displayed.
Chapter 7
Control Panels
256
Operating a Control Panel
Operating a Control Panel TriStation 1131 provides two control panels for testing and monitoring your project: • Emulator Control Panel • TRICON Control Panel The control panels are accessible from the TRICON menu or the Platform tab in the Project Directory. The operation of both control panels is identical, but their main purposes differ: • The main purpose of the Emulator Control Panel is off-line testing of a project. • The main purpose of the TRICON Control Panel is on-line monitoring of live data as a project executes in the TRICON. The sections that follow explain how to set up a control panel and use for it testing or monitoring. These topics are covered: • Setting up a monitor window • Setting values for testing • Using the program instance monitor • Sample steps for the Emulator
Chapter 7
Control Panels
Operating a Control Panel
257
Setting up a Monitor Sheet The first time you enter a control panel, TriStation 1131 displays a blank split screen with a tree structure on the left and a monitor sheet on the right. After you connect and download your project to the Emulator or the TRICON, the tree lists the variables and function blocks for all program instances in your configuration. Set up the control panel for monitoring by dragging the desired variables from the tree to the monitor sheet and arranging them in the order you prefer. You can select multiple variables from the tree or on the monitor sheet by holding down the SHIFT key or CTRL key as you make the selections. For function blocks, you can drag each parameter to the monitor sheet separately, if desired. For long programs, you can define multiple monitor sheets using Append Sheet, Insert Sheet and other commands in the Sheets menu.
Chapter 7
Control Panels
258
Operating a Control Panel
Setting Values for Testing After you start execution with the Run or Single Step command, you can manually change the value of any logic element for test purposes. Double-click on the element to bring up the Properties box and use the Set Value field to enter a new value, as shown in the following example for an input variable:
For functions and function blocks with multiple parameters, select the desired parameter in the Variable List before setting the value in the Set Value field, as in this example:
Chapter 7
Control Panels
Operating a Control Panel
259
Enlarging Your View of Elements There are two ways to enlarge your view of selected elements in the monitor sheet of the Emulator or TRICON Control Panel. One way is to use the Zoom... command in the View menu to select a percentage of enlargement. A quicker way to change the Zoom is to double-click the left mouse button in any empty area to see a “Zoom Selection” view. This is a full view of the monitor sheet with the contents of the current view area highlighted in a rectangle. You can move the current view rectangle by clicking the left mouse button in a different area of the drawing sheet or by drawing a new view rectangle, holding down the left mouse button while drawing.
Current View Rectangle
Chapter 7
Control Panels
260
Operating a Control Panel
Using the Program Instance Monitor When you invoke a program instance from a control panel, you can monitor the actual values of annotated variables in the logic during execution. Select a program instance name from the tree, then select the Instance View command or tool. The control panel then displays a read-only instance view of the program logic, with the variable annotations expanded as shown in the FBD example below. See the next page for an LD example which shows how power flow works.
Chapter 7
Control Panels
Operating a Control Panel
261
Power Flow in an LD Program Instance When you use the Instance View command or tool to display a read-only instance view of an LD program, the Control Panel uses red to indicate the power-on state and green to indicate the power-off state, as shown in this example:
Red for Power-on
Green for Power-off
Chapter 7
Control Panels
262
Operating a Control Panel
Sample Steps for Set-up & Use After you have corrected any errors in your program logic and configuration and completed a successful Build, it is time to test the configuration using the Emulator Control Panel. In general, you should only use the TRICON Control Panel after all testing is complete. The sample steps in this section are based on the AIR_DAMPER_1 instance of the AIR_DAMPER program in the FURNACE project, as shown in the illustration below. Although the Emulator Control Panel is used as an example here, the basic steps apply to the TRICON Control Panel as well. Only the steps for physically connecting to the TRICON controller are missing. Refer to the upcoming section called “Download All” on page 264 for that information.
▼ Follow these steps to set up variables and function blocks in the Emulator Control Panel and begin testing: 1 Access the Emulator Control Panel from the TRICON menu. 2 Use the Connect command to logically connect to the Emulator. 3 Select either a serial port or a network node. 4 Enter the password, if it is requested. If you do not know the password, you
cannot connect to the TRICON. (A password is requested here only if you entered one as a System Configuration parameter.)
Chapter 7
Control Panels
Operating a Control Panel
263
5 Use the Download All command to download your configuration to the
Emulator. (At this time, TriStation 1131 may send a message that your configuration needs to be rebuilt—choose yes to proceed.) 6 The program instances are now displayed in the left window. Click on the plus
(+) icon of the AIR_DAMPER_1 instance to display the program variable names. 7 Click and hold down on the NOT_ON_MIN_STOP variable, and drag it to the
right window. 8 Click, hold down and drag all of the other variables shown in the
AIR_DAMPER_1 instance, arranging them in the order shown in the illustration. Hold down SHIFT or CTRL to make multiple selections. 9 Add comments with the Insert Comment command in the Tools menu or the
Comment tool in the toolbar. 10 Select the Run or Single Step command to begin executing your configuration
in the Emulator. 11 To modify the value of a variable, double-click on the variable name and enter
the desired status in the Set Value field of the Properties box. 12 For functions and function blocks with multiple parameters, select the desired
parameter in the Variable List before setting the value in the Set Value field. 13 Make adjustments as needed—add or delete variable names, modify their
respective values in the Set Value field of the Properties box, and continue testing as long as necessary. 14 Use the Pause or Halt command to stop testing. 15 Use the Disconnect command to disconnect your configuration from the
Emulator. This is necessary if you want to change any aspect of your configuration and rebuild it. It is also necessary when you have completed all testing and are ready to move the TRICON Control Panel for actual downloading to the TRICON controller. Note Using the Run command to begin execution initializes all variables to the initial values you specified for their Tag Names in the Configuration editor. Using the Halt command initializes the variable to their first-scan state.
Chapter 7
Control Panels
264
Downloading a Project
Downloading a Project Downloading the project is the final step in developing a TriStation 1131 project. Upon downloading, your project will execute in the TRICON controller in real time, until you decide to halt execution or shut down the controlled process for maintenance purposes. TriStation 1131 offers two types of download capability: • Download All for initial loading and execution of your project • Download Change for on-line modifications to your project The sections that follow describe: • Use of the Download All feature • Use of the Download Change feature • Recommendations for controlling and changing a project • Download states • The Compare to Last Download command • The download history of a project
Download All The Download All command is used at two different times: • The first time you download your project to the TRICON controller • After a planned process shutdown for maintenance purposes The sections that follow describe typical preparations for a Download All and the possibility of a configuration mismatch upon downloading.
Chapter 7
Control Panels
Downloading a Project 265
Steps to Follow ▼ The following are typical steps to prepare for a Download All: 1 Complete all testing with the Emulator Control Panel. 2 Select the Rebuild Configuration command from the TRICON menu. 3 Ensure that the PC running TriStation 1131 is physically connected to the
TRICON controller by means of a communication module and a cable. Note A TriStation 1131 PC must be connected to a TRICON chassis by means of a special cable attached to an EICM serial port, or an 802.3 cable attached to an NCM or ACM port. For instructions, refer to the chapter about installation and checkout in the TRICON Planning & Installation Guide. Removing and replacing these modules clears the TRICON’s memory.
4 Remove all three Main Processors from the TRICON chassis. 5 Remove the NCM or ACM modules, if these are installed, and make sure that
their node numbers are set correctly. 6 Replace the Main Processor, NCM and ACM modules and wait until the PASS
indicators on all of the modules turn on. 7 Go to the TRICON Control Panel (accessible from the TRICON menu). 8 Use the Connect command to logically connect to the TRICON controller,
selecting either a serial port or a network node as appropriate. 9 Enter the password that TriStation 1131 requests, if any. If a password-
protected application is already running in the TRICON, you must know its password in order to do a Download All. 10 Select the Download All command from the Commands menu. If a
configuration mismatch occurs, read the next section for instructions. 11 If desired, drag selected elements from the tree of program instances to the
monitor sheet for later observation of the elements’ behavior. Note To set up elements on the monitor sheet, a shortcut is to copy from the Emulator Control Panel the elements you may already have organized there. 12 Select the Run command to begin execution in the TRICON. 13 The project is now in a Download Change state, which means that the next
likely type of download is a Download Change. For more information, refer to the upcoming section called “Download States” on page 276.
Chapter 7
Control Panels
266
Downloading a Project
Configuration Mismatch If you download a logical configuration created in TriStation 1131’s TRICON Configuration editor which does not match the TRICON’s actual physical configuration, a list like the following one will be displayed and the Download All will be aborted. Mismatched modules are highlighted with red asterisks in the leftmost column of the list, as shown for the Dual Discrete Output and Discrete Input modules in this example. In such a case, your only choice is to click Cancel and correct the configuration problem before attempting a Download All again.
If the slots of your TRICON chassis are empty, TriStation 1131 will still display the Module Configuration Exceptions window, but it is safe to proceed with the Download All if desired for test purposes.
Chapter 7
Control Panels
Downloading a Project 267
Download Change The Download Change feature is a convenient means of making simple modifications to an off-line system during the project development phase. To help you use Download Change effectively, this section covers the following topics. • Guidelines • Steps to follow • Allowable changes • Additional tips ! WARNING
Download Change is intended for off-line use during project development. You must exercise extreme caution if you use Download Change to modify a critical application that is running on-line, because an error in the modified application or system configuration might cause a trip or unpredictable behavior. If you must make on-line changes to a TRICON system, you should always follow the guidelines provided in this section and fully understand the risks you are taking by using the Download Change command.
Guidelines • Modify only one program for each Download Change that you perform. • Always use the Emulator Control Panel to test your changes to the program logic before using the Download Change command. • Always use both Configuration Differences reports to check for inadvertent changes as well as intended changes to the project configuration. These reports are obtainable when you use the Compare to Last Download command in: – The TRICON Control Panel (see page 277) – The TRICON Configuration editor (see page 221)—this report is highly recommended because it generates detailed information about TRICON points and system parameters • Before a Download Change, use the TRICON Diagnostic Panel to ensure that you have enough Scan Surplus available in the TRICON. How much Scan Surplus you need depends on the project you are running and the types of changes you are making. As a rule, Scan Surplus should be 10 to
Chapter 7
Control Panels
268
Downloading a Project
20% of the scan time to accommodate execution of newly added functions, function blocks and networks. A reasonable Scan Surplus helps you avoid the scan-time overruns that could result from a Download Change. • After using the Download All or Download Change command, it is a good practice to close your TriStation 1131 project and make a back-up copy of the .PT2 project file.
Steps to Follow ▼ The following are typical steps one would take to prepare for a Download Change: See “Allowable Changes” on page 269.
1 Make the allowed changes to your program logic and configuration and use the
Build Configuration command on the TRICON menu. 2 Test the project in the Emulator Control Panel (accessible from the TRICON
menu) to validate your changes. 3 Go to the TRICON Configuration editor and select the Compare to Last
Download command on the Commands menu. 4 In the Compare Configurations dialog box, click the Print button. 5 Print a hardcopy of the Configuration Differences report and validate your
current configuration against a snapshot of the last downloaded configuration. 6 Go to the TRICON Control Panel and select the Connect command from the
Commands menu. 7 Enter the password that TriStation 1131 requests for any project that is
password-protected. 8 Select the Compare to Last Download command from the Commands menu. 9 In the Compare Configurations dialog box, click the Print button. 10 Print a hardcopy of the Configuration Differences report and validate your
current configuration against the configuration that was last downloaded to the TRICON. 11 Select the Download Change command from the Commands menu.
Chapter 7
Control Panels
Downloading a Project 269
Allowable Changes The following table describes the elements of a TriStation 1131 configuration that can be changed with a Download Change operation. For any element that cannot be changed with a Download Change, you must do a Download All.
ALLOWABLE CHANGES FOR DOWNLOAD CHANGE Element
Comments
LOGIC ELEMENTS: Programs
Programs can be added and modified, unless the program size increases to a point where a Download Change is no longer possible. Programs cannot be deleted unless their instances are deleted first.
Program Logic
The Name, Data Type, Var Type, Description and Initial Value parameters of variables can be changed.
Note If you change the initial value of an existing variable, the change won’t take effect until the next time the application is run. Changing the name of a variable creates a new variable declaration, but does not remove the old variable declaration. Function Blocks
New function blocks can be added, but existing function blocks cannot be modified and cannot be deleted from the Project Directory.
Functions
New functions can be added, but existing functions cannot be modified and cannot be deleted from the Project Directory.
Libraries
Not supported. Libraries cannot be added, updated or deleted.
CONFIGURATION ELEMENTS: Program Instances
Program instances can be added, deleted or re-ordered for execution.
TRICON Points
Tag Names can be changed, removed or connected to different points. The Type, Location, Alias, Initial Value, Retentive capability, DP (Decimal Point), MinSpan, MaxSpan, Description, Group1 and Group2 properties can be changed.
Note If you change the initial value of an existing variable, the change won’t take effect until the next time the application is run.
Chapter 7
Control Panels
270
Downloading a Project
ALLOWABLE CHANGES FOR DOWNLOAD CHANGE Element
Comments
CONFIGURATION ELEMENTS: SOE Configuration
The SOE block type, block title, trip variable and trip variable parameters can be changed, but not the SOE block size or SOE Block Assignments (event variables assigned to SOE blocks).
SYSTEM PARAMETERS: Network Node
Not supported.
Scan Rate
The scan rate of the TRICON system can be changed.
Password Required
The option to require a password for downloading can be changed.
Disable STOP on Keyswitch
The option to disable the STOP position on the TRICON keyswitch from halting the control program can be changed.
Disable Remote Changes
The option to prevent Modbus masters or TCP/IP hosts from changing the values of TRICON Output Points can be changed.
Allow Disabling of Points
Not supported. Requires rebuilding of the configuration.
Peer-to-Peer
Not supported. The maximum number or peer-to-peer Send and Receive function blocks allowed in a project cannot be changed.
Memory Allocation
Not supported. Memory allocation cannot be changed—this is fixed at Download All time. However, you may allocate extra memory before doing a Download All to save room for other types of Download Changes in the future.
CHASSIS CONFIGURATION: Chassis
Not supported. Chassis cannot be added or removed unless you do a Download All.
Modules
Modules can be added, but cannot be deleted or moved to other slots, unless you do a Download All.
Module Types
Not supported. Changing module types which are configurable using TriStation 1131 is not supported. Examples are thermocouple types and short-circuit detection.
Module Set-up
The set-up of configurable modules (ACM, EICM, NCM or SMM) can be modified.
Chapter 7
Control Panels
Downloading a Project 271
Additional Tips This section provides additional tips about the elements of a TriStation 1131 application that can be changed using the Download Change command, covering the following topics: • Changing module types • Addition and deletion of chassis • Addition and deletion of modules • Addition of functions and effect on scan time • Changing memory variable types • Enabling disabled points • NCM configuration changes • SOE block size • Saving project after downloading Changing Module Types If you must change a module's type while the TRICON system is on-line, you are advised to take all precautions necessary for your application before doing a Download Change. In general, it is not a good practice to do a Download Change in order to implement module-type changes in an on-line TRICON system. Shutting down the system and doing a Download All is much safer for implementing complex changes to an application. Sample Module-Type Change
Assume that you have a Non-Isolated Thermocouple Input (NITC) Module, Type K, °C and you want to change it to Type K, °F (or Type K, °C to Type J, °F). Doing a Download Change would result in the inputs from the NITC module going to zero for 8 - 16 scans, depending on the size of the system and control program. Therefore, you should go to the TRICON Control Panel to disable all of the NITC input points and set them to appropriate values before you use the Download Change command. You need to take similar precautions for other modules whose types you change.
Chapter 7
Control Panels
272
Downloading a Project
Type Changes to Analog Input Modules
If you change the voltage range or type of open input detection for one of the following analog input modules, doing a Download Change would cause inputs of zero for 8 - 16 scans, depending on the size of the system and control program. Module Name
Model
Selection in Configuration Editor
Isolated Analog Input
3703E
EIAI 5 V UpS, 16 points EIAI 10 V UpS, 16 points EIAI 5 V DnS, 16 points EIAI 10 V DnS, 16 points
High-Density Analog Input
3704E
HAI 5V DnS, 64 points HAI 10V DnS, 64 points HAI 5V UpS, 64 points HAI 10V UpS, 64 points
Type Changes to Digital Output Modules
For a supervised digital output module, you select short-circuit detection in the off state by selecting a module name (using the TRICON Configuration editor) which includes the abbreviation SCD. If you change from an SCD selection to a non-SCD selection, doing a Download Change would cause outputs of zero for 8 16 scans, depending on the size of the system and control program.
Chapter 7
Module Name
Model
Selection in Configuration Editor
TMR Supervised Digital Output
3611E
SDO 115 V, 8 points
TMR Supervised Digital Output
3613E
SDO 120 V, OFF STATE SCD, 8 points SDO 120 V, 8 points
TMR Supervised Digital Output
3614E
SDO 24 V, OFF STATE SCD, 8 points SDO 24 V, 8 points
TMR Supervised Digital Output, Low Power
3615E
SDO 24V, Low Power, 8 points SDO 24V, Low Power, OFF STATE SCD, 8 points
TMR Supervised Digital Output
3617E
SDO 48 V SCD, 8 points SDO 48 V, OFF STATE SCD, 8 points
Control Panels
Downloading a Project 273
Addition & Deletion of Chassis You cannot add or delete chassis or change the chassis type using a Download Change command. You must use the Download All command to modify the chassis configuration of an existing TriStation 1131 project. If you think you might need additional chassis at a later date, you should include the maximum possible number of chassis required before using the Download All command. You should also allocate more memory for I/O points and memory variables in case you add new modules in the future. Addition & Deletion of Modules You can add new modules to an existing hardware configuration with a Download Change command if the following conditions are met: • There are empty slots in the chassis. • The Memory Allocation window in the TRICON Configuration editor shows that there is enough memory for the desired point types. Note When you add an I/O module, the IOMAIN and IOBAD system parameters of the TR_MP_STATUS function variables turn on for as many as 8 - 16 scans. If you are using this function in your TriStation 1131 application or DCS, then you must incorporate appropriate logic to handle this situation. Addition of Functions & Effect on Scan Time If your changes to the TriStation 1131 application include invoking new functions and function blocks (such as process control functions, math functions and print statements), then the TRICON will automatically increase the scan time to accommodate the execution of the newly added functions, if necessary. However, adding too many functions and function blocks may result in scan-time overruns. Changing Memory Variable Types If you change a Memory variable type (for example, BOOL to DINT or DINT to REAL) and then do a Download Change, the changed variable will not have the same value as it had before the Download Change. This is because the changed variable occupies a different memory location in the TRICON. The same is true if you change an Aliased Memory variable to a non-aliased memory variable and vice-versa.
Chapter 7
Control Panels
274
Downloading a Project
It is not a good practice to do any of the following actions and then use the Download Change command: • Change a memory variable type • Change an aliased memory variable to non-aliased or vice-versa • Change the alias number of a memory variable If you must do any of the above, Triconex strongly recommends using the Download All command. Enabling Disabled Points In general, it is permissible to use the Download Change command when some of your TRICON point (Tag Name) variables are disabled. However, if you are going to make the following types of changes to disabled TRICON point variables, you must enable the variables before doing a Download Change: • Changing the Alias number of the variable • Deleting the variable from the TRICON Points Table • Disconnecting the variable from its input or output TRICON point Changing the TCP/IP Address If you change the TCP/IP address of an ACM or NCM and then do a Download Change, the module will reset and re-initialize itself. During the reset cycle, the modules’s FAULT indicator will turn on. When the new configuration is complete, the PASS indicator will turn ON followed by the ACTIVE indicator. Triconex does not recommend doing a Download Change if you are changing the TCP/IP address of an ACM or NCM. Note Use of the Download All command is required to delete an ACM or an NCM from a TRICON system. Saving Application after Downloading After doing a Download Change, it is critically important to close and save your TriStation 1131 project (.PT2) file and back it up on a diskette, CD or other storage medium.
Chapter 7
Control Panels
Downloading a Project 275
Controlling & Changing an Existing Project Whenever a TriStation 1131 application is changed, even in a minor way, all changes should be controlled by a Safety Change Control Committee (SCCC) or the equivalent and should comply with strict control procedures. The following is a typical control procedure: 1 Generate a change request defining all changes and reasons for changes, then
obtain approval for the changes from the Safety Change Control Committee (SCCC). 2 Develop a specification for changes including a test specification, then obtain
approval for the specification from the SCCC. 3 Make the appropriate changes to the TriStation 1131 application including
those related to design, operation and/or maintenance documentation. 4 Print both Configuration Differences reports to compare the current
configuration with the configuration that was last downloaded to the TRICON. For details, see the sections called “Compare to Last Download” on page 221 and page 277. 5 Print all logic elements and thoroughly check all of the changed networks within
each element to make certain the changes do not affect other sections of the application. 6 Use the Emulator Control Panel to test the changes for proper operation as
documented in the test specification, then write a test report. 7 Review and audit all changes and the test results with the SCCC. 8 When approved by the SCCC, download the changes to the TRICON controller. 9 Save the downloaded application in TriStation 1131 and back up the
appropriate files on diskettes. 10 Archive two copies of the application and all associated documentation.
Chapter 7
Control Panels
276
Downloading a Project
Download States At any given time, a TriStation 1131 project is in either a Download All state or a Download Change state. After you have done a Download All, your project will be in a Download Change state on the assumption that the next kind of download you will want to do is a Download Change. (Download All is also permissible from the Download Change state.) The download state is noted in the message bar at the bottom of the TriStation 1131 window. Some TriStation 1131 operations are disabled when the project is in the Download Change state. See “Allowable Changes” on page 269 for a list of these operations. In a few cases, TriStation 1131 prompts you to change the state to Download All so that you can perform the desired operation, as shown in this example:
Change State to Download All command:
To change a project’s state to Download All, the TRICON menu (common to all TriStation 1131 views) provides a command called Change State to Download All. Use this command at your own risk, because doing a Download All usually means that you must shut down the controlled process for a period of time. ! WARNING
After using the Change State to Download All command, you cannot return to the Download Change state but must do a Download All the next time you download your application to the TRICON. If you backed up the project on diskette or another medium before the last download, you can use this backup copy in case you did not want to change the state to Download All.
Chapter 7
Control Panels
Downloading a Project 277
Compare to Last Download To use the Compare to Last Download command from the TRICON Control Panel, first you must use the Connect command to connect your project to the TRICON where it was previously downloaded. Then TriStation 1131 can make an on-line comparison of the project’s current configuration to the configuration that was previously downloaded to the TRICON. The Compare Configurations dialog box provides tabs for the following categories of information: Off-line comparison to the last downloaded configuration gives more information about system parameters and TRICON points. See page 221.
• System parameters • Modules installed in TRICON chassis • Elements of the project • Instances of programs and function blocks In each tab, there is a column of Current information beside a column of Last Download information, as shown in the System parameters tab below. For any item that is different from the previously downloaded configuration, an asterisk (“*”) is displayed in the red asterisk column on the far left.
Chapter 7
Control Panels
278
Downloading a Project
Details Display Three of the tabs in the Compare Configurations dialog box include a Details button that displays the following types of information: Tab Name
Details About
Modules
Configuration of ACM, EICM, NCM, Pulse Input and SMM. See sample below.
Elements
Changes to project elements: programs, functions, function blocks, standard libraries and user-written libraries.
Instances
Current list of instances and Last Downloaded list of instances.
Details display for the Network Communication Module (NCM) in the Modules tab
Note Using Compare to Last Download in the TRICON Configuration editor provides more details about system parameters than when you use the same command in the TRICON Control Panel, and provides TRICON point information as well. See page 221 for more information.
Chapter 7
Control Panels
Downloading a Project 279
Configuration Differences Report From any tab in the Compare Configurations dialog box, you can click on the Print button to see a print preview of the Configuration Differences Report. The following illustration shows part of a Configuration Differences Report for a TriStation 1131 project:
In the print preview, standard Crystal Report tools are available for page scrolling, enlargement and reduction of the view, and printing.
Chapter 7
Control Panels
280
Downloading a Project
Download History To view the Download History of your project and every downloaded element within it, select the View Download History command in the TRICON menu from any control panel or editor. As shown in the example below, the Download History window lists the following items: • All downloaded versions of your project • All downloaded elements and their attributes
Version Numbering of Projects The version number of a TriStation 1131 project is in this form: . The following are examples of project version numbers: Version 1.0 Version 2.2 Version 13.14
Chapter 7
Control Panels
Downloading a Project 281
TriStation 1131 automatically updates the version number if you make changes to the project that require a Download Change or Download All. Changes that require a Download All will update the major version number (for example, 3.1 to 4.0). Changes that require a Download Change will update the minor version number (for example, 3.5 to 3.6). The version number of a project provides feedback as to what type of downloading is needed. For example, if the current project downloaded to the TRICON is Version 1.1, and the current project in TriStation 1131 is Version 2.0, you must do a Download All. If the project in the TRICON is Version 3.1, and the project in TriStation 1131 is Version 3.2, doing a Download Change is sufficient. If the project in the TRICON is Version 3.2, and the project in TriStation 1131 is Version 3.2, no downloading is necessary. Example of Version Number Changes The following example shows how the version number of a project can change. Version numbers are always incremented, never decremented. After the first Download All, the version number is: 1.0 If you edit the project, TriStation 1131 changes the version number to: 1.1 If you do a Download Change, the version number remains: 1.1 If you edit the project, TriStation 1131 changes the version number to: 1.2 A Download All would change the version number to: 2.0 Another Download All would change the version number to: 3.0
Chapter 7
Control Panels
282
Downloading a Project
Downloaded Elements & Their Attributes Three types of elements are downloaded to the TRICON with each project, as shown in the Download History example that follows: • Programs, functions and function blocks • Elements from the Standard Library or other libraries • TriStation 1131 internal functions (each begins with an underscore character) TriStation 1131 internal function (option lets you choose whether to display)
Download icon
Standard Library function Program, function or function block
For each downloaded element, TriStation 1131 provides the following categories of information: State (St) Icon
Download All (downward arrow icon with bar on top) Download Change (downward arrow icon with three dots on top)
Chapter 7
Element Name
Name of library element, program variable or internal function
ID Number (Id#)
For Triconex use only
Version Number
Major and minor version numbers.
Size
In bytes
Library of Origin
Name of library containing listed element or user-created project containing listed program, function or function block
Control Panels
Downloading a Project 283
Version Numbering of Downloaded Elements A downloaded element always has a major version number of 1 (one) and is displayed in this form: 1. The following are examples of element version numbers: Version 1.0 Version 1.7 Version 1.13 TriStation 1131 automatically updates the minor version number of an element once per editing session, whether you make one minor change or several major changes. The major version number of an element is never incremented.
Chapter 7
Control Panels
284
Disabling Points
Disabling Points ! WARNING
Triconex recommends that you disable points only during initial on-line testing, before the system is put into operation on an active process. For real-time operation, using TÜV-approved “bypass” logic in your project is a safer choice. In the TRICON Control Panel only, you can disable TRICON Input, Output and Memory points for two main purposes: • Testing a project as it executes in the TRICON • Plant maintenance without system shutdown—for example, disabling a water valve so the water tank can be repaired When a point is disabled, it cannot be affected by the project executing in the TRICON. Instead, you can manually change the value of the point using appropriate commands in the Properties box, according to the instructions that follow.
Disabling Selected Points Note Use of TriStation 1131’s point disabling capability may have a negative impact on the available scan rate of a project executing in the TRICON. Before building and downloading your TriStation 1131 project, you must decide whether or not to allow point disabling. If you do plan to disable points, mark the Allow Disabling of Points option in the TRICON System Configuration dialog box. If you don’t plan to disable points, make sure the Allow Disabling... option is not marked. This option can only be changed if your project is in a Download All state. When setting up your TRICON Control Panel, it may be helpful to place all program instance variables for points to be disabled on the same sheet. Assuming that your control panel is already set up and your project is downloaded to the TRICON, follow these steps to disable points: 1 Ensure that the TRICON keyswitch is in PROGRAM mode. 2 Go to the TRICON Control Panel. 3 Select the Connect command from the Commands menu or the toolbar.
Chapter 7
Control Panels
Disabling Points
285
4 If necessary for testing or maintenance actions, change the execution mode
(Run, Single Step or Halt) using the Commands menu or the toolbar. 5 Double-click on a program instance variable for a point you would like to
disable in order to display the Properties box. You can only disable one point at a time. 6 Click the Disable button in the Properties box for the selected program
instance variable. TriStation 1131 will display a Query box with the TRICON point name to which the program instance variable is connected. Click Yes to disable the point. The value of each disabled point will be displayed in red with a frame around it, as shown in the example below.
Note A disabled point retains the value it had before you disabled it, until you use the Set Value field and the Confirm button to change its value.
Chapter 7
Control Panels
286
Disabling Points
Listing all Disabled Points After you have disabled a number of TRICON points, you can use the List Disabled Points command to display a list of all disabled points in your TRICON Control Panel, as shown in the example below. The list includes sortable columns for the Variable Name, Tag Name, Location and Modbus Alias (if any) of each point. To enable multiple points at once, select the disabled points from the list and click OK.
Enabling Points To enable a specific TRICON input or output point, double-click on the point to bring up the Properties box and click the Enable button. The value of the selected point will no longer displayed in red with a frame around it. To enable all of the disabled points in your TRICON Control Panel, select the Enable All Points command from the Commands menu.
Chapter 7
Control Panels
TRICON Operational Modes
287
TRICON Operational Modes The operational mode of the TRICON determines what functionality is available, according to general guidelines listed in the table below. Specific permissible actions in a TriStation 1131 project are listed in the next section. For example, the TRICON must be in PROGRAM mode when you download a TriStation 1131 project. To select an operational mode for the TRICON system, you need to set the fourposition keyswitch which is located above the Power Modules in the upper left corner of the Main Chassis. The keyswitch position is read by the TRICON system software, the TriStation 1131 programming system, Modbus masters, external host computers and projects executing in the TRICON. Refer to the TRICON Planning & Installation Guide for more information. Operational Mode
Available Functionality
RUN
Normal operation with read-only capability. The Main Processors execute the previously-loaded project—attempts to modify program variables by TriStation 1131, Modbus masters or external hosts are rejected.
PROGRAM
For program loading and checkout. Allows control of the TRICON system from the TriStation 1131 programming system, including Download All and Download Change. Also allows writes to program variables by Modbus masters and external hosts.
STOP
Stops reading inputs, forces non-retentive digital and analog outputs to 0, and halts the project. (Retentive outputs return to the value they had before the keyswitch was turned to STOP.) The STOP setting is recommended for installation and service of process-related equipment, but is not required for service of the TRICON.
REMOTE
Allows writes to program variables by TriStation 1131, Modbus masters and external hosts. (Download All and Download Change from TriStation 1131 are not allowed.)
! WARNING
The TRICON keyswitch is not a power switch. Its position enables or disables functionality for the entire TRICON system.
Chapter 7
Control Panels
288
TRICON Operational Modes
Permissible Actions in TriStation 1131 The following actions are permitted in a TriStation 1131 project when the TRICON keyswitch has been set to the appropriate operational mode: Mode
From
Tristation 1131 REMOTE
External Host1
Tristation 1131 PROGRAM
Action in Tristation 1131
TriStation 1131 Component
Monitor Execution Change Point Values
Emulator Control Panel
Monitor Execution Change Point Values
TRICON Control Panel
Monitor TRICON Status
TRICON Diagnostics Panel
Reads Writes Download Monitor Execution Change Point Values Control Execution
Emulator Control Panel
Download Monitor Execution Change Point Values Control Execution Disable Points
TRICON Control Panel
Monitor TRICON Status
TRICON Diagnostics Panel
Reads External Host Writes
RUN & STOP
Tristation 1131
Monitor Execution Only
Emulator Control Panel
Monitor Execution Only
TRICON Control Panel
Monitor TRICON Status
TRICON Diagnostics Panel
Reads External Host Writes 1. The external host could be a Distributed Control System (DCS), a Modbus master, a workstation or a personal computer (PC).
Chapter 7
Control Panels
CHAPTER 8
TRICON Diagnostic Panel
This chapter explains how to monitor a downloaded project and identify faults in a TRICON system using the TRICON Diagnostic Panel. The following topics are covered: • Diagnostic tools • Overview with sample steps • TRICON System Configuration window • Chassis windows • Fault identification • System performance and current project information • Summary of Output Voter Diagnostics (OVD) • Displaying and printing firmware version numbers • Collecting TRILOG events
290
Diagnostic Tools
Diagnostic Tools To help you monitor a TRICON and identify faults, the TRICON Diagnostic Panel provides diagnostic tools in a main menu and toolbar.
Main Menu Commands The Diagnostic Panel’s main menu appears above the toolbar as follows, and the diagram on the following page shows the commands which are accessible from the it. (For menus and commands which are common to all TriStation 1131 views, see “Basic Editing Tools” on page 40.)
Shortcut Keys In all TriStation 1131 menus, underlined characters are shortcut keys to be used in the typical manner of Windows applications: • For a menu item, use ALT + to open the menu. • For a command within a menu, type the of the desired command.
Chapter 8
TRICON Diagnostic Panel
Diagnostic Tools
291
Menus & Commands of the TRICON Diagnostic Panel (grayed-out commands are common to all TriStation 1131 views)
File
New Project... Open Project... Save Project... Save As... Close Project... 1 2 Print... Print Preview... Print Reports... Print Setup... Exit
View
Edit
TRICON
Edit Configuration Build Configuration Rebuild Configuration Compile All Project Elements Emulator Control Panel TRICON Control Panel TRICON Diagnostic Panel View Download History... Change State to Download All
Expand One Level Expand Branch Expand All Collapse Branch
Commands
Window
Help
Connect Disconnect Clear Faults on All Modules Enable OVD on All Modules Disable OVD on All Modules Display Firmware Versions Collect TRILOG Events Refresh Panel Continuous Refresh
New Window Cascade Tile Horizontal Tile Vertical Close All Arrange Icons Show Properties Sheet Show Message Bar (Vertical Message Bar) (Horizontal Message Bar) Hide Message Bar 1 PROGRAM:
TriStation 1131 Help Tip of the Day Keyboard Shortcuts Sample Projects Technical Support About TriStation 1131... TriStation 1131 Logo...
Chapter 8
TRICON Diagnostic Panel
292
Diagnostic Tools
Table of Diagnostic Tools The table that follows describes the main menu commands which are specific to the TRICON Diagnostic Panel and the buttons in the toolbar which correspond to these commands.
As noted earlier, the underlined characters shown in the menu and command names are shortcut keys to be used in the typical manner of Windows applications. Note On any TriStation 1131 toolbar, the name of a tool is displayed if you place the cursor inside the icon for the tool. Tree Menu Command
Description
Expand One Level
Expands a selected tree node by one level.
Expand Branch
Expands a selected tree node to all levels.
Expand All
Expands the whole tree to all levels.
Collapse Branch
Collapses a selected branch of the tree.
Commands Menu
Chapter 8
Command
Description
Connect
Establishes communication between the Diagnostic Panel and a TRICON controller, assuming the PC running TriStation 1131 is physically connected to the TRICON.
Disconnect
Logically disconnects the Diagnostic Panel from the TRICON controller with which communication was previously established.
Clear Faults on All Modules
Clears all fault flags in TriStation 1131 and clears the fault indicators on modules in the TRICON. Therefore you should determine the cause of the fault(s) before using this command.
TRICON Diagnostic Panel
Diagnostic Tools
293
Commands Menu Enable OVD on All Modules
Enables OVD for all output modules in the TRICON system. Refer to the section called “Output Voter Diagnostics (OVD)” on page 308 for more information.
Disable OVD on All Modules
Disables OVD for all output modules in the TRICON system. Refer to the section called “Output Voter Diagnostics (OVD)” on page 308 for more information.
Display Firmware Versions
Displays the firmware version numbers for all modules in a selected TRICON chassis. When available, the following information is also displayed: - Six-digit PCB assembly number - Hardware revision level - Eight-digit serial number All information is displayed in the message bar. You can print it from there using the Print command from the pop-up menu accessed with the right mouse button.
Collect TRILOG Events
Collects historical diagnostic information from the TRICON controller so that faults can be analyzed.
Refresh Panel
Updates the status of the TRICON System Configuration window or an individual chassis window. (TriStation 1131 automatically updates the status whenever you move to the Diagnostic Panel.)
Continuous Refresh
For the TRICON System Configuration window, this command/tool continuously updates the alarm status of all chassis in the system. For individual chassis windows, this command/tool continuously updates the faults status of modules in the chassis.
Chapter 8
TRICON Diagnostic Panel
294
Overview
Overview The TRICON Diagnostic Panel consists of the following main components: • The TRICON System Configuration window which displays the alarm status of all chassis in the TRICON system. • Individual windows for each chassis which display the fault status of all modules in the chassis. • Fields that give information about system performance and the current TriStation 1131 project. • A Properties dialog box which helps you identify faults in both primary and secondary modules in the selected slot. This Properties box has a tab for each type of fault: – Field Faults – Power Faults – Voter Faults Upcoming sections describe these components and their uses in greater detail.
Sample Steps ▼ The following are typical steps for using the TRICON Diagnostic Panel with an active TRICON: 1 Ensure that the PC on which you will run TriStation 1131 is physically
connected to the TRICON controller by means of a communication module and a cable. Note A TriStation 1131 PC must be connected to a TRICON chassis by means of a special cable attached to an EICM serial port, or an 802.3 cable attached to an NCM or ACM port. For instructions, refer to the chapter about installation and checkout in the TRICON Planning & Installation Guide. 2 Start TriStation 1131 if it is not already started. Open the project which has been
downloaded to the target TRICON. If this is not possible, create an empty project based on instructions in Appendix G, “Maintenance Log-on to TRICON.” 3 Go to the TRICON Diagnostic Panel (accessible from the TRICON menu).
Chapter 8
TRICON Diagnostic Panel
Overview
295
4 Use the Connect command to logically connect to the TRICON controller,
which asks you to select either a serial port or a network node. Note If you earlier specified a Network Node name as a parameter in the System Configuration dialog box, TriStation 1131 will supply the node name when you use the Connect command. A password is requested here if you entered one as a System Configuration parameter.
5 Enter the password, if it is requested. 6 If you do not know the password, click the Ignore button instead. You can still
connect to the TRICON, but the following commands will be disabled: • • • •
Clear Faults on All Modules Enable OVD on All Modules Disable OVD on All Modules Collect TRILOG Events
7 Upon connecting to the TRICON, the Diagnostic Panel displays an icon for
each chassis in the system which states whether the chassis alarm is on or off, as shown below. In addition, a beeping sound notifies you when a chassis alarm has turned on.
8 If you see a red chassis icon with “Alarm On,” double-click on the number of
that chassis in the data tree at the left of the window. 9 TriStation 1131 then displays an image of the alarming chassis with one or
more red status indicators on the faulting module(s), as shown in the illustration that follows.
Chapter 8
TRICON Diagnostic Panel
296
Overview
10 Select a faulting module and double-click to display a Properties dialog box
with tabs for the various types of faults that exist. The example below shows a faulting Supervised Digital Output module, so in this case you would select the Voter Faults tab in the Properties box.
Red Status Indicators
Fault Identification Properties Box
11 Under the Voter Faults tab, the number of the faulting point is listed. For
corrective action, refer to maintenance guidelines in the TRICON Planning & Installation Guide. 12 If necessary, repeat steps 6 through 10 for any other alarming chassis and
faulting modules. 13 After correcting all faults, select the Clear Faults on All Modules command
from the Tools menu. 14 Double-click on the node called TRICON System Configuration in the data
tree at the left of the Diagnostic panel to display the alarm states of all TRICON chassis in the system.
Chapter 8
TRICON Diagnostic Panel
TRICON System Configuration Window
297
TRICON System Configuration Window When you use the Connect command under the Tools menu to establish communication with a selected TRICON, the TRICON System Configuration window is automatically displayed. This window provides an icon for each chassis in the TRICON system which states whether the chassis alarm is on or off. Chassis with the “Alarm Off” message are displayed in green, while chassis with the “Alarm On” message are displayed in red. Red icon for chassis with alarm on
Data tree for selecting full chassis display
Green icon for chassis with alarm off
When a chassis alarm is on, double-click on the chassis number in the data tree at the left side of the window to find out which modules and/or points are faulting. Refer to the upcoming sections called “Chassis Windows” on page 298 and “Fault Identification” on page 302 for more information about this. Note When you are monitoring a TRICON system, displaying the TRICON System Configuration window continuously is a good practice. If you turn on the checkmark for the Continuous Refresh command under the Tools menu, the alarm status of all chassis is continuously updated. A beeping sound notifies you when the status of a chassis alarm has changed.
Chapter 8
TRICON Diagnostic Panel
298
Chassis Windows
Chassis Windows For each chassis in your TRICON system, you can select an individual window which displays the status of all slots and indicates the presence of faults in installed modules. You select a chassis window by clicking on the desired chassis number in the data tree of the TRICON Diagnostic Panel, as shown below.
Upcoming sections describe the representation of slots in the chassis window and the basic meanings of the status indicators. If a fault indicator on a module in the chassis window is red, double-click on that module to bring up a Properties dialog box that helps you identify the cause of the fault. Refer to the upcoming section called “Fault Identification” on page 302 for more information.
Chapter 8
TRICON Diagnostic Panel
Chassis Windows
299
States of TRICON Slots A slot in a TRICON chassis can be in one of four states identified by its color, as shown below. The slot colors are also briefly described in the Legend tab of the fault identification Properties box as shown on the next page.
White Red Blue Yellow
Slot Color
Description
White
This slot has been logically configured in the TriStation 1131 project and two I/O modules are physically installed.
Red
This slot has been logically configured for I/O modules but does not physically contain them.
Blue
This slot has been logically configured for I/O modules, and an I/O module is physically installed in one slot location. The other slot location is ready for a hot spare module but does not physically contain one, so that location is blue.
Yellow
This slot has not been logically configured for an I/O module but there is at least one module physically installed in the slot.
Chapter 8
TRICON Diagnostic Panel
300
Chassis Windows
Note An empty slot in a TRICON chassis is also white in color, but is clearly marked “Empty Slot” at the top.
Logical & Physical Slot Numbers In a chassis window, the numbers appearing above the names of the module types are logical slot numbers used to denote slots under discussion. A logical slot may contain one or two communication or I/O modules. The numbers appearing below each physical division of the chassis (as displayed in a chassis window) are physical slot numbers. These are the numbers that the TRICON uses to access individual modules within a chassis.
Status Indicators In a chassis window, the small colored squares at the top of each module represent the module’s status indicators. The color of each square corresponds to the actual color of the indicator on the module installed in the TRICON. The various colors have the following meanings, which are reflected in the Legend tab of the fault identification Properties box shown below: • Green means PASS • Yellow means ACTIVE • Red means FAULT • Gray means off (not active and not faulting)
If a module is physically present in a slot and functioning properly, the PASS indicator is green and the ACTIVE indicator is yellow. If a FAULT indicator turns red (on), a diagnostic message appears in the fault identification Properties box.
Chapter 8
TRICON Diagnostic Panel
Chassis Windows
301
Refer to the upcoming section called “Fault Identification” on page 302 for more information. Green, yellow and red may have other meanings for other types of indicators, such as POWER and LOAD/FUSE on 16-point Supervised Digital Output modules. Refer to the TRICON Planning & Installation Guide for the meanings and recommended actions for all possible combinations of status indicators for each type of TRICON Module.
OVD State Under normal conditions, OVD is enabled for all DO modules in a TRICON system. You know this is true if you see a green OVD field underneath the DO status indicators. If you disable OVD using the Disable OVD on All Modules command in the Tools menu, a yellow OVD field will appear below the DO status indicators. Examples of both states are shown below:
Green
Yellow
Chapter 8
TRICON Diagnostic Panel
302
Fault Identification
Fault Identification When a fault indicator on a TRICON module turns red (on), either the TRICON’s self-diagnostics have discovered a problem or there is a problem in the field wiring and/or field devices. To identify the cause of a fault, double-click on the faulting module to bring up the Properties box, as shown in the example below. This Properties box displays fault information for both the active and hot spare modules in the selected TRICON slot.
Red Status Indicators
Fault Identification Properties Box
The fault identification Properties box has a tab for each type of fault: • Field Faults • Power Faults • Voter Faults The example above shows a faulting Digital Output module. In this case, you would select the Voter Faults tab in the Properties box. Upcoming sections describe the types of faults in greater detail. Note Field termination modules are not shown in chassis windows, but problems with field wiring and/or field devices can be identified in diagnostic messages found under the Field Faults tab of the Properties box.
Chapter 8
TRICON Diagnostic Panel
Fault Identification
303
Field Faults The Field Faults tab lists the numbers of any points that have faulted. For output points, the faults are load or fuse problems that could have originated in the Field Termination module or the field wiring. For input points, the faults result from internal malfunctioning of the module or rapidly changing field inputs. To find out which point or points are causing the field fault(s), double-click on the faulting module to display the Properties box and go to the Field Faults tab, as shown in this example:
4...7
In the example, input points #4 through #7 are faulting. The other input points on the module are operating properly.
Alarm Behavior for Load or Fuse Errors On the Main Chassis of a TRICON system, the chassis alarm turns on when a load or fuse error is present in any chassis of the system. (If a load or fuse error occurs on a module residing in an Expansion or RXM Chassis, that chassis alarm does not turn on.) If the LOAD/FUSE indicator of a module is red (on), then the Field Faults tab of the associated Properties box lists the numbers of any faulting points.
Chapter 8
TRICON Diagnostic Panel
304
Fault Identification
Power Faults A diagnostic message under the Power Faults tab indicates the failure of a loopback power supply. For corrective action, refer to the section about maintenance in the TRICON Planning & Installation Guide.
Voter Faults Applicable to Digital Output (DO) modules only, the Voter Faults tab lists the numbers of output points whose quad-output voting (OVD) circuitry has become defective. Under normal conditions, OVD is enabled for all DO modules in a TRICON system. You know this is true if you see a green OVD field underneath the DO status indicators. If you disable OVD using the Disable OVD on All Modules command in the Tools menu, a yellow OVD field will appear below the DO status indicators. If you suspect an OVD fault, double-click on the faulting DO module and go to the Voter Faults tab of the Properties box. If an OVD fault is present, you will find the number(s) of the faulting point(s) under the Voter Faults tab. To correct OVD faults, replace the DO module. If the faults persist on the replacement module, load glitches due to faulty field wiring may be the cause. If the FAULT indicator is on, but you do not find any faulting points listed under the Voter Faults tab of the Properties box, go to the Field Faults tab to check for points with other types of faults. Note A DO module does not continue to run OVD once an OVD fault or load/fuse error has been found.
Chapter 8
TRICON Diagnostic Panel
System Performance & Project Information
305
System Performance & Project Information System performance and project information is available at the top of the TRICON Diagnostic Panel, whether you are displaying the TRICON System Configuration window or an individual chassis window. Each category of information is described in the table that follows. Note If you are monitoring a TRICON system with the Diagnostic Panel, continuously updating the system performance and project information is a good practice. To do this, turn on the checkmark for the Continuous Refresh command under the Tools menu. A beeping sound notifies you if a chassis alarm turns on. Item
Description
Project
The name and version number of the project which has been downloaded to the TRICON system you are monitoring. The version number is incremented each time the program is downloaded to the TRICON.
Calendar
The current time of the TRICON system you are monitoring, expressed as day/date/ hour/minute/second. (This is not the time according to the PC on which you are running TriStation 1131.)
Poll Time
The maximum time it takes for the TRICON to obtain data from the input modules. The poll time should not exceed the scan time—if it does, you should increase the scan time using the Scan Rate parameter in the TRICON System Configuration dialog box.
Maximum Memory
The maximum mount of memory space that the TRICON originally made available to your TriStation 1131 project. Free Memory shows how much memory space is left for expanding your project.
Key Stop/ Position
Tells whether the STOP position of the TRICON keyswitch is logically enabled or disabled (for security purposes). You can enable or disable STOP with the parameter called Disable STOP on Operator Keyswitch in the TRICON System Configuration dialog box. If STOP is logically disabled, physically setting the TRICON keyswitch to the STOP position will not halt the control program. By default, the STOP position is disabled during installation of the TRISTATION software.
Chapter 8
TRICON Diagnostic Panel
306
System Performance & Project Information
Description (continued)
Item Scan Requested/ Actual
Gives the requested scan rate and the actual scan rate. Scan rate is the time it takes the TRICON to evaluate the control program plus the time required for system overhead. Requested Scan Rate: The desired scan rate has been requested using the Scan Rate parameter in the TRICON System Configuration dialog box. If the requested scan rate is set too low, then scan-rate overruns may occur and the TRICON won’t allow you to reset the scan rate parameter. The TRICON will automatically adjust the scan rate upward during the normal run if any scan-rate overruns occur. Actual Scan Rate: Tells how much time the last scan actually took. The actual scan rate will always be greater than the requested scan rate. The difference between the actual and requested scan rate is the amount of time it took for the Main Processors to synchronize at the end of the scan.
Free Memory
Amount of memory space the TRICON has available for expanding the size of your TriStation 1131 project. The first number shows how much space is left. The second number shows the maximum space that was available.
! WARNING
In addition to the memory required for downloading your logic elements and configuration, the TRICON also needs (uses) memory for the following: • Modbus conversion information for every Input Real and Memory Real element that has an alias • Retentive masks for Output points and Memory elements • Handling of labels for networks • Configuration tables, data tables, communication tables, diagnostic tables, and so on Status
The setting of the TRICON keyswitch and the current state of the TriStation 1131 project. Key: The Main Chassis of the TRICON has a four-position keyswitch which controls the entire TRICON system. Possible keyswitch settings are REMOTE, RUN, PROGRAM and STOP. State: Possible program states are RUNNING, HALTED or PAUSED (single-scan mode).
Chapter 8
TRICON Diagnostic Panel
System Performance & Project Information
307
Item
Description (continued)
Scan Surplus
Tells how much of the requested scan rate is left after the control program has been processed. The surplus must be positive—if it is less than zero, then adjust the scan rate (using the Scan Rate parameter in the TRICON System Configuration dialog box) to make the surplus value greater than or equal to zero.
! WARNING
If the Scan Surplus is negative, the fault tolerance of the TRICON may be impaired. To avoid scan-time overrun problems, set the scan time to a higher value which allows execution time for all logic elements in your project— including conditional statements and print statements. If the scan time you set for a project is not long enough, the TRICON automatically increases the scan time when needed to execute all logic elements. However, the TRICON will not reduce the scan time to its original setting after executing at a higher rate.
Chapter 8
TRICON Diagnostic Panel
308
Output Voter Diagnostics (OVD)
Output Voter Diagnostics (OVD) Output Voter Diagnostics (OVD) is a routine used by the TRICON system to detect failures in the quad-output voting mechanism which monitors and guarantees the state of each digital output. Each type of Digital Output (DO) module in the TRICON uses a different OVD implementation and affects the load in different ways. Some DO types glitch (cause an invalid output state) only when a failed component is detected. Other DO types glitch the load on a continuing basis. In either case, the controlled process may be affected. This is why the TRICON Diagnostic Panel gives you the option of disabling OVD for selected DO Modules. The TRICON Planning & Installation Guide provides details about OVD operation for the various types of DO Modules. By default, OVD is enabled for all DO modules in the system. You know this is true if you see a green OVD field underneath the DO status indicators. If you disable OVD using the Disable OVD on All Modules command in the Tools menu, a yellow OVD field will appear below the DO status indicators. When OVD detects a failure, you can replace the failed module immediately, so that the TRICON’s fault tolerance and Triple Modular Redundancy (TMR) remain in effect. If you disable OVD, the first failure could go undetected, and a second undetected failure could endanger the integrity of the system. In addition, disabling OVD means that load and fuse errors cannot be detected for off points (this does not apply to 8-point Supervised DO (SDO) modules). If glitches to an attached load are not tolerable, you should schedule regular maintenance periods for enabling OVD. During maintenance the controlled process is shut down, and you can cycle each output to both the on and off states to ensure 100% failure detection. Refer to the TRICON Planning & Installation Guide for more information about the TRICON’s diagnostic routines and maintenance procedures. Note The OVDENABLE and OVDDISABLE functions can be used in program logic to enable and disable OVD for selected DO Modules.
Chapter 8
TRICON Diagnostic Panel
Firmware Version Numbers
309
Firmware Version Numbers Use the Display Firmware Versions command in the Tools menu to display the firmware version numbers of all modules in a selected TRICON chassis. As shown in the example below, the following information is also displayed when available: • Six-digit PCB assembly number • Hardware revision level • Eight-digit serial number All information is displayed in the message bar. You can print it from there using the Print command from the pop-up menu accessed with the right mouse button, as shown below.
Chapter 8
TRICON Diagnostic Panel
310
Collecting TRILOG Events
Collecting TRILOG Events Collect TRILOG Events on the Commands menu allows you to collect historical diagnostic information about the TRICON controller so that faults can be analyzed. You are not expected to evaluate this information yourself, but should send it to Triconex for analysis. ▼ Follow these steps to collect TRILOG events: 1 Ensure that your project is downloaded and running in the TRICON system. 2 Go to the TRICON Diagnostic Panel. 3 Select Collect TRILOG Events on the Commands menu. 4 Enter a name for the TRILOG events file and click Save. (The TEL extension
is automatically appended if you don’t type it in.) Once you enter the contact information, TriStation 1131 remembers it until you change it.
5 Enter the following contact information in the User Information for TRILOG
Events dialog box: • • • • • •
Company Address City/State/Zip Contact Phone Comments
6 Click OK. An event log file can store a maximum of 500,000 events.
7 Allow TriStation 1131 to collect TRILOG events. A dialog box tells you how
many events have been collected. 8 Click the Stop button to stop TriStation 1131 from collecting TRILOG events. 9 Send the .tel file to the Triconex Customer Satisfaction Group in Irvine,
California.
Chapter 8
TRICON Diagnostic Panel
CHAPTER 9
System Administration
This chapter covers the following topics: • Elements of a security system • Element attributes • Project options • TriStation 1131 options • Project History
Elements of a Security System In TriStation 1131, you can create a security system that defines users and their privileges with regard to editing, library changes, TRICON state changes and other operations. By selecting the Security command of the Project menu, you can access the elements that make up a security system: • Users • Level Names • Privileges Upcoming sections describe these security elements in detail, but first you should read the next section about initial log-in to TriStation 1131.
312
Elements of a Security System
Initial Log-in When you create a new project, TriStation 1131 automatically sets up a default Level 01 (fully privileged) user name and password called MANAGER and PASSWORD respectively. Triconex strongly recommends that you assign personalized level names and passwords during project creation—otherwise, anyone who is familiar with the defaults can use them to access your project.
Users Under the Users tab of the Project Security window, you can add new users, delete unwanted users, or modify the attributes of existing users, as shown in the example that follows. A password defined for a user here is verified when that person opens a TriStation 1131 project and logs in. If the default names associated with the security levels (shown below) are not appropriate for your circumstances, go to the Level Names tab and make adjustments.
Chapter 9
System Administration
Elements of a Security System
313
Privileges Under the Privileges tab of the Project Security window, you can assign security levels to TriStation 1131 and TRICON platform operations listed under the Category drop-down, as shown below.
Level 01 is the highest security level, providing access to all TriStation 1131 and TRICON operations. Level 10 is the lowest security level, providing access to the fewest operations. Each level allows access to its own operations and the operations associated with all lower levels. For example, A user with security level 03 has access to operations for security levels 04, 05, 06, 07, 08, 09 and 10.
Chapter 9 System Administration
314
Elements of a Security System
TRICON Operations The following table describes the TRICON operations to which you can assign the desired security levels. If the default security levels are not appropriate for your circumstances, go to the Level Names tab and make adjustments. Operation
Chapter 9
Description
Change Point Values
Permits use of the Set Value button in the Properties box for program variables in the Emulator and TRICON Control Panel.
Change State to Download All
Permits a state change from Download Change to Download All, as indicated in the Message Bar.
Control Execution of Mismatched Project
Permits you to halt the project that is currently running in the TRICON and download another.
Download All
Permits use of the Download All command in the Emulator and TRICON Control Panel.
Download Change
Permits use of the Download Change command in the Emulator and TRICON Control Panel.
Enable/Disable OVD
Permits use of Output Voter Diagnostics (OVD) for Digital Output modules you select in the Emulator or TRICON Control Panel.
Enable/Disable Points
Permits use of TriStation 1131’s point disabling feature in the TRICON Control Panel.
Halt Project
Permits use of the Halt command in the Emulator or TRICON Control Panel.
Open Emulator Control Panel
Permits use of the Emulator Control Panel.
Open TRICON Control Panel
Permits use of the TRICON Control Panel.
Pause/Single Step Application
Permits use of the Pause and Single Step commands in the Emulator and TRICON Control Panel.
Run Application
Permits use of the Run command in the Emulator or TRICON Control Panel.
Set Operating Parameters
Permits the setting of parameters like Scan Rate in the TRICON System Configuration dialog box.
System Administration
Elements of a Security System
315
TriStation 1131 Operations The following table describes the TriStation 1131 operations to which you can assign the desired security levels. If the default security levels are not appropriate for your circumstances, go to the Level Names tab and make adjustments. Operation
Description
Add/Modify/Remove Users
Permits addition, modification and removal of users under the Users tab of the Security dialog box.
Change Element Access Attributes
Permits changes to element access from Read Only, Read Write, or Locked status to another access state.
Change Project Options
Permits changes to all options accessible from the Project Options dialog box.
Change Security Level Descriptions
Permits changes to the names associated with security levels under the Level Names tab of the Security dialog box.
Change Security Level Privileges
Permits changes to the privileges associated with security levels under the Privileges tab of the Security dialog box.
Change TriStation 1131 Options
Permits changes to all options accessible from the TriStation 1131 Options dialog box.
Clear History Logs
Clears all actions recorded under the Project History dialog box.
Export Libraries
Permits exporting of elements to a shared library, using the Export button under the User Defined tab of the Project Directory dialog box.
Import Libraries
Permits importing of shared libraries, using the Import button under the Shared Libraries tab of the Project Directory dialog box.
Modify Element
Permits creation, modification and deletion of programs, functions and function blocks.
Print Reports
Permits printing of reports using the Print Reports... dialog box.
Chapter 9 System Administration
316
Elements of a Security System
Operation
Description
Update Report Databases
Permits use of the Update Data button accessible in the Print Reports... dialog box.
View Element
Permits Read-Only viewing of programs, functions an function blocks.
Level Names Under the Level Names tab of the Project Security window, you can assign user titles to security levels 1 though 10, as shown in the example that follows. Level 01 users have the greatest privileges—they have access to all TriStation 1131 and TRICON platform operations. Level 10 users have the fewest privileges with access to the fewest operations. Each security level allows access to its own operations and the operations associated with all lower levels. For example, A user with security level 03 has access to operations for security levels 04 through 10. Any adjustments you make to the level names under the Level Names tab will thereafter be displayed under the Users and Privileges tabs.
Chapter 9
System Administration
Element Attributes
317
Element Attributes The Element Description dialog box is accessible from the Element menu or from the Project Directory dialog box. The attributes in the top block of the Element Description dialog box are automatically logged by TriStation 1131 as you create and modify an element. The Internal ID is for Triconex use only—Customer Support personnel may ask for this number if you call for assistance. Owned by normally refers to the password-protected user who created the current element. The other attributes are selected by the user.
Access Attributes TriStation 1131 offers three choices for protecting access to an element: • Read Only • Read/Write • Locked Any user can change the access status of an element from Read Only to Read/ Write.
Chapter 9 System Administration
318
Element Attributes
Any element from which you can access the Element Description dialog box can be locked to prevent editing by unauthorized users. Once an element has been locked by a password-protected user, only that user or someone else with the same security level can unlock it.
Change Owner Normally the owner of an element is the user who created it. If the owner of an element locks it, other users can’t unlock it unless they have the same security level as the owner. The owner names that are displayed when you click Change Owner are the ones that have been defined for the Change Element Owner operation under the Privilege tab of the Security command. You will only be able to change the owner names if you have the appropriate security level.
Dependencies Pressing the Dependencies button causes the Message Bar to display a list of all elements on which the current element is dependent. As shown in the example below, an alphanumeric list of all functions and function blocks invoked by a certain program is displayed.
Chapter 9
System Administration
Project Options
319
Project Options When you create a new project, TriStation 1131’s default options apply unless you decide to change them. You can do this when you begin a new project or at any time during project development. Under the Project command of the main menu, select Project Options to access tabs for Language, Variable Annotation, and Communication options.
Language The Language tab lets you select the default language and element types for your project. These defaults apply to the New command in the Project Directory where you create new programs, functions and function blocks. Your new element can use any of the three available languages regardless of what the default language is. However, you will only be able to create new elements of the types which are marked under the Enabled Features box of the Language tab, as shown below.
Allowable Elements
Selections for New command in Project Directory
Chapter 9 System Administration
320
Project Options
Variable Annotations A variable annotation is a box attached to the bottom of a variable which contains descriptive information, as in this example from a logic sheet:
Variable annotation works automatically if you turn on the feature as soon as you open a new project, before creating any logic elements or control panels. To do this, go to the Project Options menu, select the Variable Annotations tab (shown below), and check one or both of the following options in the General box: • Annotation on by default • Monitor value on by default
The Annotation on by default option causes variable annotation boxes to appear automatically every time you place a variable on the logic sheet for a program or
Chapter 9
System Administration
Project Options
321
function block. The Monitor value on by default option displays, in the upper left corner of the annotation box, the value of each variable during execution. For descriptions of the other sub-dialog boxes in the Variable Annotations tab, refer to the section called “Using Variable Annotation” in Chapter 3, “Function Block Diagram (FBD).”
Communications The Communications tab under the Project Options dialog box lets you select the following options: • Default Connection to the TRICON system by means of a serial port or network node • Debug Message Options • Network TCP/IP Addresses
Default Connection This option lets you set the default type of port used to connect the PC running TriStation 1131 to a TRICON chassis. The choices are: • TRICON Serial Port for connecting by means of an EICM port • TRICON Network node for connecting by means of an ACM or NCM port The option you select here will be reflected in the Connect to... dialog box when you use the Connect command from the TRICON Diagnostic Panel.
Debug Message Options These options are intended for use by Triconex Customer Satisfaction Engineers when analyzing a communication problem: • Request/Response • Retries • State Changes • Message Detail
Chapter 9 System Administration
322
Project Options
Network TCP/IP Addresses If your TriStation 1131 PC is communicating with a TRICON system by means of an ACM or NCM port, the TRICON node is identified by a TCP/IP address on your 802.3 network. To accommodate TCP/IP addresses, TriStation 1131 creates a table of 32 default TCP/IP addresses each time you create a new project. These addresses have the following format: 192.168.1.##, where ## is replaced by node numbers 01 through 32 If you are using a single-node TRICON network (in other words, one TRICON system and one PC running TriStation 1131), the default node names and their associated default TCP/IP addresses are sufficient for your connection needs. However, if you are using a multi-node TRICON network, you need to modify the default TCP/IP addresses by following these steps: 1 Ensure that the TCP/IP message protocol has been installed on your PC. 2 Obtain the actual TCP/IP addresses of the TRICON nodes on your network
from your System Administrator or IS department. 3 Go to the Communications tab in the Project Options dialog box. 4 In the Network TCP/IP Addresses dialog box, select a default address from
the list, such as TRINODE07=192.168.1.7,7 and click Modify. 5 Enter the desired Node Name, Node Number and actual TCP/IP address for
your network, as shown in this example:
Chapter 9
System Administration
Project Options
323
6 Repeat Steps 4 and 5 for each TCP/IP address you want to modify.
Rules for Node Names
When modifying TCP/IP addresses and their TRICON node names, the following rules apply: • You can define multiple names for one node if desired. In other words, one TCP/IP address can by known by several node names. • You cannot use the same node name twice, even if it applies to different TCP/IP addresses.
Chapter 9 System Administration
324
TriStation 1131 Options
TriStation 1131 Options As you develop various projects, you can use the default settings for TriStation 1131’s graphical interface features or change them according to your needs. Do this by selecting the TriStation 1131 Options command from the Project menu and clicking on one of these tabs: • Directories • Message Bar • Drawing Colors • FBD Editor • LD Editor Note Option settings for TriStation 1131’s graphical interface features apply to all projects that you access. They are not specific to particular projects.
Directories The Directories tab under the TriStation 1131 Options dialog box identifies the pathnames in your system where TriStation 1131 can find project files, shared libraries and report templates. The default directories are: Project Files (*.PT2) Shared Libraries (*.LT2) Report Template (*RPT)
Using the Message Bar During a build or download operation for each element of your project, TriStation 1131 displays informative messages in a message bar which has user-selectable attributes. You can display the message bar horizontally at the bottom of your screen (shown below) or vertically on the side of the screen, and adjust the position of the message bar’s tabs. If you double-click any error message or select Jump to Source in the message bar’s pop-up menu, TriStation 1131 highlights the error source as shown in this example:
Chapter 9
System Administration
TriStation 1131 Options
325
Pop-up Menu Press the right mouse button while locating the cursor in the message bar to display a pop-up menu, as shown in the example above. The commands in the pop-up menu are accessible from the toolbar or main menu as well, with the exception of Jump to Source (described above).
Selecting Attributes Use the Message Bar tab under the TriStation 1131 Options dialog box to select these attributes for the message bar: • Horizontal position at the bottom of the screen • Vertical position on the right side of the screen • Position of tabs at top, bottom, left or right of the message bar • Size relative to the main window • Auto-maximizing of active window when the message bar is displayed
Chapter 9 System Administration
326
TriStation 1131 Options
Drawing Colors The Drawing Colors tab under the TriStation 1131 Options dialog box lets you select standard or customized colors for the attributes of your logic drawings. ▼ To change a color, follow these steps: 1 Select the desired item either by clicking on it in the graphic display or selecting
it from the Drawing Item drop-down list, as shown below:
2 Click the Change Color button to display a Windows common dialog box for
color selection, as shown below:
Chapter 9
System Administration
TriStation 1131 Options
327
3 To add a standardized color, select the desired color from Basic Colors. 4 Click OK. 5 To define a custom color, make the desired adjustments to the Hue, Saturation,
Luminescence, Red, Green and Blue attributes. 6 Click Add to Custom Colors. 7 Select the desired color from Custom Colors. 8 Click OK.
Chapter 9 System Administration
328
TriStation 1131 Options
FBD Editor Use the FBD Editor tab under the TriStation 1131 Options dialog box to select these options for logic elements written in the FBD language: • Double space function (block) terminals by default • Enable EN/ENO terminals on functions by default • Left-handed wire tool For more information about FBD editing tools, refer to Chapter 3, “Function Block Diagram (FBD).”
LD Editor Use the LD Editor tab under the TriStation 1131 Options dialog box to select these options for logic elements written in the LD language: • Double space function (block) terminals by default • Compiler warning when right power rail is missing • Left-handed link tool For more information about LD editing tools, refer to Chapter 4, “Ladder Diagram (LD).”
Chapter 9
System Administration
Project History
329
Project History The Project History, or audit trail, is automatically generated by TriStation 1131 during project development. You can use it to find out which users accessed and modified a project at what times. The Clear History button allows you to clear all recorded actions and begin a new Project History.
Chapter 9 System Administration
CHAPTER 10
Printing
This chapter explains how to print: • Logic sheets • Standard reports • Custom reports
Logic Sheets TriStation 1131 allows you to print the logic sheets for programs, functions and function blocks developed in the FBD, LD and ST languages. In a language editor, use the following File menu commands for printing: • Print Preview • Print Setup • Print...
332
Standard Reports
Standard Reports To access standard reports, select the Print Reports... command in the File menu. Before you can print reports, you have to click on Update Data to generate the report databases. Then select the name of the report you want to preview or print. The available types of reports are listed in the Print Report dialog box as shown below:
Note Whenever you modify a project, you must update the report databases again, because TriStation 1131 does not update them automatically.
Chapter 10
Printing
Custom Reports
333
Custom Reports To design custom reports, use the Crystal Reports package from Seagate or any other dBASE-compatible report generator. For instructions, refer to the Crystal Reports 5.0 User’s Guide or the user’s guide for the report-generating package of your choice. Triconex strongly recommends using Crystal Reports because the Crystal Reports print engine is integrated with TriStation 1131. If you want your report titles to appear in the Print Reports dialog box so they are printable from TriStation 1131, use Crystal Reports and take these steps: • Create a custom report and save it in a file which has the extension .RPT. • Place the .RPT file in TriStation 1131’s REPORTS directory. • In the Print Reports... dialog box accessible from the Find menu, click on Update List to add your new report to the list of available report types, if it is not already in the list.
Chapter 10
Printing
CHAPTER 11
Libraries
Topics covered in this chapter are: • Overview • Automatically attached libraries • Exporting elements • Importing libraries
Overview For every project, TriStation 1131 provides two standard libraries which contain functions and function blocks you can use for application development. In addition, you can share the programs, functions and function blocks that you create with other projects by using TriStation 1131’s shared library feature. The use of shared libraries involves two main tasks: • Exporting programs, functions or function blocks to a shared library • Importing a shared library to a project Exporting is done using a wizard that you access by means of the Export button. Importing is done with the Import and Add Library buttons. In addition, you can verify the version number of any accessible library, whether it is attached to your project or not. The upcoming sections provide more information about these topics.
336
Automatically Attached Libraries
Automatically Attached Libraries When you create a new TriStation 1131 project, two shared libraries are automatically attached to the project: • The Standard Library (STDLIB) which complies with the IEC 1131-3 standard • The TRICON Library (TR1LIB) for the TRICON platform These libraries contain functions, function blocks and other elements for use in the development of projects. When you select elements for your logic using a language editor’s Select Function (Block) tool, the elements from the Standard Library and TRICON Library are combined into one list of available elements. To attach other libraries to a project, use the Import button on the Shared Libraries tab found in the Project Directory menu. Refer to the section called “Importing Libraries to a Project” on page 345 for details. ! WARNING
Never delete the Standard Library or TRICON Library from any of your TriStation 1131 projects.
Standard Library Functions The following table briefly describes each function in the Standard Library. Refer to the on-line Help system for details. Function Name ABS ACOS ADD AIN AND AOUT ASIN ATAN BOOL_TO_DWORD
Chapter 11
Libraries
Description Calculates the absolute value of a single numeric variable Arc cosine Adds numeric, date and time, and time of day variables Converts analog inputs to real values Bitwise conjunction of two or more conditions Converts a real value to an analog output value Arc sine Arc tangent Converts type BOOL to type DWORD
Automatically Attached Libraries
Function Name CEIL CONCAT_DT COS CSCHED CTD CTU CTUD DINT_TO_DWORD DINT_TO_INT DINT_TO_LREAL DINT_TO_REAL DIV DT_TO_DATE DT_TO_TOD DWORD_TO_BOOL DWORD_TO_DINT EQ EXP EXPFLTR EXPT F_TRIG FLOOR GE GT INT_TO_DINT INT_TO_LREAL INT_TO_REAL INTGTOR LE LEADLAG LIMIT
337
Description Returns the smallest integer greater than or equal to input x Concatenates the date and time Cosine Schedule execution after specified number of scans Down counter Up counter Up-down counter Convert type DINT to type DWORD Convert type DINT to type INT Convert type DINT to type LREAL Convert type DINT to type REAL Divides numeric, date and time, and time of day variables Extract date from date and time of day Extract time of day from date and time of day Convert type DWORD to type BOOL Convert type DWORD to type DINT Compares and equates two inputs Calculates the natural exponential for real number inputs Provides an exponential filter to smooth a noisy input data value Raises one variable to the power or value of another Detects a change from true to false in the internal binary clock during execution Floor (lowest integer in real number) Greater than or equal to Greater than Converts type INT to type DINT Converts type INT to type LREAL Converts type INT to type REAL Performs integration of input values Less than or equal to Provides lead-lag compensation Limits the values that are allowed for an input
Chapter 11
Libraries
338
Automatically Attached Libraries
Function Name LN LOG LOOPDETR LREAL_TO_DINT LREAL_TO_INT LREAL_TO_REAL LT MAX MEDSEL MIN MOD MOVE MUL MUX NE NOT NUMBITS NUMBITS_DWORD OR OVDDISABLE OVENABLE R_TRIG REAL_TO_DINT REAL_TO_INT REAL_TO_LREAL ReportBadParam ROL ROR RS
Chapter 11
Libraries
Description Natural logarithm Base ten logarithm Processes loop detector inputs Converts type LREAL to type DINT Converts type LREAL to type INT Converts type LREAL to type REAL Less than Sets the maximum values that are allowable for inputs or outputs Selects median value Sets the minimum values that are allowable for inputs or outputs Modulo—calculates the remainder of the division of one input by another Moves or assigns input values to output values Multiplies numeric, date and time, and time of day variables Selects a value from multiple inputs, depending on an input selector Not equal to Performs bitwise negation of conditions Number of BOOL inputs that are TRUE (1) Count number of 1 bits in DWORD Performs a bitwise comparison of the two or more inputs to establish the resultant value Disables output voter diagnostics Enables output voter diagnostics Detects a change from false to true in the internal binary clock during execution Converts type REAL to type DINT Converts type REAL to type INT Converts type REAL to type LREAL Reports a Bad Parameter error and clears ENO Rotates inputs left by a designated number of bits Rotates inputs right by a designated number of bits Reset dominant bistable function block (latch)
Automatically Attached Libraries
Function Name RTC SCALE SEL SHL SHR SIN SQRT SR SUB TAN TCJ_CONV TCK_CONV TIME_TO_SECS TIMEADJ TIMESET TOF TON TP TRUNC_LREAL_TO_DINT TRUNC_LREAL_TO_INT TRUNC_REAL_TO_DINT TRUNC_REAL_TO_INT TSCHED UNPACK16 XOR
339
Description Real Time Clock whose output gives the current system data and time Rescales an input value from one type of engineering units to another Selects a value from multiple inputs, depending on an input selection constant Shift left Shift right Sine Square root Sets dominant bistable function block (latch) Subtracts numeric, date and time, and time of day variables Tangent Converts Type J thermocouple inputs to Centigrade Converts Type K thermocouple inputs to Centigrade Converts type TIME to type LREAL seconds Adjusts TRICON clock by supplied value Sets TRICON clock by supplied value Off Delay Timer On Delay Timer Generates a pulse on the rising edge of an input Truncates type LREAL to type DINT Truncates type LREAL to type INT Truncates type REAL to type DINT Truncates type REAL to type INT Schedules execution at a specified time interval Unpacks DWORD into 16 bits Performs exclusive bit-wise comparison of two or more inputs to establish the resultant value
Chapter 11
Libraries
340
Automatically Attached Libraries
TRICON Library Functions The following table briefly describes each function in the TRICON Library. Refer to the TRICON Library Functions manual and the on-line Help system for details. Function Name AIN AOUT BLINK CHK_ERR CLAMP CLR_ERR CSCHED EXPFLTR GASDETR GATDIS GATENB INTGTOR LEADLAG LINEMNTR LOOPDETR MEDSEL NUMBITS NUMBITS_DWORD OVDDISABLE OVDENABLE PACK16 PACK32 PAGE_EJECT PERDEV PID POLY4 POLY5 PRINT_BOOL PRINT_CDT
Chapter 11
Libraries
Description Converts analog input to real value Converts real value to analog output value Blinks a coil on and off at specified intervals Gets runtime error flags Limit range of input and output values Clears runtime error status Schedules execution after a specified number of scans Exponential filter of input value Processes gas detector inputs and generates alarms Closes a gate previously opened by GATENB for restricted write operations by external hosts Opens a gate for an external host to write to Aliased TRICON variables Performs integration of input value Provides lead-lag compensation Line monitor—monitors analog current loop Processes loop detector inputs and generates alarms Selects the median value from the arguments listed in the invocation, and returns the result Count number of bits in Boolean inputs Count the number of bits in a DWORD Disables output voter diagnostics Enables output voter diagnostics Packs 16 bits into an integer Packs 32 bits into an integer Ejects paper to top of next page Percent Deviation—computes percent of difference Proportional Integral Derivative control Polynomial with 4 coefficients Polynomial with 5 coefficients Prints boolean value—OFF if 0 and ON if 1 Prints current date and time
Description Prints carriage return and line feed Prints current time of day Prints double integer value up to eight characters Prints real value up to eight characters Prints string of text Clears the specified printer port buffer Rescales an input value Clears a specified SOE block Checks status of a specified SOE block Stops event collection for a specified SOE block Starts event collection for a specified SOE block Converts Type J thermocouple inputs to Centigrade Converts Type K thermocouple inputs to Centigrade Adjusts TRICON clock using values supplied by host Sets TRICON clock using values supplied by host Counts for a specified time interval and sets an output. Toggles the state of a coil. Gets calendar values from TSX Gets chassis information from TSX Gets Main Processor information from TSX Gets peer-to-peer information from TSX Gets point information from TSX Gets communication port information from TSX Gets program information from TSX Gets scan information from TSX Gets slot information from TSX Receives up to 20 BOOL values from a matching TR_USEND_BOOL function block on another TRICON node Receives up to 20 DINT values from a matching TR_USEND_DINT function block on another TRICON node Receives up to 20 REAL values from a matching TR_USEND_REAL function block on another TRICON node
Chapter 11
Libraries
342
Automatically Attached Libraries
Function Name TR_USEND_BOOL
TR_USEND_DINT
TR_USEND_REAL TSCHED UNPACK16 UNPACK32 X_OF_N
Description Sends up to 20 BOOL values to a matching TR_URCV_BOOL function block on another TRICON node Sends up to 20 DINT values to a matching TR_URCV_DINT function block on another TRICON node Sends up to 20 REAL values to a matching TR_URCV_REAL function block on another TRICON node Schedules execution at specified time interval Unpacks DWORD into 16 bits Unpacks DWORD into 32 bits Decides if X of N measurements exceed specified limit
Printing Messages to an EICM Port To print messages about alarm conditions and data values, you need to connect a printer to the parallel port of an Enhanced Intelligent Communication Module (EICM) installed in your TRICON system. Then use the TRICON Configuration editor to configure the EICM’s parallel port for printing—port 5 or 10 is available. Refer to the section called “EICM Configuration” in Appendix A, “Configurable Modules” for detailed instructions. Set up your logic to generate printed messages by selecting the desired print functions from the TRICON Library and connecting appropriate variables to their parameters. TriStation 1131 provides the following print functions for the TRICON platform: Function Name PRINT_BOOL PRINT_CDT PRINT_CRLF PRINT_CTOD PRINT_DINT PRINT_REAL PRINT_STRING PRNTR_FLUSH
Chapter 11
Libraries
Description Prints Boolean value—OFF if 0 and ON if 1 Prints current date and time Prints carriage return and line feed Prints current time of day Prints double integer value up to eight characters Prints real value up to eight characters Prints string of text Clears the specified printer port buffer
Automatically Attached Libraries
343
Sample Logic with Print Function The sample FBD logic in this section uses the PRINT_STRING function with the R_TRIG (Rising Edge Detector) function to ensure that the message will print only once during each scan when the Boolean condition in COMMAND_PRINT is true. After a PRINT_STRING function is placed on the logic sheet, a constant is connected to the PRINTER parameter and given a DINT value of 5 to designate the desired parallel port of the EICM, as shown next:
The IN parameter was used to specify the desired string of text with a data type of STRING in the Initial Value field of the Properties box, as shown below.
Chapter 11
Libraries
344
Exporting Elements to a Library
Exporting Elements to a Library A shared library is created by means of exporting user-defined elements. To begin an export, take these steps: 1. Open the TriStation 1131 project from which you want to export elements. 2. Open the Project Directory and go to the User Defined tab. 3. Click on the Export button to start up a wizard called the Shared Library Specification File which allows you to: • • • • •
Create a new library specification or use an existing one Select elements of your project to include in a library Provide read-only source code to users of the exported elements Save a specification for a library Create a new library
4. Follow the prompts in the wizard to complete the export. To import a shared library to another project, follow the instructions in the next section.
Chapter 11
Libraries
Importing Libraries to a Project
345
Importing Libraries to a Project After a shared library of user-derived elements has been created, you can import it to other TriStation 1131 projects. To import a library, take these steps: 1. Ensure that the shared library (LT2) file is accessible on your hard disk, over a network, or through some other media. (The Directories tab of the TriStation 1131 Options menu identifies the default directory for shared libraries.) 2. Open the TriStation 1131 project to which you want to import the shared library. 3. Open the Project Directory, go to the Shared Libraries tab and click on Import. 4. A list called Libraries Imported to this Project will be displayed. Click on Add to see a Windows list of accessible library files. 5. Select the desired library file and click OK. 6. When the import is completed, the list called Libraries Imported to this Project will include the newly imported library. 7. Go to the Shared Libraries tab and notice that the imported elements appear in the Element Name list along with elements from the Standard Library and TRICON Library.
Verifying Library Versions Occasionally Triconex issues an update to the Standard Library and/or TRICON Library which you will want to attach to your project. When you click on Verify Library Version, for each library TriStation 1131 tells you whether the version attached to your project or the version present on your hard drive is the latest. To attach the latest version, click on the Update command.
Deleting Libraries ! WARNING
Never delete the Standard Library or TRICON Library from any of your projects, and use caution when deleting other type of libraries with the Delete button.
Chapter 11
Libraries
APPENDIX A
Configurable Modules
When you add certain types of modules to a TRICON chassis, you must use the Setup option in the Properties box to configure their parameters. This appendix describes the configuration of these modules and discusses some related issues, covering the following topics: • EICM configuration • Pulse Input configuration • SMM configuration • Modules for 802.3 network communication (ACM & NCM) • Time synchronization
348
EICM Configuration
EICM Configuration Note Every TRICON system must have at least one ACM, EICM or NCM module installed in the Main Chassis or the first Expansion Chassis. Otherwise an error will be generated when you attempt to build the configuration in TriStation 1131. When you install a model 4119 EICM in a Main Chassis or the first Expansion Chassis, you must define the protocol for at least one EICM port. In TriStation 1131, go to the TRICON Configuration editor and use the Hardware Allocation window. Select Setup from the EICM’s Properties box to display the ICM Configuration dialog box:
Select the port you want to configure or modify, then choose the protocol you want to define. The options for serial and parallel ports are described in the following pages.
Serial Ports When you select a serial port (Port 1, 2, 3, 6, 7, or 8), TriStation 1131 displays choices for Not Configured, TriStation 1131, Debug, and Modbus.
Appendix A Configurable Modules
EICM Configuration
349
Not Configured, TriStation 1131 & Debug When you select Not Configured, TriStation 1131, or Debug, no additional options are involved.
Modbus Note With TriStation 1131 Version 1.1, EICM ports can be configured only as Modbus slaves. The functionality to configure an EICM port as a Modbus master or combination master and slave will be available with a future release. Please contact Triconex regarding availability. When you configure a port as a Modbus slave, TriStation 1131 displays choices for the following items. • Slave Address (1 – 247) • Baud rate (19200, 9600, 4800, 2400, or 1200) • Data bits (RTU mode or ASCII mode) • Stop bits (1 or 2) • Parity (Odd, Even, or None) • Handshake (None or Hardware) • Modbus Range: Min (0 – 32767 allowed) and Max (1 – 32767 allowed) Note All Modbus slaves on the same Modbus port must use the same baud rate, data bits (mode), parity, and handshake settings. Slave Address — Enter the slave address (1 through 247) for the port you are configuring as a Modbus slave. Baud Rate — The EICM supports an aggregate data rate of 57,600 baud. (In other words, the total data rate for all four ports must be less than or equal to 57,600.) The available baud rates are: 19200, 9600, 4800, 2400, and 1200. The following are examples of correct data rate selections: Example 1.
Port 1 (Modbus):
19,200 baud
Port 2 (Modbus):
19,200 baud
Port 3 (Modbus):
+
19,200 baud 57,600 baud
Appendix A Configurable Modules
350
EICM Configuration
Example 2.
Port 1 (Modbus):
9,600 baud
Port 2 (Modbus):
19,200 baud
Port 3 (Modbus):
9,600 baud
Port 4 (TRISTATION)
+
9,600 baud 48,000 baud
Data Bits — If you select 7 data bits, the port operates in ASCII mode. If you select 8 data bits, the port operates in RTU mode. If you are configuring a combination master and slave, TriStation 1131 automatically selects 8 data bits for RTU mode. Multipoint RS-232 Mode — On Model #4118 and #4119 EICMs, choose between RS-232 and RS-422 modes using DIP switches on the EICM side panel. If you select Hardware (HRDWR) handshake mode, the EICM asserts Request to Send (RTS) when it has a message to transmit. The EICM begins transmission when it receives Clear to Send (CTS) from the Modbus master. The EICM ignores all characters unless the Modbus master asserts Data Carrier Detect (DCD). This allows the Modbus master to use half-duplex modems. If you select None for the handshake mode, the EICM asserts RTS at all times and ignores CTS and DCD. In other words, characters are transmitted even if the receiver is not ready. This could result in an overrun state, and the characters will have to be re-transmitted. Multipoint RS-422 Mode — On Model #4118 and #4119 EICMs, choose between RS-422 and RS-232 modes using DIP switches on the EICM side panel. If you select Hardware (HRDWR) handshake mode, the EICM enables its RS-422 transmit driver only when it is sending data. This is the correct setting for all single pair networks and for slave ports in two-pair, multipoint networks. If you select None for the handshake mode, the EICM enables its RS-422 transmit driver at all times. This is the correct setting for a Modbus slave port in a two-pair, point-to-point network.
Appendix A Configurable Modules
EICM Configuration
351
Modbus Range— The TRICON uses the values you place in the Min and Max fields to convert real numbers into integers for transmission over Modbus. Modbus Min and Modbus Max are the lower and upper limits of the Modbus master’s numeric range. To determine the correct values for Modbus Min and Modbus Max, see the user’s manual for your Modbus master. The Modbus Min and Modbus Max values for commonly used Modbus masters are: Modbus Master
Min Value
Max Value
Honeywell DHP
0
9999
Operator Workstation
0
32767
For individual memory real and input real variables, may want to specify MinSpan and MaxSpan values in the TRICON Point Connections screen. MaxSpan and MinSpan are the upper and lower limits of the variable in engineering units. For more information, refer to the section called “MinSpan & MaxSpan Fields” on page 211.
Parallel Ports EICM Ports #05 and #10 are for Centronics-compatible printers. If you select Port #05 or Port #10 when configuring the EICM, TriStation 1131 displays fields for the form length (0-255 rows; default is 66) and width (0-255 columns; the default is 132).
Appendix A Configurable Modules
352
Pulse Input Configuration
Pulse Input Configuration For the model 3510 Pulse Input (PI) module, you can configure a maximum of eight Input Real TRICON points (global variables). First you have to install a PI module in a TRICON chassis and establish global variable connections for the eight Input Real points, using methods described in Chapter 6, “Configuration Editor.” Then click on the Setup option in the Properties box to display the Pulse Input Configuration dialog box. The following sections provide details about configuring Input Real points for speed or RPM measurement.
Speed Point Configuration The dialog box shown below gives an example of configuring a TRICON point for speed measurement. The global variable name of an Input Real point is selected, and Speed is selected in the Point Type field. The Point Options field displays the default values for speed characteristics, which are described below.
Maximum Speed must be a positive floating point value. Its default value is 30000.0. EU Scale is the scale factor for converting pulses per minute to the desired engineering units. EU Scale must be represented as a positive floating point number. Its default value is 1. The algorithm assumes that the normal calculation is engineering units per minute. To use units per hour, multiply the speed-perminute scale factor by 60. To use units per second, divide the speed-per-minute scale factor by 60.
Appendix A Configurable Modules
Pulse Input Configuration
353
The TRICON uses this formula for speed measurement: Speed =
Pulses • EU Scale Minute
Based on this formula, the following table shows the correct engineering units to use for measuring pulses per second, minute, and hour: To Measure:
Set EU Scale to:
pulses / second pulses / minute pulses / hour
0.016667 1.000000 60.000000
RPM Point Configuration The dialog box shown below gives an example of configuring a TRICON point for RPM measurement. The global variable name of an Input Real point is selected, and RPM is selected in the Point Type field. The Point Options field displays the default values for point characteristics, which are described in the following paragraphs.
Maximum RPM must be a positive floating point value. Its default value is 30000.0. Pulses Per Revolution represents the number of pulses per revolution of the measuring shaft.
Appendix A Configurable Modules
354
Pulse Input Configuration
The Scale Factor for engineering units must be a positive floating point number. Its default value is 1. The algorithm assumes that the normal calculation for RPM speed is revolutions per minute. To use revolutions per hour, multiply the scale factor by 60. To use revolutions per second, divide the scale factor by 60. The scale factor should also include the RPM conversion from the measuring shaft to the desired output shaft. The TRICON uses this formula for RPM measurement: RPM =
Pulses ( Minute ) • Scale Factor Pulses/Rev
Based on this formula, the following table shows the correct Scale Factor to use for measuring pulses per revolution in seconds, minutes, and hours. To Measure:
Set EU Scale to:
pulses / second pulses / minute pulses / hour
0.016667 1.000000 60.000000
Appendix A Configurable Modules
SMM Configuration
355
SMM Configuration A model 4409 SMM acts as an interface between a TRICON controller and Honeywell’s Universal Control Network (UCN), one of the principal networks of the TDC 3000 Distributed Control System. Each TRICON system can contain a maximum of six SMMs in three logical slots of the Main Chassis and Chassis #2 (Expansion or RXM Chassis). You can install the SMMs in an active and hot spare configuration, or without using the hot spare capability. The SMM’s UCN node address is configured with TriStation 1131, while the SMM’s point database is configured from a Honeywell Universal Workstation. To configure an SMM in a TRICON chassis, click on the Setup option in the Properties box to display the SMM Configuration dialog box. Enter the Node Number and check the options as needed. These parameters are explained on the next page.
Appendix A Configurable Modules
356
SMM Configuration
The following table describes the SMM’s parameters: Parameter Name Node Number
Description Up to 32 redundant devices are supported by the UCN, which consists of redundant coaxial cables. Odd-numbered addresses are reserved for active modules and even addresses for hot spare modules. Therefore you should enter an odd number from 1 to 63 as the UCN node address for this logical slot.
! WARNING
The UCN node address does not identify left and right physical positions. Because UCN points can only be mapped to one address, a redundant pair of SMMs exchanges the odd/even addresses so that the active module always has the odd address. Prohibit Writes
Check this box if you want to prevent Honeywell workstations from writing to the TRICON. Do not check the box if you want writes from Honeywell workstations on the UCN to be allowed by the TRICON.
Enable UCN Test Mode
This box should be checked only by Honeywell factory test personnel. Leave unchecked to disable factory test mode.
Enable time synchronization with external source
Check this box if you want this pair of SMMs to update the TRICON with the UCN time. SMMs operate as logical pairs in the TRICON system, so you should check this box for only one of the logical pairs of SMMs. (Two pairs of SMMs are the maximum allowed.)
SOE Block
Not supported.
Refer to the SMM User’s Manual for more information about configuring the SMM.
Appendix A Configurable Modules
Modules for 802.3 Network Communication
357
Modules for 802.3 Network Communication Note Every TRICON system must have at least one ACM, EICM or NCM module installed in the Main Chassis or the first Expansion Chassis. Otherwise an error will be generated when you attempt to build the configuration in TriStation 1131. With an ACM or NCM installed, the TRICON can communicate with other TRICONs and with external hosts over 802.3 networks. The ACM and NCM have other functions as well, but the use of a TRICON node number and TCP/IP address is common to both. Therefore this section covers the following topics: • ACM configuration • NCM configuration • TRICON node number & TCP/IP address
ACM Configuration The model 4609 ACM acts as an interface between a TRICON controller and Foxboro’s Intelligent Automation (I/A) Series DCS, appearing to the Foxboro system as a safety node on the I/A Series Nodebus. The ACM also supports the following Triconex protocols and applications on external host PCs: • Tristation protocol for TriStation 1131 • TSAA protocol for Triconex applications • TSAA/TCP(UDP)IP for user-written applications on external hosts Only one logical slot is available for ACMs in a TRICON Main Chassis or Chassis #2 (Expansion or RXM). You can install one or two ACMs in a logical slot depending upon your redundancy requirements. To configure an ACM in a TRICON chassis, click the Setup option in the Properties box to display the ACM Configuration dialog box shown below. Click the options and enter text as needed. For more information, refer to the upcoming sections called “TRICON Node Number & TCP/IP Address” on page 361 and “Time Synchronization” on page 363.
Appendix A Configurable Modules
358
Modules for 802.3 Network Communication
Appendix A Configurable Modules
Modules for 802.3 Network Communication
359
NCM Configuration With a model 4329 NCM installed, the TRICON can communicate with external hosts in an 802.3 network. The following table lists the protocols and applications that are supported by the NCM’s NET1 and NET2 ports: Triconex Protocols
NCM NET1
Tristation
NCM NET2 x
Peer-to-Peer (private 802.3 network for a maximum of 10 TRICONs)
x1
Time Synchronization (private 802.3 network for a maximum of 10 TRICONs)
x
TSAA
x1
TSAA/TCP(UDP)/IP (user-written applications for external hosts)
x
Triconex Applications
NCM NET1
NCM NET2
Sequence of Events
x1
TRICON DDE Server (DOS/Windows based)
x
TRICON DDE Server (NT-based)
x1
TRISTATION MSW
x1
TriStation 1131
x
1.
These protocols and applications will be available to TriStation 1131 projects with future releases. Please contact Triconex for more information.
Note Refer to the 802.3 Network Planning & Installation Guide for more information about Triconex protocols and applications. Only one logical slot is available for NCMs in a TRICON Main Chassis or Chassis #2 (Expansion or RXM). You can install one or two NCMs in a logical slot depending upon your redundancy requirements.
Appendix A Configurable Modules
360
Modules for 802.3 Network Communication
To configure an NCM in a TRICON chassis, click the Setup option in the Properties box to display the NCM Configuration dialog box shown below. Click the options and enter text as desired. For more information, refer to the upcoming sections called “TRICON Node Number & TCP/IP Address” on page 361 and “Time Synchronization” on page 363.
Appendix A Configurable Modules
Modules for 802.3 Network Communication
361
TRICON Node Number & TCP/IP Address An ACM or NCM installed in a TRICON must have a TRICON node number and a matching TCP/IP address. First you need to set the node number with the physical switches on the module. Then you need to establish the matching TCP/IP address using one of these methods: • Allow the ACM or NCM to obtain the address from the 802.3 network host • Allow the ACM or NCM to apply a default address • Enter the address in the TCP/IP Address field(s) of the ACM or NCM Configuration dialog box In most cases, you won’t need to enter the TCP/IP address yourself because the ACM or NCM will be able to obtain it from the 802.3 network host or use a default address. The following sections provide details.
802.3 Network Host Upon power-up, the ACM or NCM uses Reverse ARP (RARP) to obtain the TCP/ IP address from a host on an 802.3 network to which the NET2 port of the ACM or NCM is connected.
Default Address If the TCP/IP address cannot be obtained from an 802.3 network host upon powerup, the ACM or NCM applies a default TCP/IP address which matches its TRICON node number and physical switch setting. The table below lists the default TCP/IP addresses and their node number equivalents: Default TCP/IP Address
TRICON Node Number (ACM Switch Setting)
192.168.1.1
01
192.168.1.2
02
192.168.1.3
03
:
:
:
:
192.168.1.31
31
192.168.1.32
32
Appendix A Configurable Modules
362
Modules for 802.3 Network Communication
! WARNING
The physical switch setting of an ACM or NCM must match its TRICON node number. If there are two ACMs or NCMs in a logical slot, both must have the same switch setting and same TRICON node number. If there are two logical slots each containing two ACMs and two NCMs respectively, all of these modules must have the same switch settings and same TRICON node numbers.
User-supplied Address If you don’t want to use a default TCP/IP address and no 802.3 host is available to supply the TCP/IP address, follow these steps: • Ask your System Administrator for the actual TCP/IP address of the TRICON node where the ACM is installed. • Open the desired TriStation 1131 project. • Enter the actual address in the TCP/IP Address field(s) of the ACM or NCM Configuration dialog box. • Go to the Communications tab of the Project Options dialog box and associate the actual TCP/IP address with the TRICON node number which matches the switch setting on your ACM or NCM. • Connect your TriStation 1131 project to a serial port and download to a TRICON. • After a successful download, you can use the ACM NET2 port to communicate with TriStation 1131. Refer to the 802.3 Network Planning & Installation Guide and the ACM User’s Guide (under development) for more information about configuring ACMs and NCMs in multi-node TRICON systems.
Appendix A Configurable Modules
Time Synchronization
363
Time Synchronization This section gives basic facts about time synchronization, an issue that affects most TRICON configurations which use communication modules. Depending on the options you select for your communication modules, a TRICON’s time can be synchronized with: • The TRICON Master Node in a network of TRICONs • A Distributed Control System (DCS) • An external device that writes aliased data to the TIMESET or TIMEADJ functions in a TriStation 1131 project Read the following sections for more information about these options and a list of guidelines that apply to time synchronization.
TRICON Master Node In a network of TRICONs connected by 802.3 cabling, the TRICON Master Node is the TRICON with the lowest node number. For example, in a network of five TRICONs, Node 1 is the master node. If Node 1 is down, then Node 2 becomes the master node. When Node 1 comes back on-line, it again becomes the master node. You can synchronize a TRICON’s time with the master node in a network by selecting an appropriate option for the ACM’s NET2 port or the NCM’s NET1 port. For more information, refer to the sections called “ACM Configuration” on page 357 and “NCM Configuration” on page 359. If your networked TRICONs are collecting event data for system maintenance and shutdown analysis, time synchronization must be used to ensure accurate timestamping of events.
DCS I/A Series — If the TRICON is being used as a safety node on Foxboro’s Intelligent Automation (I/A) Series DCS, the configuration will include an ACM. To synchronize the TRICON’s time with the I/A Series DCS, go to the ACM Setup dialog box and select the option “On NET1 enable time synchronization with external source.” TDC 3000 — If the TRICON is being used as a safety node on the Honeywell TDC 3000 DCS, the configuration will include an SMM. Go to the SMM Setup dialog box and select the option for “Enable time synchronization with external source”
Appendix A Configurable Modules
364
Time Synchronization
if you want the TRICON to receive time adjustments from the TDC 3000. If the SMM is part of a network of TRICONs which are collecting event data for system maintenance and shutdown analysis, time synchronization must be used to ensure accurate time-stamping of events.
TIMESET & TIMEADJ Functions An external device with write privileges can adjust a TRICON’s time by writing aliased data to the TIMESET or TIMEADJ functions in a TriStation 1131 project. This could happen under circumstances such as the following: • A Modbus master writes to the project over an EICM port. • A Windows-based DDE application or DDE server writes to the project over an NCM NET2 port or an ACM NET2 port. • Another TRICON writes to the project executing in your TRICON over an EICM port acting as a Modbus Master, or over an NCM port using Peer-toPeer protocol.
Guidelines that Apply The following guidelines apply to any TRICON whose time is synchronized with an external device: • In a network of TRICONs with multiple communication modules, only one module within each TRICON should be selected to perform time synchronization. • If a TRICON’s time is synchronized with the TRICON Master Node, that TRICON rejects time adjustment attempts from all other sources. • A TRICON Master Node is always free to accept time adjustments from an external source. In a typical configuration, networked TRICONs connected by NCMs are time-synchronized with the TRICON Master Node. However, the TRICON Master Node itself may be time-synchronized with a DCS by means of an ACM or SMM. In this manner, the DCS time prevails for all TRICONs in the network.
Appendix A
Configurable Modules
APPENDIX B
Keyboard & Mouse Shortcuts
Keyboard Shortcuts This section provides keyboard shortcuts for performing tasks such as editing, scrolling and selecting. Tasks performed by the toolbar are also included here.
Keystroke Shortcuts To
Press
Copy selected items
CTRL+C
Cut selected items
CTRL+X
Paste items in the clipboard
CTRL+V
Redo the last edit operation
CTRL+A
Undo the last edit operation
CTRL+Z
Text Navigation Keys To Move
Press
Character to the left
LEFT ARROW (
Character to the right
RIGHT ARROW (
One word to the left
CTRL+LEFT ARROW (
One word to the right
CTRL+RIGHT ARROW ( →
Current line
DOWN ARROW (
Previous line
UP ARROW (
←)
↑)
→)
↓)
←) )
366
Keyboard Shortcuts
To Move
Press
To end of current line
END
To beginning of current line
HOME
One page up
PAGEUP
One page down
PAGEDOWN
To beginning of current element
CTRL+HOME
To end of current element
CTRL+END
Note The text navigation keystrokes described above work in intermediate windows or when using the Structured Text editor. To select text, press the SHIFT key while pressing the keys or key combinations shown.
Delete Keys To Delete
Press
One character to the left
BACKSPACE
One character to the right
DEL (DELETE)
To the end of a word
CTRL+T
Note The above text selection keystrokes work in intermediate windows or when using the Structured Text editor.
Sheet Scrolling To Scroll
Press
Up one line at a time
UP ARROW
Down one line at a time
DOWN ARROW
Up one page at a time
PAGE UP
Down one page at a time
PAGE DOWN
Appendix B Keyboard & Mouse Shortcuts
(↑) (↓)
Mouse Shortcuts
367
Mouse Shortcuts This section provides mouse shortcuts for selecting, re-sizing, moving (dragging and dropping), and de-selecting objects.
Selecting Objects To
Do This
Select objects
Position the mouse cursor over the item. Click the left mouse button once. To select more than one item, hold down the left mouse button while dragging the mouse such that a dotted rectangle is drawn around the objects to be selected. Releasing the left button will cause the selected objects to be highlighted. Holding down the SHIFT button while clicking on objects will also enable you to select multiple objects.
Re-sizing Objects To
Do This
Re-size objects
Select an object by clicking the left mouse button. As you move the mouse around the edges of the object you will see the cursor change to a double-sided arrow, if the object can be re-sized. Click and hold the left mouse button to drag the edge of the selected object to the desired size (larger or smaller). Example of re-size arrow:
⇔ Dragging & Dropping Objects To
Do This
Drag & drop objects
Click on an object or selected group of objects, holding the left mouse button down as you move the object(s) to the desired position on the sheet. Release the left mouse button to “drop” the object.
Appendix B Keyboard & Mouse Shortcuts
368
Mouse Shortcuts
De-Selecting Objects To
Do This
De-select objects
Click anywhere on the sheet background.
Edit Object Properties To
Do This
Edit an object’s properties
Position the mouse cursor over the item. Double-click the left mouse button to activate the Properties dialog box. The properties for a selected object or objects can then be modified.
Dialog Boxes Some TriStation 1131 dialog boxes have several groups of options, with each group on a separate tab. For example, the Project Directory dialog box (accessible from the Project menu) has the following tabs: • User Defined • Shared Libraries • Platform • Other To
Do This
Select a tab
Click on the desired tab or press the CTRL+TAB keys until the desired tab is highlighted and displayed.
Select or clear options using a mouse
Point to the option button, check box, or list item desired and click the left mouse button. Option Button Check Box
Appendix B Keyboard & Mouse Shortcuts
Mouse Shortcuts
369
To
Do This
Select an item from a drop-down list
Click on the arrow or press ALT+DOWN ARROW ( ↓ ) to list the options. Click on the desired selection or use the up/down arrows to highlight the selection, as shown in this example:
Use the keyboard
Press TAB until the desired check box, tab, or option button is highlighted. Press the SPACEBAR to set or clear the box, tab, or option.
Arranging and Displaying Windows TriStation 1131 uses the standard commands used by most Windows-based applications for displaying and arranging windows or sheets. These commands appear on the Windows menu. To
Do This
Open a new window of the current element
Click on New Window.
Make windows overlap
Click on Cascade to arrange all open windows so that they overlap and display the title bar for each. To bring an overlapped window to the top, select the window from the list of open windows on the menu or click on the title bar of the desired window.
Arrange windows abovebelow each other without overlapping
Click on Tile Horizontal to display any open windows horizontally on the screen. This is useful for showing several windows simultaneously.
Arrange windows side-byside without overlapping
Click on Tile Vertical to display any open windows vertically on the screen. This is also useful for showing several windows simultaneously.
Close all open windows for the current project without closing the project
Click on Close All to close all open windows. Prompts you to save any files that have been changed since they were opened.
Appendix B Keyboard & Mouse Shortcuts
370
Mouse Shortcuts
To
Do This
Arrange all iconized windows for the current project
Click on Arrange Icons to neatly arrange all iconized or minimized windows.
Display the properties dialog for selected items in the current project element
Click on Show Properties or the Properties Dialog button to display the properties of selected items.
Display the message bar at the bottom of the screen
Click on Show Message Bar to display the message bar across the bottom of the screen.
Display the message bar horizontally across the bottom of the screen
Click on Show Message Bar Horizontal or the Horizontal Message Bar button to display compiler messages in a horizontal box across the bottom of the screen while building elements.
Display the message bar vertically on the right side of the screen
Click on Show Message Bar Vertical or the Vertical Message Bar button to display compiler messages in a vertical box on the right side of the screen during the building of elements.
Open a new window of the current element
Click on New Window.
Make windows overlap
Click on Cascade to arrange all open windows so that they overlap and display the title bar for each. To bring an overlapped window to the top, select the window from the list of open windows on the menu or click on the title bar of the desired window.
Appendix B Keyboard & Mouse Shortcuts
APPENDIX C
TRISTATION MSW Corollaries
This appendix provides tables that show TriStation 1131 corollaries for the following features of the original TRISTATION MSW programming system: • Arithmetic & logic operators • Conditional statements & operators • Math functions • Process control functions • TRICON clock functions • Fire & gas function blocks • Sequence of Events function & function blocks • Gated access functions • Peer-to-Peer communication functions • Modbus functions • Utility functions • Printer control functions • System control functions • Coils & contacts in Relay Ladder Language (RLL) • System variables
372
Arithmetic & Logic Operators
Arithmetic & Logic Operators The following are TriStation 1131 corollaries for TRISTATION MSW’s arithmetic and logic operators: TRISTATION MSW Implementation +
Addition
ADD
-
Subtraction
SUB
*
Multiplication
MUL ( * )
/
Division
DIV ( / )
=
Assignment
MOVE ( := )
MOD
Modulo
MOD
SHL
Left shift
SHL
SHR
Right shift
SHR
&
Logical AND
AND
^
Exclusive OR
XOR
|
Inclusive OR
OR
~
Complement
NOT
-
Negation
-
Power
EXPT ( ** )
**
Appendix C
TriStation 1131 Implementation
Description
TRISTATION MSW Corollaries
Conditional Statements & Operators 373
Conditional Statements & Operators The following are TriStation 1131 corollaries for TRISTATION MSW’s conditional statements and operators: TRISTATION MSW Implementation
TriStation 1131 Implementation
Description Statement for conditional execution of various instructions. Forms of this statement include:
Math Functions The following are TriStation 1131 corollaries for TRISTATION MSW’s math functions: TRISTATION MSW Implementation
Appendix C
Description
TriStation 1131 Implementation
ABS
Absolute value
ABS
CEIL
Ceiling
CEIL
COS
Cosine
COS
EXP
Natural exponent
EXP
FLOOR
Floor
FLOOR
LN
Natural logarithm
LN
LOG
Common logarithm
LOG
SIN
Sine
SIN
SQRT
Square root
SQRT
TAN
Tangent
TAN
TRISTATION MSW Corollaries
Process Control Functions
375
Process Control Functions The following are TriStation 1131 corollaries for TRISTATION MSW’s process control functions: TRISTATION MSW Implementation
TriStation 1131 Implementation
Description
AIN
Converts analog input to real value (function)
AIN
AOUT
Converts real value to analog output value (function)
AOUT
Computes average AVG
TriStation 1131 Note: IEC-1131 does not support user-derived extensible functions. In the FDB, LD and ST languages, use the ADD and DIV Standard Library functions instead.
Not Supported
CLAMP
Limits dynamic range of input value (function)
LIMIT
CSCHED
Schedules execution after a specified number of scans (function block)
CSCHED
EXPFLTR
Exponential filter of input value (function)
EXPFLTR
HISEL
Selects highest value
MAX
INTGTOR
Performs integration of input value (function)
INTGTOR
LEADLAG
Provides lead-lag compensation (function block)
LEADLAG
LOSEL
Selects lowest value
MIN
MEDSEL
Selects median value
MEDSEL
PERDEV
Computes percent of difference (function)
PERDEV
PID
Proportional Integral Derivative Control (function block)
PID
Appendix C
TRISTATION MSW Corollaries
376
TRICON Clock Functions
TRISTATION MSW Implementation
Description
TriStation 1131 Implementation
SCALE
Rescales input value (function)
SCALE
TcJConv
Converts Type J thermocouple inputs to Centigrade
TCJCONV
TcKConv
Converts Type K thermocouple inputs to Centigrade
TCKCONV
TSCHED
Schedules execution at specified time intervals (function block)
TSCHED
XofN
Decides if “x” of “n” measurements exceed limit (function block)
X_OF_N
TRICON Clock Functions The following are TriStation 1131 corollaries for TRISTATION MSW’s TRICON clock functions: TRISTATION MSW Implementation
Appendix C
Description
TriStation 1131 Implementation
TIMEADJ
Adjusts the TRICON clock by value supplied by the host
TIMEADJ
TIMESET
Sets the TRICON clock from values supplied by host
TIMESET
TRISTATION MSW Corollaries
Fire & Gas Function Blocks
377
Fire & Gas Function Blocks The following are TriStation 1131 corollaries for TRISTATION MSW’s fire and gas functions: TRISTATION MSW Implementation
ALRMCOIN
TriStation 1131 Implementation
Description Sets coincidence alarm if inputs are in alarm state TriStation 1131 Note: Use NUMBITS and GE functions instead.
Not supported
GASDETR
Processes gas detector inputs and generates alarms (function block)
GASDETR
GASINIT
Initializes various types of gas detectors (implemented in GASDETR)
GASDETR
LINEINIT
Initializes various types of line monitors (implemented in LINEMNTR)
Initializes various types of loop detectors (implemented in LOOPDETR)
LOOPDETR
Appendix C
TRISTATION MSW Corollaries
378
SOE Function Blocks
SOE Function Blocks The following are TriStation 1131 corollaries for TRISTATION MSW’s Sequence of Events (SOE) function blocks: TRISTATION MSW Implementation
Description
TriStation 1131 Implementation
SOECLR
Clears the designated SOE function block after it has been stopped
SOECLR
SOESRT
Starts event collection for the designated SOE function block
SOESRT
SOESTAT
Returns statistics for the designated SOE function block
SOESTAT
SOESTOP
Stops event collection for the designated SOE function block
SOESTOP
Gated Access Functions The following are TriStation 1131 corollaries for TRISTATION MSW’s gated access functions: TRISTATION MSW Implementation
Appendix C
Description
TriStation 1131 Implementation
GATDIS
Closes a gate previously opened by GATENB for restricted write operations by external hosts
GATDIS
GATENB
Opens a gate for an external host to write to Aliased TRICON variables
GATENB
TRISTATION MSW Corollaries
Peer-to-Peer Communication Functions
379
Peer-to-Peer Communication Functions The following are TriStation 1131 corollaries for TRISTATION MSW’s Peer-toPeer communication functions: TRISTATION MSW Implementation
RECV
SEND
TriStation 1131 Implementation
Description Receives up to 20 values of the specified data type from a matching TR_USEND function block on another TRICON node
TR_URCV_BOOL
Sends up to 20 values of the specified data type to a matching TR_URCV function block on another TRICON node
TR_USEND_BOOL
TR_URCV_DINT TR_URCV_REAL
TR_USEND_DINT TR_USEND_REAL
Modbus Functions The following are TriStation 1131 corollaries for TRISTATION MSW’s Modbus functions: TRISTATION MSW Implementation
TriStation 1131 Implementation
Description
MBCTRL
Sets time-out and retry values for an EICM Modbus Master port
Not supported
MBREAD
Reads data from a Modbus slave
Not supported
MBWRITE
Writes data to a Modbus slave
Not supported
Appendix C
TRISTATION MSW Corollaries
380
Utility Functions
Utility Functions The following are TriStation 1131 corollaries for TRISTATION MSW utility functions: TRISTATION MSW Implementation
Description
TriStation 1131 Implementation
PACK16
Packs 16 BOOLs into an integer
PACK16
UNPACK16
Unpacks integer into 16 BOOLs
UNPACK16
Printer Control Functions The following are TriStation 1131 corollaries for TRISTATION MSW’s printer control functions: TRISTATION MSW Implementation
Writes a list of values to specified printer port preceded by date and time
PRINT_CDT
PRINTT
Writes a list of values to specified printer port preceded by time of day
PRINT_CTOD
TRISTATION MSW Corollaries
System Control Functions
381
System Control Functions The following are TriStation 1131 corollaries for TRISTATION MSW’s system control functions: TRISTATION MSW Implementation
TriStation 1131 Implementation
Description
ClearFsr
Clears arithmetic error system variables
CLR_ERR
OVDDISABLE
Disables output voter diagnostics
OVDDISABLE
OVDENABLE
Enables output voter diagnostics
OVDENABLE
Appendix C
TRISTATION MSW Corollaries
382
Coils & Contacts in RLL
Coils & Contacts in RLL The following are the TriStation 1131 corollaries for coils and contacts in TRISTATION MSW’s Relay Ladder Language (RLL): TRISTATION MSW Implementation
Appendix C
Description
TriStation 1131 Implementation
—] [—
Normally open contact
—] [—
—-]/[—
Normally closed contact
—]/[—
—]↑[—
Transition ON contact
—]P[—
—]↓[—
Transition OFF contact
—]N[—
—]==[—
Equal to
EQ
—]<>[—
Not equal to
NE
—]<[—
Less than
LT
—]>[—
Greater than
GT
—]<=[—
Less than or equal
LE
—]>=[—
Greater than or equal
GE
—( )—
Standard coil
—( )—
TRISTATION MSW Corollaries
Coils & Contacts in RLL
383
Coils and Contacts in RLL (continued) TRISTATION MSW Implementation