The text of a manual · part 9 of 26
IRL Programming Reference Manual, pages 81 to 90
Pages 81 to 90 of 260
The original document is the PDF (666 KB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Intermec 9445, Intermec 9550, Intermec 9560 and Intermec 9512
Page 81
Programming With IRL Editor and IRL Monitor
4
This chapter introduces the IRL Editor and IRL Monitor and explains how to enter and debug IRL programs on an Intermec reader. The last part of this chapter is a command reference.
Programming and Debugging Intermec programmable readers that use IRL version 2.X include a built-in IRL programming environment: the IRL Editor and the IRL Monitor. This chapter covers these topics: •
Using the IRL Editor and IRL Monitor
•
Starting the IRL Editor
•
Using the IRL Monitor
•
IRL Editor commands
•
IRL Monitor commands
4-3
Page 82
IRL Programming Reference Manual
Using the IRL Editor and IRL Monitor The IRL Editor is the custom, built-in text editor for Intermec readers that run IRL v2.X programs. You use the IRL Editor to enter and edit IRL programs directly on your reader or on a terminal attached to your reader. You can enter the program statements line by line, or you can use the IRL Editor commands to locate and change a specific program statement. To help prevent errors, the Editor checks the syntax of program statements as you enter them. The IRL Monitor is the companion debugger for Intermec readers that run the IRL Editor. You use the IRL Monitor to execute your program one line at a time. With the IRL Monitor, you can discover and correct problems that are not related to syntax or compiler errors. The IRL Editor and IRL Monitor operate in Display mode or in Terminal mode. You use display mode when the reader has its own display and a keypad or keyboard. You use terminal mode when the reader is connected to a terminal display and keyboard. You also can scan bar code program statements, Editor commands, or Monitor commands instead of using the keyboard. Note: JANUS readers do not use the IRL Editor or IRL Monitor. You can edit IRL programs with any DOS text editor. You can also use PC-IRL on a PC to edit, compile, and download IRL programs to your JANUS reader. See the PC-IRL Reference Manual, P/N 049212.
Starting the IRL Editor Use one of the following procedures to start the Editor on your reader: To start the Editor from the reader display •
Press Ctrl-I on the reader keypad or keyboard. Or, type $$ and press Ctrl-Enter on the keypad or keyboard. Or, scan the following label: Enter IRL Editor
*$$* *$$*
The Editor prompt (>) is displayed on the reader or terminal display, and the Editor waits for you to enter a command.
4-4
Page 83
Programming With IRL Editor and IRL Monitor
4
Depending on the reader you are using, the IRL Editor prompt may look like this: IRL
Editor
(C)
1982-1989
Intermec v2.2
Corp.
>_
To start the Editor from the terminal display 1. Connect the terminal to the reader’s communications port. If the reader has two ports, connect the terminal to the terminal port. 2. Make sure the reader and terminal use the same baud rate, parity, and stop bits. 3. Set the terminal for full-duplex operation. 4. Type $$$$ and press Ctrl-Enter on the keypad or keyboard. Or, scan the following label: Enter CRT IRL Editor
*$$$$* *$$$$*
The Editor prompt (>) is displayed on the reader or terminal display, and the Editor waits for you to enter a command. To toggle between the reader display and the terminal display •
While the reader is in Editor mode, press Ctrl-I. Or, scan the following label: Enter IRL Editor
*$$* *$$*
If your reader has only one communications port, the Editor accepts commands and statements from the terminal keyboard only when you select the terminal display. You may need to toggle between the reader display and the terminal display. If your reader has two communications ports, the Editor always accepts commands and statements from the connected terminal keyboard.
4-5
Page 84
IRL Programming Reference Manual
Working With the IRL Editor The IRL Editor is a command line text editor. You enter and edit each program statement one at a time. Each program statement is numbered, and many Editor commands require a specific line number to act upon. Keep these rules in mind when you work in the Editor: •
The Editor waits at the > prompt for you to type an Editor command and press Enter. When you press Enter, the Editor verifies the command syntax and carries out the command.
•
Before you press Enter, you can use the Backspace or Rubout key to erase the character to the left of the cursor. Then, retype the statement.
•
The Editor checks IRL program statements for syntax errors before they are stored in the reader. An invalid statement produces an error message and is redisplayed for editing.
•
Some commands, such as I (Insert), place the Editor in another mode. In Insert mode, you enter valid IRL program statements. When you press Enter, the Editor verifies the IRL syntax, saves the statement, and displays the next line number. You then enter another valid IRL statement. You remain in Insert mode until you press Enter at the beginning of a new line.
•
You can enter commands in uppercase or lowercase. Commands that are required to be uppercase are converted automatically.
•
The editor accepts and executes these reader commands: Backspace, Clear, Review, and Forward. If your statements scroll out of the display area, use the Review and Forward commands to move back and forth. See your reader manual for more information.
•
IRL v2.X readers can store only one IRL program. When you start the IRL Editor, there may already be an IRL program on your reader.
•
If an Insert, Delete, List, or Find command is used with an invalid line number, the last line of the program is used. Only line numbers that are in use are accepted for the Substitute command.
Entering Program Statements The Editor uses the I (Insert), D (Delete), and S (Substitute) commands to insert and change IRL program statements. The I command is the basic command for entering your program. Even if you do not have an existing IRL program on your reader, you must use the I command to begin editing a new program. To enter a program statement 1. At the > prompt, type I and press Enter. The next available line number is displayed. If there is no existing IRL program, you begin inserting at line 1.
4-6
Page 85
Programming With IRL Editor and IRL Monitor
4
2. Type any valid IRL command. If you make a mistake, press the Backspace or Rubout key to erase the character to the left of the cursor. For a list of valid commands, see Chapter 7, “IRL Command Descriptions.” 3. Press Enter. The Editor verifies the IRL syntax. If the statement is incorrect, it is redisplayed with an error message. If the syntax is correct, the Editor saves the statement and displays the next line number. 4. Type additional statements and press Enter after each one. 5. To exit Insert mode, press Enter at the beginning of a new line. The Editor saves the statements and displays the > prompt. For more information, see the command descriptions later in this chapter.
Changing Program Statements You use the D (Delete) and S (Substitute) commands to change existing program statements. You can also use the I command to insert additional statements. To delete a program statement 1. At the > prompt, type D 2. Type the line number to delete and press Enter. To replace a program statement 1. At the > prompt, type S 2. Type the line number to change and press Enter. The Editor enters Substitute mode. 3. Type the new program statement and press Enter. The Editor erases the existing statement, checks the syntax of the new statement, and displays the next line number. 4. If needed, type additional replacement statements. The exiting statements with those same line numbers are erased. 5. To exit Substitute mode, press Enter at the beginning of a new line. The Editor saves the statements and displays the > prompt. For more information, see the command descriptions later in this chapter.
4-7
Page 86
IRL Programming Reference Manual
To exit the Editor and compile your program •
Type E and press Enter. The IRL compiler checks the program for errors.
To exit the Editor without compiling your program •
Type Q and press Enter.
When you exit with the Q command, the program is not compiled. You can edit the program, but you cannot run it until you do compile it.
Compiling Programs You must compile IRL programs before you can run them. When you leave the Editor with the E (End) command or the MC (Monitor) command, your program is compiled. The IRL compiler checks the program for functional errors in the program setup. If errors are detected, the compile stops and an error message is displayed. Compiling a program also restructures the memory allocation and all data stored in the reader is purged. If data is present, the reader displays this warning before purging the data and compiling the program: Data exists -Clear all data?
Answer Y to clear the data and compile the program. Answer N to abort the compile and return to the Editor. To leave the Editor without compiling, use the Q (Quit) command.
Error Conditions When you enter and edit your program in the IRL Editor, the Editor checks each statement for the correct syntax. Your program may be free of syntax errors and still generate compiler errors or runtime errors. Compiler Errors When you exit the IRL Editor with an E (End) command, your program is compiled. If an error is detected, the compile stops. The statement that contains the error and an error message are displayed. Common errors include omitting input commands, referencing a nonexistent label or an unopened file, and exceeding memory limits when opening a file. Compiler errors are often typing mistakes that did not generate a syntax error. Runtime Errors Runtime errors are usually logic errors. These errors occur when valid program statements exceed their limits during program execution. Common errors include trying to read or write to a file record that is beyond the defined file size, comparisons for branching that never become true, and running out of available memory on the reader. Runtime errors can be fatal or nonfatal.
4-8
Page 87
Programming With IRL Editor and IRL Monitor
4
Nonfatal Errors Most runtime errors are nonfatal. IRL displays an error message, skips the statement that caused the error, and continues executing your program. Fatal Errors When IRL detects a fatal runtime error, it stops executing the program, displays an error message, and returns to the data entry mode. For a list of compiler and runtime error messages, see Appendix B, “Error Messages.”
Using the IRL Monitor The IRL program monitor is a valuable troubleshooting feature. With the IRL Monitor, you can execute a program one line at a time and view the contents of the registers and data files while you are running the program. Note: You can only start the IRL Monitor from the IRL Editor. To start the Monitor from the Editor prompt (>) •
Type M or MC and press Enter on the keypad or keyboard. You exit the Editor and the program is compiled. The Monitor displays the first IRL instruction to be executed.
To exit the Monitor and return to the Editor prompt (>) •
Type E or Q and press Enter on the keypad or keyboard. Any input you entered is saved in the appropriate register or data file.
For more information, see the command descriptions later in this chapter.
4-9
Page 88
IRL Editor Commands
IRL Editor Commands This section describes the syntax and parameters for the IRL Editor commands. You must press Enter after typing a command. The Enter key is not included in the syntax description. Use these commands to write and edit your programs with the Editor: D Delete E
End (and compile)
F
Find
I
Insert
L
List
M Enter Monitor Q Quit S
Substitute
U Usage
4-10
Page 89
D (Delete) IRL Editor Commands
4
D (Delete) Purpose:
Deletes one or more program statements.
Syntax:
D line number D line number [,line number]
Parameters:
line number is the statement number you want to delete. If you specify two numbers, the Editor deletes those two lines and all statements in between them.
Example
Result
D14
Deletes line 14
D1,6
Deletes lines 1 through 6
E (End) Purpose:
Ends the current editing session, compiles the program, and exits to Data Entry mode. If a compiler error is detected, an error message and the program line containing the error are displayed in the Editor.
Syntax:
E [modifier]
Parameters:
modifier is one of these options: RExit program. Compile all E statements in the IRL program as ER. TExit program. Compile all E statements in the IRL program as ET (same as ER). ZWrite protect. Once compiled, program cannot be changed by the Editor. RZExit program and write protect. TZExit program and write protect.
Examples
Result
E
Stops executing the program, and then starts executing again from the beginning.
ER
Exits Editor and compiles
ETZ
Exits Editor, compiles, and write protects the program.
4-11
Page 90
IRL Editor Commands F (Find)
F (Find) Purpose:
Locates a specific string and lists all occurrences of that string.
Syntax:
F [line number] [,line number] \string
Parameters:
line number is an optional starting line number for the search or a range of line numbers to search. The search is always forward to the end of the program or to the specified ending line number. string is the text to search for. Case is important: "LOOP" and "loop" are not the same string. The backslash (\) character is required at the beginning of the string.
Notes:
If your reader keypad does not have the backslash (\) character, you can attach a 1700 keyboard or you can scan the following bar code label. \ (backslash)
* %L* * %L*
Each line containing string is displayed in order, and some lines may scroll off the screen. To display only a few lines, use a range of line numbers with the I command. The Editor displays the first 20 occurrences of string, and then pauses the search and displays the >F prompt. Press Enter to continue searching.
Example
Result
F4\.inv
Searches from line 4 for ".inv" and displays all occurrences
F\$1
Searches from line 1 for "$1" and displays all occurrences
F11,25\$1
Searches from line 11 through line 25 for "$1"
4-12