Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeEnglishEspañolContact

The text of a manual · part 6 of 26

IRL Programming Reference Manual, pages 51 to 60

Pages 51 to 60 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 51

Learning to Program in IRL

2

HA=0 Q E The H (File Position) command is used here to clear file A. This command sets the total number of records stored in file A to zero. The Q command signals the end of the subroutine. The program control returns to the statement following the S command that branched to the .XMIT subroutine. In this case, the next statement is the G.START command.

2-25

Page 52

This page is a scan with no text; see it in the PDF.

Page 53

nugget code39 helconital

3 Programming Techniques

Page 54

nugget code39 helconital

Page 55

Programming Techniques

3

This chapter summarizes the structure and features of IRL, describes the tasks that IRL commands are designed for, and provides examples for using the commands.

Programming Basics This manual is designed as a guide and tutorial for novice programmers of IRL, but you must already understand the basics of programming and program structure. The sample programs from Chapter 2, “Learning to Program in IRL,” are used to illustrate programming techniques. This chapter covers these topics: •

IRL architecture

•

Program elements

•

Using input commands

•

Using output commands

•

Using data manipulation commands

•

Using program control commands

•

Using function keys

3-3

Page 56

IRL Programming Reference Manual

IRL Architecture IRL is part of the reader software and resides in the reader along with the firmware for system operation. IRL manipulates numeric registers, string registers, floating point registers, and file records. The number and types of registers available depend on the IRL version. This table summarizes the differences between the IRL versions: Item

IRL v2.X (94XX and 95XX readers)

IRL v4.X (JANUS readers)

Floating point registers

None

%0 to %9 (ten); for IRL v4.1 only Maximum of fifteen digits, from ± 1.7 X 10-308 to ± 1.7 X 10+308

Numeric registers

String registers

Program files

#0 to #9 (ten)

#0 to #9 (ten)

Seven digits, from 0 to 9999999

Nine digits, from 0 to 999999999

$0 to $3 (four)

$0 to $9 (ten)

128 characters per register

250 characters per register

1 only

Default is {IRL-1}.IRL You can use other valid DOS filenames. Maximum number depends on available disk space.

Data files

27 data files Default is file 0 A through Z The maximum size is 65,535 records or the amount of RAM available. 128 bytes per record

27 data files within a single IRL program. The maximum number stored on disk depends on available disk space. Default is file 0 IRL refers directly to files 0 and A through Z. These are stored on disk as {IRL-0}.IRD and {IRL-A}.IRD through {IRL-Z}.IRD. You can use other valid DOS filenames. Maximum file size depends on available disk space. 65,535 records maximum per file 250 characters per record

3-4

Page 57

Programming Techniques

3

String Registers The string registers are alphanumeric string registers, each with a maximum length of 128 or 250 characters. Register $0 serves as the default register for input/output functions and for storage. Several IRL commands let you manipulate the string register contents. For example, you can append the contents of one string register to the contents of another register. When you do any of the following, the string register is cleared:

• Begin executing a program. • Use the R (Record) command to transfer the contents of the register to a file.

• Use the D (Define) command to set the register equal to a null string.

Numeric Registers The ten numeric registers are labeled #0 through #9. You can only fill these registers with positive integers. No commas or decimal points are allowed. You can add, subtract, multiply, and divide the contents of the numeric registers. When you divide, the result is an integer and any remainder is lost. Although you can use all 10 numeric registers, you should avoid storing values in register #0. Certain commands return a number that indicates a status. This number is placed in register #0, and erases any other data stored there. If you place data in #0, it may be overwritten. You can convert a value in a numeric register to a string variable with the C (Convert) command. You can also convert a value in a string register to a numeric register, but the value must conform to the limits for numeric registers.

Floating Point Registers IRL version 4.1 includes ten floating point registers, labeled %0 through %9. You use the floating point registers for calculations with decimal numbers and negative numbers. For example, you can program the JANUS reader to collect item quantities as integers, and then multiply the quantity by the cost in dollars. 100 widgets at $1.89 each is $189. Thus, your reader can perform calculations before uploading the data to the host.

3-5

Page 58

IRL Programming Reference Manual

File Memory IRL version 2.X and version 4.X allocate memory to files in different ways. IRL version 2.X stores all program and data files in battery-backed up RAM. IRL version 4.X stores all files on disk.

IRL 2.X Memory Structure Once you enter your IRL program into the reader, the remaining free memory is allocated to data files for storing your data. All of the available memory is allocated to the default file (file 0) unless you designate separate files. You can have up to 26 designated files, labeled A to Z. All data files contain records, each of which is a string variable. Each record contains up to 128 bytes. The following figure illustrates the organization of IRL within a reader.

The Organization of IRL version 2.X Within a Reader

Default File (file 0)

0(0), 0(1), 0(2), 0(3)...., 0(n)

Z(0), Z(1), ... Z(n-1), Z(n)

IRL Files (A to Z)

• • •

B(0), B(1), ... B(n-1), B(n) A(0), A(1), ... A(n-1),A(n)

RAM Memory

IRL Program

Registers, Variables

Firmware

ROM Memory

IRL-3

3-6

Page 59

Programming Techniques

3

IRL 4.X Memory Structure JANUS readers store all files on disk. You can have several program files stored on a reader, but you can only run one program at a time. You can also have several data files. Within the IRL program, you can use up to 27 data files and refer to the files with the labels A to Z and 0. For more information, see Chapter 7, “IRL Command Descriptions,” and Chapter 5, “Using IRL With JANUS Readers.”

Default File The number of records in the default data file is limited only by the amount of memory available in the reader. For IRL version 2.X, your IRL program cannot access the data stored in File 0. In other words, once you have stored data in the default file, the only thing you can do with it is upload it to a host computer. You cannot manipulate the data in any way. If you want your IRL program to access the data, store the data in a designated file (A-Z). For IRL version 4.X, your IRL program can read data from and write data to File 0.

Opening and Naming Files in IRL v2.X You use the O (Open) command to create separate data files. The files are labeled A through Z. IRL v2.X and IRL v4.X allocate file memory differently, but you open and refer to the files the same way. When you open a file in IRL v2.X, you specify how many records it will contain and the maximum length of each record. You can have up to 65,535 records of 128 bytes each (if memory allows). For example: OA(100,20)

This command statement opens file A, which can contain up to 100 records of 20 bytes each. The entire file space that you have allocated is reserved, whether or not you use it. The string length and check sum add two bytes per record to the file size. Thus, in the above example, you have taken 2200 bytes (100 x (20 + 2)) from the default file and allocated them to file A. When you compile an IRL v2.X program, the reader sets aside memory for the data files based on the size and number of records you specified. Any remaining memory is allocated to File 0. If you designate more space to a file than remains in memory, an error message and the offending O command statement are displayed.

3-7

Page 60

IRL Programming Reference Manual

Opening and Naming Files in IRL v4.X You use the O (Open) command to create separate data files. The files are labeled A through Z within the IRL program. For complete information on data files for JANUS readers, see “Working With IRL Files” in Chapter 5, “Using IRL With JANUS Readers.”

Purging Data Files When you transmit a file to a host computer, the file is only copied. The data in the file remains on the reader. Exiting the program or shutting off the reader does not empty the file, because the battery back-up maintains it. You must empty the file before beginning the program again or you will merely append more data to it. To purge the data, you can either use an H (File Position) IRL command or the Delete All Data reader command. The H command is explained later in this chapter and in Chapter 7, “IRL Command Descriptions.” To purge data from 94XX and 95XX readers 1. Enter this command from the keypad or keyboard while the reader is in the data entry mode: .$[data] where data specifies the data to be cleared: A to Z Purge data from a specific designated file. Issue this command once for every designated data file you want purged. 0

Purge data from the default file.

1 or 2

Purge all data from all data files and the IRL program itself. If you do not specify a parameter, the reader asks if you want to clear all data.

2. Press Ctrl-Enter. See your reader manual for details on the Delete All Data command. Note: For JANUS readers you can use the DOS Delete command to delete an entire data file.

Input and Output All Intermec readers have several input and output (I/O) devices that your program can use. The I/O commands are limited by the hardware available in the reader, such as the display size. The I/O commands address these devices:

3-8