The text of a manual · part 14 of 26
IRL Programming Reference Manual, pages 131 to 140
Pages 131 to 140 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 131
User Tips for All IRL Versions
6
Note: Use a modem-secure protocol, one that checks for errors in transmission, whenever possible. This is particularly important when using a modem, because of the varying quality of telephone transmissions and the greater risk of transmission error.
Receiving Records Data is received continuously by the reader host port until the input buffer is full or can receive no more messages. To receive a record (string data up to 128 characters long) from the host, the reader must execute a VMP, VMN, YMP, or YMN command to transfer the record from the input buffer to the input register, $0. The YMP command can also be used with a filename, in which case the data from the input buffer is transferred directly into the named file rather than into the input register. If a previous message (perhaps a result of noise in the connection) is already stored in the input buffer when a desired record is expected from the host computer, the buffered message will be appended onto the input register by the above commands, instead of the expected record. To eliminate this problem, you can purge the input buffer before a message is expected. In the following example, the reader is connected to a host computer that is configured to send a data record with protocol as soon as it receives a “Do It” string. Before the record is requested from the host, the input buffer is cleared by changing the input protocol to No Protocol: D$1="Do It" YMN;1 XMP,$1 D$0="" YMP
:.Define command string :.Select No Protocol :.Tell host to "Do It" :.Clear input register :.Change protocol, clear input buffer. : Receive record from host and transfer : record from input buffer to $0
Receiving Files Files must be received from the host one record at a time. To receive a whole file, a program loop must be executed that will receive each record in turn and save it to a file record in the reader. A protocol must be established that will allow both the reader and the host to know how many records will be transferred. This can be as simple as always transferring files of a set number of records, or sending messages to indicate when a file transfer is complete. Note: The YMP,Filename commands transfer data directly to a file.
6-11
Page 132
IRL Programming Reference Manual
Transmitting Records Records are transmitted from within IRL programs with the X (Transmit Data) command. Any string register or file record can be selected by the X command and transmitted from either the modem port or the terminal port. If no protocol is selected, data characters are sent to the designated I/O port without any handshake or error checking. If protocol is selected, the currently configured protocol is used while sending the data to the I/O port.
Transmitting Files You can transmit any designated IRL file, or the default file, with a single X command during IRL program execution. The IRL Z command cannot execute the reader command Transmit File (%%) during an IRL program. The X command transmits a file one record at a time, in ascending order from record 0 to record n-1 of a file with n records. When no protocol is selected, record data is transmitted continuously, one record right after another. When protocol is selected, each record is separated from the next with the Start of Message (SOM) and End of Message (EOM) characters designated by that protocol. The transmission of each record is then controlled by the host computer in accordance with the selected protocol. Once the whole file has been transmitted, an End of File (EOF) character is sent to the host computer and transmission is ended. Establish a data handling protocol of some kind between the reader and the host so that the host is prepared to receive the data from the reader in the format that it is sent. For details of the various protocols you can use, see the Data Communications Reference Manual, Part No. 044737.
DLE Character The Data Link Exception (DLE) character is used to indicate that a transmitted character is to be accepted by the receiving device as a data character and not a control character. The DLE character precedes the data character and is not recorded by the receiving device. See your reader manual for details.
6-12
Page 133
7 IRL Command Descriptions
Page 134
Page 135
IRL Command Descriptions
7
This chapter describes the function, syntax, and use of each IRL command. The commands are listed in alphabetical order.
Understanding the Description Formats The command descriptions in this chapter use these conventions: This Convention
Means italic
Indicates a variable that you replace with a real value.
""
Indicate literal string entries. Include the straight quotation marks in the command, such as P"Enter Quantity..."
[]
Usually indicate optional parts of the command string. Do not include the brackets in the command unless the parameter description states that they are required. For example: This sample syntax description has an optional parameter: XAB,C[;time] The function for string length requires brackets: D#1=[$2].
| (vertical bar)
Indicates optional parameters: use either the first parameter or the second parameter. Use only one of the parameters and do not include the bar in the command. For example: This sample syntax description has two exclusive parameters: A [len, len, len, len, len | mask] [;time]
, . ()
Required punctuation: commas (,), semicolons (;), periods (.), or parenthesis (( )). Type these marks just as they appear in the Syntax description.
bold type
Emphasizes command names in text. For example, “See the C (Convert) command later in this chapter.”
Notes, Notes IRL v2.X, Notes IRL v4.X
Indicates notes for command descriptions. The Notes section applies to all IRL versions. The Notes IRL v2.X and Notes IRL v4.X apply only to that version and are in addition to any general notes.
spaces and indents
Make the program statements easier to read. The Syntax descriptions include optional spaces between parameters. IRL ignores these spaces at compile time.
7-3
Page 136
IRL Programming Reference Manual
IRL Version Notes Specific differences in IRL v2.X and IRL v4.X commands are noted in the descriptions. These general differences apply to all commands: Item
IRL v2.X
IRL v4.X (JANUS readers)
Floating point registers
None
%0 to %9 (ten) IRL v4.1 only
Numeric registers
#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
String registers
Program files
Maximum of fifteen digits, from ± 1.7 X 10-308 to ± 1.7 X 10+308
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 If RAM is available, the maximum size is 65,535 records 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
For more information, see your reader manual or Chapter 5, “Using IRL With JANUS Readers.”
Page 137
IRL Command Descriptions
7
IRL Commands The IRL command descriptions that follow are in alphabetic order. Use this table to help locate a specific command. Data Manipulation Commands
Alphabetic List
C
Convert, 7-12
A
ASCII Input, 7-8
D
Define Data, 7-14
B
Beep, 7-11
O
Open File, 7-33
C
Convert, 7-12
D
Define Data, 7-14
E
End, 7-17
F
Function Output, 7-19
G
Goto, 7-21
Input Commands A
ASCII Input, 7-8
I
Insert, 7-24
K
Keyboard Input, 7-26
N Numeric Input, 7-31 U
Unedited Input, 7-45
V
Universal Input, 7-47
Y
Receive Data, 7-53
H File Position, 7-23 I
Insert, 7-24
K
Keyboard Input, 7-26
L
Lookup Record, 7-29
N Numeric Input, 7-31
Output Commands
O
Open File, 7-33
B
Beep, 7-11
P
Prompt, 7-36
F
Function Output, 7-19
Q
Quit Subroutine, 7-38
P
Prompt, 7-36
R
Record, 7-40
R
Record, 7-40
S
Call Subroutine, 7-41
T
Time, 7-43
T
Time, 7-43
X
Transmit Data, 7-50
W Wait, 7-49
Program Control Commands
X
Transmit Data, 7-50
.
Label, 7-6
Y
Receive Data, 7-53
:
Comment, 7-7
Z
Execute Reader Command, 7-56
E
End, 7-17
G
Goto, 7-21
H File Position, 7-23 L
Lookup Record, 7-29
Q Quit Subroutine, 7-38 S
Call Subroutine, 7-41
W Wait, 7-49 Z
Execute Reader Command, 7-56
7-5
Page 138
. (Label)
. (Label) Purpose:
Labels a line in the program. Use a label to mark the beginning of a subroutine or to locate a destination for the G (Goto) and S (Call Subroutine) commands.
Syntax:
.aaaaaaa
Parameters:
. A label always begins with a period and contains only one period. aaaaaaa A label contains up to seven characters. Any printable ASCII character is allowed, except for spaces, colons (:), or additional periods. Labels are case specific. These three labels are not the same: .label, .Label, and .LABEL.
Return Value: Notes:
None. The label must be on a line by itself, without any other statement. You can use each label as a program statement only once within a program, but you can reference the label several times. When possible, use descriptive labels to indicate the purpose of the routine or subroutine. You can include a comment after the label to make your program easier to read.
Examples .Add .add
This label is unique. This label is unique.
.ADD
This label is unique.
.ADD#3#4
Describes the function of the routine.
.PARSE$2
Describes the function of the routine.
7-6
Page 139
: (Comment)
7
: (Comment) Purpose:
Indicates a comment within an IRL program. Use comments liberally to provide a description of the logic flow and processes you use.
Syntax:
: comment text
Return value: Notes:
None. Any characters after the colon (:) are treated as comments and are ignored by IRL. You can include comments anywhere within an IRL program statement after an IRL command. You can also include blank lines to make your program easier to read.
Examples : Inventory program P"Ready for input" A
: prints message
: wait for input
7-7
Page 140
A (ASCII Input)
A (ASCII Input) Purpose:
Accepts ASCII character (alphanumeric) input from the scanner, keypad, or keyboard and appends the data to string register $0. Readers running IRL 2.X accept up to 128 characters. Readers running IRL 4.X (JANUS readers) accept up to 250 characters.
Syntax IRL v2.X:
A [len] [, len] [, len] [;time] A [len] [, len] [, len] [, len] [, len] | [mask] [;time]
Syntax IRL v4.X: Parameters:
len is a number or numeric register that indicates an acceptable length for input data. The reader only accepts input that matches one of the specified lengths. For example, A4 only accepts data that is 4 characters long. For IRL v2.X, you can set up to three lengths. For IRL v4.X, you can set up to five lengths. The lengths can be a fixed value (such as 10) or a range (such as 2-4). For example, A 2-4,10 accepts a string that is two, three, four, or ten characters long. You cannot specify a length and a data mask. If you omit len, then data of any length is accepted. mask is a data mask that only accepts input that matches the format you define with wild card characters. ? Any alphanumeric character # Any number @ Any letter (uppercase or lowercase) For example, the following command only accepts input that contains three letters, a dash, and three numbers. A"@@@ - ###" You cannot define a length and a mask in the same statement. If you omit len and mask, then data of any length is accepted. ;time Sets the receive timeout period from 1 to 6500. If the reader does not completely receive the data within (time X 10) milliseconds, the next statement is executed.
7-8