The Key Editor
To define a function key: 1 Select the function key.2 Click the button with tools symbol. The Key Editor shown in the Figure 59 ap- pears.
3 Choose the key type you want to use from the Type drop-down list box.
4 A function key can be blinking or non-blinking. Blinking means that the key will start blinking when it is activated and continues until the !RESTORE command is executed. Non-blinking means that the function key will not blink in any situation.
Figure 59. You can define the key in the Key Editor
5 Continue function key definition by programming the key and typing the help text.
Programming Function Keys
All three types of function keys, command keys, text keys and command line keys, are programmed in the Key Program Editor, which is entered via the Key Editor. To pro- gram the key:
1 First enter Key Editor.
2 Click Program and the Key Program Editor appears. If the key has not been pro- grammed before, the program lines are empty. Otherwise the program that has been written before is shown.
3 To program command keys or line command keys, type the SCIL statements line by line. To program string keys, you can only use the first line. Do not use quota- tion marks (“). The variable CURSOR_POS must be defined before the
!INPUT_VAR command in the program of line command keys.
For example, the following line command key program activates the function key on the next line when Enter is pressed on the keyboard.
@CURSOR_POS(2) = %CURSOR_POS(2) + 1 !INPUT_VAR
4 When you have finished programming, choose Exit from the File menu.
5 A dialog box with the question “Do you want to update edited object?” is shown. Click on Yes.
6 Choose Close in the Key Editor.
SYS 500
5 Function KeysPicture Editing
Configuration Manual
1MRS751255-MEN ABB Automation 70Inserting Help and Header Tex
You can insert Help or Header texts for keys. Help texts are read with the command !INPUT_KEY HELP. These texts give information about the key to the user - they have no functional meaning. To insert help or header text:
1 Select the function key.
2 Click the button with the tools symbol in the toolbox. The Key Editor appears. 3 Click Help or Header depending on which one you want to insert. The Key Help
or Key Header dialog box appears.
4 Start the typing in the first row. For more information on editing text see Chapter 6.
6
Picture Programs
About this Chapter
This chapter contains the following sections:
6.1 The first section describes the different program types and gives some general rules and hints for programming with SCIL.
6.2 The second section describes how to use the SCIL Program Editor. 6.3 Description of the compilation feature in the Picture Editor.
6.4 The fourth section describes some common SCIL commands related to picture handling.
6.1 Overview
Picture Program Types
Programs are the active parts of a picture. The background, draw, start and update programs are executed each time the picture is requested to be shown on screen, no matter whether it is shown as a main picture or a part picture. A picture can contain the following types of programs:
• Background program. The background program is created automatically. It contains only graphical commands, which are usually made by Picture Editor. Other than graphical commands will be removed. The graphics drawn by the background program are shown in the Picture Editor. Note that the program should not be edited manually.
• Draw program. The draw program is executed immediately after the background program, before the start program. Though the draw program can contain any command, it is especially suitable for full graphic SCIL commands. The elements drawn with graphics commands in the draw program are not shown until the whole program has been executed. The graphics created in the draw program are shown in the Picture Editor, but cannot be edited without changing the program. Graphics commands added to the draw program during the picture editing can be shown by choosing Refresh from the View menu.
• Start program. Start programs are normally used for showing or reading initial picture values, defining the updating of the picture and other similar functions.
• Update program. The update program provides the possibility to update the picture cyclically with a selected time interval as long as the picture is shown on screen.
• Exit program. The exit program is executed each time the picture is closed. It does not matter if the picture is shown as a main picture or a part picture, or in what way it is exited.
SYS 500
6 Picture ProgramsPicture Editing
Configuration Manual
1MRS751255-MEN ABB Automation 72• Key program. A key program is executed each time the corresponding function key is activated. There can be several key programs in a picture.
• Named program. A named program is executed by a SCIL command or as a callback from a Motif widget or Visual SCIL object. There can be several named programs in a picture.
• ERROR_HANDLER. The standard error messages shown in the upper left cor- ner of pictures can be avoided. Each picture may contain a named program with predefined name, ERROR_HANDLER, where the programmer can define the er- ror handling to be used in the picture. The ERROR_HANDLER program receives information about the errors. See the manual Programming Language SCIL, Chapter 7.
Programming
Each program, except string key programs, can contain up to 10 000 lines. All pro- gramming is written with SCIL. When you program with SCIL you can leave empty lines and spaces anywhere in the program. In picture programs, except in background programs, all types of SCIL statements are allowed.
Programs are written in the SCIL Program Editor. It includes a number of useful fea- tures, for example it enables cutting, copying and pasting program lines as well as searching texts and replacing them with others. A program can be copied to and from an ASCII file.
Hints and Notes
The updating of a picture can be defined by programs. The update program is not started until the !UPDATE command has been executed. Automatic event based up- dating in a picture is done with #ON command and event objects. A window is up- dated at the time interval that is given in the same window picture. The event based updating of a window is also defined in the window picture.
Named programs can be used when a program should be executed several times in the same picture. Note that the #EXEC commands are queued in a separate execution queue. This means that some commands that are meant to be executed after the #EXEC command may be executed before, if the program is not done carefully. When a window picture is shown with the !SHOW command, its start program is exe- cuted. When the picture is erased, its exit program is executed. You can erase a win- dow picture with !ERASE command that is located in the same hierarchical picture stucture. If the command is located inside the window picture, the program in which the command is located stops immediately when the command is executed.