Features Of The PG5 - ULisboa

Transcription

Advantages of the PG5 programming tools Program portability: PG5 programs can run on all SAIA PCD platforms. Program organization by files (containing several program blocks) simplifiesthe shared use of program files between several SAIA PCD controllers. Programming and debugging environments united in each program editor.User Manual Simple programming of terminal displays with the HMI Editor. Powerful instruction set supported by macros and assem bler directives.Features of the PG5 Symbol Manager administers all local, global and network symbols or symbolgroups. Automatic address allocation largely dispenses with the need forfixed addressing. Project Manager administers complex installations of networked PCDs, includingdisplays and documentation. Online functions for commissioning and error detection via Ethernet-TCP/IP,SAIA S-Bus, modem, etc. Integrated programming environments:– FUPLA (function block diagram)– S-Edit (instruction list IL)– GRAFTEC (sequential function chart) Integrated network editors for SAIA S-Bus, PROFIBUS DP, LONWORKS . Extensive additional libraries broaden the scope of PG5 functions.Edition 26/732 E11

Saia-Burgess Controls Ltd.PG5-User Manual I Chapter 0 I Index I 23.09.10I

IISaia-Burgess Controls Ltd.Contents1PCD-Quick start2Project Manager3Device Configurateur4PCD – Data Typ5Symbol Editor6Program with Fupla7Program structures8Graftec programming9Programming in IL (Instruction List)10Additional tools11Saia User Manual I Chapter 0 I Index 23.09.10

Saia-Burgess Controls Ltd.PrefaceThis document is intended as an introduction to Saia PCD programmablecontrollers, rather than as a detailed commissioning manual. It therefore concentrateson the essential points for users who wish to acquire practical expertise quickly. Formore comprehensive information, please refer to the help supplied by theprogramming tool itself, or to the detailed manuals that will be found on thedocumentation CD.To ensure ideal conditions for your training, we advise you to obtain the followingprograms, documentation and material: CD PG5 version 2.0Documentation CD 26/8031 x PCD2. M5540 1 controller1 x PCD2.E110 module with 8 digital inputs1 x PCD2.A400 module with 8 digital outputs1 x USB cableAll the necessary instructions for installing PG5 2.0 on your computer are provided onthe PG5 version 2.0 CD (see under: CD:\ PG5 InstallationGuide E.pdf).Please also note that all the English names of menus, instructions, options andbuttons present in the PG5 program are reproduced in italics in this manual.We wish you every success with your training and with future projects involvingSaia PCD products.Your partner Saia-Burgess Controls Ltd.1an other PCD may also be suitablePG5-User Manual I Chapter 0 I Index I 23.09.10III

IVSaia-Burgess Controls Ltd.PG5-User Manual I Chapter 0 I Index 23.09.10

Saia-Burgess Controls Ltd.Contents11.1PCD – QUICK-START . 3Introduction .31.2Preparing the hardware.41.2.1Example: Stairway lighting .41.2.2Connection diagram of PCD2.M5540 .41.2.3PCD2.M5540 assembly .51.2.4Wiring.51.3Editing the program .61.3.1Software Installation.61.3.2Starting the PG5 .61.3.3Opening a new project.71.3.2Opening an existing project .71.3.4Configuration.81.3.5Adding a new program file .101.3.6Opening an existing file.111.3.7Editing a program .111.4Running and testing the program .151.4.1Building the program.151.4.2Downloading the program into the PCD .151.5Finding and correcting errors (Debugging).161.6Correcting a program .17PG5 User Manual I Chapter 1 I Quick Start I 23.09.101-1

1-2Saia-Burgess Controls Ltd.PG5 User Manual I Chapter 1 I Quick Start I 23.09.10

Saia-Burgess Controls Ltd.1PCD – Quick-start1.1IntroductionAs your first point of contact with PCD equipment, we propose a direct approach:tackling the production of a small real-life application. Even without any experience ofSaia products, this is easy to do. Everything is set out in detail in this quick-startchapter.This example shows how to commission a PCD2.M5540. Programming and testingusing the PG5 programming tools.Subsequent chapters in this document repeat in more detail the contents of thisquick-start chapter, and provide much more information such as descriptions ofavailable symbols, program structures and instruction list programming.PG5 User Manual I Chapter 1 I Quick Start I 23.09.101-3

1-4Saia-Burgess Controls Ltd.1.2Preparing the hardware1.2.1Example: Stairway lightingThe commissioning of a PCD is illustrated using stairway lighting as an example. Thebuilding has a ground floor and three upper storeys. Each level has a push-button forswitching the lights on. By briefly pressing any of these buttons, all 4 lights in thestairway will be switched on for a period of 5 minutes.The push-buttons are connected to the 4 inputs of the PCD: I0, I1, I2 and I3.The 4 lights are switched on/off via a relay. The relay is controlled via a single output(O32) on the PCD.1.2.2Connection diagram of PCD2.M5540Etage 3Etage 2Etage 1Rez-de-chausséeNPPG5PCD2.E110024 VDCPCD2.A4001629::– :– : : :: 20112 / PG5 User Manual I Chapter 1 I Quick Start I 23.09.10230 VAC3296230 VAC488064

1-5Saia-Burgess Controls Ltd.1.2.3PCD2.M5540 assembly1. Insert the supplied 3.0 V lithium battery.2. Plug a PCD2.E110 module into socket 1 (addresses 0 to 15).3. Push the module towards the middle of the device until the end stop andengage latch. This provides 8 digital inputs for 24 VDC with addresses I0 toI7. Only inputs I0 to I4 will be used.4. Plug a PCD2.A400 module into socket 3 (addresses 32 to 47) as previouslydescribed. This provides 8 digital outputs (O32 to O39) for 24 VDC / 0.5A.Only output O32 will be used.1.2.4Wiring1. Connect the 24 VDC supply to screw terminals 20 ( ) and 23 (–) .Thefollowing supply voltages are allowed: 24 VDC 20% smoothed or 19 VAC 15% full-wave rectified2. The four inputs used are connected according to the hardware description ofthe PCD2.E110 module. Connect the 4 push-button switches to terminals 0 to3. Terminals 8 and 9 are connected to the power supply negative.st3 floorst2 floorst1 floorGround floor 24 VDC–0 1 2 3 4 5 6 7 8E0 E1 E2 E3 E4 E5 E6 E7 L9– Module base address ( 0 for this example)3. Connect terminal 0 to the relay coil , terminal 8 to the 24 VDC supply positive,and terminal 9 to the supply negative.3rd floor2nd floor1st floorGround floor 24 VDC–230 VACNP0 1 2 3 4 5 6 7 8A0 A1 A2 A3 A4 A5 A6 A7 9– Module base address, , ( 32 for this example)4. Connect the PC’s USB interface to the PCDNote: For more detailed information about hardware assembly and wiring, pleaserefer to your PCD hardware manual.PG5 User Manual I Chapter 1 I Quick Start I 23.09.10

1-6Saia-Burgess Controls Ltd.1.3Editing the program1.3.1Software InstallationInstall the PG5 programming tool for Saia PCD on the PC (if it has not already beeninstalled), following the instructions supplied on the CD(CD:\ PG5 InstallationGuide E.pdf).1.3.2Starting the PG5Start the PG5's Project Manager:Start Programs Saia-Burgess PG5 Suite 2.0 Project Manager PG5The Saia Project Manager window is displayed. The Project Tree window shows thestructure of the new project. (If this window is not shown, use the View, Project Treemenu command.)PG5 User Manual I Chapter 1 I Quick Start I 23.09.10

Saia-Burgess Controls Ltd.Folders in the Project Tree window contain project information, which is arrangedaccording to certain criteria: The name of the main folder shows the project name and the number ofdevices used in the project.Files which are shared by several of the devices can be stored in the CommonFiles folder.Next are the device folders (each device represents a PCD).Each device folder contains the following sub-folders: 1.3.3Online Settings, Device Configurator and Build Options.Program Files, contains the program module files.Listing Files, contains files generated during the program build (Build). Theseare not so interesting to the inexperienced user.Opening a new projectBefore starting to write a new program, a new or existing project must be opened thatcontains the necessary definitions, a few configuration parameters and the filesneeded for the user program.If the project does not yet exist, select Project, New , define the name of the newproject in the Project Name field, check the Create Device option and confirm with theOK button.1.3.2Opening an existing projectA project which already exists can be opened using the Project, Open menucommand. This searches for all project files (.saia5pj) in the project directory, anddisplays them in a list. Double-click on the project in the list, or select the project fromthe list and press the Open button. Alternatively, you can press the Browse buttonand find the project or device file directly.PG5 User Manual I Chapter 1 I Quick Start I 23.09.101-7

1-8Saia-Burgess Controls Ltd.1.3.4ConfigurationBefore you can work with a device in the project, configuration parameters must bedefined, so that the programming tools and the generated user program will work withthe PCD.Under Online Settings, parameters can be set for communication between the PCand the PCD. Several possibilities are available. For this exercise the default protocol(PGU) will be selected, followed by the PC's serial port number (COM1).Channel S-Bus USBDefine S-Bus USBprotocolSelectPGUNote:The USB interface is onlyavailable for the new CPUs:PCD2 and PCD3. For olderdevices, use the PGUinterface (RS 232).Channel PGU (RS 232)Select PGU protocolClick on SetupSelect the PC’sserial port RS232 to beconnected toPG5 User Manual I Chapter 1 I Quick Start I 23.09.10

1-9Saia-Burgess Controls Ltd.The Device Configurator defines the device type, memory size, S-Bus stationnumber, communications interfaces, etc., but we won't describe all the options justyet. However, it is important to select the correct device type and memory size. ThePCD2.M5540 is always supplied with a standard 1024 Kbyte RAM.To define a new device, select the correct PCDtype from the Change Device Type context menu.The properties window is shown withthe Properties context menucommand. Here the memory size ofcan be defined.The configuration must always be downloaded into the PCD, using the menucommand Online, Download Configuration Check Memory Allocation tooDownload theconfigurationPG5 User Manual I Chapter 1 I Quick Start I 23.09.10

1-10Saia-Burgess Controls Ltd.1.3.5Adding a new program filePCD user programs are stored in one or more files. There are several ways of addinga program file:In the Project Tree window, select Program Files, click the right-hand mouse button todisplay the context menu and select New (new file).Alternatively, you can click on the New File button on the toolbar, or use the File,New menu command.In the New File window the name and type of the module are defined: two veryimportant items of information.Several editors are available for writing PCD user programs. The user can choosewhich editor is best suited to the user program. For this example it is Fupla File(*.fup). Fupla is a general-purpose graphical programming language.PG5 User Manual I Chapter 1 I Quick Start I 23.09.10

1-11Saia-Burgess Controls Ltd.1.3.6Opening an existing fileIf the folder already contains a program file, the file can be opened as follows:In the Project Tree window, open the Program Files folder and double-click on therelevant file. Alternatively, right-click on the file name to open the context menu andselect Open.Mark file or open itby double-clickingthe mouse button1.3.7Editing a programPG5 User Manual I Chapter 1 I Quick Start I 23.09.10Open file

1-12Saia-Burgess Controls Ltd.Editing symbolsSymbols reference the data needed by the PCD's user program, e.g. the stairwaylighting switches. We edit symbols in the connectors on the Fupla page. ‘Read’symbols are on the left, ‘write’ symbols are on the right.This stairway lighting example has 4 light switches as inputs (I 0, I 1, I 2 and I 3) andone output (O 32) to drive the stairway lights. The required period of 5 minutes, duringwhich stairway lighting will be on, must be entered in the input connector as a multipleof tenths of a second.The value of this constant is therefore 3000 (5 min. x 60 sec. x 10 3000).AddConnectorsTo add a connector and its symbol to a Fupla page, press the toolbar button AddConnector and position the mouse on the Fupla page. A ‘read’ input connector isadded by clicking the left-hand mouse button. A ‘write’ output connector is added byholding down the Shift key and pressing the left-hand mouse button. The connectoryou have just added is ready to receive a symbol and a cursor is displayed inside theconnector. If you do not wish to edit the symbol inside the connector straight away,press the ESC key and place the next connector.To edit or modify a connector symbol already present on the Fupla page, select theconnector by double clicking quickly. A cursor will be displayed inside the connector.It is now possible to enter the address I 0 to I 3, or output O 32, or the constant. Makesure you always leave a space between the letter I and the input address. The sameapplies for the output.Show HideSymbols EditorTo edit the input symbols, 4 consecutive cells in the left-hand column of the programscreen are marked with the mouse and addresses I 0 to I 3 are entered. The timeconstant 3000 (left) and output O 32 (right) are entered in the same way.Please note that the address type (I or O) and address value (0 to 3 and 32) must beseparated by a space character.The symbols will immediately appear in the Symbols window of the Symbol Editor. Ifthe symbol editor is not visible it can be displayed using the View, Symbols menucommand or by pressing the Show/Hide Symbol Editor toolbar button:Note: By default, each new page may already provide margins with connectors on theleft and right. If you prefer new pages not to appear with these connectors, so thatyou can place them wherever you want, just turn off the relevant option with menucommand: View, Options , Workspace, New pages with side connectors.To remove any empty connectors present on the left or right of the page, selectmenu: Page, Remove Unused Connectors.To place connectors once again on a blank page, select menu: Page, Add SideConnectors.PG5 User Manual I Chapter 1 I Quick Start I 23.09.10

Saia-Burgess Controls Ltd.Editing program functionsProgram functions are inserted in the area between the ‘read’ and ‘write’ connectors.This is done by positioning the graphical symbols of the function boxes (FBoxes) thatare used to create user programs.Function boxes are selected from the FBox Selector window.Show/HideThe first function required in this example serves to switch on the lighting in responseto a short pulse from a stairway switch. This is an OR function, which is found in theBinary family.The second function Off delay defines the 5 minute period during which the lights areon. It is found in the Time related family.Further information about the FBox can be found by right-clicking on the function inthe FBox Selector window, and choosing the FBox Info context menu command.When a function box has been selected from the FBox Selector window, the left-handmouse button is used to place it in the edit window between symbol columns.With certain function boxes, such as OR logic, the number of inputs can be selected.This is done by dragging the mouse vertically and clicking the left-hand mouse buttonwhen the number of inputs is correct.PG5 User Manual I Chapter 1 I Quick Start I 23.09.101-13

1-14Saia-Burgess Controls Ltd.Connecting functionUse this method when connection points are aligned horizontally1.2.3.4.Press the Select Mode buttonPlace the mouse pointer over the FBox and pressthe left-hand mouse button.Hold the button down and drag the FBoxhorizontally until the connection is made. Do notrelease the mouse button.Drag the FBox back to its original position andrelease the mouse button.1.2.3.4.Use this method for the other connections1.Press the Line Mode button2.Click on the starting point with the left-hand mousebutton and release it. Move the mouse pointer tothe right as far as required and press the left-handmouse button again.3.Move the mouse vertically and click the left mousebutton once more.4.Move the mouse pointer to the FBox connector andpress the left-hand mouse button again to finalisethe connection.5.If necessary, line drawing can be aborted bypressing the right-hand mouse button.Deleting a line, function box, symbol or connectorPress the Delete Object toolbar button and click on theline, FBox, Symbol or Connector to be deleted.PG5 User Manual I Chapter 1 I Quick Start I 23.09.101.2.3.4.

Saia-Burgess Controls Ltd.1.4Running and testing the program1.4.1Building the programBefore the program can be executed by the PCD, it must be built (compiled,assembled and linked) using the Project Manager's Device, Build Changed Filesmenu command, or the Rebuild All Files toolbar button.RebuildAll FilesThe results of the build are shown in the Messages window (Compiling, Assembling,Linking etc.). If the program has been correctly edited, the build function completeswith the message: Build successful. Total errors 0 Total warnings: 0Errors are indicated by a red error message. Most errors can be located in the userprogram by double-clicking on the error message.1.4.2Downloading the program into the PCDThe user program is now ready. All that remains is to download it from the PC into thePCD. This is done using Project Manager's Download Program toolbar button or theOnline, Download Program menu command.If any communications problems arise, check the Online Settings and the cableconnection between the PC and the PCD (PCD8.K111 or USB).DownloadProgramPG5 User Manual I Chapter 1 I Quick Start I 23.09.101-15

1-16Saia-Burgess Controls Ltd.1.5Finding and correcting errors (Debugging)The first version of a program is rarely perfect. A stringent test is always needed.Program testing is done using the same editor that was used to write the program.1. Press the Go On /Offline button2. Start program with the Run buttonObserve the Run LED on the PCD at the same time.When the Run button is pressed, the Run LED on the PCD should turn on becausethe PCD is now executing the user program.When the Stop button is pressed, the Run LED on the PCD should turn off becausethe PCD has stopped executing the program.When the editor is Online and the PCD is in Run mode, the state of each individualsymbol can be displayed: The logical state of binary data is shown with a heavy or fine line (heavy 1 andfine 0)Other data values can be displayed by clicking the left-hand mouse button on theconnection to show a Probe window: use the mouse to select the Add Probebutton and the link.PG5 User Manual I Chapter 1 I Quick Start I 23.09.10

Saia-Burgess Controls Ltd.1.6Correcting a programTo modify a program, proceed as follows:1. Go offline (using the Go On /Offline button).2. Modify the program.3. Build the new program (with the Build button).4. Download program to the PCD with the Download Programbutton.PG5 User Manual I Chapter 1 I Quick Start I 23.09.101-17

1-18Saia-Burgess Controls Ltd.PG5 User Manual I Chapter 1 I Quick Start I 23.09.10

Saia-Burgess Controls SAContents2PROJECT MANAGEMENT . 22.1Project Organisation .22.1.1Opening a Project .32.1.2Creating a new Project.32.1.3How projects are stored on the PC .42.1.4Backup and restore of a Project or Device .52.2The Project Tree window.62.2.1Project folder.62.2.2Common Files folder .72.2.3Libraries folder .72.2.4Device folder .82.2.5Online Settings.92.2.6Connecting the PC to the PCD .102.2.7Device Configurator .112.2.8Build Options.112.2.9Program Files folder .132.2.10 File Types .152.3Building the Program.172.3.1Build Changed Files, Rebuild All Files, Rebuild All Devices.182.3.2General Build Options .182.4Messages Window.192.5Downloading the Program into the PCD.202.5.1Download Program .202.5.2Download Options.212.6Commands for All Devices.222.7Self Downloading Files .232.7.1Creating a self-downloading file .232.7.2Downloading a self-downloading file.242.8Flash Backup Memory .252.8.1Saving the executable program.252.8.2Saving the program's source code.252.8.3Backing up data to a file .282.9The View Windows .292.9.1Block Call Structure .292.9.2Global Symbols and Data List Views .302.9.3Cross-Reference List .302.10 The Online Configurator .312.10.1 Device Configurator .312.10.2 PCD History .322.10.3 Setting the PCD's Clock .322.10.4 Saving program and data from RAM .332.10.5 Create Diagnostic File .33PG5 User Manual I Chapter 2 I Project Management I 23.09.102-1

2-2Saia-Burgess Controls SA2.10.6Firmware Downloader.332Project Management2.1Project OrganisationModern automation processes usually contain several devices connected in anetwork, where each device carries out a particular function. For example, a buildingcontrol system might have dedicated devices for handling lighting, heating,ventilation, automatic doors in the underground garage, etc.Active DeviceThe PG5 Project Manager provides a global view of all the devices and files in asingle project. All operations are started from here. For example, adding new programfiles to the project, opening files to write the programs, configuring the hardware,building and downloading the programs into the devices, backup and restore,reporting errors and warnings when building the program, etc.The Project Tree window shows a hierarchical representation of each device and itsconfiguration and program files. To display this window use the View, Project Treemenu command.PG5 User Manual I Chapter 2 I Project Management I 23.09.10

2-3Saia-Burgess Controls SAThe Messages window shows general information messages, and error and warningmessages generated when building a program. Display this window with the View,Messages menu command.The other View windows show lists of symbols and media used, and the programstructure. They also provide a symbol cross-reference feature.The active device is marked with a green triangle. Many of the menus and Tool Barbuttons work on the active device. To change the active device, just select anotherdevice in the Project Tree, or use the Device, Set Active menu command.2.1.1Opening a ProjectThe PG5 is installed with all the examples in this manual. The Project, Open command displays a list of all projects by finding all the project files (.saia5pj) in theProjects Directory. Double-click on the project to open it, or select the project andpress the Open button. Alternatively you can press the Browse button and find aspecific project or device file (.saia5pc) in another directory.Folder containing theprojects listed belowSelected project2.1.2Creating a new ProjectTo start a new project, use the Project, New menu command, enter the name of theproject in the Project Name field (default ProjectX) and press OK.PG5 User Manual I Chapter 2 I Project Management I 23.09.10

2-4Saia-Burgess Controls SAProject Name:Projects Directory:Description:Create Device:2.1.3The name of the new project.Name of folder which will contain the project.Free text, desc

1-6 Saia-Burgess Controls Ltd. PG5 User Manual I Chapter 1 I Quick Start I 23.09.10 1.3 Editing the program 1.3.1 Software Installation Install the PG5 programming tool for Saia PCD on the PC (if it has not already been installed), following the instructions supplied on the CD (CD:\ PG5_InstallationGuide_E.pdf). 1.3.2 Starting the PG5