The text of a manual · part 13 of 26
IRL Programming Reference Manual, pages 121 to 130
Pages 121 to 130 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 121
6 User Tips for All IRL Versions
Page 122
Page 123
User Tips for All IRL Versions
6
This chapter provides helpful tips for working with IRL. These tips are taken from IRL user group discussions and engineers who create and work with IRL.
Using the Tips This chapter summarizes information that is covered elsewhere in this manual and in reader manuals. Use this chapter as a quick reference on these topics: •
Entering keypad and keyboard characters
•
Formatting the reader display
•
Performing binary searches in IRL
•
Receiving data
•
What is data communications
•
The input buffer
•
Transferring data
6-3
Page 124
IRL Programming Reference Manual
Entering Keypad and Keyboard Characters Your reader accepts keyed input from the reader keypad, an attached 1700 keyboard, or an attached terminal with keyboard. Your reader keypad and the keyboard may use a different sequence of keys to generate the same ASCII character. The following table lists the differences. ASCII Character
9440 Keypad
1700 Keyboard
Backslash \ (5CH)
Ctrl-2
Alt 7
NULL (00H)
Ctrl-.
Ctrl Alt N
HT (09H)
Ctrl-P , Ctrl-I
Ctrl-P , Ctrl-I
BS (08H)
Ctrl-P , Ctrl-H
Ctrl-P , Ctrl-H
CR (0DH)
Ctrl-P , Ctrl-M
Ctrl-P , Ctrl-M fT cp cI cH cM
JANUS
•
Most control characters (ASCII characters 0 through 31) can be entered with a Ctrl-character pair. Characters 1 through 26, for example, are represented with Ctrl-A through Ctrl-Z, respectively.
•
The backslash character (\) character is used extensively to enter ASCII control codes within reader configuration commands and to enter special display control characters.
•
The NULL character (ASCII character 00 hex) is used frequently during reader protocol configuration to disable communications events.
•
The HT and BS characters have dedicated display functions while in the IRL editor. You normally enter the control character HT by pressing Ctrl-I. In the IRL editor, Ctrl-I changes the editor mode from Display Edit to CRT Edit or back again. You normally enter the control character BS by pressing Ctrl-H.
6-4
Page 125
User Tips for All IRL Versions
6
JANUS Reader Keys and 94XX Keys The JANUS reader keypads are different from the 94XX TRAKKER keypad, and some keys return a different string value. •
The input buffer stores function keys as a two-character sequence. 94XX readers support function keys F1 through F8. The JANUS readers support F1 through F12. While DOS programs respond to F11 and F12, IRL v4.X ignores F11 and F12 and does not return them from the input buffer.
•
When you use the commands U and V for unedited input on a JANUS reader, several keys return a different value than on the TRAKKER. This table lists the keys and the input strings returned from the TRAKKER keypad and JANUS 2010 keypad: Keypad Name s t
F9 F10 F11 F12
Keys to Press
TRAKKER String
JANUS String
Alt B
%/
None fo fp ffl ffm
%+
None
None
F9
None
F0
None
None
None
None
Alt A
Formatting the Reader Display Most of the commands that affect the reader display work on the 944X and 95XX readers, but most advanced display features are only useful on the larger 944X or JANUS displays.
Using Transparent Display Mode When you set the bar code reader to Transparent display mode, you have complete control over the reader’s display. Any automatic formatting features, such as autoscroll, autowrap, and the addition of CR/LF sequences to prompt messages, are disabled.
6-5
Page 126
IRL Programming Reference Manual
Use the following screen manipulation commands in Transparent mode: Screen Action
Character Sequence
Clear Display
\e[2J
Cursor Position
\e[r;cH where: r = row, I= column
Save \e[s Restore
\e[u
Line Feed
\n
Carriage Return
\r
Backspace
\b
Escape (ESC)
\e
Backslash (\)
\\
ASCII Character
\0xhh where: hh = character’s hex value
Tip: When you execute Z commands from an EPROM program, the display will noticeably flicker. To give the reader display a snappier look, clear the display with the Clear Display command \e[2J before executing Z commands in EPROM programs. JANUS readers do not use EPROM programs.
Using a Protected Field in the Display The protected field is an area on the display that you can manipulate separately from the rest of the display. You can reserve all or part of the bottom line of the display, excluding the far left character, for a protected message. If you do not specify a protected field message, then the bottom line is displayed normally. If you do specify a protected field message, then the message is protected from being overwritten by other data. To specify a protected field message •
Enter the following Z command Z"\0x09message" where message is your protected field message.
To clear a protected field message •
Enter the following Z command Z"\0x09"
6-6
Page 127
User Tips for All IRL Versions
6
Performing Binary Searches in IRL IRL is able to download, store, and search large reference files. Instead of sequentially searching through a file from top to bottom, you can perform a binary search to quickly locate a specific entry in a file. In a binary search, the file records are sorted beforehand and searches are performed by a process of elimination. While a sequential search may have to look through every byte of information in a file, a binary search will locate the required entry in only a few cycles. A binary search would need no more then ten look-up cycles to locate any record within a file of over two thousand records. A binary search works by comparing the desired entry to the first and last entries in the reference file. If the desired entry is out of that range, then the entry does not match and the search ends. If the entry is between the two values, the end pointer is set to the middle entry in the file, and the values are compared again. The binary search continues dividing the search area in half until the entry is located or the search fails. To perform a binary search 1. Sort your reference file on the host and download it to the reader. You can sort the file on any criteria, such as alphanumeric order. 2. Open the reference file A and an exception file B in your IRL program. 3. Set the upper limit pointer (UL) to equal n, the last record in the file. 4. Set the lower limit pointer (LL) to 0, the first record. See the illustration after this procedure. 5. Find the middle entry (M) of file A. M = (UL + LL) / 2 6. Compare record A(M) with the search string, using the criteria set in step one. • If A(M) matches, you are done. • If A(M) < search string, then set LL = M. • If A(M) > search string, then set UL = M. Half of the records to search have been eliminated. Each time this step is performed, the number of records to search is halved. 7. Repeat from step 3 until you have a match or until LL = UL. When LL = UL, you have searched the entire file and no match is present.
6-7
Page 128
IRL Programming Reference Manual
A(0)
LL Data (O) Data (1)
M
A(M)
A(N)
Data (N)
UL IRL-2
As data is collected and an exclusion file is created, you will have to search the exclusion file sequentially until you upload it to the host computer. The host can add the exclusion file to the reference file and sort the data again. Meanwhile, the bulk of the reference data is still searched quickly and efficiently with the binary search routine. Appendix C, “Sample IRL Programs,” contains a binary search program.
Searching During Selective Data Collection In selective data collection, you may want to record only new items or only items that match existing part numbers. A common approach to selective data collection follows these steps: 1. The host computer sorts the reference file. 2. The host downloads the reference file to the reader. 3. The reader is used to collect data. 4. The reader compares the collected data to the reference file as the new data is collected. A binary search is used to speed the search process. 5. Differences between the reference data and the collected data are stored in an exception file.
6-8
Page 129
User Tips for All IRL Versions
6
6. Data collection is repeated as needed. 7. The reader transmits the exception file to the host. 8. The host updates and re-sorts the reference file. You are ready to begin another data collection cycle.
Receiving Data The following limits apply to all data input: •
512 byte input buffer
•
256 byte minimum free buffer space is required when using a polling (ACK/NAK) protocol
•
128 characters maximum in any register or record for IRL v2.X
•
250 characters maximum in any register or record for IRL v4.X
The input buffer receives data as long as there is room for more. During unsecured (non-polling) input of data, this may cause a problem. If a pointer is available and there is buffer space left, the input is attempted. During a nonpolling protocol, input is attempted even if the incoming message is larger then the available buffer space. Excess data is dropped once the buffer is full. When input stops, only part of the message is stored, and the message is flagged as a bad receive. The I/O driver purges this message and the buffer is again capable of receiving data. If the next message is small enough, it is stored in the buffer. Meanwhile, the intervening message data is gone, and the sequence of received messages is corrupted.
What Is Data Communications? The flow of data between a host computer and a reader is called data communications. All Intermec equipment follows the data communications standards established by the International Standards Organization (ISO). Your reader is equipped with a serial communications port to connect to a remote host computer, either through a modem or a direct connection. Your reader and the host send ASCII characters back and forth in the form of binary data. Some of the data is information characters, and some is control characters. To send and receive data without errors, you need to configure the reader and the host for the same communications parameters and protocols.
6-9
Page 130
IRL Programming Reference Manual
Various communication events, such as a Clear to Send (CTS) signal or an End of Message (EOM) character, are optional events within readers and can be enabled or disabled as needed. The nature and significance of these events are discussed in detail in the Data Communications Reference Manual, Part No. 044737.
The Input Buffer Communications ports are provided on readers to allow two-way communications between the reader and remote devices. Refer to your reader manual for details about the communications ports provided on your readers. The port designated as the host or modem port on your reader has an input buffer and all data is buffered as it is received from the host. Data is transferred to the IRL program from the top of the buffer during the following conditions:
• A VMP or VMN (Universal Input, modem allowed) command is executed during an IRL program.
• A YMP or YMN command is executed in an IRL program. As messages are transferred to the IRL program, the next pointer becomes the top of the buffer and the last pointer becomes the bottom. The input buffer is purged whenever any parameter of the reader’s receive protocol is changed. This includes changing from the Protocol to No Protocol option of the V or Y commands. This does not affect any data that is in IRL files or IRL registers.
Transferring Data While the reader is connected and configured to talk to the host computer, either directly or by modem, data messages can be transferred back and forth between the two devices.
CAUTION
Caution You can lose data if you transmit or receive data without a protocol. Use a protocol to ensure that the host and reader expect data in the format that it is sent. Conseil Vous risquez de perdre des données si vous envoyez ou recevez des données sans un protocole. Utilisez un protocole pour vous assurer que l’hôte et le lecteur s’attendent à des données sous le même format.
6-10