Intermec Finger Print Developers Guide IPL
Intermec Finger Print Developers Guide IPL
Developer’s Guide
Intermec Technologies Corporation
Worldwide Headquarters
6001 36th Ave.W.
Everett, WA 98203
U.S.A.
www.intermec.com
The information contained herein is provided solely for the purpose of allowing customers to operate and service
Intermec-manufactured equipment and is not to be released, reproduced, or used for any other purpose without
written permission of Intermec Technologies Corporation.
Information and specifications contained in this document are subject to change without prior notice and do not
represent a commitment on the part of Intermec Technologies Corporation.
© 2008 - 2009 by Intermec Technologies Corporation. All rights reserved.
The word Intermec, the Intermec logo, Norand, ArciTech, Beverage Routebook, CrossBar, dcBrowser, Duratherm,
EasyADC, EasyCoder, EasySet, Fingerprint, INCA (under license), i-gistics, Intellitag, Intellitag Gen2, JANUS,
LabelShop, MobileLAN, Picolink, Ready-to-Work, RoutePower, Sabre, ScanPlus, ShopScan, Smart Mobile
Computing, SmartSystems, TE 2000, Trakker Antares, and Vista Powered are either trademarks or registered
trademarks of Intermec Technologies Corporation.
There are U.S. and foreign patents as well as U.S. and foreign patents pending.
Version
Number Date Description of Change
002 7/2009 Updated document for new printer models and new symbologies.
001 7/2008 Initial release of this document. Content in this document was
originally located in:
• the Fingerprint Programmer’s Reference Manual
(P/N 937-005-001).
• the Intermec Fingerprint 8.00 Tutorial (P/N 1-960608-00).
Contents
Before You Begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
Safety Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
Global Services and Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
Who Should Read This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv
Related Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv
1 Introduction to Fingerprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1
What Is Fingerprint?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2
Handling Faulty Dots With HEAD, SET FAULTY DOT, and BARADJUST . . . . . . . . . . 107
Checking Printhead Status With FUNCTEST or FUNCTEST$ . . . . . . . . . . . . . . . . . . . . . 109
Reprinting Labels After Interruptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
About Batch Printing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
PM4i . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
PD42 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
I Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .159
Safety Information
This section explains how to identify and understand the notes that are in this
document.
Note: Notes either provide extra information about a topic or contain special
instructions for handling a particular condition or set of circumstances.
Web Support
Visit the Intermec web site at www.intermec.com to download our current manuals
(in PDF).
Visit the Intermec technical knowledge base (Knowledge Central) at
www.intermec.com and click Support > Knowledge Central to review technical
information or to request technical support for your Intermec product.
Telephone Support
In the U.S.A. and Canada, call 1-800-755-5505.
Outside the U.S.A. and Canada, contact your local Intermec representative. To
search for your local representative, from the Intermec web site, click About Us >
Contact Us.
Related Documents
This table contains a list of related Intermec documents and their part numbers.
The Intermec web site at www.intermec.com contains our documents (as PDF files)
that you can download for free.
To download documents
1 Visit the Intermec web site at www.intermec.com.
2 Click Support > Manuals.
3 Use the Product Category field, the Product Family field, and the Product
field to help you locate the product whose documentation you want to
download.
What Is Fingerprint?
Fingerprint is a programming language you use to design custom label formats and
printer application software. Fingerprint firmware is stored in the printer memory.
This guide includes information on using Fingerprint to develop applications for
your Intermec printer. For information on specific Fingerprint commands, see the
Fingerprint Command Reference Manual.
Intermec Direct Protocol is a subset of Intermec Fingerprint and is used for
combining variable input data with predefined label layouts. For more information,
see the Intermec Direct Protocol Programmer’s Reference Manual .
10 PRPOS 200,200
20 DIR 3
30 ALIGN 5
40 PRIMAGE “GLOBE.1”
50 PRINTFEED
RUN
where:
Follow the next procedure to connect the printer to a PC and send a Fingerprint
command to the printer via HyperTerminal.
To connect to the printer with HyperTerminal
1 Connect the printer to the serial port (COM1) on your desktop PC. For more
information, see the user’s guide for your printer.
2 Turn the printer on.
3 On the desktop PC, start the HyperTerminal application.
4 Configure HyperTerminal for a serial connection using these parameters:
These serial connection parameters are the default for Fingerprint printers. If
you have changed the communication settings on your printer, change the
HyperTerminal connection settings accordingly.
The printer should now be connected to your PC. Continue with the next step to
send a SETUP WRITE command to the printer.
5 In HyperTerminal, type the following text:
SETUP WRITE “uart1:”
6 Press Enter. The printer returns its current setup parameters.
SETUP WRITE Command Results: This screen shows some of the default settings.
Keyword Examples
Keyword Description
BARSET Specifies a bar code.
COPY Copies a file.
FORMAT DATE$ Specifies the format to be used for dates (such as
YYMMDD).
GOTO Branches unconditionally to a specified line.
STORE IMAGE Sets up parameters for storing an image in printer memory.
Statement Examples
Keyword and Statement Description
PRTXT “HELLO” Keyword PRTXT indicates that the following
data (“HELLO”) is to be placed in a text field.
ON BREAK 1 GOSUB 1000 ON BREAK 1 GOSUB indicates that on the first
break interrupt instruction, the program must
branch to a subroutine at line 1000.
FILES “tmp:”, A Indicates that all files (A) in the “tmp:” directory
should be listed to the printer OUT channel.
Note: By default, if you enter a carriage return on the host, the printer echoes back a
Carriage Return + Line Feed (ASCII 13 + 10 decimal). With the setup option “New
Line”, you can restrict the printer to only echo back either a Carriage Return (ASCII
13 decimal) or a Line Feed (ASCII 10 decimal).
If you choose to enter the line numbers manually, start with number 10 and
increment line numbers up by 10s (10, 20, 30, 40, etc.). That makes it easier to insert
additional lines (for example 11,12,13...etc.), should the need arise.
After typing the line number, use a space character to separate it from the keyword
and statement that follows, as in this example:
100 FONT “Swiss 721 BT”
Several Fingerprint commands may be issued on the same line, provided they are
separated by colons (:) as in this example:
100 FONT “Swiss 721 BT”:PRTXT “HELLO”
Note: In Immediate Mode and in Direct Protocol, you can send a complete
set of instructions as a single line as in this example:
PP100,250:FT“Swiss 721 BT”:PT“Text 1”:PF ?
It is not possible to alter a line after it has been transmitted to the printer. If you
want to change such a line, you must send the whole line again using the same line
number, or delete it using a DELETE statement.
About Functions
A function is a statement which returns a value. A function consists of a keyword
combined with values, flags, and/or operators enclosed by parentheses. The next
table lists function examples.
Function Examples
Keyword and Function Description
CHR$(65) Return the readable character for ASCII code 65.
TIME$(“F”) Return the current time based on the currently
specified format.
ABS(20*5) Return the absolute value of 20*5.
IF(PRSTAT AND 1)... If the current position of the insertion point +1...
About Operators
There are three main types of operators: arithmetic, relational, and logical.
Arithmetic Operators
Operator Description Example
+ Addition 2+2=4
- Subtraction 4-1=3
* Multiplication 2*3=6
\ Integer division 6\2=3
MOD Modulo arithmetic. Results in an integer value equaling the 5MOD2=1
remainder of an interger division.
^ Exponent 5^2=25
() Specifies the order of calculation. 7+5^2\8 = 10
(7+5^2)\8 = 4
Relational Operators
Operator Description
< Less than
<= Less than or equal to
<> Not equal to
= Equal to. Also used as an assignment operator.
> Greater than
>= Greater than or equal to
Logical Operators
Operator Description
AND Conjunction
OR Disjunction
XOR Exclusive OR
About Devices
“Device” is a generic term for communication channels, various parts of the printer
memory, and operator interfaces such as the printer display and keyboard.
Note: Use the DEVICES command to see the list of devices your printer
supports.
You may need to specify a device in relation to a Fingerprint command. The next
table lists available device names.
Communication Devices
Name Refers To Can Be OPENed For
console: Printer display and/or keyboard Input/Output
uart1: Serial communication port Input/Output
uart2: Serial communication port Input/Output
(optional)
uart3: Serial communication port Input/Output
(optional)
rs485: RS 485 communication Input/Output
centronics: Parallel communication Input
net1: EasyLAN communication (optional) Input/Output
usb1: USB communication port Input/Output
finisher: Printer finisher interface Input/Output
Memory Devices
Name Refers To Can Be OPENed For
/rom Printer firmware (Kernel) plus read-only Input (files only)
memory card. Also called “rom:”.
/c Main printer memory. Also called “c:” or Input/Output/Random
“ram:”
tmp: Printer temporary memory. Input/Output/Append/
Random (files only)
card1: Compact Flash memory card if installed. Input/Output/Append/
Random (files only)
Special Devices
Name Refers To Can Be OPENed For
lock: Electronic key. Input
Devices are referred to by name with directory commands, such as SAVE, KILL, or
FORMAT, and with OPEN statements.
In instructions used in connection with communication (for example BREAK,
BUSY/READY, COMSET), the keyboard/display unit and the communication
channels are specified by numbers instead of names:
0 = “console:”
1 = “uart1:”
2 = “uart2:”
3 = “uart3:”
4 = “centronics:”
5 = “net1:”
6 = “usb1:”
As soon as a carriage return is received, the firmware checks the instructions for
syntax errors. Provided there is a working two-way communication and the verbosity
is on, the printer returns either an error message or “Ok” to the host.
Note: If you need more flexibility than Immediate Mode provides, use the
Intermec Direct Protocol, since it allows variable input data to be combined
with predefined layouts, handles counters, and includes a flexible error-
handler. For more information, see the Intermec Direct Protocol
Programmer’s Reference Manual.
10 GOSUB Q123
20 END
30 Q123: SOUND 440,50
40 RETURN
There are three main methods of writing and transmitting a program to the printer:
• One line at a time. If you have a “non-intelligent” terminal that can only transmit
and receive ASCII characters, you must write and send each line separately. All
lines must include line numbers. To correct a mistake, you must rewrite the
complete line using the same line number.
• Copying and pasting lines from a file. If the host computer has both a
communications program, such as HyperTerminal, and a text editor, you can
write the program in the text editor and then copy and paste it into the
communications program.
• Sending a text file to the printer. If the host computer has both a
communication program and a text editor, you can write the program in the text
editor and send the whole program as a text file to the printer using the
communications program.
For more information, see “Sending Programs to the Printer” on page 15.
If an IMMEDIATE OFF statement has been issued before starting to write the
program, turn on the Immediate Mode again using an IMMEDIATE ON
statement before using a RUN statement to start the program.
• REM
Any characters preceded by REM are not regarded as part of the program and are
not executed. Use REM to add comments to your program. REM statements can
also be used at the end of lines if they are preceded by a colon (:).
• END
Because subroutines are typically entered on lines with higher numbers than the
main program, always finish the main program with an END statement to
separate it from the subroutines. When an END statement is encountered, the
execution is terminated and all OPENed files and devices are CLOSEd.
• LIST
You can LIST the entire program to the screen of the host. You can also choose to
list only part of the program, just the variables, or just the breakpoints. If you
have edited the program without line numbers, the numbers automatically
assigned to the lines at execution appear. LIST is issued in the Immediate Mode.
• DELETE
Remove program lines using the DELETE statement in the Immediate Mode.
Both single lines and ranges of lines in consecutive order can be deleted.
• RENUM
Program lines can be renumbered to provide space for new program lines, to
change the order of execution, or to make it possible to MERGE to programs.
Line references for GOSUB, GOTO, and RETURN statements are renumbered
accordingly.
For debugging the program, use STOP, DBBREAK, DBBREAK OFF, DBSTDIO,
DBSTEP, DBEND, or CONT commands. For more information, see “Breaking
Program Execution” on page 26.
60 END
RUN
Another way to compare the two values in the example above is to use three
IF...THEN statements:
10 INPUT “Enter first value ”, A%
20 INPUT “Enter second value ”, B%
30 C$=“First value > second value”
40 D$=“First value < second value”
50 E$=“First value = second value”
60 IF A%>B% THEN PRINT C$
70 IF A%<B% THEN PRINT D$
80 IF A%=B% THEN PRINT E$
90 END
RUN
About Branching
Both conditional and unconditional branching is possible in Fingerprint.
• For information on conditional branching, see the next section.
• For information on unconditional branching, see “Unconditional Branching
Using a GOTO Statement” on page 21.
• For information on branching to subroutines, see the next section.
Branching to Subroutines
A subroutine is a range of program lines intended to perform a specific task
separately from the main program execution. For example, branching to
subroutines can occur when:
• an error condition occurs.
• a condition is fulfilled, such as a certain key being pressed or a variable obtaining
a certain value.
• a break instruction is received.
About Loops
One type of loop has already been described in connection with the GOTO
statement, where GOTO referred to the same line or a previous line. There are two
instructions for using more advanced loops:
10 B%=0
20 WHILE B%<>89
30 INPUT “Want to exit? Press Y=Yes or N=No”,A$
40 B%=ASC(A$)
50 WEND
60 PRINT “The answer is Yes”
70 PRINT “You will exit the program”
80 END
RUN
By default, program execution starts at the line with the lowest number and
continues in ascending line number order, with the exception of possible loops and
branches. Optionally, you can start execution at a specified line (for example, RUN
40 starts at line 40).
Use an EXECUTE statement to execute a program that is not currently loaded, or to
execute Fingerprint programs from within another Fingerprint program.
When you are connected to the printer through a serial connection, the first error
that stops the execution causes an error message to be returned to the host screen.
In case of program errors, the number of the line where the error occurred is
reported by default (for example ,“Field out of label in line 110”). After the error has
been corrected, the execution must be restarted by means of a new RUN statement,
unless an error-handling routine is included in the program.
6 Type LIST and press Enter. The program is listed with line numbers.
Four instructions can be used for providing a program with a break interrupt
facility:
• BREAK - Specifies an interrupt character.
• BREAK...ON - Enables break interrupt.
• BREAK...OFF - Disables break interrupt.
• ON BREAK...GOSUB... - Branches the execution to a sub-routine when a break
interrupt is executed.
10 BREAK 1,88
20 ON BREAK 1 GOSUB 1000
30 GOTO 50
40 BREAK 1 ON
50 OPEN “console:” FOR OUTPUT AS 1
60 PRINT #1 : PRINT #1
70 PRINT #1, “Press X”
80 PRINT #1, “to break program”;
90 BREAK 1 OFF
100 END
1000 SOUND 880,50
1010 PRINT #1 : PRINT #1
1020 PRINT #1, “PROGRAM”
1030 PRINT #1, “INTERRUPTED”;
1040 RETURN 90
RUN
If you omit the extension, Fingerprint automatically adds the extension “.PRG”. If
you plan to transfer the program file to a host platform, you need to consider
conventions and restrictions imposed by the host operating system when you name
the program.
The automatic case conversion and adding of the extension can be disabled using
SYSVAR(43). For help, see “Using the SYSVAR System Variable” on page 121.
Examples:
SAVE “PROGRAM1”
saves the program as PROGRAM1.PRG in the current directory (by default “/c”).
SAVE “program2”
saves the program as PROGRAM2.PRG in the current directory.
SAVE “card1:PROGRAM1.TXT”
saves the program as PROGRAM1.TXT in a CompactFlash memory card installed in
the printer.
Making Changes
If you LOAD a program, make changes, and then SAVE the program under the
original name and in the original directory, the original program will be replaced.
The next example changes the value of a variable in line 50, and replaces the original
version with the new version:
LOAD “PROGRAM1.PRG”
50 A%=300
SAVE “PROGRAM1.PRG”
Renaming a Program
To rename a program (or any other file), LOAD it, SAVE it under a new name, and
finally KILL the original program.
Example (renames LABEL1.PRG with the name LABEL2.PRG):
LOAD “LABEL1.PRG”
SAVE “LABEL2.PRG”
KILL “LABEL1.PRG”
Note: While a file or directory name may contain all printable characters
except “:” (colon) and “/” (slash), only “/c” supports using directories.
Note: Do not confuse CHECKSUM with CSUM. For more information, see
“Commands for Working With Arrays” on page 38.
Sorting Arrays
The SORT statement sorts a one-dimensional array in ascending or descending
order according to the ASCII values for the character in the Roman 8 character set.
You can also choose between sorting the complete array or a specified interval. For
string arrays, you can select by which character position the sorting is performed.
This example shows how one numeric array is sorted in ascending order and one
string array is sorted in descending order according to the fifth character in each
element:
10 FOR Q%=0 TO 3
20 A$=STR$(Q%)
30 ARRAY%(Q%)=1000+Q%:ARRAY$(Q%)=“No. ”+A$
40 NEXT Q%
50 SORT ARRAY%,0,3,1
60 SORT ARRAY$,0,3,-5
70 FOR I%=0 TO 3
80 PRINT ARRAY%(I%), ARRAY$(I%)
90 NEXT I%
RUN
The printer returns:
1000 No. 3
1001 No. 2
1002 No. 1
1003 No. 0
In this example, the checksum of a string array is calculated according both to the
LRC (Logitudinal Redundancy Check) and the DRC (Diagonal Redundancy Check)
algorithms:
10 FOR Q%=0 TO 3
20 A$=STR$(Q%)
30 ARRAY$(Q%)=“Element No. ”+A$
40 NEXT
50 CSUM 1,ARRAY$,B%:PRINT “LRC checksum: ”;B%
60 CSUM 2,ARRAY$,C%:PRINT “DRC checksum: ”;C%
RUN
The printer returns:
LRC checksum: 0
DRC checksum: 197
This chapter explains how to manage input and output data for
Fingerprint applications, and includes these topics:
• Preprocessing Input Data
• Converting Input Data
• Generating Random Numbers
• Setting the Standard IN and OUT Channels
• Input From a Host
• Input From Sequential Files
• Input From a Random File
• Input From the Printer Keypad
• Controlling Communication
• Managing Background Communication
• Output to the Standard OUT Channel
• Redirecting Output to a File
• Output to Sequential Files
• Output to Random Files
• Output to Communication Channels
• Output to the Printer Display
For a list of character sets and the corresponding reference numbers, see Fingerprint
Command Reference Manual.
For example, you may want to use the German character set (49) and 7 bit
communication protocol. However, you need to print £ characters, but have no need
for the § character. Then remap the £ character (ASCII 187 dec.) to the value of the §
character (ASCII 64 dec.) Type a series of § characters on the keyboard of the host
and finish with a carriage return:
10 NASC 49
20 MAP 64,187
30 FONT “Swiss 721 BT”
40 PRPOS 100,100
50 INPUT “Enter character”;A$
60 PRTXT A$
70 PRINTFEED
RUN
The printer returns:
Enter character?
Note: When using 7 bit communications, the printer cannot echo back the
correct character to the host if its ASCII value exceeds 127. Although
semicolon characters appear onscreen, the desired “£” characters are printed
on the label.
There are various ways to produce double-byte characters from the keyboard of the
computer. By selecting the proper character set using a NASCD statement, the
typed-in ASCII values are translated to the corresponding Unicode values, so the
desired glyph will be printed.
Double-byte fonts and character set tables are available from Intermec. For
information, contact your Intermec sales representative.
In this example, the text field in line 50 contains both single- and double-byte fonts.
The double-byte font and its character set are stored in a Font Install Card. The
program yields a printed text line that starts with the Latin character A (ASCII 65
dec.) followed by the Chinese font that corresponds to the address 161+162 dec. in
the character set “BIG5.NCD.”
10 NASC 46
20 FONT “Swiss 721 BT”, 24, 10
30 NASCD “/rom/BIG5.NCD”
40 FONTD “Chinese”
50 PRTXT CHR$(65);CHR$(161);CHR$(162)
60 PRINTFEED
RUN
10 A%=TICKS
20 RANDOMIZE A%
30 B%=RANDOM(1,100)
40 PRINT B%
RUN
The printer returns:
42
SETSTDIO Values
Value Standard IN Channel Standard OUT Channel
0 “console:” “console:”
1 “uart1:” “uart1:”
2 “uart2:” “uart2:”
3 “uart3:” “uart3:”
4 “centronics:” Not applicable.
5 “net1:” “net1:”
6 “usb1:” “usb1:”
100 100 = “auto” (default) 100 = “auto” (default)
Note: Do not choose “console:” for both the standard IN and OUT
channels, which makes only characters entered on the printer keypad appear
in the display.
The standard IN channel is used for sending instructions and data from the host to
the printer to perform a variety of tasks, such as controlling the printer in
Immediate Mode, creating programs in Programming Mode, downloading program
files, or transmitting input data.
The following Fingerprint commands receive data only on the standard IN channel:
• INKEY$
• INPUT
• LINE INPUT
150 PRINT D$
160 PRINT E$
170 PRINT F$
180 CLOSE #1
RUN
The printer returns:
Record A a b c
Record B 1 2 3
Record C xyz
Record D
Record E
Record F
Closing a File
When a file is no longer used, it can be closed using a CLOSE statement containing
the same reference number as the corresponding OPEN statement. An END
statement also closes all open files.
The example illustrates how the length of the file “PRICELIST” is returned:
10 OPEN “PRICELIST” AS #5
20 PRINT LOF(5)
.....
.....
Record: 1 2 3
Field: 1 2 3 1 2 3 1 2 3
Byte: 1 2 3 4 1 2 3 4 1 2 3 4 5 6 1 2 3 4 1 2 3 4 1 2 3 4 5 6 1 2 3 4 1 2 3 4 1 2 3 4 5 6
Now you can use the variables assigned to the fields using the FIELD statement to
handle the data. Numeric expressions converted to string format before being put
into the record can now be converted back to numeric format using VAL functions.
In this example, the following code displays the data on the host screen:
40 PRINT F1$,F2$,F3$
Closing a File
Finally, close the file and execute:
50 CLOSE #1
RUN
The printer returns:
ABC DEF 123456
The following Fingerprint commands are used in connection with input from the
printer keyboard:
• OPEN (opens the device “console:” for sequential INPUT)
• INPUT#
• INPUT$
• LINE INPUT#
• CLOSE
For more information on ASCII values and printer keyboards, see
The printable characters actually generated by the respective ASCII value depend on
the selected character set (NASC/NASCD) and possible MAP statements.
In case of INPUT# and LINE INPUT#, the input is not accepted until a carriage
return is issued.
This example demonstrates how the printable character and decimal ASCII value of
various keys on the printer keyboard can be printed to the screen of the host.
10 PRINT “Character”, “ASCII value”
20 OPEN “console:” FOR INPUT AS 1
30 A$=INPUT$(1,1)
40 B%=ASC(A$)
50 PRINT A$, B%
60 GOTO 30
70 CLOSE 1
RUN
Controlling Communication
The following Fingerprint commands are used to control the communication
between the printer and the host (or other connected devices):
• BUSY
• READY
• ON | OFF LINE
• VERBON | VERBOFF
• SYSVAR(18)
• the character or string of characters used to tell the printer to start receiving
data and to stop receiving data.
• the character or characters to be ignored (filtered out from the received data).
• the character or string of characters to use as an attention string that
interrupts reception.
Note: Start, stop, ignore, and attention characters are selected according to
the protocol of the computing device that transmits the data. Non-printable
characters, for example STX and ETX can be specified using a CHR$
function. To specify no character, use an empty string.
5 When reception is interrupted, check the buffer contents. You can read the
content of the buffer (for example, to a string variable) using a COMBUF$
function:
1000 QDATA$=COMBUF$(1)
The COMSTAT function can be used to detect what has caused the interruption.
Use the logical operator AND to detect the following four reasons of
interruption as specified by COMSET:
• Max. number of characters received (2).
• End character received (4).
6 Add a few lines to print the content of the buffer (line 1060) and create a loop
that waits from input from the host (line 90). The entire example looks like this:
NEW
10 COM ERROR 1 ON
20 A$=“Max. number of char. received”
30 B$=“End char. received”
40 C$=“Attn. string received”
50 D$=“Communication error”
60 COMSET 1, “A”,CHR$(90),“#”,“BREAK”,20
70 ON COMSET 1 GOSUB 1000
80 COMSET 1 ON
90 IF QDATA$=“” THEN GOTO 90
100 END
1000 QDATA$=COMBUF$(1)
1010 Q% = COMSTAT (1)
1020 IF Q% AND 2 THEN PRINT A$
1030 IF Q% AND 4 THEN PRINT B$
1040 IF Q% AND 8 THEN PRINT C$
1050 IF Q% AND 32 THEN PRINT D$
1060 PRINT QDATA$
1070 RETURN
RUN
7 You can test the example by pressing Enter on the host keyboard. Then enter
various characters and see what happens, starting with the start character, stop
character, ignore character, attention string, and maximum number of
characters parameters in the COMSET statement.
2 Use the SETSTDIO statement to set “uart2:” or “uart3:” as the standard I/O
channel.
Counting Data Blocks and Determining File Length With LOC and
LOF
Use LOC to return the number of 128-byte blocks that have been written since the
file was opened. For an example, see “Counting Data Blocks With LOC” on
page 49.
LOF returns the length (in bytes) of a file that has been opened. For an example, see
“Determining File Length With LOF” on page 49.
Record: 1
Field: 1 2 3
Byte: 1 2 3 4 1 2 3 4 1 2 3 4 5 6
The file can consist of many records, all with the same format. To produce files with
different record lengths, the file must be OPENed more than once and with
different reference numbers.
Now it is time to write some data to the file. Usually the data comes from the host or
from the printer keyboard. In this example, we will type the data directly on the host
and assign the data to string variables:
30 QDATA1$=“ABC”
40 QDATA2$=“DEF”
50 QDATA3$=“12345678”
Note: Only string variables can be used. Possible numeric expressions must
therefore be converted to strings using STR$ functions.
Record: 1
Field: 1 2 3
Byte: 1 2 3 4 1 2 3 4 1 2 3 4 5 6
The first field is left-justified, the second field is right-justified, and the third field is
left-justified and truncated at the end. Digits 7 and 8 are omitted since the field is
only six bytes long. If the field had been right-justified, then digits 1 and 2 would
have been omitted instead.
Finding the Last Field Read and Determining File Length With LOC
and LOF
Use LOC to return the number of the last record read by the use of GET statement.
For an example, see “Finding the Last Field Read With LOC” on page 51.
LOF returns the length (in bytes) of a file that has been opened. For an example, see
“Determining File Length With LOF” on page 49.
In this example, “Record 1” and “Record 2” are printed to the serial communication
channel “uart2:”:
10 OPEN “uart2:” for OUTPUT AS #1
20 PRINT #1, “Record 1”
30 PRINTONE #1, 82;101;99;111;114;100;32;50
40 CLOSE #1
In this example, the file “datafile” (stored in a DOS-formatted CompactFlash
memory card) is printed to the serial communication channel “uart2:”:
COPY “card1:datafile”,“uart2:”
This chapter explains how to manage fonts, bar code printing, and
images, and includes these topics:
• Managing Fonts
• About Bar Code Symbologies
• Understanding Images and Image Files
Managing Fonts
Fingerprint includes a variety of commands you can use to manage fonts and font
printing. Fingerprint printers include 15 scaleable single-byte fonts in permanent
memory. The next table shows the fonts in 10 point size, with no slant, at 100%
width.
Century Schoolbook BT
DingDings SWA
Futura Light BT
Monospace 821 BT
OCR-A BT
OCR-B 10 Pitch BT
Swiss 721 BT
Note: When selecting DingDings SWA, OCR-A BT, or OCR-B 10 Pitch BT,
the printer automatically switches to a special character set for the font.
When any other font is selected, the printer automatically returns to the
previously selected character set.
Selecting Fonts
Single-byte fonts are selected using the FONT and BARFONT statements. Use a
NASC statement to choose the corresponding character set.
Double-byte fonts are selected using the statement FONTD, and the corresponding
character set is chosen using the NASCD statement. These fonts cannot be used for
bar code interpretations or multi-line text fields.
In the FONT and BARFONT statements, the full case-sensitive names for each font
must be used.
For illustrations of the available character sets, see “Character Sets and Keywords”
on page 153.
All font stored in the printer memory can be listed to the standard OUT channel by
a FONTS statement. This statement does not list dedicated bar code fonts.
Another method of listing fonts is to use a FONTNAME$ function, which will list
dedicated barcode fonts.
Font files can be listed to the standard OUT channel using the FILES statement.
This example shows how to list all fonts:
10 A$ = FONTNAME$(0)
20 IF A$ =“” THEN END
30 PRINT A$
40 A$ = FONTNAME$(-1)
50 GOTO 20
RUN
It is possible to use fonts in the “old” Intermec .ATF bitmap font format. This
feature improves compatibility with custom-made programs originally created in
Fingerprint v6.xx or earlier versions.
Downloading an .ATF font (for example XX030RSN.ATF) to the printer produces
three fonts in the memory; one without any extension (for example XX030RSN),
one with the extension .1 (for example XX030RSN.1), and one with the extension .2
(for example XX030RSN.2). When using bitmap fonts in Fingerprint v8.xx, the
relation between print direction and the file extension is unimportant.
Instead of specifying the font height parameter in the FONT and BARFONT
statements, use MAG to enlarge a bitmap font. Bitmap fonts do not support slant
values.
“/c/.FONTALIAS”
The format of the file should be:
“<Alias name #1>”,“<Name of font>”[,size[,<slant>[,<width>]]]
“<Alias name #2>”,“<Name of font>”[,size[,<slant>[,<width>]]]
“<Alias name #3>”,“<Name of font>”[,size[,<slant>[,<width>]]]
......
“<Alias name #n>”,“<Name of font>”[,size[,<slant>[,<width>]]]
The file can contain as many fontname aliases as required. The default size is 12
points, the default slant is 0°, and the width is 100%.
A font alias can be used like any other font, but its size, slant, and width can not be
changed.
Examples:
“BODYTEXT”,“Century Schoolbook BT”,10,80
“HEADLINE”,“Swiss 721 Bold BT”,18,110
“WARNING”,“Swiss 721 BT”,12,10,95
Standard Images
As a standard, the systems part (“Kernel”) of the printer permanent memory
contains a number of images primarily used for printing test labels and for training
purposes:
• CHESS2X2.1
• CHESS4X4.1
• DIAMONDS.1
• GLOBE.1
50 INPUT “Protocol:”, P$
60 STORE IMAGE N$, W%, H%, P$
70 STORE INPUT 100
80 STORE OFF
RUN
The system variable SYSVAR allows you to check the result of an image download
using STORE INPUT:
• SYSVAR (16) reads the number of bytes received.
• SYSVAR (17) reads the number of frames received.
Both values are reset when a new STORE IMAGE statement is executed.
A special case involves print images complying with the PRBUF protocol. These are
not normal pictures or logotypes, but complete labels including including printable
objects which have been designed in some application program or printer driver in
the host. Using the PRBUF statement, these print images can be downloaded
directly to the printer image buffer and printed, but cannot be saved in the printer.
Listing Images
The names of all images stored in printer memory can be listed to the standard OUT
channel using an IMAGES statement, or to a program using the IMAGENAME$
function.
Image files can be listed to the standard OUT channel using a FILES statement.
This example lists all standard images in the printer memory.
IMAGES
This results in:
CHESS2X2.1 CHESS4X4.1
DIAMONDS.1 GLOBE.1
3568692 bytes free 1717812 bytes used
Ok
This chapter describes how to design and print a bar code label layout,
and includes these topics:
• Creating a Layout With Fields
• Positioning Fields in the Layout
• Creating Single-Line and Multi-Line Text Fields
• Creating Bar Code Fields
• Creating Image Fields
• Creating Box Fields
• Creating Line Fields
• Additional Printing Instructions
• Using the LAYOUT Command
• Creating a Simple Label
• Handling Errors With ERRHAND.PRG
Box field
ABC Company
1000 First Ave. Line field
Azusa CA
X-axis
Anchor points
Y-axis Field
Origin
Insertion point
X-start
Dot #0
Feed direction
Dots are the same size along both the X-axis and the Y-axis.
The next illustrations show the anchor point locations for the different fields.
5
7 8 9
4 6
1 2 3
Bar Code Field Anchor Points
1, 4, or 7 2, 5, or 8 3, 6, or 9
Box Field Anchor Points
7 8 9
5
4 6
1 2 3
Image Field Anchor Points
1, 4, or 7 2, 5, or 8 3, 6, or 9
Line Field Anchor Points
7 8 9
ABC Company ABC Company ABC Company
1000 First St 1000 First St 1000 First St
Azusa CA 99999 Azusa CA 99999 Azusa CA 99999
Attn: Receiving Attn: Receiving Attn: Receiving
1 2 3
Multi-Line Text Field Anchor Points
Note: For a multi-line text field, ALIGN sets the anchor points for both the
text inside the box and the box surrounding the field. The box can be made
visible or invisible.
7 8 9
6
4 Baseline
1 2 3
5
Single-Line Text Field Anchor Points
DIR 4
ABCDE
ABCDE ABCDE DIR 1
Field origin
ABCDE
DIR 3
DIR 2
Feed direction
Print Directions in Fingerprint: In this example, the DIR command rotates the text field
around anchor point 1.
50 INVIMAGE
60 PRTXT “HELLO”
70 PRINTFEED
RUN
Example of a multi-line text field:
10 DIR 1
20 ALIGN 8
30 R$=“Hyphen&Sated words will be divid&Sed
into sylla&Sbles.”
40 NL$=“NEWLINE”
50 S$=“&S&Special Cases and EXTRAORDINARILY long
words.”
60 T$=R$+NL$+S$
70 PRPOS 300,300
80 PRBOX 700,500,20,T$,25,1,NL$,“&S - +”
90 PRINTFEED
RUN
60 PRBAR “ABC”
70 PRINTFEED
RUN
Example:
10 PRPOS 100,100
20 ALIGN 1
30 DIR 4
40 PRLINE 200,10
50 PRINTFEED
RUN
The remaining bytes are used differently depending on record type, and may specify
direction, position, or some other parameter. Each such instruction corresponds to
a Fingerprint instruction (for example, direction corresponds to DIR, alignment to
ALIGN, and x- and y-positions to PRPOS). Note that there are only 10 bytes
available for the font and bar font names. Since most names of standard fonts are
longer, you may need to use font aliases.
Text and bar code records can contain both fixed and variable data. The fixed data
(max. 20 characters) are entered in the layout record. A parameter (bytes 43 and 44)
specifies how many characters (starting from the first character) of the fixed data
that will be printed or used to generate the bar code. Possible variable data will be
appended to the fixed data at the position specified in bytes 43 and 44.
The LAYOUT statement does not support multi-line text fields.
Example
01A13300 800 GLOBE.1 11
Byte No. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
TEXT RECORD:
Element No. (00–FF hex) Char. to be printed
Type of record in byte 23-42
Direction (1–4) Normal (blank) or
Alignment (1–9) Inverse printing (I_)
X-Position (0–9999) Vertical mag.
Y-Position (0–9999) Horizontal mag.
Font name (10 char.) Fixed Text (max. 20 char.) Not used
Example 01E212 0 0 0
Byte No. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
BARADJUST RECORD:
Element No. (00–FF hex) Not used
Type of record
Not used Not used
Not used
Baradjust left (0-9999) Not used
Baradjust right (0–9999) Not used
Not used Not used Not used
Example 01J 50 50
Byte No. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
LINE RECORD:
Element No. (00–FF hex)
Type of record
Direction (1–4) Not used
Alignment (1–9) Not used
X-Position (0–9999) Not used
Y-Position (0–9999) Not used
Line length (0-6000) Line thickness (0-6000) Not used
BOX RECORD:
Element No. (00–FF hex)
Type of record Not used
Direction (1–4) Not used
Alignment (1–9) Not used
X-Position (0–9999) Not used
Y-Position (0–9999)
Line thickness
Box Width (0–6000) Box height (0-6000) (0-999)
If you specify logotype-by-name (record type A), the printer memory is searched for
an image with the specified name. A logotype-by-name file is composed by a number
of records with a length of 10 bytes each that contain the image names, for example:
10 OPEN “LOGNAME.DAT” FOR OUTPUT AS 1
20 PRINT#1, “GLOBE. ”
30 PRINT#1, “GLOBE.2 ”
40 PRINT#1, “DIAMONDS.1”
50 PRINT#1, “DIAMONDS.2”;
60 CLOSE 1
If you specify logotype-by-number (record type L), you must have a logotype name
file. A logotype-by-number file is composed by a number of records with a length of
13 bytes each. The first 2 bytes is a reference number (0-99), the third byte is always a
colon (:), and the following 10 bytes are used for the image name:
10 OPEN “LOGNAME.DAT” FOR OUTPUT AS 1
20 PRINT#1, “0 :GLOBE.1 ”
30 PRINT#1, “1 :GLOBE.2 ”
40 PRINT#1, “2 :DIAMONDS.1”
50 PRINT#1, “3 :DIAMONDS.2”;
60 CLOSE 1
10 DIM QERR%(28)
20 QERR%(0)=0
.....
190 IF QERR%(1)=0 THEN GOTO 260
200 PRINT “-ERROR- LAYOUT 1”
210 I%=0
220 IF QERR%(I%)=0 THEN GOTO 260
230 PRINT “ERROR ”;QERR%(I%+1);“ in record” ;QERR%(I%)
240 I%=I%+2
250 GOTO 220
260 PRINTFEED
Note: The loop in line 240 must be large enough to accommodate all possible errors.
Note: You cannot omit any file or array, since the syntax requires a file name or array
designation in each position. For example, you must create an empty logotype file if
your design does not use a logotype field.
The example below shows a simple layout created using the layout statement in
combination with data and error arrays:
10 DIM QERR%(28)
20 LAYDATA$(0)=“02Var. input”
30 LAYDATA$(1)=“03 PRINTER”
40 QERR%(0)=0
50 OPEN “LOGNAME.DAT” FOR OUTPUT AS 1
60 PRINT #1, “GLOBE.1”;
70 CLOSE 1
80 REM:LAYOUT FILE
90 OPEN “LAYOUT.DAT” FOR OUTPUT AS 2
100 PRINT #2, “01H1 FONT1 “;
110 PRINT #2, “02C11100 650 FONT1 Fixed Text 11I 22 “;
120 PRINT #2, “02C11130 450 FONT1 Fixed Text 0 11 “;
130 PRINT #2, “03B17100 300 CODE39 ABC 3 311 100“;
140 PRINT #2, “04A12300 800 GLOBE.1 11 “;
150 PRINT #2, “05X11100 440 300 100 5 “;
160 PRINT #2, “06S11100 100 300 10 “;
170 CLOSE 2
180 LAYOUT “LAYOUT.DAT”,“LOGNAME.DAT”,LAYDATA$,QERR%
190 IF QERR%(1)=0 THEN GOTO 260
200 PRINT “-ERROR- LAYOUT 1”
210 I%=0
220 IF QERR%(I%)=0 THEN GOTO 260
230 PRINT “ ERROR “; QERR%(I%+1); “ in record ”; QERR%(I%)
240 I%=I%+2
250 GOTO 220
260 PRINTFEED
RUN
This code specifies a box 430 dots high and 340 dots wide, with a line thickness
of 15 dots, and inserted at position X=10, Y=10.
3 Type RUN and press Enter. The printer prints this label:
Feed direction
GLOBE.1 image
6 Enter the following text:
50 PRPOS 75,270
60 BARTYPE “CODE39”
70 PRBAR “ABC”
This code specifies a bar code field at location X=75, Y=270, using Code 39, with
the data “ABC”.
7 Type RUN and press Enter. The printer prints this label:
Bar code
interpretation field
12 Type LIST and press Enter. The program lines are listed in ascending order:
13 To change any program line, you can rewrite the line using the same line number.
Enter the following text, which repositions the text field so the left side of the
field is aligned with the left side of the bar code field:
80 PRPOS 75,220
14 Type RUN and press Enter. The printer prints this label:
15 (Optional) To save your program, enter the following text and then press Enter:
SAVE “LABEL1”
Your program is saved in the printer memory with the filename “LABEL1.PRG”.
ERRHAND.PRG contains subroutines that displays the type of error on the printer
display (for example, “Out of paper” or “Head lifted”), prints the error number on
your screen, and assigns subroutines to some of the keys on the keyboard. There is
also a subroutine that performs a PRINTFEED with error-checking. The
ERRHAND.PRG occupies lines 10, 20, and 100000-1900000.
LIST
50 BARFONT ON
60 BARFONT “Swiss 721 BT”,6
70 PRPOS 10,10
80 PRBOX 400,340,15
90 PRPOS 30,30
100 PRIMAGE “GLOBE.1”
110 PRPOS 75,270
120 BARTYPE “CODE39”
130 PRBAR “ABC”
140 PRPOS 75,220
150 FONT “Swiss 721 BT”,6
160 PRTXT “My FIRST label”
170 PRINTFEED
180 END
Ok
Merging Programs
Now your label-printing program LABEL1.PRG will not interfere with
ERRHAND.PRG and you can merge the two programs into a single program. In
fact, you will create a copy of ERRHAND.PRG which is merged into LABEL1.PRG.
Thus the original ERRHAND.PRG can be merged into more programs later:
MERGE “/rom/ERRHAND.PRG”
Controlling Printing
This section describes Fingerprint commands used in connection with printing bar
code labels.
This affects new statements executed after the PRINTFEED statement, but not
statements already executed.
In this example, five identical labels are printed:
10 PRPOS 100,100
20 FONT “Swiss 721 Bold BT”,14,10,80
30 PRTXT “TEST LABEL”
40 PRINTFEED 5
RUN
This example prints five copies of the same label, numbered consecutively:
10 FOR A%=1 TO 5
20 PRPOS 100, 100
30 FONT “Swiss 721 Bold BT”,14,10,80
40 PRTXT “LABEL ”;A%
50 PRINTFEED
60 NEXT A%
RUN
Handling Faulty Dots With HEAD, SET FAULTY DOT, and BARADJUST
A faulty dot is a dot on the printhead that does not print properly, which can result
in white lines across a printed bar code label. The HEAD function identifies possible
faulty dots.
Note: Some printhead faults, such as cracked or dirty dots, will not be detected by
this function because only the resistance is measured.
Use SET FAULTY DOT to mark specified dots on the printhead as faulty. You can
also revoke all previous SET FAULTY DOT statements by marking all dots as
correct.
BARADJUST enables the firmware to track all faulty dots, and relocates the bar code
so the spaces between the bars are lined up with the faulty dots. This way, you can
print bar code labels immediately without loss of quality, although the printhead
should still be replaced.
Note: The BARADJUST statement cannot be used for ladder bar codes, stacked bar
codes such as Code 16K, bar codes with horizontal lines such as DUN-14, EAN/UPC
bar codes, or two-dimensional bar codes such as PDF417.
The next example lists a program that checks the printhead for faulty dots and
warns the operator when a faulty dot is encountered. Pending printhead
replacement, the bar code is repositioned to ensure continued readability. Such a
program takes a few seconds to execute (there may be more than a thousand dots to
check), so it is advisable either to restrict the dot check to the part of the printhead
that corresponds to the location of the bar code, or to perform the test at startup
only.
10 OPEN “console:” FOR OUTPUT AS 10
20 IF HEAD(-1)<>0 THEN GOTO 9000
30 BEEP:D1$=“Printhead Error!”:D2$=“”:GOSUB 2000
40 GOSUB 1000
50 BARADJUST 20,20
60 GOTO 9000
1000 FUNCTEST “HEAD”,TMP$
1010 A$=“:” : TMP%=INSTR(TMP$,A$)+1
1020 RETURN
1030 SET FAULTY DOT -1
1040 QMEAN%=HEAD(-7)
1050 QMIN%=QMEAN%*85\100
1060 QMAX%=QMEAN%*115\100
1070 FOR I%=0 TO WHEAD%-1
1080 QHEAD%=HEAD(I%)
1090 IF QHEAD%>QMAX% OR QHEAD%<QMIN% THEN SET FAULTY DOT I%
1100 NEXT
2000 PRINT #10 : PRINT #10, LEFT$(D1$,16)
2010 PRINT #10, LEFT$(D2$,16);
2020 RETURN
9000 PRPOS 200,20
9010 BARTYPE “CODE39”
9020 BARRATIO 2,1 : BARMAG 2
9030 BARHEIGHT 150
9040 PRBAR “1234567890”
9050 PRINTFEED
9060 END
The PRSTAT function can detect printing progress and report any print-related
error conditions. This makes it possible to create an error-handling routine that
automatically resumes interrupted print jobs and reprints lost labels.
As the printer prints the label, it empties the image buffer. High print speeds empty
the image buffer more quickly. After the buffer is emptied, the printer processes the
next bitmap pattern and stores it in the second image buffer.
These Fingerprint commands can facilitate batch printing:
• FIELDNO - Divides the program into portions that can be cleared individually.
• CLL - Clears part or all of the image buffer.
• OPTIMIZE “BATCH” ON|OFF
If there are only small differences between the labels, write your program to use the
CLL and FIELDNO instructions to manage the buffers first, and process variable
data last.
Should the printer stop between labels, lower the print speed somewhat. Usually, the
overall time to produce a certain number of labels is more important than the actual
print speed. For more information on adjusting the print speed, see the printer
user’s guide.
For the KEY...ON command, keys are specified by identification (id.) numbers. Each
key has two id. numbers, one for its unshifted position and another for its shifted
position. The id. number of the shifted key is equal to its unshifted id. number +
100. For example, the F1 key has id. number 10 in unshifted position, but id.
number 110 in shifted position.
If a key is remapped, its id. number follows the key to its new position.
In the following example, F1 and F2 are enabled and used to branch to different
subroutines. The keys are specified by their id. numbers (10 and 11 respectively):
10 ON KEY (10) GOSUB 1000
20 ON KEY (11) GOSUB 2000
30 KEY (10) ON: KEY (11) ON
40 GOTO 40
50 END
1000 PRINT “You have pressed F1”
1010 RETURN 50
2000 PRINT “You have pressed F2”
2010 RETURN 50
RUN
The current keyboard mapping can be read to a string variable using the
KEYBMAP$ command. This example reads the unshifted characters on the
keyboard of a PF4i. Non-existing key positions get ASCII value 0:
10 PRINT “Pos”,“ASCII”,“Char.”
20 A$=KEYBMAP$(0)
30 FOR B%=1 TO 64
40 C$=MID$(A$,B%,1)
50 E%=ASC(C$)
60 PRINT B%,E%,C$
70 NEXT
RUN
You can also use the KEYBMAP$ instruction to remap the keyboard, with the
following syntax:
KEYBMAP$(n) = <string>
where:
n = 0 maps the unshifted characters in ascending position number order.
n = 1 maps the shifted characters in ascending position number order.
Note: Position numbers and id. numbers are not the same thing.
The string that contains the desired keyboard map should contain the desired
character for each of 64 key positions (in ascending order) regardless if the keyboard
contains that many keys.
Characters that cannot be produced by the keyboard of the host can be substituted
by CHR$ functions, where the character is specified by its ASCII decimal value
according to the selected character set.
This example shows how to print text to the printer display. Before you can print any
text to the display, it must be opened for sequential output as follows:
The cursor is either a black line under a character position in the display, or a
blinking block that intermittently blacks out the character position:
Underline Cursor
There are 16 character positions in each of the two lines in the display.
You can use a PRINT# statement to control the cursor. The cursor control
instructions can be used for four purposes:
• To clear the display (instead of using a double PRINT# statement).
• To select the cursor type (underscore or block).
• To enable or disable the cursor.
• To place the cursor at a specified position or to move it.
Each cursor control command starts with the Control Sequence Introducer, ASCII
155 decimal, indicated by “CHR$(155)”.
For 7-bit communication, use the characters “ESC” + “[” (ASCII 27 + 91 decimal).
Several different icons appear in the state area of the PD42 display depending on the
current printer state. You can add a custom icon to display when the printer is
running your application. Use a DISPLAY STATE statement to show the icon in the
state area.
The graphic for the icon should be in monochrome .bmp format and no larger than
48 x 48 pixels. Filename for the bitmap should be Sn.bmp, where n is the state image
number. Place the .bmp in the /c/ADMIN/DISPLAY directory.
When certain errors occur, the PD42 display shows a graphic that makes it easy to
interpret the error. You can add a custom graphic to display when a specific error
condition occurs by using a DISPLAY IMAGE statement.
The graphic should be in monochrome .bmp format and no larger than 240 x 79
pixels. Filename for the .bmp should be in the form n.bmp, where n is the image
number. Place the image in the /c/ADMIN/DISPLAY directory.
Depending on the current state of the printer, the soft key area of the PD42 display
shows pictograms corresponding to the current use for each of the five soft keys.
You can add custom pictographs to display when your application is running by
using a DISPLAY KEY statement.
The graphic for the pictograph should be in monochrome .bmp format and no
larger than 47 pixels wide by 32 pixels high. Filename for the image should be
Kn.bmp, where n is the pictogram number. Place the image in the /c/ADMIN/
DISPLAY directory.
The beeper can be controlled by either a BEEP statement, which gives a short shrill
signal, or by a SOUND statement, which allows you to vary both the frequency and
duration. The SOUND statement even allows you to compose your own melodies.
In this example, a warning signal is emitted from the beeper, for example when the
error “printhead lifted” occurs and keeps sounding until the error is cleared. A short
beep indicates that the printer is OK.
10 ON ERROR GOTO 1000
20 PRPOS 100,100
30 FONT “Swiss 721 Bold BT”, 36
40 PRTXT “OK!”
50 PRINTFEED : BEEP
60 END
1000 SOUND 880,25 : SOUND 988,25 : SOUND 30000,10
1010 RESUME
RUN
WEEKDAY$ (DATE$)
TIMEDIFF (TIME$, “120000”)
The next example shows how the date and time formats are set and the names of
months are specified. Finally, a number of date and time parameters printed to the
standard OUT channel:
10 FORMAT DATE$ “MMM/DD/YYYY”
20 FORMAT TIME$ “hh.mm pp”
30 NAME DATE$ 1, “Jan”:NAME DATE$ 2, “Feb”
40 NAME DATE$ 3, “Mar”:NAME DATE$ 4, “Apr”
50 NAME DATE$ 5, “May”:NAME DATE$ 6, “Jun”
60 NAME DATE$ 7, “Jul”:NAME DATE$ 8, “Aug”
70 NAME DATE$ 9, “Sep”:NAME DATE$ 10, “Oct”
80 NAME DATE$ 11, “Nov”:NAME DATE$ 12, “Dec”
90 A%=WEEKDAY(DATE$)
100 PRINT WEEKDAY$(DATE$)+“”+DATE$(“F”)+“”+TIME$(“F”)
110 PRINT “Date:”,DATE$(“F”)
120 PRINT “Time:”,TIME$(“F”)
130 PRINT “Weekday:”, WEEKDAY$(DATE$)
140 PRINT “Week No.:”,WEEKNUMBER (DATE$)
150 PRINT “Day No.:”, DATEDIFF (“030101”,DATE$)
160 PRINT “Run time:”, TICKS\6000;“ minutes”
170 IF A%<6 THEN PRINT “It is ”;WEEKDAY$(DATE$);
“. Go to work!”
180 IF A%>5 THEN PRINT “It is ”;WEEKDAY$(DATE$);
“. Stay home!”
RUN
The printer returns (for example):
Monday Apr/03/2003 08.00 am
Date: Apr/03/2003
Time: 08.00 am
Weekday: Thursday
Week No.: 14
Day No.: 93
Run time: 1 minutes
It is Thursday. Go to work!
This example shows how the TICKS function is used to delay the execution for a
specified period of time:
10 INPUT “Enter delay in sec’s: ”, A%
20 B%=TICKS+(A%*100)
30 GOSUB 1000
40 END
1000 SOUND 440,50(Start signal)
1010 IF B%<=TICKS THEN SOUND 880,100 ELSE GOTO 1010
1020 RETURN
RUN
10 A$=VERSION$(1)
20 IF A$=“PF2i” THEN GOTO 1000
30 IF A$=“PF4i” THEN GOTO 2000
40 IF A$=“PM4i” THEN GOTO 3000
50 .....
60 .....
70 .....
1000 SETUP “SETUP_PF2i.SYS”
1010 GOTO 50
2000 SETUP “SETUP_PF4i.SYS”
2010 GOTO 50
3000 SETUP “SETUP_PM4i.SYS”
3010 GOTO 50
Rebooting does not affect the printer setup, unless the printer hardware
configuration has changed during the power-off period (for example, if the
printhead has been replaced or an interface board has been installed or removed).
Permanent Memory
Note: To provide compatibility with earlier versions of Intermec
Fingerprint, the device designations “ram:” and “c:” are interpreted as “/c”
and “rom:” as “/rom”.
The permanent memory, “c:” or “/c” (also called /ram or “ram:” in some printer
manuals) resides in a flash memory SIMM. Additional flash SIMMs are also
included in the device “/c”.
At least one SIMM must always be present. It must have a boot sector and a number
of sectors containing the so called “kernel.” There is also a temporary area for media
feed info and odometer values. Some of these sectors are read-only and are included
in the device “/rom”.
The “/c” file system uses 1K blocks. Files smaller than 1K use 1K of space. File space
always rounds up, so a 4.5K file uses 5K of file space. A directory takes 1K, regardless
of how many files it contains.
When there are no free blocks left in any sector and at power up, the memory is
automatically reorganized to save space. This process takes some time and makes
the flash memory comparatively slow.
Temporary Memory
Temporary memory has no battery backup and is completely erased at power-off.
However, the following Fingerprint commands can be used to prevent variables
from being lost at a power failure:
• SETPFSVAR - Register variable to be saved at power off.
• GETPFSVAR - Recover saved variable.
• LISTPFSVAR - List saved variables.
• DELETEPFSVAR - Delete a saved variable.
The temporary memory is used for the following purposes:
• To execute Fingerprint instructions. At startup, the kernel in the permanent
memory is copied to the temporary memory, where all Fingerprint instructions
are executed and the print image bitmaps are created.
• For print image buffers. The current image buffer can be saved as a file using the
IMAGE BUFFER SAVE statement. The file will automatically converted to an
image, that can be used in new label layouts like a preprint or template.
• For the font cache.
• For the Receive/Transmit buffers. Each serial communication channel must have
one buffer of each kind. The size of each buffer is decided separately by the
printer.
• For communication buffers. In a program, you may set up one communication
buffer for each communication channel. This makes it possible to receive data
simultaneously from several sources to be fetched at the appropriate moment
during the execution of the program.
• To store data that does not need to be saved after power-off.
• To temporarily store data before it is copied to the permanent memory or to a
memory card. Because the permanent flash memory has to reorganize itself
occasionally, is becomes comparatively slow. Thus, it is more efficient to first
create files in the temporary memory and then save them to the permanent
memory. When speed is important, avoid using the permanent memory to save
data that will be of no use after power off.
Note: There are no fixed partitions in the temporary memory. After the
firmware has been copied to it and the Receive/Transmit buffers have been
set, the remaining memory will be shared between the various tasks.
10 CHDIR “tmp:”
.....
90 CHDIR “/c”
Note: Make backup copies on the host before you replace memory units or install
additional memory in the printer.
When used with the optional Serial/Industrial Interface Board, Fingerprint can
control external equipment such as conveyor belts, gates, turnstiles, and control
lamps, in addition to the printer. Conversely, the status of various external devices
can be used to control both the printer and other equipment. Thus, a Fingerprint
program can independently control workstations without an online connection to a
host computer.
There are several Fingerprint commands used in connection with the Serial/
Industrial Interface Board:
• PORTOUT ON/OFF: Sets one of the OUT ports (digital or relay) to either on or
off.
• PORTOUT.DATAREADY ON: Asserts the Dataready signal, which can be used
to control a print applicator.
• PORTIN: This function returns the status of a specified port, or checks the
current state of a specified input or output signal.
For more information, see:
• the Fingerprint Command Reference Manual.
• the PA30 Print Engine User’s Manual.
• the installation instructions for the Serial/Industrial Interface Board.
This chapter describes how Fingerprint handles errors and includes these
topics:
• Standard Error Handling
• Checking for Programming Errors
• Commands for Error-Handling Routines
• Using the ERRHAND.PRG Utility Program
• Standard Error Codes
Specifying Breakpoints
To make it easier to debug a program step by step, you can specify breakpoints in the
program. Use a DBBREAK statement to create or delete a breakpoint. Alternatively,
you can use the DBSTEP statement to specify how many lines should be executed
before next break.
At a break, the message “break in line nnn” is sent on the Debug STDOUT port,
which can be specified by a DBSTDIO statement. You can resume the execution at
next program line using a CONT statement or from the start of the program using a
RUN statement.
All breakpoints can be deleted by a single DBBREAK OFF statement.
Using SYSVAR(36) you can choose whether a change of program mode should be
printed to the Debug STDOUT port or not.
The statement LIST,B lists all breakpoints to the standard OUT channel.
The statement DBEND terminates the debugger.
Multiple errors are indicated by the sum of the values. For example, if the printhead
is lifted (1), and the printer is out of media (128) and ribbon (8), then PRSTAT
returns 137.
To speed up execution when several conditions are to be checked, assign the
PRSTAT value to a numeric variable, for example:
10 A% = PRSTAT
20 IF A% (AND 1) GOTO 1000
30 IF A% (AND 2) GOTO 2000
...
For more information, see PRSTAT in the Fingerprint Command Reference Manual.
To merge ERRHAND.PRG with your program, your code should look like this:
NEW
LOAD “MY PROGRAM.PRG”
MERGE “/rom/ERRHAND.PRG”
RUN
The approximate size of ERRHAND.PRG is 4 KB. To use ERRHAND.PRG with
more than one application stored in printer memory, you can save valuable memory
space by merging ERRHAND.PRG with the current program directly after loading.
ERRHAND.PRG Subroutines
At Line Description
160000 Errors which normally may occur during printing are handled:
• Error 1005: Out of paper
• Error 1006: No field to print
• Error 1022: Head lifted
• Error 1027: Out of transfer ribbon
• Error 1031: Next label not found
The subroutine shows the last error that occurred, if any, and the
line number where the error was detected. The information is
directed to your terminal. Called by the statement GOSUB
160000.
200000 Includes error-handling routines that can be called from
routines where errors may occur. See lines 200000 through
200080.
1800200 RETURN
1900000 'Feedkey
1900010 KEY 19 OFF
1900020 GOSUB 400000
1900030 KEY 19 ON
1900200 RETURN
Extensions to ERRHAND.PRG
The following subroutines may be added manually to stop new input via the printer
keyboard while a subroutine is executed.
To enable all keys after completing a subroutine:
800000 'Turn all keys on
800010 FOR I% = 0 TO 21
800020 KEY (I%) ON
800030 NEXT I%
800040 RETURN
To disable all keys before entering a subroutine:
900000 'Turn all keys off
900010 FOR I% = 0 TO 21
900020 KEY (I%) OFF
900030 NEXT I%
900040 RETURN
ID Numbers (Default)
7 8 9 15
4 5 6 18
10 11 12 1 2 3 19
13 14 21 0 20 16
17
ID Numbers (+ Shift)
117
Position Numbers
44 49 54 34
43 48 53 33
1 6 11 42 47 52 32
16 21 41 46 51 31
56
55 56 57 30
52 53 54 29
1 2 3 49 50 51 28
4 5 46 48 8 13
31
159
PM4i
PM-Series Keypad
17 117
Position Numbers
56
1 6 11 33
16 21 31
44 49 54 34
43 48 53 32
42 47 52
41 46 51
31 159
ID Numbers (Default)
7 8 9 15 18
4 5 6 19 16
10 11 12 1 2 3
13 14 21 0 20 17
ID Numbers (+ Shift)
Position Numbers
44 49 54 59 63
43 48 53 58 62
2 7 12 42 47 52
1 6 11 41 46 51 56
55 56 57 30 29
52 53 54 28 13
1 2 3 49 50 51
4 5 46 48 8 31
Position Numbers
30 35 40 45 50 55 60 64
29 34 39 44 49 54 59 63
3 8 13 18 23 28 33 38 43 48 53 58 62
2 7 12 17 22 27 32 37 42 47 52 57 61
1 6 11 16 21 26 31 36 41 46 51 56
PD42
Note: The PD41 keyboard has only one button, with Id. number 17 when
pressed and 117 when released, giving the corresponding ASCII values of 16
and 144. The keyboard map string is only six characters long (compared to
64 for PF/PM/PX printers), with the Print key assigned position 1.
10 11 12 13 14
17
117
144
144
Position Numbers
2 3 4 5 6
17 20
16 19
17 20
16 19
For the full set of illustrations of the character sets supported by Fingerprint, see
Fingerprint Command Reference Manual.
Follow the next procedure to convert a Unicode character code in hex format to the
UTF-8 byte decimal value necessary to print the characters.
To convert a hex format Unicode character code to a decimal value
1 Determine the Unicode hex value for the character. For example, the hex value
for the Cyrillic capital letter ZHE ( ) is 0416.
2 Based on the hex value, determine the number of bytes required for UTF-8
encoding:
Using the same example, a hex value of 0416 requires two bytes for UTF-8
encoding.
3 Convert the hex value to binary. Using the same example, a hex value of 0416
equals the binary value 10000010110.
4 Identify x, y, and z bits as applicable. Start with the least significant digits to the
right and pad with zeros to the left if necessary.
In this example, the first five digits of the binary value 10000010110 correspond
to the y bits, and the remaining six digits correspond to the x bits. No padding
zeros are necessary.
The first byte is 11010000.
The second byte is 10010110.
5 Convert the bytes to decimal format. Using this example, the byte value
11010000 equals a decimal value of 208, and the byte value 10010110 equals a
decimal value of 150.
Now that you have determined the decimal value for the Unicode character, you can
use the values in a print command:
prtxt chr$(208)+chr$(150)
When selecting UTF-8 with the NASC command, the font must be selected with the
FONT command. Disable UTF-8 encoding by choosing a different character set
with the NASC command.
Use FONTD to select the desired font if you invoke UTF-8 with the NASCD
command. After you select UTF-8 with the NASCD command, you must actively
disable it with NASCD “” before returning to a single-byte character set.
Note: To avoid confusion between active character sets and fonts, Intermec
recommends you use only the NASC and FONT commands with UTF-8
unless you have experience with the NASCD and FONTD commands.
When using UTF-8, it is important that the font contains the desired characters.
The default font, Swiss 721 BT, contains the largest number of glyphs of the pre-
installed fonts. Unicode character numbers can be found at the web site of the
Unicode organization (www.unicode.org). It is not recommended to have UTF-8
enabled when printing bar codes since bar code data will use the UTF-8 byte
sequence as input, while the human readable uses the UTF-8 mapped character
number.
Note: FONT and FONTD commands are reset to their defaults after a
PRINTFEED (or CLL) command. NASC and NASCD commands are not
reset to default after a PRINTFEED (or CLL) command.
Example
This example prints the Hiragana Letter Small A character (Unicode hex 3041),
corresponding to the UTF-8 sequence 227 dec. + 129 dec. + 129 dec., in the Song
font. This is followed by the Cyrillic Capital Letter ZHE (Unicode hex 0416) in the
Swiss 721 BT font.
10 NASC “UTF-8”
20 FONT “Song”
30 PRTXT CHR$(227)+CHR$(129)+CHR$(129)
40 PRTXT “ = Hiragana Letter Small A”
50 PRPOS 0,35
60 FONT “Swiss 721 BT”
70 PRTXT CHR$(208)+CHR$(150)
80 PRTXT “ = Cyrillic Capital Letter ZHE”
90 PRINTFEED
159
Index
D E
data blocks, counting with LOC, 49 END, to finish a program, 16
data file, for layouts, 95 EOF, verifying end of file with, 49
data files, commands for ERRHAND.PRG, 134
managing, 36 described, 101
date and time, setting, 118 listed, 135
DATE$, 118 subroutines, 134
DBBREAK, in debugging, 131 variables, 134
DBSTEP, in debugging, 131 error codes, list of, 138
debugging error handling, 130
breakpoints, setting, 131 error codes, checking with
error handling, 130 ERR, 132
error-handling routines, 132 resuming execution, 132
Fingerprint programs, 131 status, returning with
DELETE, to remove program PRSTAT, 132
lines, 16 subroutines with ON ERROR
DELETEPFSVAR, 124
deleting a file with KILL, 36 GOTO, 132
deleting program lines, 16 error-handling routines,
devices, described, 11 creating, 132
DIAMONDS.1, 74 error-handling subroutines
DIM, 39 branching to, 21
DIR ON ERROR GOTO, 21
choosing print direction for RESUME, 21
fonts, 70 resuming execution, 21
default after PRINTFEED, 106 errors
default for bar code fields, 86 branching to specified line on
default for box fields, 88 error, 21
default for image fields, 87 breakpoints, setting, 131
default for line fields, 89 ERRHAND.PRG, 101
default for text fields, 84 error codes, list of, 138
print direction, setting, 81 error handling, 130
directories, 34 error-handling routines,
commands used with, 34 creating, 132
current, 125 message format, 130
path shortcuts, 34 programming errors, checking
DIRNAME$, to return directory for, 131
names, 34 EXECUTE, to start a program, 25
DISPLAY IMAGE, for PD42 custom executing a program with RUN, 36
graphics, 116 execution, breaking, 26
DISPLAY KEY, for PD42 custom BREAK, 27
pictographs, 116 BREAK...OFF, 27
DISPLAY STATE, for PD42 display BREAK...ON, 27
icons, 116 ON BREAK...GOSUB, 28
display, using, 114 specifying printer action on
cursor, controlling, 115 break, 28
customizing for PD42, 116 expressions, defined, 8
printing text with PRINT#, 114
dots F
described, 79 faulty dots, defined, 107
faulty, finding with SET FAULTY Feed key
DOT, 107 handling errors, 130
double-byte character set, choosing Immediate Mode, 114
with NASCD, 43 FIELD
double-byte fonts, described, 69 creating buffer with, 50
downloading Intel hex files, 74 random files, creating buffer in, 62
U W
uart1: as device, described, 11 waiting loop, described, 21
uart2: as device, described, 11 wand: as device, described, 11
uart3: as device, described, 11 WEEKNUMBER, 118
usb1: as device, described, 11 WHILE...WEND, 23
UTF-8 character set, 155 X
V X-axis, for printing, 79
VAL$, 45 XORMODE OFF, 90
variables XORMODE ON, 90
defined, 8 Y
saving to prevent loss, 124
Y-axis, for printing, 79
VERB ON|OFF, 53
verbosity, controlling with VERB Z
ON, 53 ZMODEM protocol, 37
VERSION$, 122
*934-019-002*
P/N 934-019-002