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 7 of 26

IRL Programming Reference Manual, pages 61 to 70

Pages 61 to 70 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 61

Programming Techniques

Input Devices

Output Devices

Wand/laser scanner

Display

Communications ports

Communications ports

Keyboard or keypad

Beeper

Real-time clock

Real-time clock

Sense inputs on a 9560

Output relays on a 9560

3

Status lights (LEDs)

Program Elements An IRL program is a series of program statements that are stored in a reader’s memory. A program statement is one instruction in a program that gives directions to the reader about what data to collect and what to do with the data once it is collected. Your program statements can contain reader commands, special characters, and program commands.

Reader Commands Reader commands directly control the reader’s functions. There are reader commands to start running your IRL program, to exit the program, and to increase the volume of the beeper. You can enter reader commands from the reader keypad, the 1700 keyboard, a host, an attached terminal, or from a bar code label scanner. You can also execute reader commands within an IRL program. You use the Z (Execute Reader Command) command to specify and execute reader commands during an IRL program. For example, you could raise the beep volume temporarily to give an extra amount of warning to the operator. The Z command is covered in detail in Chapter 7, “IRL Command Descriptions” and in “Using Program Control Commands” later in this chapter.

Special Characters You can use IRL with several special characters that have no single character to represent them, such as the carriage return, line feed, and backspace.

3-9

Page 62

IRL Programming Reference Manual

You enter non-printable ASCII control characters with a backslash (\) character sequence in this format: \0xhh where hh is the hexadecimal value of the ASCII control character, taken from the ASCII chart in Appendix A. For example, the string \0x0D represents hexadecimal 0D, which is a carriage return. The string \0x0A\0x0D represents hexadecimal values 0A and 0D, which is a line feed-carriage return. You can use these backslash (\) sequences in IRL programs: \b Backspace character \e

Escape character

\n New line (line feed) character \r

Carriage return character

\\ Backslash If the backslash is followed by any other character (other than in a hexadecimal sequence), the backslash is ignored.

Program Statements Each statement contains a valid IRL command, followed by parameters or ASCII symbols that represent the data to be manipulated by the command. The command parameters are briefly discussed later in this chapter and in more detail in Chapter 7, “IRL Command Descriptions.” These rules apply to all program statements:

3-10

•

Command statements can be the length of a string register, 128 or 250 characters long.

•

Blank spaces outside of literal strings are ignored by the reader. Use spaces to make your program easier to read.

•

IRL data and input are case sensitive: the letters A and a are considered different letters.

•

IRL commands can be uppercase or lowercase. When possible, use uppercase letters for program commands for clarity. If you download your program from PC-IRL, lowercase commands are converted to uppercase automatically.

Page 63

Programming Techniques

3

Program Command Types IRL uses 26 unique commands. Each command is either a letter, period, or colon. The commands are short to save reader memory. Command

Description

Command

Description

.

Label

N

Numeric Input

:

Comment

O

Open File

A

ASCII Input

P

Prompt

B

Beep

Q

Quit Subroutine

C

Convert

R

Record

D

Define Data

S

Call Subroutine

E

End

T

Time

F

Function output

U

Unedited input

G

Goto

V

Universal input

H

File position

W

Wait

I

Insert

X

Transmit data

K

Keyboard input

Y

Receive data

L

Lookup record

Z

Execute Reader command

IRL commands are grouped into four categories: Input Commands Accept input from the wand or scanner, the keyboard, the keypad, the real-time clock, or the communications ports. Output Commands Send output to the display, the beeper, the communications ports, the real-time clock, or the status lights (LEDs). Data Manipulation Commands and retrieving it. Program Control Commands

Perform operations on data, including storing Control the execution of the IRL program.

The following sections describe how these commands are used in IRL programs. For a detailed description of each command and its parameters, see Chapter 7, “IRL Command Descriptions.”

3-11

Page 64

IRL Programming Reference Manual

Using Input Commands Input commands instruct the reader to accept ASCII input from these devices: •

Wand or laser scanner

•

Keypad or keyboard

•

Communications ports

•

Time clock

Certain input commands let you specify which device or devices are valid for data collection, as well as the format and length of the input data. For example, your program may require scanned data for part numbers and keyed data for quantities. The reader can receive data concurrently from all devices you have selected. The data is appended to the input register ($0) until the input is terminated. Note: If your program does not have at least one input command, you will get a compiler error message. An IRL program requires at least one input command. There are seven input commands: A ASCII Input K Keyboard Input N Numeric Input U Unedited Input V Universal Input Y Receive Data T Time append The A, K, and N commands are edited input commands. That is, the reader checks the input data for valid reader commands and executes any found. The U and V commands are unedited input commands: the reader does not check the data for reader commands. You can modify the V command to check for some reader commands.

Receiving Edited Data The edited input commands, A (ASCII), K (Keyboard), and N (Numeric), accept ASCII input from a specific source and check the input for reader commands. The A command accepts data from a keyboard, keypad, wand, or scanner.

3-12

Page 65

Programming Techniques

3

The K command only accepts data from a keyboard or keypad, and the N command only accepts numbers. Typical reader commands include: •

Enter Accumulate

•

Exit Accumulate

•

Backspace

•

Capacity

•

Clear

•

Enter

•

Exit Program

•

Forward

•

Review

See your reader manual for a complete list of supported commands.

Receiving Unedited Data The U (Unedited) and V (Universal) accept all input as data. Any imbedded reader commands are not executed. The U and the V commands are similar, but the Universal command provides more control and variety. You can add parameters to the U and V commands to expand or restrict what the user can do. Thus, you can add a parameter that instructs the reader to accept only wand or modem input. Essentially, unedited input commands give you more control. You can limit the tasks that the reader operator can perform and still collect data. For more information, see Chapter 7, “IRL Command Descriptions.”

Appending Input Data As you enter data, it is appended to the default register, $0. If you do not clear that register, subsequent inputs continue to be appended until the register is full. When you scan bar code data, the entire label is appended to $0. If the input register is full, or if there is insufficient space for the complete label, an error occurs. The input stops, the reader beeps, and any scanned data that cannot be appended in its entirety is lost. You must clear the register and scan the label again.

3-13

Page 66

IRL Programming Reference Manual

There are two ways to clear register $0 while a program is executing: •

Use the R (Record) command to move the data to a file

•

Use the D (Define) command to define a null string ("") to the register

Note: The register is also cleared at the beginning of the program.

Receiving Data From a Communications Port The reader can accept data from a host or a terminal using the Y (Receive Data) command. The following table lists the readers and their available ports. Reader

Ports Available

Connection Type

94XX

Modem (Host)

RS-232

95XX

Terminal, Modem (Host)

RS-232, RS-422, RS-485

JANUS

COM1

RS-232, RS-422, RS-485, Communications dock

COM2

RS-232

COM4

RF only

If your reader does not have a specific port, it ignores commands to receive from that port. For proper operation, the reader’s protocol must be the same as the protocol of the terminal and the host computer. The reader’s communication protocol is preset at the factory to default values. You can configure the reader protocol before starting an IRL program or from within the program using reader configuration commands. It is best to set the protocol before you execute the program. In addition, the 94XX and JANUS readers can receive data from the host port directly into an opened file. Readers that use IRL version 2.1 append data from the host to register $0 only.

Appending the Time The T (Time) command is both an input and an output command, but you are most likely to use it as an input command. Use it as an input command to append the time or the time and date to register $0.

3-14

Page 67

Programming Techniques

3

Use it as an output command to set the clock within your reader. However, you can only set the day, hour, minutes, and seconds with the T command. Because the year and month must be set with a reader command, you will probably find it more efficient to set the entire date and time with the reader command. See your reader manual for information on setting the time and date with a reader command. You can use the Z command to execute the reader command to set the time and date within an IRL program. See “Using Program Control Commands” later in this chapter for details.

Using Output Commands The output commands are: P

Prompt

B Beep F

Function output

X Transmit data Output commands send data to these devices: •

Display

•

Beeper

•

Status lights (LEDs)

•

Communications ports

The display size and status light configurations depend on the type of reader.

Creating Prompts and Messages Readers can display messages and prompts on their screens, telling users what information to enter next and what action to take next. Use the P (Prompt) command to display information to the screen. These commands display the text inside the quotation marks: P"Enter Part #" P"Must Xmit Now"

If the information you want displayed takes up more than one line of your reader display, you can use several P commands to display your message.

3-15

Page 68

IRL Programming Reference Manual

Note: For compatibility with earlier versions of IRL, the P command will also work without quotation marks. However, if you omit the quotation marks, all the text after the P is displayed, including any comments in the statement.

Using Sound and Lights Along with the display, all readers can generate a two-tone beep. The 9450, 9512, 9550, and 2050 readers also have status lights (LEDs). You can use both sound and lights to provide information to the reader operator. Beeps provide an easy and obvious method for communicating with the user. For example, when the reader is turned on, it beeps several times to let the user know it is ready. Use the B (Beep) command to insert beeps into your programs. You can vary the high and low tones and the number of beeps to convey different messages. In Program Three in Chapter 2, “Learning to Program in IRL,” the beeping lasts longer as the memory gets close to being filled. The status lights found on the 95XX readers have a predefined use, which is explained in your reader’s user manual. You can use the F (Function Output) command to redefine the use of a particular light. There are five status lights on the 9512 and the 9550 readers. You can redefine four of them. You cannot redefine the power status light, which comes on when the reader is turned on.

Transmitting Data The X (Transmit Data) command transmits data from the reader’s communications port, terminal port, or modem port. The ports available depend on the type of reader. If your program references a port that the reader does not have, the command is ignored. For a successful transmission, the reader’s protocol must match the protocol of the terminal and the host computer. Refer to your reader manual for information on the default protocol values and the reader configuration commands for changing the protocol.

Using Data Manipulation Commands Most of your programs will manipulate data. IRL can transfer data from a string register to a file and perform mathematical calculations or string operations to verify your data.

3-16

Page 69

Programming Techniques

3

You can use five data manipulation commands: R Record O Open File I

Insert

C Convert D Define Data The R, O, and I commands each have a single function, while the C and D commands have multiple functions. These functions are described in the next sections.

Storing Data Use the R command to store data in a file within your reader’s memory. The R command moves data from the string register $0 to default file 0, unless you specify another string register or file. For example, this command transfers data from $0 to file A: RA

When the R command moves data from a string register, it also clears the data from the string register. For example, this command moves data from $2 to file J and then clears $2: R$2J

You cannot transfer data from a numeric register to a file. You must first convert the numeric data to string values with the C command. Then you can use the R command with the string register to transfer the data to a file.

Opening Files Use the O (Open) command at the start of a program to open a designated file (A to Z). If you do not open a designated file, all data is collected in file 0, the default file. Readers running IRL v2.X cannot manipulate data in File 0. You can only transfer the data to a host computer. When you open a designated file in IRL v2.X, you must specify the number of records in the file and the number of bytes in each record. For example, this command opens file A, which contains 15 records of 10 bytes each: OB(15,10)

3-17

Page 70

IRL Programming Reference Manual

When you open a designated file in IRL v4.X, you can use a dimensioned or undimensioned file. For a dimensioned file, you specify the number of records in the file and the number of bytes in each record. For more information, see Chapter 7, “IRL Command Descriptions,” and Chapter 5, “Using IRL With JANUS Readers.” Note: The O command must be the first command in the program except for comments. Use one O command for each file you open, although you do not have to follow alphabetic order in opening your files.

Appending Data Use the I (Insert) command to append data to a string register. For example, the three sample programs in Chapter 2 use the I command to insert a comma between two separate pieces of information within a record. You must enclose the characters you are inserting inside quotation marks. Note: For compatibility with earlier versions of IRL, the I (Insert) command also works without quotation marks. However, all information after the I is displayed, even comments. Therefore, it is recommended that you use quotation marks at all times.

Converting Data Use the C (Convert) command to move data between string registers and numeric registers. Mathematical operations can be performed only in numeric registers and string operations can be performed only in string registers. Thus, you might have to convert your data from one type of register to another to perform the operation that you want. Converting data in a numeric register to a string register or a file record is a straightforward process. The number in the numeric register simply converts to a string of alphanumeric characters, all of which happen to be numbers. The program then handles this data as a string, rather than as a number. Converting data in a string register to a numeric register has more limitations. A numeric register accepts only up to seven or nine integers. No commas, decimals, or other characters are allowed. Therefore, when you convert string data to numeric data, you must know the kind of data you are moving and be aware of these conversion rules:

3-18

•

Non-numerical characters that come before a number are dropped.

•

Non-numerical characters following a number are converted to zeros.

•

Any character after the seventh or ninth character is dropped.