Software DNC PLC

The modifications in the new version (4.0) of the PLC64 program with respect ...... The keys for controlling the ranges and sizes of the different windows are.
298KB taille 85 téléchargements 328 vues
SOFTWARE PLC REF. 9701 (in)

INDEX

1.

Version 4.0. Modifications of the version 3.0 ................................. 1

2. 2.1 2.2. 2.3. 2.3.1. 2.3.2. 2.3.3. 2.3.4. 2.3.5. 2.3.6. 2.3.7. 2.3.8. 2.4. 2.5. 2.6. 2.6.1. 2.6.2. 2.6.3. 2.6.4. 2.6.5. 2.7. 2.7.1. 2.7.2. 2.7.3. 2.7.3.1. 2.7.3.2. 2.7.3.3. 2.7.3.4. 2.7.3.5. 2.7.4.

Version 3.0 .......................................................................................... 7 Introduction ......................................................................................... 9 General description ............................................................................ 15 Options ............................................................................................... 17 Main menu ......................................................................................... 17 Utilities and configuration ................................................................. 19 Program editing ................................................................................. 24 Syntax control.................................................................................... 26 Reports ............................................................................................... 28 Command lines .................................................................................. 33 Display ............................................................................................... 43 Global - display and command line .................................................. 50 Conversion of mnemonic code to contact diagram .......................... 53 Examples of listing of the application .............................................. 59 Instruction editor ................................................................................ 67 Introduction ....................................................................................... 67 Selecting a program ........................................................................... 68 Inside the editor ................................................................................. 69 How the commands operate .............................................................. 71 Advanced operation: editing commands .......................................... 80 Contacts editor ................................................................................... 83 Introduction ....................................................................................... 83 General description of the editor menus and commands ................. 87 Description of the editor functions ................................................... 93 Initial menu ........................................................................................ 93 Level 2 menu ..................................................................................... 98 Level 3 menu ................................................................................... 102 Level 4 menu ................................................................................... 107 Special function keys....................................................................... 124 SW funcion ...................................................................................... 127

pg-1

Version 4.0 Modifications of the version 3.0

pg-2

pg-3

The modifications in the new version (4.0) of the PLC64 program with respect to the previous version (3.0) are described below.

. * Installation and requirements This new version is only for installation in hard disks. Therefore the option of installation on floppy disks, present in the previous version, is not permitted. Computer memory 640 Kb. * Configuration The configuration or parameter selection process incorporates the following fields: - Number of lines printed per page. - Type of printer. Graphics or Non graphics. * Directory Control Window The structure and way of selecting files are retained. However only the following appear in this window: -

Directories. Programs with .LST extension Programs with .PLC extension Programs with .LDS extension Programs with . PL extension edited with the equation editor - Programs with . LD extension with the contact editor - Programs with .SBL extension

= Equation programs in PLC format. = Equation programs in user format. = Contact programs. = Copies of equation programs = Copies of contact programs edited = Symbol table.

pg-4

* Editing processes Option 2 on the Main Menu (Program Editor), gives the following menu: 1.2.3.4.-

Equation editor. Contact editor. Translator. LDS —> LST. External editor.

1. Equation editor Calls the EDIPLC equation editor. 2. Contact editor Calls the EDILD contact editor. 3. Translator. LDS —> LST This process translates an equation program in plc format (.LST extension) into a contact program, generating a file with the same name and the .LDS extension. This new contact file can be used by the contact editor. The aim of this new utility is to allow users who normally edit these programs in equations, to obtain a version of these programs in contacts. 4. External editor Calls the external editor which is defined in the configuration option.

pg-5

* Reports Option The main new feature which this option has, is that depending on whether the file selected for reports is an equation program (.PLC, .LST) or a contact program (.LDS), it will generate source program listings and cross references in equations or in contacts.

. The list selection screen is as follows: Source program......... X-Ref. Inputs (I)........ X-Ref. Outputs (O) ... X-Ref. Marks (M) ..... X-Ref. Counters (C) . X-Ref. Timers (T) ..... X-Ref. Records (R) ... X-Ref. Rrd Bits .........

N N N N N N N N

Contact Source - Page............ N Contact Source - Comment ... N PRN active (0-LPT1/1-LPT2) O Graphics Printer ..................... S Lines per page ........................ 72 Output device (P/I) ................ I Listings between pages .......... 000:999 Header: __________________________

As far as listings which can be generated are concerned the “Contact Diagram” listing has been deleted, as the “Source Program” option will present the listing according to the selected file format (equations or contacts). As regards the printing parameters it should be pointed out that the file selected is contacts (.LDS), two new options will be presented which refer to the contact source listing, and these are: - Source in contacts with paging ............. : N - Source in contacts with commentaries .. : N With the first of these you can indicate in the source listing in contacts if you want to jump a page. With the second you can select the inclusion or not in the listing of range commentaries.

pg-6

* X-Ref. of a contact program The structure and sense content of the X-Ref of an equation program are maintained. That is to say that they indicate in which ranges each of the variables appear. The range numbers in which each variable appears are classified into the following groups: Variable used as an enquiry expression, in normally open contacts. / Variable used as an enquiry expression, in normally closed contacts. That means subject to the negation operation. ()

Variable used as an action, in normally open contacts.

(/) Variable used as an action, in normally closed contacts. That means subject to the negation operation.

pg-7

Version 3.0

pg-8

pg-9

2.1 INTRODUCTION . Before going on to describe the different options of the application we shall indicate the elements which are necessary for its correct operation. Configuration: The minimum configuration needed to be able to run the program correctly is: - An IBM PC/XT/AT microcomputer or a 100% compatible or IBM PS/2. - Minimum RAM memory 512 Kb. - Monochrome of graphics monitor, according to MDA, CGA, EGA or VGA standards. - Two disk units or one disk unit plus hard disk (the latter is more recommendable). - RS232C series output (one or two). - Parallel outlet/Centronics for IBM-compatible printer. - Operating system 3.x (3.0 or higher). The Fagorplc program consists of three floppy disks in 5 1/4" format and with a capacity of 360 Kb or three floppy disks of 3 1/2" and 720 Kb, labelled, respectively, as disks no. 1 and 2. As a safety precaution, you may, by means of the COPY command of the Operating System, make a copy of both. Should the files be erased by accident you may use the same command to restore the original contents of the disks.

pg-10

Installation: Once the computer has been put into operation, when the Operating System prompt appears, insert disk no. 1 in drive A and after the A> prompt type: INSTALL The installation program will run and ask you if you are using a hard disk or floppy disks, the working language, working disk, .... After answering these questions, the program will be ready for running. Normally, this procedure will be carried out only once, unless you should wish to change the language or installation disk. Operation: The Fagorplc program is designed to operate from a main menu, from where the main options are selected. In some cases, these options can have others which depend on them. These are called submenus. To choose a specific option, use the cursor movement keys to place the cursor over the desired option which will be shown in reverse video. Once the cursor is positioned over the desired option, press to select. If you are in an option or submenu, the key can be used to return to the previous options or abandon same. In addition, we have in each option or suboption, some specific data to fill in. These pieces of data are called fields, e.g., the name of a program. When it is necessary to fill in one of these you must press when finished. You will use the alphanumeric keyboard of your computer throughout the program. In addition, there is a series of function keys which we describe below: Function keys: These are placed either on the left or on the upper part of your keyboard. They are numbered from F1 to F10, or from F1 to F12, normally. The following are used in the program:

pg-11

Help. When this key is pressed, a reverse-video window will be superimposed on the screen with the help text referring to the point of the application in question. The size of this text is variable, according to the option where it is situated. You may use the cursor up, down, , , , keys to move through the text vertically, from the beginning to the end of the help. When is pressed, the help window disappears. Line change. If you are using a microcomputer with two RS232C series outputs, by means of this key you can indicate to the program which of them the PLC is connected through, i.e., 1 or 2. Should two PLCs be connected to the microcomputer, you would also tell the program which one you wish to make the connection with. Should you establish a line which does not exist or has no physical connection with the PLC. When an attempt is made to connect to it on the “on-line” options, a connection error would be displayed on the screen of your computer. Throughout the program you will see a message on the upper righthand part of your monitor a message indicating which line has been chosen for communication: COM1 (series output one) or COM2 (series output two). Load. In the Commands or Global options in the commands window, F2 allows a program to be sent from the computer to the RAM memory of the PLC. Unload. For the above-mentioned options, F3 carries out the opposite operation, i.e., it receives the program in RAM from the PLC to the computer. Display. In the global option of display and command line, it actuates the display window, allowing access to the menu by means of which the types of elements to be displayced are chosen. "Special"keys:

. is the key which allows us to return from a submenu back to the main menu, as we have described before. It also allows us to exit certain options without running them.

pg-12

+ makes the display window smaller by one row. + makes the display window bigger by one row. in the global option, changes the cursor from the display window to the command line and vice versa. Note: The + sign indicates that both keys must be pressed simultaneously to obtain the specified action. Structure of the application Below, we offer a brief description of how the application is organised within your computer. Distinction is made between users with two disk units or users of hard disks. -floppy disksThe program disk must be in drive A.Drive B will be used as the working drive for the application. -hard diskA directory named plc64 which contains the Fagorplc application programs is created in the disk selected in the installation program. The working programs will be resident in any area you wish to choose. -hard disk and floppy disksThe working programs will bear two extensions: .plc and .lst. The first is obligatory for those source files edited with the editor in question and may be indicated in the parameter options which contain the source program. The second corresponds to program files in PLC format generated from source programs by the syntax verification option. Both can be transmitted to the PLC and the reports themselves can be generated from the program.

pg-13

Connections:

. According to the series output type of your computer, these will be the following: PLC 9-pin male connector

TxD RxD CTS DSR DTR GND

1 2 3 5 6 9 7

PLC 9-pin male connector

TxD RxD CTS DSR DTR GND

1 2 3 5 6 9 7

AT Computer 9-pin male connector Shield 2 RxD 3 TxD 8 CTS 6 DSR 4 DTR 5 GND

XT or PS/2 Computer 25-pin male connector Shield 3 RxD 2 TxD 5 CTS 6 DSR 20 DTR 7 GND

pg-14

pg-15

2.2 GENERAL DESCRIPTION . Among other features, the Fagorplc program allows you to communicate with the Fagorplc, send and receive programs, display the running of these, generate listings of contact diagrams on the source files written for the PLC, verify the syntax of same, and obtain cross references of actuation elements.

pg-16

pg-17

2.3 OPTIONS 2.3.1

MAIN MENU Let us suppose that you have installed the program according to the installation program described in the introduction. Should you have any doubt, check this point. The way to call the program is by typing from the Operating System, once you are situated in the right drive and directory: Fagorplc- hard disk and floppy disks The program loading procedure is initiated and the main menu of the application appears (figure). From here, we can go to any point of same, and likewise, is the last screen which we will see if we wish to leave the application. F1 -- Help F5 -- Line change

Active Line -- COM1

Menu Options 1.- Utilities and Configuration 2.- Edit PLC program 3.- Syntax Control 4.- Reports 5.- Command Line with PLC 6.- Display 7.- Global (Monit + Commands) 8.- End of Program

Select an option

What we have to learn first is the way to go to the different options and the keys we must use to do this.

pg-18

As a general rule, those keys which do not have a specific meaning in the application will remain inactive, i.e.,they will have no effect.series line As in all menus the cursor up and down keys allow us to move vertically through the menu. The specific position in which we find ourselves at a given moment is indicated by the cursor, which appears as a horizontal bar in reverse video. Movement through the menu is circular, i.e., when we reach the last item the cursor will continue its movement at the top of the menu. The function keys which are available at that moment are shown on the top line of the screen. In this case and . By pressing these we shall obtain a general help menu for this menu or a change of series output which we wish to use for communicating with the PLC. To exit from help, press . The result of pressing appears in the upperright part of the screen, indicating the series line established. To select a specific option, place the cursor on it and press . You can place the cursor with the arrow keys or by typing the option number which appears on the menu directly. On the lower part of the screen, there is a message indicating what action you must take. In this menu remains inactive. Therefore, to finish the program, you must choose the End of Program option. Let's go on to the first option: Utilities and Configuration.

pg-19

2.3.2

UTILITIES AND CONFIGURATION This is the first option on the main menu. We are presented with a submenu, with three sub-options. The last of these is to return to the previous menu, i.e., the main menu. You can also return to the previous menu by pressing the key.

Utilities: The first option of this menu calls a series of DOS programs. To choose this, place the cursor on the option and press . By pressing we return to the main menu.

F1 -- Help F5 -- Line change

Active Line -- COM1

Utilities and Configuration

1.-

Utilities

2.-

Configuration

3.-

Previous Menu -

Select an Option - floppy disks Only these commands are available: -

Copy files. Directory. Execution of commands. Spooler control.

pg-20

- hard disk Accessibility of all commands. To select a command, place the cursor on this option and press . Commands which belong to the Operating System itself have to be indicated with the correct parameters, i.e., in the same order and exactly as specified in the reference manual of the Operating System. Apart from these, there are two special options which are as follows: Execution of commands and spooler control, which we describe below: Execution of Commands: Allows any other DOS program you may have in your computer to be called from the program. F1 -- Help F5 -- Line change DOS Utilities 1.- File copy 2.- Backup 3.- Restore 4.- Directory 5.- Diskette formatting 6.- Execution of Commands 7.- Control Printing Spooler 8.- Pervious Menu

Operating System Utilities

Active Line -- COM1

pg-21

In this option, if we type: command

. will make a temporary exit to DOS. In order to return to the program, you must type: exit You must bear in mind that in order to run a program from DOS with this option, the RAM memory required by the program you call must be be lower than that left by the Operating System, the resident programs you may have installed and the Fagorplc program. The way to calculate this is as follows: - Memory occupied by the Operating System: 50Kb approx. - Memory occupied by the Fagorplc program: 400Kb approx. Therefore, if your computer has 512Kb of RAM memory you cannot call programs which occupy more than 112Kb. If the computer has 640Kb it will have 190Kb of RAM memory available. You must bear in mind that the memory occupied by the Operating System depends on the version you are using. On the other hand, the resident programs you might have installed also take up part of the memory. A simple method to know the amount of memory free for working is to use the DOS chkdsk command which gives you this information. You may call it using this option and check that the memory which is still free is sufficient to load the program you wish to run. Lastly, remember that it is necessary to indicate the complete path in order to call the program, unless this is indicated in the autoexec.bat start-up file. Should you not do this, a wrong command message will be displayed.

pg-22

Spooler Control: When making printouts, the PRINT command of the Operating System can be used to establish a spool. This allows us to continue executing other options, without waiting for the printer to finish the printout. This command can be included in the auto start-up file, autoexec.bat, or be called just before calling the Fagorplc program (consult the DOS reference manual for more information).

F1 -- Help F5 -- Line change

Active Line -- COM1

Printing Spooler Control

1.- Display listings of the printing spooler 2.- Eliminate a listing from the printing spooler 3.- Eliminate all listing from the printing spooler 4.-Previous Menu

Operating System Utilities The Fagorplc program detects automatically if the spool is installed, in which case, allows us to make the following operations, as sub-options: - Display the files in the spooler: This enables us to see which files are waiting to be printed. - Eliminate one file from the spooler: We can erase a file which is waiting to be printed. It will be sufficient to indicate its name. The remaining files stay in the spooler. - Eliminate the spooler: We cancel all the files which are in the spooler waiting to be printed. If the spooler is not installed, this option does not appear in the utilities menu.

pg-23

Configuration: Second option on the menu. The default hardware elements of the system and editor are established. To choose this option place the cursor over it and press . By pressing we return to the main menu.

. We can move through the different lines on the screen by means of the cursor up and down keys, or by means of the home and end keys. By pressing the option is exited without making any modification. If we press on any line of the screen, the data which is being displayed is recorded and is assumed, by default, in the application. Active Series line: By means of this we determine which will be the default communication line with the PLC. We can choose between the first series port: COM1 or the second: COM2, by typing 1 or 2. Printer Active: This establishes the parallel output with the printer for the report option. By typing 0 the first output is chosen, 1 the second. Active Unit: This establishes the disk unit or disk activated to display directories. Name of Editor: This establishes the way to call the editor which is used to create the PLC programs in the Edit PLC Program option. You must include the complete path to call the editor, unless an auto start-up file, autoexec.bat, has already been established. For example, if we are using the Norton editor which is stored in the editor directory of disk C, type: c:\editor\ne If, on the other hand, we use the edlin editor which is included in the Operating System and this is stored in a DOS directory in disk C, type: c:\dos\edlin You may use either capital or small letters.

pg-24

2.3.3

PROGRAM EDITING

This is the second option on the main menu. In this option we will use the editor which we have indicated in the configuration option for editing “source” programs, which must bear the .plc extension or those which we may have generated from the syntax verification option with the .lst extension. If the source file is new, it will sufficient to type its name and extension in the name window. The editor is called and is stored in the directory in which it has been placed and which appears on the upper part of the directory window. F1 -- Help Name:

test1.PLC_____

Name

Active Line -- COM1 C:\PLC64 Size Date Hour

command.com 26075 english.msg 55897 fagorplc.bat 25 install.exe 26829 patch.exe 13395 plc64.exe 226779 plc64.par 39 test1.plc 77 test2.lst 4566

13-07-89 18-03-87 16-06-89 05-04-89 04-01-80 02-12-88 24-05-89 13-07-89 13-07-89 13-07-89

14:10 12:00 08:42 23:24 12:36 12:06 10:07 14:10 14:20 14:21

Select program to be edited, to exit

If the file is edited (.plc) or generated (.lst), you may use the directory window to find it, as is described below: To exit the option, type .

pg-25

On the right, the directory window appears which displays the different files, directories, ... of the unit indicated in the configuration option. You can move through this window with the cursor up,down,, , , . Some names indicated between the < and > symbols appear in the window with the extension. These are the subdirectories of the directory in which it is situated. By placing the cursor in these and pressing we enter the directory of the chosen subdirectory. To go from subdirectories back to the main directory we select the . The prompt for the unit and subdirectory in which we are moving is shown at all times at the top of the window.

. In the same way, we can select the name of the file to edit directly, just by typing it - including its path, if we are in a different directory from the one we see in the display window - directly in the name window. The PageUp> and .

pg-48

To move within one window or another, we use the keys. : :

moves to the next window on the right. moves to the next window on the left.

The indicator of the variable of the first row of the window in which we are situated is in reverse video. When we have gone through the first range of windows, we then move through the second range. If we have reached the last window of the second range, by pressing we will be placed in the first window of the first range. With the cursor in the first window of the first range, by pressing we will be placed in the last window of the second range. The ranges of the variables have the same format as individual windows, except for the record window. In this window, the records are organised in two columns, the first of these being the one which appears under column 0, i.e., if we are displaying the record indicated in the row as R003, we will have the decimal value of record 3 in the first column of that row and in the second, the decimal value of record 4. In the following row, we will have the R005 index, therefore the first column will indicate the decimal value of record 5 and the second column of that row will indicate the decimal value of record 6, and so on. The information which appears in the windows which make up the global window are as follows: -

input window: logic status of inputs. output window :logic status of outputs. counter window: logic status of inputs and decimal value of the count. mark window: logic status of marks. record window: decimal value of records. timer window: logic status of the inputs and decimal value of time due for timing.

Note: As you will note, following the sampling values, as we increase the range of the display windows, this increases between values of under about 50 msec for windows of variables which are consulted by ranges: inputs, outputs, marks up to values of nearly 1.9 sec. in displays by means of global window. The operation of the computer requires that great attention be paid to displays in detriment of the commands which we give to the

pg-49

program via the keyboard, therefore we must bear in mind that for long display times the response to the key we press will be delayed a time equivalent to the sampling. By bearing this in mind, we avoid having to keep pressing the key for a long time, as its effects will take as much time to take effect as that of sampling due to the number of characters it might have sent while being pressed. This will avoid unwanted movement within the windows. Lastly, we recommend that resident programs such as Sidekick should not be used in the display options as the results may be unpredictable.

. If during the display process a communications break should occur, the program detects this sending a communications error message and exiting to the menu. One of the most frequent causes which can cause this error is a physical disconnection between the series outlet and the PLC input. Check that the connectors are correctly fitted and call the program again.

pg-50

2.3.8

GLOBAL - DISPLAY AND COMMAND LINE The last option for communications with the PLC allows simultaneous operation of the two previous options of sending commands and establishing windows for displaying variables. To choose this option, position the cursor and press the key. By pressing we return to the main menu. The first thing we must pay attention to is the initialization and connection process with the PLC described in section 5. Once the connection has been made satisfactorily we enter the command line and the # prompt is displayed, indicating that we can send commands following the processes described in the above-mentioned section. On the top line of the screen we have the active function keys for this option. We will see that there is a function key which calls the display function. By pressing this, the menu for choosing the display window will appear.

F1 -- Help F2 -- Load F3 -- Unload INPUTS

F4 -- Monit. RS -- COM1 OUTPUTS

0 1 2 3 4 5 6 7 8 9

COMANDO COUNTERS

0 1 2 3 4 5 6 7 8 9

E U D P S

C

I08_

1 1 1 1 1 1 1 1 1 1 000_

I09_

1 1 1 1 1 1 1 1 1 1 001_ 0 1 0 0 0 1 0 1 0 0 C002 1 1 1 1 0 -00841

I10_

0 0 0 0 0 0 0 0 0 0 002_ 0 1 0 0 0 1 0 1 0 0 C003 1 0 1 1 0 -00841 MARKS

1 0 0 0 0 0 1 0 0 C001 1 1 1 1 0 -00841

REGISTERS

0 1 2 3 4 5 6 7 8 9

TIMERS

0

1

E R G S M

1 1 0 0 1 1 1 0 1 R001

02193

00258

T001 1 1 1 1 T 00837

M001_ 0 1 0 1 0 1 1 1 0 1 R003

00000

00000

T002 1 1 1 1 T 00829

M002_ 0 1 0 0 0 1 0 1 0 0 R005

00000

00000

T003 1 1 1 1 T 00821

M000_

Sample time = 1265 milliseconds 1 #T3 S=1 ET=56452 TO=08648 M=T G=1 E=1 R=1 #C2 S=0 C=01159 U=1 D=0 E=1 P=1 #M1.4 1100 #

TO

pg-51

By choosing the desired window, the monitor is divided into two areas. In the upper part, we have the display window and in the lower, the # prompt for sending commands. The command line area varies according to the size of the command window. F1 -- Help Name:

F2 -- Load

F3 -- Unload F4 -- Monit. RS -- COM1 C:\PLC64 test1.PLC__________ Name Size Date

0 1 2 3 4 5 6 7 8 9 I08_

1 1 1 1 1 1 1 1 1 1 000_

I09_

1 1 1 1 1 1 1 1 1 1 001_

I10_

0 0 0 0 0 0 0 0 0 0 002_ MARKS 0 1 2 3 4 5 6 7 8 9

M000_

0 1 0 0 1 1 0 1 1 R001

M001_ 0 0 0 1 1 0 1 0 1 1 R003

command.com english.msg error.msg fagorplc.bat install.exe patch.exe plc64.exe plc64.par test1.lst test1.plc test2.lst

26075 55897 114 25 26829 13395 226779 39 58 77 4566

COMANDO

13-07-89 18-03-87 16-06-89 13-07-89 05-04-89 04-01-80 02-12-88 24-05-89 13-07-89 13-07-89 13-07-89 13-07-89

Hour 14:10 12:00 08:42 14:22 23:24 12:36 12:06 10:07 14:10 14:22 14:20 14;21

M002_ 0 0 0 1 0 0 0 0 1 0 R005 Sample time #T3 S=1 ET=56452 TO=08648 M=T G=1 E=1 #C2 S=0 C=-01159 U=1 D=0 E=1 P=1 #M1.4 1100 # #

The operating principles in both areas are those which have been described in the previous paragraphs. The only question we must consider is that on the top right-hand side of the screen we have an indicator in reverse video which indicates in which area we find ourselves: Display or Command. To go from one area to another we press the tab key. Being situated in the command area, if we press we go directly to the main menu. Being situated in the display area, by pressing , we leave the display menu, where we can choose another window or by pressing once again, return to a single command area. We have to bear in mind that if we are working with the two options simultaneously and wish to write a command, the time it takes for this to appear written in the # command prompt depends on the sampling time of the display area. In fact, a scan is made of the display window between two command line keys.

pg-52

pg-53

2.4 CONVERSION OF MNEMONIC CODE TO CONTACT DIAGRAM . DIRECTIVES: .NOP .PRG

General Form

.AL(1/8)

DIRECTIVE

.PE(1/4)(1/65535)

Examples:

.OWD

PRG

.RER

AL2

.CY1

PE 1 1000

.END

REA

.REA

L45

.IMA .L(1/255)

ENQUIRY EXPRESSIONS SINGLE: I(1/255) O(1/255)

General form: Expression

M(1/2047) 15 T(1/255)

/Expression

Examples: M100 B11R200

pg-54

C(1/255)

B12 R79

B(0/15)R(1/239)

FLANK DETECTION: M2009 I(1/255) DFU

/DFU O(1/255)

DFD

M(1/2047)

O56 DFD

COMPARISON:

T U CP

C

GT GE EQ NE

R S #

T

CPU A EQU B

C R

LE LT

/CPS A EQU B

#

BINARY ACTIONS ASSIGNMENT: I O M BR TEN TRS

General form: (Action) (/Action)

pg-55

TG(1/7) CEN CUP CDW CPR

Examples: B11 R4 TEN 20 ( / ) ( ) (TG1 4)

(/TG1 12)

10 (SET)

B7 R100 (/RES)

M210 (CPL)

I51 (/CPL)

. CONDITIONED: I O M BR

SET RES CPL

ABORT ACTIONS JMP L(1/255) CAL L(1/255) RET

(JMP)

(/CAL)

ARITHMETIC ACTIONS I O M MOV T C R #

NG

AD SB ML DV MD

U S D

U S D

I O M R

0 1

R(1/239)

R R (1/255)

0 1

16 12 8 4

R17 (NGS)

R (1/239)

T1 108 R20 (A MOV B) M100 004 I5 (A /MOV B)

R34 (/NGD)

100 R10 R8 (A MDD B=C) 40 4 R3 (A /DVU B=C)

pg-56

LOGIC ACTIONS ROTATION TO THE RIGHT OR LEFT R 1 R L 2 (/RR2)

(RL1)

AND, OR, XOR ACTIONS: AND OR XOR

R #

R #

R

R1 R3 R10 HFF 50 R6 (A AND B=C) (A /XOR B=C)

SPECIAL ACTIONS:

ERA

I O M T C R

1/255 1/255 1/2047 1/255 1/255 1/239

1/255 1/255 1/2047 1/255 1/255 1/239

WDG(1/65535) E(1/255)

MSG(1/255) SYS (0/15) R(1/239)

I1 255 (ERA) C1 30 (/ERA)

65535 (/WDG) 25 ( E )

( MSG) 12 R15 ( /SYS)

Note on the intermediate signal SWITCH: SW is generated automatically to link instructions which cause overflows in graphics representation, and it is also generated to resolve complex instructions.

pg-57

The graphics representation range, 24 rows and 80 columns, allows up to 6 AND’s and 8 OR’s to be represented. When the representation exceeds these dimensions we say that an overflow has been produced which generates a switch. Cases of switch generation: 1.2.3.4.5.-

Overflow of AND’s (>6) Overflow of OR’s (>8) in enquiry instruction. Overflow in the actions of an expression (>8) XOR function (generates xswitch) Negation of complex structures.

The maximum number of switches generated per expression is 10.

. In the case of negations, the maximum is 4 per negation.

pg-58

pg-59

2.5 EXAMPLES OF LISTINGS OF THE APPLICATION In the following sheets, a summary of the listings which may be obtained with the report option is offered. The listings presented here are limited to the first page, and are as follows:

. - Listing of an .LST extension source file. - Listing of a contact diagram. - Listing of cross references for inputs (the format is identical for outputs, marks and records. - Listings of cross references for counters. - Listings of cross references for timers. - Listings of cross references for record bits.

As you will see, the information in them varies according to these groups. Those stages which correspond to the syntax errors in the source file will not be indicated in the contact diagram listing. The different types of switch will be generated automatically according to the discussion established in the reports chapter. In the input, output, etc. listings, the variable used appears in the left-hand column and the lines of the program where it is used in the central columns. The number of the counter or timer appears in the left-hand column of the listings of counters and timers, their elements in the central column and in the right-hand column, the lines of the programme in which it is used together with the assigned value, if any. If any element is not used, this is indicated with: ***Not used***. Lastly, the record used appears on the left of the record bits, in the middle, bit (0-15) and on the right, the line of the programme in which it is used, if not, it is indicated by: ***Not used***.

pg-60

27/7/1.989

APPENDIX B

LISTING .

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57

CY1 M2047 (1) = NOT TRS 1 = TRS 1 = NOT TRS 2 = TRS 2 = NOT TRS 3 = TRS 3 = NOT TRS 3 = TRS 3 = M2047 (1) = NOT TRS 4 = TRS 4 = NOT TRS 5 = TRS 5 = M2047 (1) = NOT CPR 1 - 1 = CPR 1 - 1 = RES M105 = RES M200 = RES M201 = M2047 (1) = RES M202 = MOV B000000000000000000 01 0016 = MOV B000000000000000000 017 0016 = MOV B000000000000000000 M100 0016 = MOV B000000000000000000 N116 0016 = CAL L1 = M2047 (1) = MOV R51 R12 0016 = MOV R51 R50 0016 = MOV 0 R10 0016 = MOV 0 R30 0016 = NOT M105 (0) = SET 017 = NOT M105 (0) OR NOT 120 (1) = RES 024 = I12 (0) = NOT 025 END PRG REA M2047 (1) = MOV R12 R50 008 = MOV R10 R30 108 I19 (0) = JMP L11 CPU R50 EQ R51 (1) = JMP L11 = M116 (0) = JMP L12 = M2047 (1) = RES 011 = SET 012 = SBS R50 R51 R60 = NOT TG1 3 500

pg-61

27/7/1.989

APPENDIX B

LISTING

CY1

M2047

TRS 1 (/) TRS 1 () TRS 2 (/) TRS 2 () TRS 3 (/) TRS 3 () TRS 3 (/) SW0 ()

SW0

TRS 3 ()

M2047

TRS 4 (/) TRS 4 () TRS 5 (/) TRS 5 ()

pg-62

27/7/1.989

INPUT XREF.

-I-

APPENDIX B

LISTING .

VARIABLE LOCATION

-

PROGRAM

LINES

I001

0164

0337

357

I002

0326

0338

0370

I003

0080 0136

0085 0330

0103 0339

0118

I004

0074

0077

0113

0340

I005

0342

I008

0348

I009

0175

0178

I010

0176

0187

I011

0182

0191

I012

0040 0323

0172

0181

0190

I013

0292

I014

0108

I015

0225

I016

0247

I017

0303

I018

0289

I019

0048 0180 0279 0363

0106 0189 0324

0142 0223 0356

0157 0245 0359

I020

0038 0238 0263

0217 0246 0308

0224 0261 0316

0239 0265

I021

0144 0333

0159

0220

0283

0364

0115

-

pg-63

27/7/1.989

COUNTER XREF.

-C-

APPENDIX B

LISTING

COUNTER

ELEMENT

LINES (Description)

001

CPR (Preselection)

0413--> Preselection value 0414 --> Preselection value 0464 --> Preselection value 0465 --> Preselection value 0757 --> Preselection value 0755, *** Not Used *** 0753, *** Not Used***

C CUP CDW CEN

(Status/Value) (Count up) (Count down) (Enable)

= -1 = -1 = R60 = R60 = -1

pg-64

27/7/1.989

TIMER XREF.

-T-

APPENDIX B

LISTING .

TIMER

ELEMENT

LINES (Descripción)

001

TG T TEN TRS

(Start) (Status/Count) (Enable) (Reset)

1040 --> TG2 /Time const. = 130 1042, *** Not Used *** 0775, 0776,

002

TG T TEN TRS

(Start) (Status/Count) (Enable) (Reset)

1067 --> TG1 / Time const.= 2000 1069, 1072, *** Not Used *** 0777, 0778,

003

TG

(Start)

T (Status/Count) TEN (Enable) TRS (Reset)

0829 --> TG1 / Time const.= 500 0812 --> TG1 / Time const.= 500 0853, 0858, *** Not Used*** 0779, 0780, 0781, 0782, 0872,

004

TG T TEN TRS

(Start) (Status/Count) (Enable) (Reset)

1121 --> TG1 / Const. tiempos= 100 0867, 0899, *** Not Used *** 0784, 0785,

005

TG T TEN TRS

(Start) (Status/Count) (Enable) (Reset)

*** Not Used *** *** Not Used *** *** Not Used *** 0786, 0787,

pg-65

27/7/1.989

Record: 060

BIT XREF.

Bit 060/00 060/01 060/02 060/03 060/04 060/05 060/06 060/07 060/08 060/09 060/10 060/11 060/12 060/13 060/14 060/15

-BR-

APPENDIX B

Lines (Description) *** Not Used *** *** Not Used *** *** Not Used *** *** Not Used *** *** Not Used *** *** Not Used *** *** Not Used *** 0060, *** Not Used *** *** Not Used *** *** Not Used *** *** Not Used *** *** Not Used *** *** Not Used *** *** Not Used *** *** Not Used ***

LISTING

pg-67

2.6 INSTRUCTION EDITOR 2.6.1 INTRODUCTION The Fagorplc program instruction editor is a line by line editor with commands which are operated using the function keys -F1 to F7- of your computer. The programs can also be checked for syntax which permits a rapid identification and correction of errors. It is an ASCII editor, that is to say that it enables you to read and export program files from and to other programming editors which accept this format, e.g. Norton Editor, Microsoft Quick-C, Wordstar, Edit, ... The editor accepts source programs with the .PLC and/or .LST extension - PLC format-. Likewise when a source program (.PLC) is edited and saved, the file is automatically generated in PLC format (.LST) as is an image file (. PL) as a backup copy of the first, so that you can always return to a program previous to that in which the last modification was made. To do this you have to rename/ copy the image file .PL to one with a .PLC extension using the ren/copy of the operating system.

pg-68

2.6.2 SELECTING A PROGRAM Once you have selected the program editing option in instructions or mnemonic language, the directory window will appear for selection of the program to be edited. The header of this window is the work area (disk and directory) where the programs are stored by default. In the window all the files stored there appear with their size, date and time of their last updating. The files with the . extension correspond to the names of the subdirectories which are in the work directory. The . directory allows you to go back from one directory to the previous one which contains it until you reach the root or main directory of the disc where the program is installed. To enter a file just move the cursor to it using the following keys: , , , , , and press . If you select a subdirectory, the directory window is updated with the files contained in the directory selected. If you want to start editing a new program, directly key in its name and .PLC extension. If you want to store it in a different directory from the current one, with the name key in the complete path or move to the directory using the window and choosing the right . directory with the cursor, using the aforementioned keys and then press . If you want to store it in another disk you should specify the disk and complete path with the name of the file. The only restriction that there is for storing programs is that the directory where you are going to store the program has been created previously. Examples:

pru.plc \prog\pru.plc a:pru.plc d:\prog\pru.plc

- editing in current directory - editing in prog. directory - editing in floppy disk in drive A - editing in prog. directory in drive D.

If the program already exists, just move the cursor to the program name, provided that it has a .PLC or .LST extension and press or key it in directly as explained in the previous section. Note: If you are not familiar with the terminology and meaning of the directory structure in the Operating System we recommend that you work with the default directory that is provided by the application. To understand in more detail the organization of the hard disks consult the users manual for the Operating System of your computer. Remember that the directory window only works in the disk in which the installation was carried out. The cursor movement keys for the directory window are: , , , , , .

pg-69

2.6.3 INSIDE THE EDITOR Note: Users with portable computers or color monitors can choose the combination of tones or colors with which the display is clearest by means of the combination of the following keys: + , pressing the space bar to select the various colors offered by your adaptor. To retain the configuration of tones/colors press: + . If you wish to modify them again repeat the process until you have made the choices you require. You will see a line at the top of the screen where the name of the program being edited and a mode indicator appear. By default the overstrike mode is the operative mode. By pressing the key repeatedly you can toggle between the overstrike and insert modes. The difference between these modes is explained later. You will also see an empty window of 15 lines immediately below this line, this is called the display window. This window is empty as the program you are going to edit does not contain any lines yet; as you enter lines they will appear in the window. In the lower half of the screen there is a new window in which the cursor appears. This is the editor’s work window where lines are edited/ modified, commands to be run are written, etc ... this is called the editing window. The bottom line gives the menu of the editor’s command or function keys. Each of the commands or functions corresponds to a function key and these keys must be pressed to execute the corresponding command or function. Note that there are two “special” commands:

- Interactive help function which allows you to receive information about the command executed at any moment.



- Menu movement function, represented by a horizontal arrow : ->. Using this function you can access the rest of the editor’s commands.

The editor’s menu is circular and is represented by three lines on the screen, so that using you can move from one line to the next and when you get to the last line you will then be returned to the first line of the menu. The editor’s command menu is as follows: 1st line: EDIT MODIFY SEARCH REPLACE DELETE 2nd line: MOVE COPY SAVE EDIT FILE VALIDATE 3rd line: PRINT SAVE ROUTINE LOAD ROUTINE RENUMBER EXIT

pg-70

The commands function for a line, e.g. MODIFY, or for a block of lines or program block: MOVE, PRINT. The commands can be interrupted with the key. EDIT: Allows new lines to be entered in the program. MODIFY: Modifies the content of a line which has already been edited. SEARCH:

Locates one/several characters in a program, moving the cursor directly to the selected line.

REPLACE: Selectively replaces one or more characters in a program. DELETE: Deletes one or more lines in a program. MOVE: Moves one or more lines in the program. COPY: Duplicates one or more lines in the program. SAVE: Records the program with the edited lines without exiting the editor. EDIT FILE:Brings the contents of a new program from the memory, allowing the previous one to be saved. VALIDATE: Checks the syntax of the program being edited. PRINT: Print out of one or more lines of the program. SAVE ROUTINE:Allows part of the program being edited to be saved as a separate program. LOAD ROUTINE:Allows another previously saved program to be added to the program being edited. RENUMBER: Renumbers the program line numbers according to the values determined. EXIT: Ends the editing process saving or without saving the edited program. If saved, the program is automatically checked for syntax. As you can see, in some options you must determine the block of lines which you wish to work with or indicate the characters with which you want to carry out an operation. In these cases the commands themselves contain the subsequent commands necessary to do this as suboptions. There follows a more detailed description.

pg-71

2.6.4 HOW THE COMMANDS OPERATE EDITING:

This command is activated by pressing in the first line of the menu. It is concluded by pressing instead of entering a new line.

When you begin the program, the lines are automatically numbered in units of 10, starting with line 10. If you want to insert new lines at the end of an already edited program, move the display window cursor to the last line edited and press , the new line to be inserted will appear with the number of the last line in the program plus 10. If you wish to insert a new line between two lines of an already edited program, just press and enter a line number which is between the two where you want to make the insertion. Whilst the display window cursor is at a line other than the last line, the command does not number the line you want to insert. The cursor motion keys in the display window are: , , , , , . Within a line being edited you can move the cursor forward or back using the cursor positioning arrows. You can insert characters from the point where you position the cursor if you are in insert mode; in overstrike mode the characters will be written over the previous ones. By pressing at the end of the line, this line goes to the display window, the number of the next line to be edited is generated, except when you are inserting between lines. If you press without having pressed before finishing the line, the command is deactivated and the line you were inserting is lost. MODIFY: This command is activated by pressing in the first line of the menu. It is terminated by pressing , if you press the modification made is lost. To modify a line move the display window cursor to the line to be modified and press . The line selected will appear in the editing window.

pg-72

Make the changes using the normal editing keys, deleting, replacing characters, ... To send the line to the display window press and the line is modified. SEARCH: This command is activated by pressing in the first line of the menu. SUBOPTIONS: Line No. text

- search for line no. - search for text.

There are two possibilities, location of a specific line or location of a group of characters. The first possibility is used as a fast way of moving the cursor to a program line, the contents of which you may want to see and then modify. The second possibility is for when you are looking for a mark, variable, instruction, and you want to know where it is in the program. To go to a line press again and then enter the number of the line you require; press to start the search. If it cannot be found a message appears on the screen. The command is still active, so with you can move the cursor to the end of the command and change the number of the line being searched for. By pressing the command is executed again. Press to end the command. The text search is carried out by entering the text and pressing . You can use the mask * to locate occurrences of a partial text. For example: I17

- to locate the occurrences where this specific input appears.

I1*

- to locate the occurrences where the inputs from I10 to I19 appear.

B*

- all the occurrences which have the character B.

MOV - all the occurrences which have this instruction. The format of the mask is: text* To go from one occurrence to the next just press . The search through the program is cyclical; once the last occurrence in the program being edited has been located the search continues to find the next occurrence from the start of the program. Whilst the search is in progress the following message appears on screen: processing ...

pg-73

To end the search press . The command is still active, so the text to be located can be changed or can be pressed again to terminate the command.

. REPLACE: This command is activated by pressing in the first line of the menu, entering the text to be replaced the text which replaces it. SUBOPTIONS: - to the end - replace - do not replace If the text to be replaced is not found the command is terminated. If the text is found you are presented with the suboptions of replacement to the end, or selective replacement. If you choose replacement to the end, all the occurrences are replaced and the command is terminated. If you choose replace, the text is replaced by the new text and at the next occurrence you are presented with the same suboptions. If you select do not replace the text remains unchanged and at the next occurrence you are presented with the three suboptions. This command works starting from the line at which the cursor is located in the display window. It remains active until the last occurrence of the text to be replaced, when the command is terminated. If you press when this command is active it is deactivated and the occurrence at which the cursor is positioned is not replaced. DELETE: This command is activated by pressing in the first line of the menu. It is terminated by pressing . SUBOPTIONS: - delete line. - delete block of lines Deleting line by line: By pressing you delete the line at which the cursor is located in the display window, the cursor moves to the next line. As the command remains active if you press again you delete this line and so on. You can also move the cursor to a new line to be deleted and press . The command is terminated when you press . Deleting groups of lines (blocks): Press and move to the first line of the block to be deleted, press and move to the last line in the block and press . The block to be deleted appears in reverse video. By pressing the block is deleted and the command terminated. At any moment during this suboption you can press which will terminate the command without deleting anything.

pg-74

MOVE: This command is activated by pressing in the second line of the menu. The command terminates when the text has been moved. Press to abort the command. SUBOPTION: first line last line destination This command is for moving blocks of lines from one place in the program to another. If the block has the same first line and last line number you are only moving one line. When the command is executed the editor automatically renumbers all the lines. By pressing the line moving command is activated, move the cursor to the first line of the block to be moved, press ; move the cursor to the last line of the block to be moved and press . The block to be moved appears in reverse video. Move the cursor to the line from which you wish to place the block, press and the block will be moved and the command terminated. The line where the block is moved to, is displaced by the block and appears after it. You should bear in mind that: - The block is moved in line number order regardless of how the first and last lines are set. - A block cannot be moved to a line within the block established. - If you want to move the block to the end of the program, you must previously edit a line as the last line in the program and move the block to this line, and afterwards delete the empty last line. COPY: This command is activated by pressing in the second line of the menu. It is terminated when the copying is completed. Press to abort the command. SUBOPTION: first line last line destination This command is for copying blocks of lines from one place in the program to another. If the block has the same first line and last line number you are only copying one line. When the command is executed the editor automatically renumbers all the lines.

pg-75

By pressing the line copying command is activated, move the cursor to the first line of the block to be copied, press ; move the cursor to the last line of the block to be copied and press . The block to be copied appears in reverse video. Move the cursor to the line from which you wish to place the block, press and the block will be copied and the command terminated. The line where the block is copied to, is displaced by the block and appears after it.

. You should bear in mind that: - The block is copied in line number order regardless of how the first and last lines are set. - A block cannot be copied to a line within the block established. - If you want to copy the block to the end of the program, you must previously edit a line as the last line in the program and copy the block to this line, and afterwards delete the empty last line.

SAVING: This command is activated by pressing in the second line of the menu. It is terminated when the program has been saved. Press to abort the command. SUBOPTION: By pressing a current copy of the program being edited is saved to the disk. This process should be carried out periodically as a safety measure to guard against power failures and disconnection of equipment which mean the loss of the program being edited. No syntax check is carried out. EDIT FILE: This command is activated by pressing in the second line of the menu. It is terminated once the file is edited. Press to abort the command. SUBOPTIONS: This allows a new program to be edited without quitting the editor. Press to obtain the directory window from which you can choose the new file. Before editing the file selected you should indicate whether or not you wish to save the one you are editing by pressing Y or N.

pg-76

VALIDATE FILE: This command is activated by pressing in the second line of the menu. It is terminated when the file has been validated. Press to abort the command. SUBOPTION: This command makes a syntax check of the file being edited. In every line in which an error is found, a message appears indicating the type of error and the line appears in the editing window. This allows the error to be corrected. By pressing the checking goes on to the next line with an error, where the process is repeated. Bear in mind that: - If you modify a line with an error during checking, the line modified is not checked to see if it is correct or not. Therefore you should modify lines and run the validate command again to ensure that the modifications have corrected the errors. - There are errors which may originate in lines prior to that indicated by the checker, a typical example is an action without a corresponding expression. - If you see that the line indicated is correct, look for errors of this type. - Another type of error is that of defined labels for which there is nothing corresponding, the checker runs through the whole program and gives an error message and the number of the label it refers to. PRINT:This command is activated by pressing in the third line of the menu. It is terminated when printing is completed. Press to abort the command. Either part or all of the file being edited can be printed. SUBOPTION: first line last line Press to activate the command, move the cursor to the first line of the block to be printed, press ; move the cursor to the last line of the block to be printed and press . You have now established the block. Press to execute the command.

pg-77

If the printer is not connected an error message will appear. If you want to cancel the print command press . If you connect the printer and press the command is executed.

. The number of lines per page and the active printer are determined in the general program configuration. SAVE ROUTINE:This command is activated by pressing in the third line of the menu. It is terminated when the routine has been saved. Press to abort the command. SUBOPTION: Routine name first line last line This command allows you to save part or all of the program being edited under a different name. This command linked to that of LOAD ROUTINE gives the possibility of reusing parts common to different programs, improving the structure. When you press you will be asked for the file name under which you want to save the program block. Move the cursor to the first line of the block to be saved and press ; then move the cursor to the last line of the block to be saved and press . The block is now established. Press to execute the command. Bear in mind that: - By default the program block will be recorded on the disk and in the default directory which is assumed when the Fagorplc program is installed. - If you want to save it in another directory and/or disk you should indicate the complete path where you wish to store this file. For example, after pressing you can enter as a name: a:testl.plc c:\routines\testl.plc d:\routines\test\testl.plc

- saved in floppy in drive A - in drive C, routines directory - in drive D, routines directory, test subdirectory

- If a file with the same name is found in the place chosen to save it, the following message appears: File already exists. Press to replace the old file with the new one. Press to abort the command and repeat with a new name.

pg-78

LOAD ROUTINE:This command is activated by pressing in the third line of the menu. When the routine has been loaded the command is terminated. Press to abort the command. SUBOPTION: This allows you to insert one program into another. The command works in a similar way to COPY, bearing in mind that you are copying a file previously saved on the disk. Press to activate the command. Move the cursor to the line where you wish insert the file and press . The directory window will appear, indicate the file name either using the cursor or keying it in, then press . The line where the cursor is located is displaced by the file inserted and appears after it. The program being edited is automatically renumbered at the end of the insertion process. Bear in mind that: - If you want to insert a file at the end of a program, you should previously edit a line as the last line of the program and insert the file at this line. Afterwards delete the empty last line. RENUMBER:This command is activated by pressing in the third line of the menu. It is terminated when the renumbering is completed. Press to abort the command. SUBOPTIONS: -renumber with first number 10 and intervals of 10 first numberinterval - renumber with first number and interval set by user (1 to 10) By default, the correlative numbering assumed by the editor is in intervals of 10. This numbering is used automatically in different commands: EDIT, COPY, MOVE, LOAD ROUTINE. This can be modified, if required, by specifying a first number and a different interval, always between 1 and 10. Bear in mind that after renumbering in one of the commands mentioned, the line numbers, by default, return to intervals of 10.

pg-79

EXIT: This command is activated by pressing in the third line of the menu. Press to abort the command. SUBOPTIONS:



- do not save the program being edited - save the program being edited

Note: If you end the editing session without saving - - all the work done in the session will be lost.

. When you end the session by pressing , saving the work done, an automatic syntax check is carried out, with the number of errors appearing on the screen. Obviously if you have not finished your program you may ignore this information.

pg-80

2.6.5 ADVANCED OPERATION: EDITING COMMANDS You already know that by pressing you can cancel any command and return to the menu line. This is the normal procedure if you have chosen the wrong command and wish to abort before carrying it out. However, the commands, except EDIT and MODIFY, and their various suboptions appear in the editing window. This allows you to work on the commands line as if it were a line of text, to vary the suboptions or even directly delete them whilst editing them, using the keys: , , . For example: Suppose you want to find the mark 2047 first of all and then the input 12. You could carry out the following sequence: -

Press in the first line of the menu. Key in M2047 which will start the search process. Press which will terminate the command. Key in to reactivate the SEARCH command. Key in 12 to start the search process. Press to terminate the command.

Or taking advantage of command editing: - Press in the first line of the menu. - Key in M2047 - to move to M2047, when you want to end the search for this function. - Key in 12 and delete the rest of the characters - Press and the search process begins. - Press to terminate the command. As you remain in the search operation you can directly vary the element to be found, and by means of execute the search. You thus save one step. Another useful example is changing a block if you have made a mistake in establishing it. Just use and move to the first and/or last line, using , , ... move to the new line required and press and/or to redefine the block without having to key in the whole command again.

pg-81

Moreover, if in a suboption you press the key you will move backwards through the options chosen, that is to say that you can go back to the command point from which you want to continue. If you eliminate all the command, you return to the menu, just as if you had pressed .

. Take this example: You want to renumber with a certain first number and a certain interval and you make a mistake and want to change the interval once you have entered it. -

Press , in the third line of the menu. Press , and a first number. Press and an interval, you realize it is the wrong one. Press Press and a new interval Press and the renumbering will take place.

Obviously you could have used to have moved to the interval and replaced it directly. Commands can then be modified and repeated more quickly than by following the whole input sequence.

pg-83

2.7 CONTACTS EDITOR 2.7.1

INTRODUCTION

* Aims of the application The contact editor of the Fagorplc program allows you to program the FAGOR64 PLC by means of contacts. The editing and execution of the commands is carried out with the function keys (F1 to F10), which facilitates and improves the handling of the application. This program allows you to: -

Create and modify PLC programs in contacts. Create and insert routines of generic use. Validate the syntax of the edited file. Execute commands which affect blocks (group of ranges defined by the user), such as Copy, Move, Erase ... - Document each of the ranges of the program. - Print all or part of the file. The editor only admits contact source programs with the .LDS extension. When a program is edited and saved, an . LD image file is automatically generated as a backup copy, so that you can always return to a program previous to that in which the last modification was made. To do this you should rename/copy the . LD image file to one with a .LDS extension using the operating system’s ren/copy commands. Note: Range —> With this term you define all the instructions which form a complete statement. * Program selection Once you have selected the program editing option in contact language, the directory window will appear for selection of the program to be edited.

pg-84

The header of this window is the work area (disk and directory) where the programs are stored by default. In the window all the files stored there appear with their size, date and time of their last updating. The files with the . extension correspond to the names of the subdirectories which are in the work directory. The . directory allows you to go back from one directory to the previous one which contains it until you reach the root or main directory of the disk where the program is installed. To enter a file just move the cursor to it using the following keys: , , , , , and press . If you select a subdirectory, the directory window is updated with the files contained in the directory selected. If you want to start editing a new program, directly key in its name and .LDS extension. If you want to store it in a different directory from the current one, with the name, key in the complete path or move to the directory using the window and choosing the right . directory with the cursor, using the aforementioned keys and then press . If you want to store it in another disk you should specify the disk and complete path with the name of the file. The only restriction that there is for storing programs is that the directory where you are going to store the program has been created previously. Examples: pru.lds \prog\pru.lds a:pru.lds d:\prog\pru.lds

- editing in current directory - editing in prog. directory - editing in floppy disk in drive A - editing in prog. directory in drive D.

If the program already exists, just move the cursor to the program name, provided that it has a .LDS extension and press o key it in directly as explained in the previous section. Note: If you are not familiar with the terminology and meaning of the directory structure in the Operating System we recommend that you work with the default directory that is provided by the application. To understand in more detail the organization of the hard disks consult the users manual for the Operating System of your computer.

pg-85

Remember that the directory window only works in the disk in which the installation was carried out. The cursor movement keys for the directory window are: , , , , , . * Description of the screen Once the program to be edited has been selected, the initial screen appears with the following:

. Lines 1 - 18 --> Program display and editing window. With the cursor movement keys, you can move through the program. Line 19 —>

Message line. Appears in reverse video, after the display window.

Line 20 —>

Used to request and enter data.

Lines 21 - 22 --> Used to present status and messages referring to the actions which can be carried out. Lines 23 - 25 --> Editor command or function key menu. The key which has to be pressed to execute each of these commands or functions is indicated. * Range format The range of a contact diagram consists of a series of enquiry expressions or instructions assigned to one or more actions. The contact range appears between two vertical lines, located in columns 0 and 80 in the display window. So the maximum length of the range (characters in a line) is 80. Both the number of actions and the number of OR’s (parallel jump lines) permitted are limitless. However, the physical limitation supposed by a line length of 80 characters (screen size) means that the maximum number of enquiry expressions or instructions is limited to 6 per line.

pg-86

To solve this problem, the SW function was established, which in the case of horizontal overflow, enables the user to establish intermediate stages which he himself selects. These stages are assigned to an action (Mark or SW) which acts as a bridge between the stage generated and the initial range. The SW function is explained in more detail in another chapter of this manual. Meanwhile we can say that there is a solution for contacts whose length exceeds the horizontal size of the screen. * General use keys There are a series of keys whose function is the same in all levels of the application:

- Cancels a process or returns you to previous menu levels. - Executes commands or data input. - Interactive Help key. - Moves the cursor to the start. - Moves the cursor to the end. - Moves the cursor to the previous line. - Moves the cursor to the next line. - Displays the next page. - Displays the previous page.

pg-87

2.7.2 GENERAL DESCRIPTION OF THE EDITOR MENUS AND COMMANDS In this section an overall description of the different menus in the application is given. * Initial Menu This is the menu which appears at the start of the application. It contains a series of general commands. Using the cursor movement keys , , , , , you can move around and monitor the contents of file in the display window.

INITIAL MENU



-



- -

- - ................................................. (LEVEL 2).



pg-88

* Level 2 Menu This menu appears when the EDITING [F5] command is selected in the initial menu. It allows you to carry out operations which affect ranges as a whole. The cursor movement keys operate in the same way as described for the initial menu.

LEVEL 2

(EDITING) ——> (Actions on ranges.-

............................. (LEVEL 3) ............................. (LEVEL 3) - - - - - - - -



* Level 3 Menu This menu appears when the command INSERT RANGE [F1] or MODIFY RANGE [F2] is selected in the level 2 menu. It allows you to carry out true editing operations, which affect a specific range: - MODIFY RANGE: this will affect the range where the cursor is positioned - INSERT RANGE:this will affect a new range which is created below the range where the cursor is located.

pg-89

The cursor movement keys , , , , , only allow you to move in the active range.

. LEVEL 3

(INSERTING AND MODIFYING RANGES)





.................... (LEVEL 4)

*Level 4 Menu This menu appears when the command INSERT INSTRUCTIONS [F4] is selected in the level 3 menu. It enables you to insert any of the PLC programming instructions in the range, in a contact format. The cursor movement keys function in the same way as described in the level 3 menu. That is to say they enable you to move within the active range.

pg-90

LEVEL 4

(INSERTING INSTRUCTIONS)

.



















pg-91



.

















.

pg-92













Note: You can return from any menu level to previous levels by pressing the [ESC] key. Except from level 3 to level 2, which is done by means of pressing [F7] VALIDATE RANGE.

pg-93

2.7.3

DESCRIPTION OF THE EDITOR FUNCTIONS In this section a detailed description is given of each of the functions and commands of the contact editor.

2.7.3.1

INITIAL MENU

This menu enables you to carry out the following functions: [F1] - HELP.

Brings up an interactive help menu.

[F2] - LOAD.

Edit a new program or add previously saved routines to the current one.

[F3] - SAVE.

Save the program without exiting the editor or store part of the actual program as routines.

[F4] - PRINT.

Print out all or part of the program.

[F5] - EDIT.

Enter level 2 menu (Actions on ranges).

[F6] - VALIDATE. Check the syntax of the program being edited. [F7] - EXIT.

End the editing process saving or not saving the program.

* [F2] - LOAD By pressing [F2] you enter the LOAD option which offers you the following: [F1] - HELP.

Interactive help window.

[F2] - FILE.

Load a new program in the memory, allowing the previous one to be saved.

[F5] - ROUTINE. Insert a previously saved program in the program currently being edited.

pg-94

** [F3] - LOAD FILE This option allows a new file to be edited without the need to exit the application. By pressing [F3] the directory window appears, in which the new file to be edited can be selected. Once this file has been selected you can indicate if you wish to save the file you have been editing or not.

** [F5] - LOAD ROUTINE This option allows you to insert the contents of a program in the program you are currently editing. This command is activated by pressing [F5]. You should then move the cursor to the program range before which you wish to make the insertion and press [F6] - WHERE, to mark this range as the insertion destination. The directory window will appear immediately allowing you to select the name of the file to be inserted. Bear in mind that if you wish to insert a file at the end of a program, you should previously edit a new range as the last range in the program, and mark this as the destination. * [F3] - SAVE By pressing [F3] you enter the SAVE option which offers you the following: [F1] - HELP.

Interactive help window.

[F2] - FILE.

Save a copy of the program currently being edited, without exiting the application.

[F5] - ROUTINE. Save a part, defined by the user, of the program currently being edited.

pg-95

** [F3] - SAVE FILE This option saves a copy to disk of the program currently being edited, without having to exit the application. Press [F3] and [RETURN] to execute the command. This procedure should be carried out periodically as a safety measure for the work done with respect to power cuts or the equipment being switched off, which would mean the loss of the program being edited. No syntax check is carried out. ** [F5] - SAVE ROUTINE

. This option saves part or all of the program being edited under a different name. This command linked to the LOAD ROUTINE command offers you the possibility of reusing parts common to different programs thus improving the structure. Press [F5] to activate the command. Next move the cursor to the first range of the block to be saved, and press [F4] - START BLOCK; now move the cursor to the last range in the block to be saved, and press [F5] - END BLOCK. Finally you are asked for the file name under which you want to save the program block. Press [ENTER] to execute the command. You should bear in mind that: - By default the program block will be recorded on the disk and in the directory that was assumed by default when the Fagorplc program was installed. - If you wish to store it in a another directory and/or disk you should indicate the complete path to where you want to store the file. For example, you could key in the following: a:test1.lds c:\routines\test1.lds d:\routines\test\test1.lds

- it will be saved in a floppy in drive A. - in drive C, routines directory. - in drive D, routines directory, test subdirectory.

- If a file with the same name is found in the place selected to save the file a message appears: File already exists. Press [ENTER] to replace the old file with the new one. Press [ESC] to abort the command and repeat with a new name.

pg-96

* [F4] - PRINT This option allows you to print all, part of the program being edited, as well as the symbols table. Press [F4] to activate the program. You can print all the file by pressing [ENTER] or you can mark the block to be printed or you can print the symbol table by pressing [F2]. Move the cursor to the first range of the block to be printed, press [F4] - START BLOCK; move the cursor to the last range in the block to be printed, press [F5] to establish the block. Press [ENTER] to execute the command. If the printer is not connected an error message will appear. Press [ESC] to cancel the print command. If you connect the printer and press [ENTER] the command is executed. The number of lines per page and the active printer are determined in the general program configuration. * [F5] - EDIT When this option [F5] is selected you enter the level 2 menu, which contains actions which affect the ranges as a whole. These functions are described later. * [F6] - VALIDATE This option carries out the syntax check of the program being edited. Bear in mind that contact editing generates syntactically correct ranges. The possible errors are: - Duplicated directives. - Jumps to non existent labels. - Ranges with an incorrect SW number. A window appears with the error messages, giving the number of the range in which the errors occur.

pg-97

* [F7] - EXIT Press [F7] to enter the EXIT option which will offer you: [F1] - HELP.

An interactive help screen.

[F3] - DO NOT SAVE. Exit the application without saving.

. [F5] - SAVE.

Exit the application and save.

** [F3] - EXIT WITHOUT SAVING Press [F3] and [ENTER] to activate the command and exit the application without saving, which means the work done during the session is lost. ** [F5] - EXIT AND SAVE Press [F5] and [ENTER] to activate the command and save the program on disk. A syntax check is automatically carried out on the program, with the number of errors appearing on the screen. Obviously if you have not finished your program, this information can be ignored.

The program compilation is also carried out automatically, generating two new programs with the same name and the .PLC and .LST extensions. As can be deduced from the extension, these files contain the contact program translated to equations, in user format (.PLC) and PLC format (.LST).

pg-98

2.7.3.2

LEVEL 2 MENU

This menu corresponds to option [F5] - EDITING, of the initial menu. It enables you to carry out the following functions: [F1] - INSERT RANGE. Insert a new range after the one which is active. Pass to level 3 menu. [F2] - MODIFY RANGE. Modify the active range. Pass to level 3 menu. [F3] - ERASE RANGE.

Erase one or several ranges.

[F4] - DOCUM.RANGE. Document the active range. [F5] - COPY RANGES.

Copy one or several ranges to another part of the program.

[F6] - MOVE RANGES. Move one or several ranges to another part of the program. [F7] - SEARCH.

Search for a range number or a text.

The cursor is used in this level to move through the program. Note: The active range is that where the cursor is positioned.

* [F1] - INSERT RANGE When this option is selected a range is inserted after the active range. This new range is represented by a dotted line. You pass to the level 3 menu, which contains all the options necessary for true editing. * [F2] - MODIFY RANGE This option enables you to modify the active range. You pass to the level 3 menu (as in the INSERT RANGE option), which contains all the options necessary for true editing.

pg-99

* [F3] - ERASE RANGE This option allows you to erase one or several ranges. Press [F4] to activate the command. You can then press [ENTER] to erase the active range or proceed to select a block to erase. Move the cursor to the start of the block to be erased, press [F4] - START BLOCK; move the cursor to the final range of the block to be erased, press [F5] to establish the block. Press [ENTER] to execute the command. Working with blocks, the first and last ranges form part of the block. Once the blocks have been removed the cursor is positioned at the previous range. * [F4] - DOCUM. RANGE

. This option allows you to document the active range. Press [F4] to activate the command. A window appears at the bottom of the screen with 4 lines with 64 characters in each, which is used to document the range. If the range already has a comment this information will appear in the documentation window. The maximum number of characters for a range commentary is 255. Press [Enter] to end and save the commentary, or [ESC] to end without saving. * [F5] - COPY RANGES This option allows you to copy blocks of ranges from one part of the program to another. Press [F5] to activate the command. Next, using the cursor movement keys, move the cursor to the first range in the block to be copied, press [F4] START BLOCK; move the cursor to the last range in the block to be copied, press [F5] - END BLOCK. The range block selected appears in reverse video. Move the cursor to the range before the one where you want to copy the block, press [F6] - DESTINATION and [ENTER], and the command will be executed.

pg-100

Bear in mind that: - The block is copied in logical order, regardless of the selection sequence of START BLOCK and END BLOCK. - A block cannot be copied to a position within itself. - If you wish to copy a block to the end of the program, you should previously edit a new range as the last one in the program, and mark this as the block destination. * [F6] - MOVE RANGES This option allows you to move blocks of ranges from one part of the program to another. Press [F6] to activate the command. Next, using the cursor movement keys, move the cursor to the first range in the block to be moved, press [F4] - START BLOCK; move the cursor to the last range in the block to be moved, press [F5] - END BLOCK. The range block selected appears in reverse video. Move the cursor to the range before the one where you want to move the block to, press [F6] DESTINATION and [ENTER], and the command will be executed. Bear in mind that: - The block is moved in logical order, regardless of the selection sequence of START BLOCK and END BLOCK. - A block cannot be moved to a position within itself. - If you wish to move a block to the end of the program, you should previously edit a new range as the last one in the program, and mark this as the block destination. * [F7] - SEARCH Press [F7] to enter the SEARCH option which offers: [F1] - HELP.

An interactive help window.

[F3] - RANGE.

Search for and display of a specific range, indicating its number.

[F5] - TEXT.

Search for a text in the file.

pg-101

** [F3] - SEARCH FOR RANGE Press [F3] and you will be asked for a range number to search for and display. Press [ENTER] to execute the command. If the range is found it appears on screen as the active range. If it is not found a message appears to this effect. An application for this command could be searching for ranges in which the validation process says there is an error. ** [F5] - SEARCH FOR TEXT

. Press [F5] and you will be asked for the text to search for, which could be a variable or an operation. Press [ENTER] to execute the command. If it cannot be found a message to this effect appears and the command is terminated. If it is found the first occurrence of the text is presented in reverse video. By pressing [Enter] successively the successive occurrences of the text will appear. If the end of the file is reached the search continues from the beginning in a cyclical way. To cancel the process press [ESC]. You can use the mask * to locate occurrences in a partial text, following the conventions established by DOS. For example: Il7

- you locate the occurrences in which this specific entry appears

Il*

- you locate the occurrences in which the entries from I10 to I19 appear.

B*

- all the occurrences which have the letter B.

MOV - all the occurrences which have this instruction-. The mask format is: text*

pg-102

2.7.3.3

LEVEL 3 MENU

This menu corresponds to the [F1] option - INSERTING RANGES and the [F2] option - MODIFYING RANGES of the level 2 menu. It enables you to carry out the following functions: [F1] - HELP.

Interactive help window.

[F2] - OR.

Generation and erasing of OR’s in the range.

[F3] - XOR.

Generation of XOR’s in the range, at the cursor position.

[F4] - INSERT INSTR. Insert instructions in the range, at the cursor position. Pass to level 4 menu. [F5] - MODIFY INSTR. Modify the instruction on which the cursor is positioned. [F6] - ERASE INSTR.

Erase the instruction on which the cursor is positioned.

[F7] - VALIDATE RANGE. Control whether the range is correctly programmed and return to previous memory. The cursor movements in this level affect the contents of the active range. * [F2] - OR Press [F2] to enter the Generation and Erasing of OR’s option: [F1] - HELP.

Interactive help window

[F2] - INSERT OR.

Generate an OR (contact jump).

[F3] - ERASE OR.

Eliminate a contact OR.

** [F2] - INSERT OR This option enables you to generate an OR in the active range, from the cursor position to the left, that is, towards the start of the range.

pg-103

By pressing [F2] the possible OR destinations will appear in the range, indicated by means of the letters A to F. Remember that the start of the OR is the current cursor position. To select the OR destination, each of the possible letters (A-F) is assigned to a function key. Press the function key you require, the OR is generated in which you can then insert the instructions you require. During the OR destination selection process you can move vertically through the range using the cursor movement keys. So if the range cannot be seen completely in the display window you can move through the range to see the possible OR destinations.

** [F3] - ERASE OR This option enables you to erase OR from the active range. Use the cursor motion keys to move to any of the corresponding OR positions you wish to erase and press [F3]. This puts the OR selected in reverse video and a confirmation is requested. If the OR selected is not empty, if it has instructions, you will be so informed and a confirmation will be requested. Press [ENTER] to execute the command or [ESC] to cancel it. * [F3] - XOR

. This option allows you to insert two enquiry options linked by means of the XOR logic operator at the cursor position. Press [F3] to activate the command. [ESC] allows you to cancel it. First of all you should select which two types of instructions you want to link in the XOR operator. Any combination of enquiry instructions is valid (Single Exp, DFU, DFD, CPU, and CPS). Once the selection has been made, the contact corresponding to the XOR operator is displayed, in order next to request the variable(s) for each of the two instructions. When the data entry is complete the XOR operation is inserted.

pg-104

Example: I1 I1 XOR I2

I2 I1

I2

Bear in mind that: - If during data entry corresponding to the variables for each of the instructions, the process is cancelled ([ESC] key) the XOR contact is displayed, but without instructions. - To eliminate a XOR the process is identical to that for any type of range instruction. You can eliminate the XOR and OR instructions. - The insertion of this type of operations can cause an overflow in the length of the range (80 characters). In this case this gives rise to an SW function. This function is dealt with in a subsequent chapter, given its importance.

* [F4] - INSERT INSTR. This option passes you to the level 4 menu, which allows you to insert any type of instruction in the active range. The insertion is made at the cursor position. So using the cursor movement keys the cursor should be positioned in the place where the instruction is to be included. Enquiry expressions or instructions can be inserted between columns 0 and 60. To insert an action you should be in column 80. In the length of the range (80 characters) is surpassed the SW function is activated. This function will be dealt with in detail in a subsequent chapter. * [F5] - MODIFY INSTR. This option allows you to modify any instruction, whether it is an enquiry or an action expression.

pg-105

Before pressing [F5] - MODIFY INSTR., you should select the instruction to be modified by moving the cursor: - To modify an enquiry instruction or expression, move the cursor to the left of the instruction or expression. - To modify an action you should move the cursor to column 80, to the right of the action you wish to modify. When the cursor is in the correct position press [F5]. If there is no instruction at the cursor position an error message will appear and the process is cancelled. If there is an instruction at the cursor position the instruction to be modified appears in reverse video, and the menu of instructions to be inserted is displayed, corresponding to the one for the type of instruction. You should select the new instruction to be displayed and enter the data just as if it were an insertion.

. Bear in mind that: - The modification of an instruction means replacing it with a contact of the same type. Example: If the instruction to be modified is: . A comparison expression, it can be replaced with CPU or CPS. . An arithmetic action, it can be replaced by any arithmetic action. - So modifying allows you to: . Replace the instruction with another of the same type. . Modify the instruction variables. . Change the NOT (negation) component of the instruction. - If you wish to replace an instruction with another of a different type, you should erase it and insert the new one.

pg-106

* [F6] - ERASE INSTR. This option allows you to erase any instruction, whether it is an enquiry or an action expression. Before pressing [F6] - ERASE INSTR., you should select the instruction to be erased by moving the cursor: - To erase an enquiry instruction or expression, move the cursor to the left of the instruction or expression. - To erase an action you should move the cursor to column 80, to the right of the action you wish to erase. When the cursor is in the correct position press [F6]. If there is no instruction at the cursor position an error message will appear and the process is cancelled. If there is an instruction at the cursor position the instruction to be erased appears in reverse video, a message requesting confirmation appears. Press [ENTER] to execute the command or [ESC] to cancel it.

* [F7] - VALIDATE RANGE Returning to previous menus as already mentioned is done using the [ESC] key. However this menu level is the exception as you have to press [F7] to return to the previous menu level. In addition a verification of the edited range is carried out, which is described below: - If the range has no instructions it is erased and you return to the previous menu. - All ranges must have at least one action to be correct. So if a range does not have one, a message to this effect appears and you are unable to return to the previous menu until it is correct.

pg-107

2.7.3.4

LEVEL 4 MENU

This menu corresponds to the [F4] option - INSERT INSTR. of level 3. It enables you to carry out the following functions: [F1] - HELP.

Interactive help window.

[F2] - INS DIR.

Inserting directives.

[F3] - SING EXP. Inserting single expressions. [F4] - DF EXP.

Inserting flank detection expressions.

[F5] - COMP EXP.

Inserting comparison expressions.

[F6] - ASSIG ACT.

Inserting assignment actions.

[F7] - COND ACT.

Inserting conditional actions.

[F8] - RUPT ACT. Inserting rupture actions. [F9] - MOV ACT. Inserting MOV actions. [F10] - You obtain the following options: [F1] - HELP.

Interactive help window.

[F2] - NEG ACT. Inserting record negation actions. [F3] - ARIT ACT. Inserting arithmetic actions. [F4] - ROT ACT. Inserting record rotation actions. [F5] - LOG ACT. Inserting logic actions. [F6] - SPEC ACT. Inserting special actions. [F10] - Return to previous insertion options.

pg-108

General notes: - During the insertion of instructions, when the user has to enter data, a small help feature appears in the status line indicating the type of data to enter or the actions to execute. - In the data entry process, a check is made of the values keyed in, an error message is given in the case of error. - The instruction is inserted at the cursor position. - In the case of horizontal overflow the SW function is executed, which will be dealt with in detail later. * [F2] - INS. DIR. This option selects the insertion of a directive in the range. It should be the only element in the range. Press [F2] to activate the command and see the following options: [F1] - HELP.

Interactive help window.

[F2] - DIR.

Single Directives.

[F3] - AL.

Alarm module directive.

[F4] - PE.

Periodic module directive.

[F5] - LABEL. Labels. ** [F2] - DIR. This option enables you to insert the following directives: PRG, CY1, REA, IMA, END, NOP, OWD and RER. Press [F2] to activate the command. Enter the name of the directive to program and press [ENTER] to display it or [ESC] to cancel the process. Contact: PRG

pg-109

** [F3] - AL. This option enables you to insert the alarm module directive. Press [F3] to activate the command. Enter the number of the alarm module to be programmed and press [ENTER] to display it or [ESC] to cancel the process. Contact: AL1

. ** [F4] - PE. This option enables you to insert the periodic module directive. Press [F3] to activate the command. Enter the number of the periodic module to be programmed and press [ENTER] to continue or [ESC] to cancel the process. Then enter the module frequency and press [ENTER] to display the directive or [ESC] to cancel the process. Contact: PE2 12000

** [F5] - LABELS This enables you to insert labels. Press [F5] to activate the command. Enter the number of the label to be programmed and press [ENTER] to display it or [ESC] to cancel the process. Contact: L15

pg-110

* [F3] - SING. EXP. This option selects the insertion of a single expression in the range. Press [F3] to activate the command and see the following options: [F1] - HELP.

Interactive help window.

[F2] - SING. EXP. Display of single expressions. [F10] - FLAG NOT.

Switch the NOT component of the instruction

** [F2] - SING. EXP. This option enables you to insert a single expression at the cursor position. Press [F2] to activate the command. Enter the variable corresponding to the contact to be programmed and press [ENTER] to display it or [ESC] to cancel the process. Contact: ‘variable’

‘variable’ /

** [F10] - FLAG NOT This key is active for all types of instructions to be inserted. Each instruction can be displayed as a normally open or a normally closed contact. The latter corresponds to negated instructions. Therefore, when in the [F10] key - FLAG NOT, the following appear: - OFF —> the contact is displayed as open. - ON —> the contact is displayed as closed or negated. Press this key to switch the instruction NOT component flag, which will enable you to select the type of contact (open or closed). By default when you enter to insert any type of instruction, it is OFF (open).

pg-111

* [F4] - DF EXP. This option selects the insertion of a flank detection expression in the range. Press [F4] to activate the command and see the following options: [F1] - HELP.

Interactive help window.

[F2] - DFU.

Display of up flank detection expressions.

[F3] - DFD.

Display of down flank detection expressions.

[F10] - FLAG NOT.

Switch the instruction NOT component.

. ** [F2] - DFU / [F3] -DFD This option enables you to insert a flank detection expression at the cursor position. Press the function key assigned to the instruction to be displayed to activate the command. Enter the variable corresponding to the contact to be programmed and press [ENTER] to display it or [ESC] to cancel the process. Contact: ‘variable’ DFU

‘variable’ /DFD

pg-112

* [F5] - CP EXP. This option selects the insertion of a comparison expression in the range. Press [F5] to activate the range and see the following options: [F1] - HELP.

Interactive help window.

[F2] - CPU.

Display of comparison expressions without sign.

[F3] - CPS.

Display of comparison expressions with sign.

[F10] - FLAG NOT.

Switch the instruction NOT component.

** [F2] - CPU / [F3] - CPS This option allows you to insert a comparison expression at the cursor position. Press the function key assigned to the instruction to be displayed to activate the command. Enter the variable corresponding to the first operand of the comparison operation and press [ENTER] to continue or [ESC] to cancel the process. Next the possible instruction operators are presented in the function keys. Press the function key corresponding to the operator you wish to program. Finally enter the variable corresponding to the second operand of the comparison operation and press [ENTER] to display the contact or [ESC] to cancel the process. Contact: op.1 CPU A

op.2 EQ

B

op.1 /CPS A

op.2 EQ

B

pg-113

* [F6] - ASSIG. ACT. This option selects the insertion of an assignment action in the range. Press [F6] to activate the command and see the following options: [F1] - HELP.

Interactive help window.

[F2] - SING. ACT.

Display of single actions.

[F3] - TG.

Display of timer start actions.

[F4] - CPR.

Display of counter selection actions.

[F10] - FLAG NOT.

Switch the instruction NOT component.

.

** [F2] - SING. ACT. This option enables you to insert a single action at the cursor position. Press [F2] to activate the command. Enter the variable corresponding to the contact to be programmed and press [ENTER] to display it or [ESC] to cancel the process. Contact: ‘variable’ ()

‘variable’ (/)

** [F3] - TG This option enables you to insert a timer start action at the cursor position. Press [F3] to activate the command. The possible timer start entries are presented in the function keys. Press the function key corresponding to the entry you wish to program. Next enter the number of the timer to be started and press [ENTER] to continue or [ESC] to cancel the process. Finally enter the variable corresponding to the timer time constants and press [ENTER] to display the contact or [ESC] to cancel the process. Contact: ‘c.time.’ (TG1 14)

‘c.time’ (/TG1 124 )

pg-114

**[F4] - CPR This option enables you to insert a counter selection action at the cursor position. Press [F4] to activate the command. Enter the number of the counter to be started and press [ENTER] to continue or [ESC] to cancel the process. Finally enter the variable corresponding to the counter preselection value and press [ENTER] to display the contact or [ESC] to cancel the process. Contact: ‘presel.’ (CPR 14)

‘presel.’ (/CPR 124)

* [F7] - COND. ACT. This option selects the insertion of a conditioned action in the range. Press [F7] to activate the command and see the following options: [F1] - HELP.

Interactive help window.

[F2] - SET.

Display of SET actions.

[F3] - RES.

Display of RES actions.

[F4] - CPL.

Display of CPL actions.

[F10] - FLAG NOT.

Switch the instruction NOT component.

** [F2] - SET / [F3] - RES / [F4] -CPL This option enables you to insert conditioned actions at the cursor position. Press the function key assigned to the action to be displayed to activate the command. Enter the variable corresponding to the contact to be programmed and press [ENTER] to display the contact or [ESC] to cancel the process.

pg-115

Contact: ‘variable’ (SET)

‘variable’ (/CPL)

* [F8] - RUPT. ACT. This option selects the insertion of a rupture action in the range. Press [F8] to activate the command and see the following options:

. [F1] - HELP.

Interactive help window.

[F2] - JMP.

Display of jump to label actions.

[F3] - CAL.

Display of subroutine call actions.

[F4] - RET.

Display of return from subroutine actions.

[F10] - FLAG NOT.

Switch the instruction NOT component.

** [F2] -JMP This option allows you to insert jump to label actions, at the cursor position. Press [F2] to activate the command. Enter the number of the label you wish to jump to and press [ENTER] to display the contact or [ESC] to cancel the process. Contact. ‘label’ (JMP)

‘label’ (/JMP)

** [F3] - CAL This option allows you to insert subroutine call actions, at the cursor position. Press [F3] to activate the command. Enter the number of the label you wish to jump to and press [ENTER] to display the contact or [ESC] to cancel the process.

pg-116

Contact. ‘label’ (CAL)

‘label’ (/CAL)

** [F4] - RET This option enables you to insert return from subroutine actions, at the cursor position. Press [F4] to activate the command and display the action. Contact: (RET)

(/RET)

* [F9] - MOV. ACT. This option selects the insertion of a movement action in the range. Press [F9] to activate the command and see the following options: [F1] - HELP.

Interactive help window.

[F2] - MOV.

Display of movement actions.

[F10] - FLAG NOT.

Switch the instruction NOT component.

** [F2] - MOV This option allows you to insert a movement action, at the cursor position. Press [F2] to activate the command. Enter the source variable of the movement operation and press [ENTER] to continue or [ESC] to cancel the process. Next enter the destination variable of the movement operation and press [ENTER] to continue or [ESC] to cancel the process. Finally using the function keys select the operation format, indicating the source and destination variable codes and the number of bits to move.

pg-117

Contact. source form. dest. ( A MOV B )

source form. dest. ( A /MOV B )

* [F10] - -> Press [F10] to obtain the rest of the possible instructions to insert and which are described below.

* [F2] - NEG. ACT.

. This option selects the insertion of a record negation action in the range. Press [F2] to activate the command and see the following options: [F1] - HELP.

Interactive help window.

[F2] - NGU.

Display of record negation actions without sign.

[F3] - NGS.

Display of record negation actions with sign.

[F4] - NGD.

Display of double record negation actions

[F10] - FLAG NOT.

Switch the instruction NOT component.

** [F2] - NGU / [F3] - NGS / [F4] - NGD This option enables you to insert record negation actions at the cursor position. Press the function key assigned to the action to be displayed to activate the command. Enter the number of the record to be negated and press [ENTER] to display the contact or [ESC] to cancel the process. Contact: ‘rgto’ (NGU)

‘rgto’ (/NGU)

pg-118

* [F3] - ARIT. ACT. This option selects the insertion of an arithmetic action in the range. Press [F3] to activate the command and see the following options: [F1] - HELP.

Interactive help window.

[F2] - AD.

Display the sum arithmetic action.

[F3] - SB.

Display the subtraction arithmetic action.

[F4] - ML.

Display the multiplication arithmetic action.

[F5] - DV.

Display the division arithmetic action.

[F6] - MD.

Dislplay the modulus arithmetic action.

[F10] - FLAG NOT.

Switch the instruction NOT component.

** [F2] - AD / [F3] - SB / [F4] - ML / [F5] - DV / [F6] - MD This option allows you to insert an arithmetic action at the cursor position. Press the function key assigned to the instruction to be displayed to activate the command. Using the function keys select the type of operation you wish to carry out: without sign, with sign or double. Next enter the variable corresponding to the first operand of the operation and press [ENTER] to continue or [ESC] to cancel the process. Then enter the variable corresponding to the second operand of the operation and press [ENTER] to display the contact or [ESC] to cancel the process. Finally enter the variable corresponding to the result of the operation and press [ENTER] to display the contact or [ESC] to cancel the process.

pg-119

Contact: op.1 op.2 res. (A ADU B = C )

op.1 op.2 res. ( A /MLD B = C )

* [F4] - ROT. ACT. This option selects the insertion of a record rotation action in the range.

. Press [F4] to activate the command and see the following options: [F1] - HELP.

Interactive help window.

[F2] - RIGHT.

Display rotation action to right.

[F3] - LEFT.

Display rotation action to left.

[F10] - FLAG NOT.

Switch the instruction NOT component.

** [F2] - RIGHT / [F3] - LEFT This option allows you to insert a record rotation action at the cursor position. Press the function key assigned to the instruction to be displayed to activate the command. Using the function keys select the type of rotation: 1 or 2. Next enter the record to rotate and press [ENTER] to continue or [ESC] to cancel the process. Finally enter the number of rotations to be carried out in the selected record and press [ENTER] to display the contact or [ESC] to cancel t h e process. Contact: ‘rot’ ‘rec’ (RR1)

‘rot’ ‘rec’ (/RL2)

pg-120

* [F5] - LOG. ACT. This option selects the insertion of a logic action in the range. Press [F5] to activate the command and see the following options: [F1] - HELP.

Interactive help window.

[F2] - AND.

Display logical action AND.

[F3] - OR.

Display logical action OR.

[F4] - XOR.

Display logical action XOR.

[F10] - FLAG NOT.

Switch the instruction NOT component.

** [F2] - AND / [F4] - OR / [F5] - XOR This option allows you to insert a logic operation as an action at the cursor position. Press the function key assigned to the instruction to be displayed to activate the command. Enter the variable corresponding to the first operand of the operation and press [ENTER] to continue or [ESC] to cancel the process. Then enter the variable corresponding to the second operand of the operation and press [ENTER] to continue or [ESC] to cancel the process. Finally enter the variable corresponding to the result of the operation and press [ENTER] to display the contact or [ESC] to cancel the process. Contact: op.1 op.2 res. (A AND B = C ) op.1 op.2 res. (A /XOR B = C )

pg-121

* [F6] - SPEC. ACT. This option selects the insertion of a special action in the range. Press [F6] to activate the command and see the following options: [F1] - HELP.

Interactive help window.

[F2] - ERA.

Display special action ERA.

[F3] - WDG.

Display special action WDG.

[F4] - ERR.

Display special action ERR.

[F5] - MSG.

Display special action MSG.

[F6] - SYS.

Display special action SYS.

[F10] - FLAG NOT.

Switch the instruction NOT component.

.

** [F2] - ERA This option enables you to insert the special action ERA (erase block) at the cursor position. Press [F2] to activate the command. Enter the block of variables to be erased according to the following format: [Variable][First No.][Final No.] and press [ENTER] to display the contact or [ESC] to cancel the process. Contact: I10.30 (ERA)

M1000.1100 (/ERA)

** [F3] - WDG This option enables you to insert the special action WDG (setting Watch Dog time), at the cursor position. Press [F3] to activate the command. Enter the time value to assign as Watch Dog and press [ENTER] to display the contact or [ESC] to cancel the process.

pg-122

Contact: ‘time’ (WDG)

‘time’ (/WDG)

** [F4] - ERR This option enables you to insert the special action E (error generation) at the cursor position. Press [F4] to activate the command. Enter the error number to be generated and press [ENTER] to display the contact or [ESC] to cancel the process. Contact: ‘err. no.’ (E)

‘err. no.’ (/ E )

** [F5] - MSG This option enables you to insert the special action MSG (message generation) at the cursor position. Press [F5] to activate the command. Enter the message number to be generated and press [ENTER] to display the contact or [ESC] to cancel the process. Contact: ‘mess. no.’ (MSG)

‘mess. no.’ (/MSG)

** [F6] - SYS This option enables you to insert the special action SYS (call system) at the cursor position. Press [F6] to activate the command. Enter the system call number press [ENTER] to continue or [ESC] to cancel the process.

pg-123

Then enter the auxiliary record number and press [ENTER] to display the contact or [ESC] to cancel the process.

. Contact. ‘rec. no.’ (SYS)

‘rec. no.’ (/SYS)

pg-124

2.7.3.5

SPECIAL FUNCTION KEYS

In order to speed up the editing processes there are a series of special keys to which specific editing functions have been assigned. The basic idea behind these keys is that when you are editing (inserting instructions) and you need to carry out a series of generic functions which are in previous menus, you can carry out these functions without having to return through the menus. * [ALT] + [C] —> COLOR SELECTION. In equipment with color monitors, the user can select the color attributes to be used in the application, from a preset series of palettes. This key is active during the whole application. Once [ALT] + [C] has been pressed, each time the spacebar is pressed the different preset color palettes appear. You can exit the option with: - [ESC] Sets the last palette displayed for the session. In subsequent sessions the standard palette will appear. - [ALT]+[S] Sets the last palette displayed as the standard palette. That is tosay that this palette is definitive, until it is changed using the same procedure. * [ALT] + [O] —> GENERATE OR. This option enables you to generate OR’s. It has the same effect as OR generating function in the level 3 menu of the application. This key is active in the level 3 and 4 menus of the application. So there is no need to exit the level 4 menu (Inserting instructions) to generate an OR. * [ALT] + [B] —> ERASE OR. This option enables you to erase OR’s. It has the same effect as OR erasing function in the level 3 menu of the application.

pg-125

This key is active in the level 3 and 4 menus of the application. So there is no need to exit the level 4 menu (Inserting instructions) to erase an OR. * [ALT] + [M] —> MODIFY INSTRUCTION This option enables you to modify an instruction. It has the same effect as instruction modifying function in the level 3 menu of the application. This key is active in the level 3 and 4 menus of the application. So there is no need to exit the level 4 menu (Inserting instructions) to modify an instruction.

. * [ALT] + [D] —> ERASE INSTRUCTION. This option enables you to erase an instruction. It has the same effect as the instruction erasing function in the level 3 menu of the application. This key is active in the level 3 and 4 menus of the application. So there is no need to exit the level 4 menu (Inserting instructions) to erase an instruction. * [ALT] + [X] —> GENERATE AN XOR. This option enables you to generate an XOR. It has the same effect as the XOR generating function in the level 3 menu of the application. This key is active in the level 3 and 4 menus of the application. So there is no need to exit the level 4 menu (Inserting instructions) to generate an XOR. * [ALT] + [V] —> DOCUMENT RANGE. This option enables you to display and modify the comment on a range. It has the same effect as the documenting function in the level 2 menu of the application. This key is active in the whole application. So there is no need to exit the level 2 menu to display or modify a range comment.

pg-126

* [ALT] + [T] —> SYMBOL TABLE. This option enables the maintenance of symbol table. This key is active in the whole application. Options: [F1] [F2] [F3] [F4] [F5]

- HELP. - EDIT SYMB. - MODIFY SYMB. - ERASE SYMB. - END.

Interactive help window. Insert elements in the table. Modify the element at the cursor position. Eliminate the element at the cursorposition. Terminate.

pg-127

2.7.4

SW FUNCTION

* Range overflow analysis As has already been mentioned the length of a range is limited to 80 characters (screen size). Therefore, in instruction or XOR insertion processes, it could occur that the insertion of the mentioned element causes an overflow of the range. In other words there is not enough physical space in the range to write a new instruction. Let us look at an example of an equation which produces an overflow and the manual solution that can be used: I1 AND I2 AND I3 AND I4 AND I5 AND I6 AND I7 AND I8 AND I9 = SET 012 given that this equation in contacts produces an overflow, it is suggested that it be broken down into two ranges or stages, 1st STAGE I1 AND I2 AND I3 AND I4 AND I5 AND I6 = M1000 2nd STAGE M1000 AND I7 AND I8 AND I9 = SET 012 - Part of the range is taken to a previous stage and an intermediate mark is used as a link or bridge between both ranges. So what has been done in the contact editor is to automate the previous procedure, with the possibility of using physical variables (MARKS) or fictitious variables (SW) as links between the stages.

* Treatment in the application When on trying to insert an element in a range there is an overflow, the user is requested to establish the part of the active range that he wishes to take to a previous stage and the type of variable he wants to use in the link (MARK or SW). The previous stage is automatically generated and both stages are linked by means of the selected variable.

pg-128

The procedure is as follows: 1.- A message appears informing you that the operation requested causes an overflow. You have to select the block of instructions to take to a previous stage. To do this you must move the cursor to the far right of the block (start) to be taken to a previous stage (using the cursor movement keys). Press [ENTER] to continue or [ESC] to cancel the process. 2.- Then in the range the possible block ends are presented, indicated by means of the letters A to F. To select the end of the block, each of the letters (A-F) is assigned to a function key. Press the function key which you require and the block will appear in reverse video. Bear in mind that one stage must contain all the OR levels in which the instructions it contains are; if the stage you select is incorrect the correct block is automatically calculated and presented in reverse video. 3.- Next you are requested to select the variable you wish to use as the link between the established stage and the current range. The possibilities are SW or MARK. If you select MARK you should indicate the number. Press [ESC] to cancel the process. 4.- Once the range selection has been made it is automatically split into two stages, linked by means of the variable selected: - The block established passes to a previous stage with the selected link variable as an action. - In the current range the established block is replaced by the selected link variable. In this way the active range has space for new insertions. Successive overflows in the range are resolved in the same way.

pg-129

Notes on the stages linked with MARKS: - The MARKS as link variables can be modified or erased. - There is no limit as to the number of overflows in one range, when MARKS are used as linkage variables.

. Notes on stages linked with SW: - The SW are numbered automatically and in order from 0. - The overflow limit in one range, using SW’s as linkage variables, is 10. So the last SW allowed is SW9. - The SW linkage variables can be modified or erased. But bear in mind that as they are fictitious marks, if the number of SW programmed does not correspond, an error will be produced during the verification process. Therefore when an SW is modified or erased in one stage, it must be deletedin the following stage.