UBI EasyCoder 301 User Manual

Page 1
1
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Contents
Contents
Contents
UBI EasyCoder 301 Direct Protocol Programmer's Guide Edition 1, July 1997 Part No. 1-960419-00
1. Introduction 1. Introduction.......................................................................... 4
2. Getting Started 1. Computer Connection .......................................................... 5
2. Check Paper Supply ............................................................. 6
3. Turn on the Printer ............................................................... 6
4. Serial Communications Test................................................. 6
3. Principles of Operation 1. UBI Direct Protocol Special Features ................................... 8
2. Sending Commands ............................................................. 8
3. Fields ................................................................................. 10
4. General Formatting Commands.......................................... 10
5. Field-Related Formatting Commands ................................. 10
6. Layout Commands ............................................................. 11
7. Printable Data Commands .................................................. 11
8. Feeding and Printing Commands........................................ 12
9. Setting Up the Printer ......................................................... 12
10. Reading Printer's Status ...................................................... 12
11. File-Handling Commands .................................................. 13
12. Syntax Descriptions ........................................................... 13
13. File Storage Devices and File Names ................................. 14
4. Label Design 1. Introduction........................................................................ 15
2. General Formatting Commands.......................................... 16
3. Text Field........................................................................... 19
4. Bar Code Field ................................................................... 23
5. Image Field ........................................................................ 28
6. Box Field ........................................................................... 30
7. Line Field........................................................................... 31
8. Layout Commands ............................................................. 32
9. Printable Data Commands .................................................. 33
5. Feeding and Printing 1. Paper Feed ......................................................................... 39
Commands 2. Label Printing.....................................................................41
3. Batch Printing .................................................................... 42
Page 2
2
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Contents
Contents, cont'd.
6. Setting Up the Printer 1. Layout Mode/Immediate Mode .......................................... 44
2. IN/OUT Channel Setup ...................................................... 44
3. Date and Time.................................................................... 45
4. Date and Time Format........................................................ 46
5. Separators .......................................................................... 47
6. Counters............................................................................. 48
7. Label-Taken Sensor ........................................................... 49
8. Feed Key............................................................................ 49
9. Memory Formatting ........................................................... 50
10. Input Data Preprocess......................................................... 50
11. Character Set Selection....................................................... 51
12. Printer Reboot .................................................................... 52
13. Verbosity Level.................................................................. 53
14. Error Message Types.......................................................... 53
15. Error Handling ................................................................... 53
16. Break in Batch Printing ...................................................... 55
17. Printer Setup ...................................................................... 55
7. Reading the Printer's 1. Introduction........................................................................ 58
Status 2. Date and Time.................................................................... 58
3. Memory ............................................................................. 58
4. Printhead ............................................................................ 59
5. System Counters ................................................................ 59
6. Sensors............................................................................... 60
7. Printer's Status.................................................................... 60
8. Software and Hardware Versions ....................................... 60
8. File Handling 1. Reading the Printer Memory .............................................. 61
2. Removing Images, Files and Fonts ..................................... 61
3. Copying Files ..................................................................... 62
4. Downloading Binary Files.................................................. 62
5. Downloading Image Files...................................................63
9. Advanced Features 1. Specifying Complex Bar Codes.......................................... 64
2. Using International Character Sets......................................65
3. Font Scaling ....................................................................... 69
Page 3
3
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Contents
Information in this manual is subject to change without prior notice and does not represent a commit­ment on the part of UBI Printer AB.
© Copyright UBI PTC AB, 1997. All rights reserved. Published in Sweden. EasyCoder is a trademark of United Bar code Industries (UBI).
Centronics is a register ed trademark of Centronics Data Computer Corp. Microsoft, MS, and MS-DOS are registered trademarks of Microsoft Corporation. Speedo is a trademark of Bitstr eam, Inc. T rueType ar e registered trademarks of Apple Computer, Inc. Unicode is a trademark of Unicode Inc. W indows is a tr ademark of Microsoft Corporation.
10. Firmware Upgrade 1. Software and Fonts............................................................. 70
11. Character Set, Fonts 1. Character Sets .................................................................... 71
and Bar Codes 2. Resident Fonts.................................................................... 98
3. Resident Bar Code Fonts .................................................... 99
12. Error Messages 1. Error Messages in Numerical Order ................................. 100
13. Commands and 1. Commands (Alphabetical)................................................ 102
Functions 2. Command Syntax............................................................. 106
3. Function Syntax ............................................................... 108
Contents, cont'd.
Page 4
4
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 1 Introduction
Chapter 1
Introduction
UBI Direct Protocol is an easy-to-use printer programming lan­guage that has been developed for use with the computer-control­led direct thermal and thermal transfer printers manufactured by United Barcode Industries (UBI).
UBI Direct Protocol can be used in two ways:
To create label layouts consisting of fields with fixed or variable information. A layout can then be selected and provided with variable input from the host computer in the form of a simple string of data.
To send input data and formatting commands as a continuous string of data directly from the host computer.
In both cases, UBI Direct Protocol provides a flexible error handler , which allows you to compose your o wn error messages in any lan­guage.
UBI Direct Protocol has been created with two main types of appli­cation in mind:
Applications where the end-user requires a simple printer control program, but needs a versatile error handler.
Applications which have a comprehensive printer control program in the host computer.
Refer to chapter 13 in this manual for lists of the various commands in UBI Direct Protocol.
We recommend that you have the following manuals accessib le:
EasyCoder 301 Installation and Operation Manual
This Programming Manual.
Page 5
5
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 2 Getting Started
Chapter 2
UBI Direct Protocol is stored in two Flash EPR OM packages fitted as standard on the printer's CPU board. No floppy disks or operat­ing system, e.g. MS-DOS, are required. The printer only needs to be connected to a mains supply and to a device capable of transmit­ting characters in ASCII format, which can be anything from a non­intelligent terminal to a mainframe computer system.
For running the printer, we recommend a computer with a screen, an alphanumeric keyboard, and a communication program which provides two-way communication via an RS 232C serial port. A Centronics parallel port can also be used, but it will provide one­way communication only: no data or messages can be returned to the screen of the host.
Connect the printer and host as described in the EasyCoder 301 Installation and Operation Manual.
It is possible to set up the printer's communication protocol to fit the host computer, as described in the EasyCoder 301 Installation and Operation Manual. Howe ver , until you hav e become familiar with UBI Direct Protocol, it may be easier to adapt the host to the print­er's default setup parameters. There is no communication setup for the Centronics parallel interface.
Default serial communication setup on "uart1:"
Baud rate.................... : 9600
Parity ......................... : None
Character length ......... : 8
No. of stop bits ........... : 1
Flow control............... : Disabled
New line .................... : CR/LF (Carriage Return + Line Feed)
Getting Started
1. Computer Connection
Page 6
6
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 2 Getting Started
Check that the printer has an ample supply of paper or other receiv­ing material and, where applicable, of thermal transfer ribbon. Re­fer to the EasyCoder 301 User's Guide or Installation and Opera­tion Manual for loading commands.
Check that the printhead is lowered. Turn on the mains switch, which is fitted on the printer's rear plate, and check that the Power LED comes on.
Check that you have a working two-way serial communication by sending a simple command from the host to the printer . On the host, type:
? VERSION$
Provided you hav e serial two-way communication, the printer should respond by immediately returning the version of the installed UBI Direct Protocol software to the screen of the host, e.g.:
D6.1 Ok
This indicates that the communication is working both ways. If the communication does not work, turn off the printer and check
the connection cable. Also check if the communication setup in the host corresponds to the printer's setup and if the connection is made between the correct ports. Then try the communication test again.
Once you know that the communication is working, you may go on and send a line of text to make sure that characters transmitted from the terminal are interpreted as expected by the printer's software:
PP 10, 10 FT "Swiss 721 BT" PT "ABCDEFGHIJKLM" PF
2. Check Paper Supply
3. Turn on the Printer
4. Serial Communications Test
( = Carriage Return)
Page 7
7
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 2 Getting Started
Each line will be acknowledged by “Ok” on the screen, pro vided it has been entered correctly. When you press ↵ (Carriage Return) the third time, the printer will feed out a label, ticket, tag or piece of strip with the text printed in the lower left corner of the printable area.
You can try using other characters between the quotation marks in the third line, especially typical national characters like ÅÄÖÜ¿¢¥ç, etc. If any unexpected characters are printed, you may need to se­lect another character set (see chapter 6.11), or change the commu­nication setup from 7-bit to 8-bit character length.
4. Serial Communications Test, cont'd.
ABCDEFGHIJKLM
Page 8
8
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 3 Principles of Operation
Chapter 3
Principles of Operation
There is a built-in error handler , that can indicate selected error con­ditions and produce error-messages of your own creation in any language you like.
Variable input data (in a special format) can be inserted into fields in a predefined layout.
You can create counters without extensive programming. You can easily enable the Feed key to produce printouts. By default, verbosity is turned on in UBI Direct Protocol1. UBI Direct Protocol allows you to send commands to the printer in
two ways:
Immediate Mode
Layout Mode
Immediate Mode You send commands that the printer will act upon immediately. This method is used for setting up the printer, for returning information from the printer back to the host and for managing files, fonts and images.
Examples:
PRINT KEY ON (enable Feed key) ? DATE$ (read printer's calendar) KILL "LAYOUT1" (delete a layout or file)
Immediate Mode can also be used for creating label layouts including all the printable data as illustrated below.
Layout Mode Layout Mode is only intended for creating labels. Firstly, create a layout containing formatting commands for a number of fields and such printable data that you do not need to change. Secondly, send a string of printable data to the empty fields plus a print command. You can create a number of different layouts, select the one you need, add the variable data and print out the labels.
1. UBI Direct Protocol Special Features
2. Sending Commands
1
/. While you are experimenting with UBI Direct Protocol, we recommend that you retain the default verbosity setting (ON). Later you should change it to OFF, since this will produce optimum printer performance.
Page 9
9
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 3 Principles of Operation
Let us create the simple label shown on the left using both methods:
Immediate Mode:
BF ON:BF "Swiss 721 BT",10,0:PP 10,20: PX 400,300,10:PP 25,25:PM "ROM:UBI.1": PP 75,250:BT "CODE39":PB "UBI":PP 75,200: FT "Swiss 721 BT",10,0:PT "My FIRST label!": PF
You can also send the same string line by line:
BF ON (enable bar code interpretation) BF "Swiss 721 BT",10,0 (select bar code interpr. font) PP 10, 20 (insertion point for box field) PX 400,300,10 (create a box) PP 25,25 (insertion point for image field) PM "ROM:UBI.1" (select image) PP 75,250 (insertion point for bar code field) BT "CODE39" (select bar code type) PB "UBI" (input data to bar code field) PP 75,200 (insertion point for text field) BF "Swiss 721 BT",10,0 (select font for text field) PT "My FIRST label!" (input data to text field) PF (print one label)
Layout Mode:
First, create a layout:
LAYOUT INPUT "LABEL1" (start layout recorder) BF ON (enable bar code interpretation) BF "Swiss 721 BT",10,0 (select bar code interpr. font) PP 10,20 (insertion point for box field) PX 400,300,10 (create a box) PP 25,25 (insertion point for image field) PM "ROM:UBI.1" (select image) PP 75,250 (insertion point for bar code field) BT "CODE39" (select bar code type) PB VAR1$ (variable input data to bar code field) PP 75,200 (insertion point for text field) BF "Swiss 721 BT",10,0 (select font for text field) PT VAR2$
(
variable input data to text field)
LAYOUT END (save layout)
Note: If a label has been printed using a predefined layout and you want to return to Immediate Mode, the predefined layout must first be cleared from the printer's working memory using the following command:
LAYOUT RUN ""
2. Sending Commands, cont'd.
Page 10
10
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 3 Principles of Operation
Then add the variable input data and a print command:
LAYOUT RUN "LABEL1" (select layout) <STX> (start of input data, ASCII 02 dec) UBI (variable input data to VAR1$) My FIRST label! (variable input data to VAR2$) <EOT> (end of input data, ASCII 04 dec) PF (print one label)
The printable information on a label, ticket, tag or piece of strip consists of various types of field. A field can consist of:
A single line of text
A bar code with or without human readable interpretation
An image, i.e. a picture, logo or sign in .PCX format
A box, i.e. a hollow square or rectangle
A line
Any type of field should be specif ied with re gard to:
Position
Alignment
Direction Refer to chapter 4.2 for more information.
Depending on the type of field, additional formatting commands can be used:
Text Field:
- Font (typeface)
- Font Size (in points)
- Font Slant (in degrees)
- Magnification
- Normal Image/Inverse Image
Bar Code Field1:
- Bar Code Type
- Height (height of bar pattern)
- Ratio (wide bars/narrow bars)
- Magnification (bar pattern)
- Bar Code Interpretation On/Off
- Bar Code Interpretation Font
- Bar Code Interpretation Font Size
- Bar Code Interpretation Font Slant
3. Fields
2. Sending Commands,
cont'd.
4. General Formatting Commands
5. Field-Related Formatting Commands
1
/ . This refers to one-dimensional bar codes only. Complex two­dimensional bar or dot codes may have other formatting parameters.
Page 11
11
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 3 Principles of Operation
5. Field-Related Formatting Commands, cont'd.
Image Field:
- Magnification
- Normal Image/Inverse Image
Box Field:
- Size (height, width, line thickness)
Line Field:
- Size (length, line thickness)
Text, bar code and image fields also require some input data:
Text Field: Alphanumeric text
Bar Code Field: Alphanumeric or numeric value (depending on type of code)
Image Field: Name of the image
The input data to text and bar code fields may either be provided by the host or read from the printer's software, e.g. counter values or various data related to the printer's clock/calendar.
In UBI Direct Protocol, you can either specify the fields both with regard to formatting parameters and input data in the same string, or you can create a layout to which you can send variable data later.
The layout should contain formatting parameters for all fields and input data to such fields that will always contain the same informa­tion. When the variable input data are added, they will be inserted into their respective fields (like filling in a pre-printed form).
When creating predefined layouts, special commands must be used for:
Starting the layout recorder
Saving the layout
Depending on the type of field and the type of bar code, printable data to text and bar code fields may consist of:
Alphanumeric data (i.e. text)
Numeric data
Counter values
Current date
Current time
Current date +/- nn days
Current time +/- nn seconds
Current week number
Current weekday
6. Layout Commands
7.Printable Data Commands
Page 12
12
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 3 Principles of Operation
8. Feeding and Printing Commands
9. Setting Up the Printer
Some commands control printing and paper feed, e.g.:
Changing paper feed speed
Rotating the print roller during cleaning
Feeding out an empty label, ticket, tag or piece of strip
Adjusting the label stop/black mark sensor.
Printing one label or a batch of labels (or similar).
You can control how the printer will work, e.g.:
Select standard IN and OUT channels
Set the printer's clock/calendar
Set formats for the printing of date and time
Set separators for input data strings to predefined layouts
Create label counters
Enable/disable the optional label-taken sensor
Enable/disable Feed key
Format the printer's RAM memory or a memory card
Remap certain incoming characters
Select character set(s)
Restart the printer
Select verbosity level
Select type of error message
Enable error handling and create customized error messages
Select method for breaking the printing of a batch of labels
Change the printer's setup
Provided you hav e two-way serial communication between printer and host, you can return the printer's status with regard to a number of functions to the host, e.g.:
Current date and time
Memory status
Printhead status and characteristics
Value of various system counters
Status of various sensors
Software and hardware version
10. Reading Printer's Status
Page 13
13
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 3 Principles of Operation
11. File-Handling Commands
12. Syntax Descriptions
A number of commands are used to control the printer's memory, for example:
Read the names of files, fonts or images stored in the printer's
memory
Download binary files
Download .PCX files
Remove files
Remove downloaded images
Copy files
Many commonly used commands have a shorthand v ersion to mini­mise the transfer of data. In the explanations of the various com­mand that follow , both the full name and the shorthand v ersion will be shown, separated by a thin vertical line, e.g. :
PRPOS | PP
Upper- and low er-case characters can be used at will in commands. Parameters for commands are shown like this:
<parameter> numeric value "<parameter>" alphanumeric text (enclosed by double quo-
tation marks)
Compulsory space characters are indicated by a double-headed
arrow (↔).
Square brackets [ ] indicate optional parameters.
Thin vertical bars (|) indicate alternatives.
Always enter parentheses, commas, colons, semicolons, minus
signs, quotation marks and period characters exactly as shown.
Negative values are indicated by leading minus signs (-).
Page 14
14
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 3 Principles of Operation
Files can be stored in the EasyCoder 301 on one of four devices:
"ROM:"
Contains the built-in files necessary for using the printer.
"RAM:"
Contains files created by the user.
"CARD1:"
A PCMCIA card in the slot nearest the ON/OFF switch, which can be a DOS-formatted card or a specially formatted font cartridge.
"CARD2:"
A PCMCIA card in the slot farthest from the ON/OFF switch, which can be a DOS-formatted card or a specially formatted font cartridge.
The files in each device can be listed using the FILES command, e.g. FILES "RAM:"
In general, ROM: and font cartridges in "CARD1:" or "CARD2:" are read-only devices: you cannot create, copy or delete files on these devices, e.g. the following commands would cause err ors :
FILE&LOAD "ROM:NEWFILE",123 COPY "RAM:OLDFILE","CARD1:NEWFILE"
(if CARD1: contains a font cartridge)
KILL "CARD2:OLDFILE"
(if CARD2: contains a font cartridge)
In contrast, "RAM:" and DOS-formatted cards in "CARD1:" or "CARD2:" are read/write devices which support all file operations.
When using a Direct Protocol command which has the name of an existing file as a parameter, you can:
specify the device name before the filename,
e.g. KILL "RAM:MYFILE.TXT"
omit the device name,
e.g. KILL "MYFILE.TXT" in which case, the printer will search each device in turn until it finds a file with this name.
If you use a Direct Protocol command which creates a file, you can:
specify the device on which the file is to be stored,
e.g. FILE&LOAD "CARD1:MYFILE.TXT", 123
omit the device name,
e.g. FILE&LOAD "MYFILE.TXT", 123 in which case the file will be stored on "RAM:".
13. File Storage Devices and File Names
Page 15
15
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 4 Label Design
Chapter 4
Field T ypes
A label layout is made up of a number of fields. There are five different types of field:
Text Field A text field consists of a single line of text.
Bar Code Field A bar code field consists of a single bar code, with or without a bar code interpretation in human readable characters.
Image Field An image field is a picture, drawing, logo or other type of illustration in bitmap format.
Box Field A box field is a square or rectangular paper- coloured area surrounded by a black border line. If the border is sufficiently thick, the whole area may appear black.
Line Field A line field is a black line that goes either along or across the paper web. A short but thick line can look like a black box.
There are no restrictions, other than the size of the memory , on the number of fields on a single label.
Label Design
1. Introduction
Box Field
Bar Code Field (with interpretation)
Text Field
Line Field
Image Field
Page 16
16
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 4 Label Design
Origin
The positioning of all printable objects on the label, i.e. text fields, bar code fields, images, boxes, and lines, uses a common system. The starting point (called the origin) is the point on the paper that corresponds to the innermost active dot on the printhead at the mo­ment when printing is started.
The location of the origin is affected by the following f actors:
Position across the paper web (X-axis):
The position of the origin in the X-axis is determined by the XSTART value in Setup Mode.
Position along the paper web (Y-axis):
The position of the origin in the Y-axis is determined by the STARTADJ and STOPADJ values in Setup Mode and by any FORMFEED command executed before the current PRINTFEED command or after the preceding PRINTFEED.
Coordinates
Starting from the origin, the X-axis runs across the paper web from left to right (as seen when facing the printer) and the Y-axis runs along the paper web from the printhead towards the back of the printer.
Units of Measurement
The unit of measurement is always “dots”, i.e. all measures depend on the density of the printhead. The EasyCoder 301 has an 8 dots/ mm printhead, i.e. a dot is 1/8 mm = 0.125 mm = 0.00492" or 4.92 mils.
Insertion Point
The insertion point of any printable object is specified within the coordinate system by means of PRPOS|PP. The coordinates must be selected so the field fits completely inside the printable area.
PRPOS | PP <x-coordinate>,<y-coordinate>
<x-coordinate> the distance in dots along the x-axis fr om the
origin to the insertion point
<y-coordinate> the distance in dots along the y-axis fr om the
origin to the insertion point
Default value: PRPOS 0,0 Reset to default by: PRINTFEED|PF
Example:
PP 100, 200
2. General Formatting Commands
Page 17
17
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 4 Label Design
2. General Formatting Commands, cont'd.
Alignment
Once the insertion point is specified, you must also decide which part of the object should match the insertion point. For example, a text field forms a rectangle. There are 8 anchor points along the borders and one in the centre, numbered 1–9 as shown in this illus­tration. The desired anchor point is specified by means of the ALIGN command.
ALIGN | AN <anchor point>
<anchor point> is a number from 1 – 9 Default value: 1 Reset to default by: PRINTFEED|PF
Example:
AN 1 ALIGN|AN will place the lower left corner of the text field at the
insertion point specified by PRPOS. Refer to the illustration below for detailed information on the anchor points for various types of printable objects.
Page 18
18
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 4 Label Design
Direction
UBI Direct Protocol allows printing in four directions. Y ou can ro­tate the printable object clockwise around the anchor point/inser­tion point with a 90° increment (0°, 90°, 180°, or 270°) by means of a DIR command:
DIR <direction>
<direction> is a number from 1 – 4 (DIR 1 = 0°; DIR 2 =
90°; DIR 3 = 180°; DIR 4 = 270°)
Default: 1 Reset to default by: PRINTFEED|PF
Example:
DIR 3 DIR rotates all following printable fields so that they are printed
across the paper web and upside down with respect to the way the paper is fed out of the printer.
This illustration summarizes the three general formatting commands PRPOS|PP, ALIGN|AN and DIR:
2. General Formatting Commands, cont'd.
Page 19
19
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 4 Label Design
3. Text Field
A text field consists of one or more alphanumeric characters on the same line (max 300 characters). UBI Direct Protocol cannot wrap text to a new line, b ut each line must be specif ied as a separate te xt field.
UBI Direct Protocol has been extended to allow characters from any national character set, such as Chinese, Cyrillic and Hebrew, to be included in a text field. In this section we will discuss the com­mands required to control the format of text fields containing char ­acters from the default character set, Roman 8 (see chapter 11.1). The Direct Protocol commands related to printing characters from other character sets are discussed in chapters 6.11 and 9.2.
In addition to the general formatting commands, PRPOS, ALIGN and DIR (see chapter 4.2), a text field can contain the following commands:
Font (typeface)
Font Size (in points)
Font Slant (in degrees)
Magnification
Normal Image/Inverse Image
Select a Font
The FONT command specifies the file name of the scalable font to use and the height and the italic angle with which the characters will be printed.
FONT | FT "<font file name>" [,<font size>,<font slant>]
<font file name> the name of a Speedo or TrueType font file,
and must be enclosed by double quotation marks.
<font size> the height of the characters in points (a point
is a standard typogr aphic unit, equal to 1/72 inches/0.352 mm).
<font slant> the italic angle of the characters in degrees;
a positive value slants the characters clock­wise away from the vertical.
Default: "Swiss 721 BT", size 12p, slant 0
°
Reset to default by: PRINTFEED|PF
Before using any of the standard fonts OCR-A BT , OCR-B 10 Pitch BT or Zapf Dingbats BT , you must select a special character set for that font by means of a NASC command (see chapters 6.11, 9,2 and
11.1). Before switching back to any other font than those mentioned
above, you must specify the original character set again by means of a new NASC command.
Page 20
20
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 4 Label Design
The three font parameters can be specified separately using the fol­lowing commands:
FONT | FT "<font file name>" FONTSIZE | FS <font size> FONTSLANT | FL <font slant>
For each parameter, the v alue specif ied by these commands will be used in all text fields on the current label, until a ne w value is speci­fied.
Standard EasyCoder 301 printers contain the following 15 font f iles:
Century Schoolbook BT
Dutch 801 Roman BT
Dutch 801 Bold BT
Futura Light BT
Letter Gothic 12 Pitch BT
Monospace 821 BT
Monospace 821 Bold BT
OCR-A BT (use NASC "OCR-A.NSC)
OCR-B 10 Pitch BT (use NASC "OCR-B.NSC)
Prestige 12 Pitch Bold BT
Swiss 721 BT (default font)
Swiss 721 Bold BT
Swiss 721 Bold Condensed BT
Zapf Dingbats BT (use NASC "ZAPF.NSC)
Zurich Extra Condensed BT
For examples of the abov e fonts, see c hapter 11.2. Previous EasyCoder printers contained bitmapped fonts, i.e. fonts
scaled with a fixed size and slant1. To provide backward compat­ibility, the EasyCoder 301 provides FONT commands to select the equiv alent combinations of font f ile name, size and slant:
“Old” EasyCoders EasyCoder 301
"SW020BSN" "Swiss 721 Bold BT", 6,0 "SW030RSN" "Swiss 721 BT", 9,0 "SW050RSN" "Swiss 721 BT", 14,0 "SW060BSN" "Swiss 721 Bold BT", 17,0 "SW080BSN" "Swiss 721 Bold BT", 23,0 "SW120BSN" "Swiss 721 Bold BT", 34,0 "MS030RMN" "Monospace 821 BT", 9,0 "MS050RMN" "Monospace 821 BT", 14,0 "MS060BMN" "Monospace 821 Bold BT", 17,0 "OB035RM1" "OCR-A BT",8,0
3. Text Field, cont'd.
1
/. Since the height of these fonts where specified in dots, not points, the point sizes in the table indicate the nearest value expres­sed as a whole number (integer) of points and is thus not 100% correct.
Page 21
21
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 4 Label Design
Set Font Magnification
Fonts can be magnified 1 - 4 times independently with regard to height and width by means of a MAG command.
MAG <height mag>,<width mag>
<height mag> the magnification factor 1,2,3 or 4 times with
regard to height.
<width mag> the magnification factor 1,2,3 or 4 times with
regard to width. Default: 1,1 Reset to default by: PRINTFEED|PF
Specifying both a font height and two magnification parameters allows the user to control both the height and the aspect ratio of printed characters. For example, to specify Swiss 721 Roman at 12 points with double width, use:
FONT "Swiss 721 BT",12,0 MAG 1,2
T o specify Swiss 721 Roman a t 12 points with a height:width ratio of 2:3, use:
FONT "Swiss 721 BT",6,0 MAG 2,3
Select Normal/Inverse Printing
Normally, text is printed in black without any background (NOR­IMAGE). Using INVIMAGE, the printing can be inversed so that
the paper gives the colour of the characters, whereas the background will be black. The size of the background is decided by the font size and slant. A NORIMAGE statement is only needed when changing back from INVIMAGE printing.
NORIMAGE | NI INVIMAGE | II
Default: NORIMAGE Reset to default by: PRINTFEED|PF
3. Text Field, cont'd.
NORIMAGE
INVIMAGE
Page 22
22
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 4 Label Design
3. Text Field, cont'd.
Summary
To create a text field, the following formatting commands must be given (in most cases default values may substitute missing para­meters). Input data to the field is explained chapter 4.9, printing commands are explained in chapter 5.2, and the use of national character sets is explained in chapters 6.11 and 9.2.
Purpose Command Default Remarks
X/Y Position PRPOS | PP 0,0 Number of dots Alignment ALIGN | AN 1 Select AN 1 – 9 Direction DIR 1 Select DIR 1 – 4 Font FONT | FT “Swiss 721 BT”, 12, 0 Font Size FONTSIZE | FS 12 Can be added to
FONT command
Font Slant FONTSLANT | FL 0 Can be added to
FONT command
Magnification MAG 1,1 Height 1–4,
Width 1–4
Appearance INVIMAGE | II off White-on-black print
NORIMAGE | NI on Black-on-white print
Examples:
PP 200,500:AN 7:DIR 2: FT "Futura Light BT",15,10:MAG 2,2:II
PP 50,300:NASC "OCR-A.NSC": FT "OCR-A BT":PT "This is OCR-A": PP 50,50:NASC 1: FT "Futura Light BT",15,10: PT "This is Futura Light"
Page 23
23
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 4 Label Design
As standard, UBI Direct Protocol supports 37 of the most common bar code symbologies. Each bar code (optionally including its hu­man readable interpretation) makes up a bar code field.
In addition to the general formatting commands, PRPOS, ALIGN and DIR (see chapter 4.2), a bar code field can specify the follow- ing properties:
Bar Code Type
Height (height of bar pattern)
Ratio (wide bars/narrow bars)
Magnification (bar pattern)
Bar Code Interpretation On/Off
Bar Code Interpretation Font
Bar Code Interpretation Font Size
Bar Code Interpretation Font Slant
Select a Bar Code Type
The type of bar code is specified by a BARTYPE command con­taining an abbreviation of the bar code name. The ab breviation must be entered exactly as listed below.
BARTYPE | BT "<bar code name abbreviation>"
<bar code name...> the designation of the bar code type accord-
ing to the list below; it must be enclosed by
double quotation marks. Default: "INT2OF5" Reset to default by: PRINTFEED|PF
Bar Code Abbreviation
Codabar "CODABAR" Code 11 "CODE11" Code 16K "CODE16K" Code 39 "CODE39" Code 39 full ASCII "CODE39A" Code 39 w. checksum "CODE39C" Code 49 "CODE49" Code 93 "CODE93" Code 128 "CODE128" DUN-14/16 "DUN" EAN-8 "EAN8" EAN-13 "EAN13" EAN-128 "EAN128" Five-Character Supplemental Code "ADDON5" Industrial 2 of 5 "C2OF5IND" Industrial 2 of 5 w . checksum "C2OF5INDC"
4. Bar Code Field
Note: Complex bar codes, such as PDF 417 and MaxiCode, must be specified by means of an extended version of the BARSET com­mand, see chapter 9.1.
Page 24
24
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 4 Label Design
4. Bar Code Field,
cont'd.
Bar Code Abbreviation
Interleaved 2 of 5 "INT2OF5" Interleaved 2 of 5 w. checksum "INT2OF5C" Interleaved 2 of 5 A "I2OF5A" Matrix 2 of 5 "C2OF5MAT" Maxicode "MAXICODE" MSI (modified Plessey) "MSI" PDF 417 "PDF417" Plessey "PLESSEY" Straight 2 of 5 "C2OF5" Two-Character Supplemental Code "ADDON2" UCC-128 Serial Shipping Container Code "UCC128" UPC-5 digits Add-On Code "SCCADDON" UPC-B "UPCB" UPC-A "UPCA" UPC-D1 "UPCD1" UPC-D2 "UPCD2" UPC-D3 "UPCD3" UPC-D4 "UPCD4" UPC-D5 "UPCD5" UPC-E "UPCE" UPC Shipping Container Code "UPCSCC"
See also chapter 9.1.
Set Bar Code Height
The height of the bars that make up the bar code can be specified by means of the BARHEIGHT command.
BARHEIGHT | BH <height>
<height> the height of the bar s in dots Default: 100 Reset to default by: PRINTFEED|PF
Set Bar Code Ratio
The ratio between the wide and the narrow bars can be set using a BARRATIO command.
BARRATIO | BR <wide bars>,<narrow bars>
<wide bars> width of wide bars in dots <narrow bar s> width of narrow bars in dots Default: 3:1 Reset to default by: PRINTFEED|PF
Page 25
25
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 4 Label Design
4. Bar Code Field,
cont'd.
Set Bar Code Magnification
The magnification of the bar code and the bar code ratio decides the actual thickness of the bars. For example, if BARRATIO is 3:1 and BARMAG is 2, then the wide bars will be 6 dots thick (3 × 2) and the narrow bars will be 2 dots (1 × 2). Magnif ication also af fects inter ­pretations that are integrated in the code, e.g. EAN and UPC codes.
BARMAG | BM <magnification>
<magnification> the enlargement factor of the bar code pat-
tern. Default: 2 Reset to default by: PRINTFEED|PF
Bar Codes (combined command)
The BARSET command is primarily intended for complex 2-di­mensional codes (see chapter 9.1), but can also be used to specify more simple bar codes by means of a single command:
BARSET"<code name>",<ratio wide bars>,<ratio narrow bars>,<magn.>,<height>
<code name> specifies bar code name
(default "INT2OF5") <ratio wide bars> specifies ratio wide/narrow bars
(default 3) <ratio narr ow bars> specifies ratio wide/narr ow bars
(default 1) <magnification> specifies magnification
(default 2) <height> specif ies height of bar s in dots
(default 100) Reset to default by: PRINTFEED|PF
Page 26
26
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 4 Label Design
Select Bar Code Interpretation Font
Most bar codes do not automatically include any bar code interpre­tation in human readable characters. If you wish to include a bar code interpretation, you can specify the font to be used for the bar code interpretation (human readable).
BARFONT | BF[#<start parameter>,]"<font filename>"[, "<fontsize>" [,"<fontslant>"[,<vert. offset>[,<height mag> [,<width mag>]]]]][ON]
<start parameter> specif ies the fir st parameter of the command
(default 1) <font filename> the file name of the font to be used
(default "Swiss 721 BT") <font size> the height of the font in points
(default 12 pt) <font slant> the slant of the font in degrees clockwise
(default 0°) <vert. offset> distance between bar code and interpretation
in dots
(default 6 dots) <height mag> the magnification with regard to height
(default 1) <width mag> the magnification with re gard to width
(default 1) <ON> enables the printing of bar code interpreta-
tion
(default OFF) Reset to default by: PRINTFEED|PF
The bar code font size and slant can be specified separately using the following commands:
BARFONTSIZE | BFS <font size> BARFONTSLANT | BFL <font slant>
As with text fields, human readable bar code interpretation fonts can contain characters from any national character set.
Howev er, before using any of the standard fonts OCR-A BT , OCR­B 10 Pitch BT or Zapf Dingbats BT , you must select a special char­acter set for that font by means of a NASC command (see chapters
6.11, 9,2 and 11.1). Before switching back to any other font than those mentioned above, you must specify the original character set again by means of a new NASC command.
4. Bar Code Field,
cont'd.
Page 27
27
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 4 Label Design
4. Bar Code Field,
cont'd.
Bar code interpretation printing can be enabled or disabled by means of these commands:
BARFONT | BF ON BARFONT | BF OFF
By default, bar code interpretation is disabled.
Summary
T o create a bar code field, the follo wing formatting commands must be given (in most cases default values may substitute missing pa­rameters). Input data and printing commands are explained in chap­ters 4.9 and 5.2 respectively.
Purpose Command Default Remarks
X/Y Position PRPOS | PP) 0 ,0 Number of dots Alignment ALIGN | AN 1 Select ALIGN 1 – 9 Direction DIR 1 Select DIR 1 – 4 Bar Code Select BARSET see above Can be replaced
by BT, BH, BR, BM
Human Readable BF ON Off Can be omitted
Examples:
PP 100,100:AN 7:DIR 4:BARSET "CODE39",2,1,3,120: BF "Swiss 721 Bold BT"20,0,5,1,1 ON
PP 100,100:AN 7:DIR 4:BARSET "CODE39",2,1,3,120: NASC "OCR-A.NSC": BF "OCR-A BT"20,0,5,1,1 ON:NASC 1
Page 28
28
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 4 Label Design
5. Image Field
An image field contains a picture or logo in .PCX format. The im­age can either be stored in the printer's RAM or in a memory card. It can also be downloaded from the host computer.
You cannot store images in the printer's ROM, but it does contain two standard images: "ROM:UBI.1", which is the UBI logo for DIR 1 and 3, and "ROM:UBI.2", which is the UBI logo for DIR 2 and 4.
In addition to the general formatting commands, PRPOS, ALIGN and DIR, an image f ield can contain the following commands:
Name
Magnification
Normal/Inverse printing
Select an Image:
An image is selected by the full name under which it is stored in the printer's memory , either as plain text or as a v ariable (also see chap­ter 4.9).
PRIMAGE | PM "<image name>"
<image name> the full name and stora ge location of the im-
age including extension, enclosed by double
quotation marks Default: None
The UBI image name convention includes an extension (.1 or .2), where .1 indicates that the image is intended for print directions 1 and 3, whereas .2 indicates print directions 2 and 4 (see chapter
4.2). For example, the image "R OM:UBI.1" is suited for directions 1 and 3.
Set Image Magnification:
Images can be magnified 1 – 4 times independently with regard to height and width by means of a MAG command.
MAG <height mag>,<width mag>
<height mag> the magnification factor 1, 2, 3 , or 4 times
with regard to height. <width mag> the magnification factor 1, 2, 3 , or 4 times
with regard to width. Default: 1,1
Reset to default by: PRINTFEED|PF
T o obtain the best printout quality, select a larger image rather than magnifying a smaller one.
Page 29
29
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 4 Label Design
Select Normal/Inverse Printing
Normally, an image is printed in black and white, just as it was created. Using INVIMAGE, the black and white can be inverted. The size of the background is decided by the actual size of the im­age including “invisible” background. A NORIMAGE statement is only needed when changing back from INVIMAGE printing.
NORIMAGE | NI INVIMAGE | II
Default: NORIMAGE Reset to default by: PRINTFEED|PF
Summary
T o create an image f ield, the following formatting commands must be given (in most cases default v alues may substitute missing para­meters). Image selection by means of variable input, and printing commands are explained in chapters 4.9 and 5.2 respectiv ely.
Purpose Command Default Remarks
X/Y Position PRPOS | PP 0,0 Number of dots Alignment ALIGN | AN 1 Select ALIGN 1 – 9 Direction DIR 1 Select DIR 1 – 4 Magnification MAG 1,1 Height 1 – 4,
Width 1– 4
Appearance INVIMAGE | II off Black and white parts
inverted
NORIMAGE | NI on Normal (revokes
INVIMAGE)
Image name PRIMAGE | PM n.a. Full name including
extension
Example:
PP 200,500:AN 3:DIR 3:MAG 2,2:II:PM "ROM:UBI.1"
5. Image Field,
cont'd.
Page 30
30
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 4 Label Design
6. Box Field
A box is a hollow square or rectangle that can be rotated with an increment of 90° according to the print direction. If the line thick­ness is sufficiently large, the box will appear to be filled (another method is to print an extremely thick short line).
In addition to the general formatting commands, PRPOS, ALIGN and DIR, a box field is specified by a single command.
Set Size of the Box
The size of the box is specified with regard to height, width and line weight (thickness).
PRBOX | PX <height>,<width>,<line thickness>
<height> the height of the box in dots perpendicular to
the selected direction. <width> the length of the box in dots along the se-
lected direction. <line thickness> the line weight in dots. Default: None
Summary
To create a box field, the following formatting commands must be given (in most cases, default values may substitute missing para­meters). Printing commands are explained in chapter 5.2.
Purpose Command Default Remarks
X/Y Position PRPOS | PP 0,0 Number of dots Alignment ALIGN | AN 1 Select ALIGN 1 – 9 Direction DIR 1 Select DIR 1 – 4 Box size PRBOX | PX n.a. Height, width and line
thickness in dots
Example:
PP 250,250:AN 1:DIR 3:PX 200,200,10
Page 31
31
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 4 Label Design
7. Line Field
A line can be printed in right angles along or across the paper ac­cording to the print direction.
In addition to the general formatting commands, PRPOS, ALIGN and DIR, a line f ield is specified by a single command.
Set Size of the Line
The size of the line is specified with regard to length and line weight (thickness).
PRLINE | PL <length>,<line thickness>
<length> the length of the line in dots along the se-
lected direction. <line thickness> the line weight in dots. Default: No
Summary
To create a line field, the following formatting commands must be given (in most cases default values may substitute missing para­meters). Printing commands are explained in chapter 5.2.
Purpose Command Default Remarks
X/Y Position PRPOS | PP 0,0 Number of dots Alignment ALIGN | AN 1 Select ALIGN 1 – 9 Direction DIR 1 Select DIR 1 – 4 Line size PRLINE | PL n.a. Length and line
thickness in dots
Example:
PP 100,100:AN 1:DIR 4:PL 200,10
Page 32
32
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 4 Label Design
8. Layout Commands
Start Layout Recorder
The LAYOUT INPUT command clears the printer's working memory, starts the layout recorder and allows you to assign a name to the layout.
LAYOUT INPUT "<layout name>"
<layout name> up to 30 characters enclosed by double quo-
tation marks. Example:
LAYOUT INPUT "Shipping Label"
Assign Input Variables to Fields
The layout may consist of both fixed fields and fields for variable information. In the layout, you must give a reference to each text, bar code or image field intended to recei ve variable data, so that the input data can be inserted into the correct field. The variable VAR<n>$ is used to indicate variable input, where <n> specifies the number of the field. The first variable input data block will be entered into the field containing VAR1$, the second block with VAR2$, etc. Fixed data and variable data can be combined in the same field. See also chapter 4.9.
VAR<n>$
<n> the number of the field. Ther e is no pr actical
limit to the number of fields. Examples:
PT VAR1$ (text field with variable input) PT "Price: ";VAR2$ (text field with fixed & variable input) PB VAR3$ (bar code field with variable input) PM VAR4$ (image field with variable input)
Save the Layout
After completing the layout, save it in the printer's RAM memory, turn off the layout recorder and clear the printer's working memory by means of a LAYOUT END command. The layout can then be copied or killed like any other f ile, see chapter 3.1.
LAYOUT END
Example:
LAYOUT END
Page 33
33
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 4 Label Design
9. Printable Data Commands
Select a Layout
Before any variable data can be transmitted to a preprogrammed layout, the layout must be selected by means of a LAYOUT RUN command.
LAYOUT RUN "<layout name>"
<layout name> the name given to the layout in the LA YOUT
INPUT command and must be enclosed by
double quotation marks. Example:
LAYOUT RUN "Shipping Label"
Transmit Variable Data to a Layout
After having selecting a layout using a LAYOUT RUN command, you can transmit the variable data to their respecti ve layout f ields:
The transmission starts with a start-of-text separator.
Then comes a block of data to the field containing VAR1$.
A field separator separates the blocks of data.
Next block goes to the field containing VAR2$.
A field separator separates the blocks of data and so on.
The last block must also end with a field separator.
The end of transmission is indicated by an End-of text separator. By default, the following separators should be used:
Start separator: STX (ASCII 02 dec)
Field separator: CR (ASCII 13 dec)
End separator: EOT (ASCII 04 dec) All separators can be changed by means of INPUT ON/OFF and a
FORMAT INPUT command, see chapter 6.5.
<STX> <Input data to VAR1$> <CR> <Input data to VAR2$> <CR>.....<EOT>
Input data must not be enclosed by double quotation marks.
Example:
LAYOUT RUN "Shipping Label" <STX> Abcdefg <CR>123456789 <CR> <EOT>
INPUT ON is the default, so there
is no need to issue the command before using LAYOUT RUN.
Page 34
34
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 4 Label Design
Input Data to Text Fields
Input data is inserted into a text field using a PRTXT command. Y ou can add various types of data to a text f ield:
Plain text, by typing e.g. "Abcdefgh" or "012345"
Variable input data, using variables e.g.VAR1$
Counter values, e.g. CNT1$
Current date, using DATE$ or DATE$("F")
Current time, using TIME$ or TIME$("F")
The weekday of the current or specified date, using WEEKDAY$
The number of the current or specified date, using WEEKNUMBER
An offset date, using DATEADD$ or DATEADD$("F")
An offset time, using TIMEADD$ or TIMEADD$("F") You can combine different types of data in a single PRTXT com-
mand. The different parts are separated by semicolons (;). Note that plain text must be enclosed by double quotation marks.
PRTXT | PT "<input data>"[;"<input data>"...]
Examples:
PT "Price: $1.99" PT "Price: ";VAR1$;" per dozen" PT "Box No. ";CNT15$;" Packed: ";DATE$ ("F") PT WEEKDAY$(DATE$);", ";DATE$("F") PT "Week Number ";WEEKNUMBER(DATE$) PT "Expiry date: ";DATEADD$ (30,"F")
Input Data to Bar Code Fields
Input data is inserted into a bar code field using a PRBAR com­mand. You can add the same types of data to a bar code field as to a text field, so long as the type of data (e.g. numeric/alphanumeric) and the number of characters, etc. comply with the bar code speci­fication.
You can combine different types of data in a single PRBAR com­mand. The different parts are separated by semicolons (;). Note that alphanumeric input must be enclosed by double quotation marks.
PRBAR | PB <input data>[;<input data>...]
Examples:
PB "71543";VAR5$ PB "UBI" PB DATE$;TIME$
9. Printable Data Commands, cont'd.
Page 35
35
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 4 Label Design
9. Printable Data Commands, cont'd.
Input Data to Image Fields
An image can be selected either by name in plain text (e.g. "ROM:UBI.1"), or in the form of a v ariable (e.g. VAR1$), (see also chapter 4.5). Note that plain text input must be enclosed by double quotation marks.
PRIMAGE | PM <image name>
Examples:
PM VAR5$ PM "LOGO.2"
Input Data from Counters
By means of a COUNT& command, various counters can be created (see chapter 6.6). You can r ead the present value of a counter and use it as input data by including a reference to the counter in the PRTXT or PRBAR commands in the form of a variable.
CNT <Counter No.>$
<Counter No.> the number assigned to the counter in the
COUNT& command. Example:
PT "Label number: ";CNT1$ PB CNT2$
Input Data from the Printer's Clock/Calendar
The printer's clock/calendar can be used to provide input data for text and bar code fields by including any of the following in the PRTXT or PRBAR commands:
DATE$
DATE$("F")
TIME$
TIME$("F")
WEEKDAY$
WEEKNUMBER
DATEADD$
TIMEADD$
A real-time clock circuit is an optional extra on the EasyCoder
301. If the optional RTC is not fitted,
the date and time will be lost when the printer is switched off. Use the DATE$ and TIME$ commands to reset the clock and calendar.
Page 36
36
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 4 Label Design
9. Printable Data Commands, cont'd.
DATE$
Returns the current date according to the printer's calendar in the standard format
YYMMDD
, where YY is the last two digits of the year, MM is the number of the month (01–12) and DD is the number of the day (01–31).
Example:
PT DATE$
DATE$ ("F")
Returns the current date according to the printer's calendar in the format specified by
FORMAT DATE$
(see chapter 6.4).
Example:
PT DATE$("F")
TIME$
Returns the current time accor ding to the printer's clock in the stand­ard date form at
HHMMSS
, where HH is the hour (00–24), MM is the
minute (00–59) and SS is the second (00–59). Example:
PT TIME$
TIME$ ("F")
Returns the current time according to the printer's clock in the for­mat specified by
FORMAT TIME$
(see chapter 6.4).
Example:
PT TIME$("F")
WEEKDAY$ ("<date>")
Returns the name of the weekday in plain text according to
NAME
WEEKDAY$
(see chapter 6.4) fr om a given date or the current date .
<date> can be specified in the standard format
"YYMMDD"
or by a
DATE$
command.
Examples:
PT WEEKDAY$("970601") PT WEEKDAY$(DATE$)
Page 37
37
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 4 Label Design
9. Printable Data Commands, cont'd.
WEEKNUMBER ("<date>")
Returns the weeknumber from a given date or the current date. <date> can be specified in the standard format
"YYMMDD"
or by a
DATE$
command.
Examples:
PT WEEKNUMBER("970601") PT WEEKNUMBER(DATE$)
DATEADD$ (["<original date>",]<number of days>[,"F"])
Adds or subtracts a certain number of days to the current date or optionally to a specified date. <original date> optional; it is entered in the standard date
format
"YYMMDD"
. Note that the original date must be enclosed by double quotation marks.
<number of days> the number of days to be added to or sub-
tracted from the current date or, optionally, the date specified by <original date>. In case of subtraction, the <number of days> should be preceded by a minus sign (-).
<"F"> an optional flag specifying that the result
should be returned in the format specified by
FORMAT DATE$
instead of the standard
format
YYMMDD
.
Example:
PT DATEADD$("970601",-15,"F")
Page 38
38
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 4 Label Design
9. Printable Data Commands, cont'd.
TIMEADD$ (["<original time>",]<number of sec's>[,"F"])
Adds or subtracts a certain number of seconds to the current time or optionally to a specified moment of time. <original time> optional; it is entered in the standard date
format
"HHMMSS"
. Note that the original time must be enclosed by double quotation marks.
<number of secs> the number of seconds to be added to or sub-
tracted from the current time or, optionally, the moment of time specified by <original time>. In case of subtraction, the <number of secs> should be preceded by a minus sign (-).
<"F"> an optional flag specifying that the result
should be returned in the format specified by
FORMAT TIME$
instead of the standard for -
mat
HHMMSS
.
Example:
PT TIMEADD$("123026",100,"F")
Page 39
39
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 5 Feeding and Printing Commands
Chapter 5
Feeding and Printing Commands
1. Paper Feed
In order to provide maximum flexibility, there is a number of com­mands for controlling the paper feed:
CLEANFEED
FORMFEED
TESTFEED
CLEANFEED <feed length in dots>
Runs the printer's paper feed mechanism in order to facilitate clean­ing of the print roller .
FORMFEED | FF [<feed length in dots>]
Feeds out a blank label or optionally feeds out (+) or pulls back (-) a certain amount of paper without printing.
TESTFEED
Feeds out a blank label while adjusting the label stop/black mark sensor.
The paper is fed past the printhead by a rubber-coated roller driv en by a stepper motor . The software can control the stepper motor with an accuracy of one dot in either direction. The movement of the paper is detected by the label stop sensor (LSS) or black mark sen­sor (BMS), except when various types of paper strip are used.
The printer's setup with regard to Detection, Media Size, Length and Media Type determines how the paper feed will work. There are five different types of Media Type options (also see the EasyCoder 301 Installation and Operation Manual):
Label (w gaps)
Ticket (w mark)
Ticket (w gaps)
Fix length strip
Var length strip When a FORMFEED, TESTFEED or PRINTFEED command is
executed, the photoelectrical label stop sensor (LSS) detects the forward edge of each new label or the forward edge of each detec­tion gap, and the black mark sensor (BMS) detects the forward edge of each black mark, as the paper is fed past the sensor .
Page 40
40
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 5 Feeding and Printing Commands
1. Paper Feed,
cont'd.
By performing a TESTFEED operation after loading a new supply of paper, the software is able to measure the distance between, for example, the forward edges of two consecuti ve labels, thereby de­termining the label length, so that it can adjust the paper feed ac­cordingly. The same principle applies to tickets or tags with detec­tion gaps and to tickets with black marks.
In the case of paper strip, the LSS will only detect an out-of-paper condition; the amount of paper feed is decided in two different w ays:
Fixed length strip The amount of paper fed for each FORMFEED, TESTFEED and PRINTFEED operation is decided by the Media Size: Length setup.
Variable length strip After executing a PRINTFEED, the printer will stop feeding as soon as printing stops. Note that a blank space character or “white” part of an image is also regarded as a printable object. The amount of paper fed by FORMFEED is decided by the Media Size: Length setup.
The Detection setup allows you to perform two global adjustments to the paper feed described above:
Start Adjust
Stop Adjust
By default, both these parameters are set to 0, which allows for proper tear-off operation when there is no requirement of printing immediately at the forward edge of the label (equivalent).
Start Adjust decides how much paper will be fed out or pulled back before the FORMFEED, TESTFEED or PRINTFEED is executed. There is a small distance between the dispenser shaft or tear off edge and the printhead. Thus, if you want to start printing directly at the forward edge of the label, you must pull back the paper before printing by means of a negative start adjust value.
Stop Adjust decides how much more or less paper will be fed out after the FORMFEED, TESTFEED or PRINTFEED is executed.
Recommended Adjustments: Dispensing:
Start Adjust : -88 Stop Adjust: -48
Tear Off:
Start Adjust: -136 Stop Adjust: 0
Strip:
Start Adjust: -136 Stop Adjust: -60
Page 41
41
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 5 Feeding and Printing Commands
2. Label Printing
1. Paper Feed,
cont'd.
If the FORMFEED command is issued without any specification of the feed length, a complete blank label (or the equivalent) will be fed out. By specifying a positive or ne gative value in the FORMFEED command, the global Start Adjust and Stop Adjust setup can be substituted or supplemented for individual layouts or labels.
It is important whether the FORMFEED command is executed be­fore or after the PRINTFEED command:
FORMFEED before PRINTFEED corresponds to Start Adjust.
FORMFEED after PRINTFEED corresponds to Stop Adjust.
The relationship between paper and printhead when printing starts decides all positioning along the Y-axis, i.e. along the paper web .
Printing Commands:
When a PRINTFEED command is issued, the software processes all previously entered text f ields, bar code f ields, image fields, box fields and line fields into a bitmap pattern. The bitmap pattern con­trols the heating of the printhead dots as the paper is fed past them. Each PRINTFEED command produces one single copy or, option­ally, a batch of labels, tickets, tags or pieces of strip.
PRINTFEED | PF [<batch size>]
<batch size> specifies the number of copies to be printed. Default: 1
The execution of a PRINTFEED command resets the following commands to their respective default values:
ALIGN BARFONT BARFONTSIZE BARFONTSLANT BARFONT ON/OFF BARFONTD BARFONTDSIZE BARFONTDSLANT BARHEIGHT BARMAG BARRATIO BARSET BARTYPE DIR FONT FONTSIZE FONTSLANT FONTD FONTDSIZE FONTDSLANT INVIMAGE MAG PRPOS
This reset only affects commands ex ecuted after PRINTFEED, not commands that have already been executed, which makes batch printing possible.
Page 42
42
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 5 Feeding and Printing Commands
General Information:
The term “Batch Printing” means the process of printing several labels. The labels may either be exact copies or dif ferent from each other .
For batch printing, the most critical factor is the time required to process the print image into a bitmap and store it in the image buffer . The image buffer compensates for differences between processing time and printing time. If the bitmap is too large to be stored in its entirety in the image buffer, it will be divided into a number of segments across the paper feed direction which will be processed one after the other and downloaded to the image buf fer. As the buf fer is emptied by printing, a new segment can be processed and downloaded.
When printing a batch of labels from a predefined layout, the layout is processed before each new copy is printed, in order to allow coun­ter, date and time values to be updated. When a layout is not used, all copies will contain exactly the same information.
When using batch printing, take the following into consideration:
Using command abbreviations, e.g. PF instead of PRINTFEED improves the performance.
The more processing a label requires, the slower it will be printed.
In case of small differences between labels, make use of CLL and FIELDNO commands (see below) and edit the layout so that variable data are processed last.
If you are printing scaled TrueType fonts and the printer is working very slowly, use the PRESCALE command to create bitmapped versions of the scaled fonts for quicker access (see chapter 9.3).
Switching verbosity off with SYSVAR(18) may improve printing speed.
If you have any problems, e.g. the printer stops between labels, lower the print speed, or make the print image easier to process.
You can interr upt batch printing by issuing a break command as described in chapter 6.16.
3. Batch Printing
Page 43
43
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 5 Feeding and Printing Commands
Clearing the Image Buffer:
The image buffer stores the bitmap pattern of the la bel between processing and printing. The image buffer can be cleared partially or completely by means of a CLL command.
CLL [<field>%]
<field> the same alphanumeric designator as in the
corresponding
FIELDNO
command, followed
by a mandatory % sign. CLL clears the image buf fer completely CLL <field>% clears the image buf fer fr om the correspond-
ing
FIELDNO
command to the end of the la-
bel
Complete clearing is useful to avoid printing a faulty label after certain errors have occurred.
Partial clearing is used in batch printing when only part of the label should be modified between the copies. In this case, the CLL state­ment must include a reference to a field, specified by a FIELDNO command. When a CLL command is issued, the image buff er will be cleared from the specified field to the end of the label.
<field>% = FIELDNO
<field> the same alphanumeric designator as in the
corresponding
CLL
command followed by a
mandatory % sign. Example:
FT "Swiss 721 Bold BT" MAG 2,2 PP 100,300 PT "MONTH:" (kept in the image buffer for re-use) PP 100,200 A%=FIELDNO PT "JANUARY":PF (cleared from the buffer after printing) CLL A% PP 100,200 PT "FEBRUARY":PF (cleared from the buffer after printing) CLL A% PP 100,200 PT "MARCH":PF (cleared from the buffer after printing) CLL A%
3. Batch Printing,
cont'd.
Page 44
44
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 6 Setting Up the Printer
Chapter 6
Setting Up the Printer
The EasyCoder 301 Printer can operate in Immediate Mode or Lay­out Mode. In Immediate Mode, layouts and variable data f ields are disabled. In Layout Mode, layouts and variable data fields are ena­bled (see chapter 4.8). The printer default is Layout Mode.
INPUT ON
INPUT ON sets SYSVAR(18) to 0 and enables the use of layouts and variable data. (Default)
INPUT OFF
INPUT OFF restores SYSVAR(18) to its value before the INPUT ON command was received and disables the use of layouts and v ari-
able data.
The printer will receive and transmit data on the standard serial communication channel "uart1:". If you use parallel communica­tion, two-way communication will be lost and the printer will not be able to echo any data back to the host or return any other data. It is possible to select different channels manually as standard IN and standard OUT channels, using the SETSTDIO command.
SETSTDIO <IN channel>, <OUT channel>
<IN channel> and <OUT channel> can be individually specified as: 0 automatic port switching (Default) 1 "uart1:" serial communication channel 4 "centronics:" par allel communication chan-
nel (IN channel only) Example:
SETSTDIO 0,1
1. Layout Mode/ Immediate Mode
2 IN/OUT Channel Setup
Page 45
45
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 6 Setting Up the Printer
The printer's CPU board is, as standard, provided with an internal clock/calendar without battery backup, i.e. the setting will be lost when the printer is turned off.
The CPU board may optionally be fitted with a real-time clock cir­cuit (RTC). The RTC is battery backed-up and will keep running even when the printer is turned off.
If no RTC is installed and you try the read the date or time before the internal clock has been set, an error will occur (error 1010 “Hard­ware Error”). Once either time or date has been set, the internal clock will work until next po wer off or reboot. If only time has been set, by default the current date will be Jan 01 1980 and if only date has been set, by default the clock will start running at 00:00:00.
The following commands are used to set the clock/calendar:
DATE$ = "<YYMMDD>"
<YYMMDD> the curr ent date in the standard format, wher e
YY = Year, last two digits
MM = Month, two digits
DD = Day , two digits. Note that the input data must be enclosed by double quotation marks. Example:
DATE$ = "970601"
TIME$ = "<HHMMSS>"
<HHMMSS> the current time in the standar d format, where
HH = Hour (00–24)
MM = Minute (00–59)
SS = Second (00–59) Note that the input data must be enclosed by double quotation marks. Example:
TIME$ = "131548"
3. Date and Time
Page 46
46
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 6 Setting Up the Printer
The formats for printing dates and time in connection with the com­mands DATE$("F"), DATEADD$("F"), TIME$("F") and TIMEADD$("F") (see chapter 6.5) can be specified by the com­mands FORMAT DATE$ and FORMAT TIME$. W ith both these com- mands, you should enter characters representing the various types of information. The order and number of the characters decides the format. You can also include separating characters like periods, slashes, colons, etc. Note that the input string must be enclosed by double quotation marks.
FORMAT DATE$ "<string>"
Y Year M Month D Day Default: YYMMDD
Examples:
FORMAT DATE$ "YYYY.MM.DD" gives e.g.
1997.06.01
FORMAT DATE$ "DD/MM/YY" gives e.g.
01/06/95
FORMAT TIME$ "<string>"
H Hour in 24-hour cycle (one digit per H; right-
justified) h Hour in 12-hour cycle (one digit per h; right-
justified) M Minute (one digit per M; right-justified) S Second (one digit per S; right-justified) P AM/PM (uppercase) in 12-hour cycle (one
character per P; left-justified) p am/pm (lowercase) in 12-hour cycle (one
character per p; left-justified) Default: HHMMSS
Examples:
FORMAT TIME$ "HH:MM:SS" gives e.g.
14:15:37
FORMAT TIME$ "HH.MM" gives e.g.
14.15
FORMAT TIME$ "hh.MM.SS p" gives e.g.
2.15.37 p
FORMAT TIME$ "hh.MM PP" gives e.g.
2.15 PM
4. Date and Time Format
The date and time formats as well as the names of months and weekdays are not saved in the printer's battery backed-up memory, but must be transmitted to the printer after each power­up.
Page 47
47
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 6 Setting Up the Printer
4. Date and Time Format, cont'd.
5. Separators
1
/. If you transmit a FORMAT INPUT command containing separators identical to any of the separators already stored in the printer's memory, an error will occur unless you first enter Immediate Mode.
The separators are not saved in the printer's battery backed-up memory, but must be transmitted after each power-up.
In many cases,you may prefer to have the names of months and weekdays printed in plain text rather than as a number. There are two commands which allow you to assign names in any language to months and weekdays:
NAME DATE$<No. of month>,"<name of month>"
<No. of month> 1–12. <name of month> the desired name enclosed by double quota-
tion marks. The name of the month will be printed according to the format speci­fied by
FORMAT DATE$
and will be left justified.
NAME WEEKDAY$<No. of weekday>,"<name of weekday>"
<No. of weekday> 1 (Monday) – 7 (Sunday). <name of weekday> the desired name enclosed by double quota-
tion marks. Default: Full English names, e.g. Monday .
When transmitting variable input data to a predefined layout, the string must contain certain separating characters. By default, you should use <STX> as start-of-text separator , <CR> as field separa­tor and <EOT> as end-of-te xt separator(see chapter 6.5).
Howe ver, the FORMAT INPUT command allows y ou to select other characters as separators if the default separators for some reason cannot be produced or will interfere with the host computer system. Simply insert the desired separator characters (enclosed by double quotation marks) into the FORMAT INPUT command. A v oid using characters like XON/XOFF or ENQ/ACK, which may interfere with the communication between printer and host.
You must first leave Layout Mode by means of an INPUT OFF command, change the separators using a FORMAT INPUT com­mand and then enter Layout Mode again by means of an INPUT ON command1.
FORMAT INPUT "<start separator>","<end separator>","<field separator>"
Example:
INPUT OFF FORMAT INPUT "#","&",CHR$(13) INPUT ON
Page 48
48
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 6 Setting Up the Printer
You can create counters for use in text and bar code fields (see chapters 4.3 and 4.4). The counters are global, i.e. the same counter can be used in many different labels and layouts, but will be incremented/decremented on any PRINTFEED operation, regard­less of label. Thus, if you want to use a counter for a specif ic layout only , you must not use it in any other layout.
Each counter is designated by means of a number. Alpha counters are restricted to A–Z; numeric counters have no practical limit. The type of counter is decided by the type of start, stop or reset value.
There are various commands for creating a counter and specifying its characteristics:
Start Value
Number of Digits
Number of Copies Before Update
Incrementation/Decrementation
Stop Value
Restart Value Note that input data must be enclosed by double quotation marks.
Start Value
COUNT& "START", <counter number>,"<start value>"
<start value> is the first value to be printed (positive or
negative). Ne gative values ar e indicated by a
leading minus sign (-). Default: 1 or A
Number of Digits
COUNT& "WIDTH", <counter number>,"<number of digits>"
<number of digits> adds leading zero char acters up to the speci-
fied number of digits. Must only be used in
numeric counters. Default: 1
Number of Copies Before Update
COUNT& "COPY", <counter number>,"<number of copies>"
<number of copies> sets the quantity of copies to be printed be-
fore the counter is incremented or
decremented. Default: 1
6. Counters
Page 49
49
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 6 Setting Up the Printer
Incrementation/Decrementation
COUNT& "INC", <counter number>,"<incr. value>|<decr. value>"
<incr . value> sets the value by which the counter should be
incremented. <decr . value> sets the value by which the counter should be
decremented. Decr ementation is indicated by
a leading minus sign (-). Default: 1
Stop Value
COUNT& "STOP", <counter number>,"<stop value>"
<stop value> sets the value after which the counter should
start all over again at the RESTART value. Default: 2, 147, 483, 647 or Z
Restart Value
COUNT& "RESTART", <counter number>,"<restart value>"
<restart value> sets the value at which the counter should
start all over again after having exceeded the
STOP value. Default: 1 or A
All printers are fitted with a label-taken sensor (LTS) which detects if there is a label left in the printer's outfeed slot and holds up print­ing until the label has been removed. This f acility is especially use­ful for batch printing.
You can enable or disable this function by means of the following command. By default, LTS is disabled.
LTS& ON | OFF
Feed on the EasyCoder 301 is used to initiate a PRINTFEED op- eration.
You can enable or disable this function by means of the following command. By default, the Print key is disabled.
PRINT KEY ON | OFF
6. Counters, cont'd.
Note that counters are not saved in the printer's battery backed­up memory, but must be transmitted to the printer after each power-up.
7. Label-Taken Sensor
8. Feed Key
Page 50
50
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 6 Setting Up the Printer
By formatting the printer's memory , you will erase all files stored in the RAM memory . Y ou can also format a RAM-type memory card inserted in the printer's PCMCIA slot to MS-DOS format. Be care­ful not to use this command unintentionally!
FORMAT "<device>"[,<No. of entries>[,<No. of bytes>]]
<device> "RAM:", "CARD1:" or "CARD2:" <No. of entries> used for "CARD1:" and "CARD2:"; it speci-
fies the number of entries in the root direc-
tory (Default 208). <No. of bytes> used for "CARD1:" and "CARD2:"; it speci-
fies the number of bytes per sector (Default
512 bps).
All input data to the printer arrives in binary form via the standard IN channel (default "uart1:"). Characters are transmitted in ASCII format, which will be preprocessed by the printer's software ac­cording to any MAP commands.
The MAP command is used to modify a character set, or to f ilter out undesired characters on a specified communication channel by mapping them as Null (ASCII 0 dec).
If no character set meets your requirements completely (see NASC below), select the set that comes closest and modify it using MAP commands. Mapping will be saved e ven during power-up or reboot.
MAP [<device>],<original ASCII value>, <desired ASCII value>
<device> either 1 = Serial channel "uart1:"
or 4 = Parallel channel "centronics:" <orig. ASCII value> the value of the character according to the
selected character set (see N ASC below). <des. ASCII value> the new ASCII value you want to assign to
the character. Example: You want to use the Roman 8 character set and 7- bit communication. However, you need to print £ characters which are not included in the 7-bit part of the Roman 8 character set (see chapter 3.2). However, you do not need the $ character. Then remap the £ character (ASCII 187 dec.) to the value of the $ character (ASCII 36 dec.).
MAP 36,187
9. Memory Formatting
10. Input Data Preprocess
Page 51
51
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 6 Setting Up the Printer
The NASC command is used to select a character set that decides how the various char acters will be printed. This command makes it possible to adapt the printer to various national standards. By de­fault, characters will be printed according to the Roman 8 character set. Most resident character sets are illustrated in chapter 11.1. For information on how to create user-defined character sets, refer to chapter 9.2.
NASC <character set number> | <"file name">
<character set no.> one of the following numbers:
1: Roman 8 (default)
33: French
34: Spanish
39: Italian
44: English
46: Swedish
47: Norwegian
49: German
81: Japanese Latin (romají)
240: Micr osoft Hebrew [not documented]
241: Micr osoft Ar abic [not documented]
351: Portuguese
850: MS-DOS Latin 1
851: MS-DOS Greek 1
852: MS-DOS Latin 2
855: MS-DOS Cyrillic
857: MS-DOS T urkish
862: MS-DOS Hebre w [not documented]
1250: W indo ws Latin 2 (Cental Europe)
1251: W indo ws Cyrillic (Slavic)
1252: W indo ws Latin 1 (ANSI)
1253: W indo ws Gr eek
1254: W indo ws Latin 5 (Turkish)
1255: W indo ws Hebrew [not documented]
1256: W indo ws Ara bic [not documented]
1257: W indo ws Baltic Rim
-1: PCMAP (same as 1252)
-2: ANSI
<"file name"> one of the following names, or the name of a
user-defined character set file
"OCR-A.NSC" [OCR-A BT]
"OCR-B.NSC" [OCR-B 10 Pitch BT]
"ZAPF.NSC" [Zapf Dingbats BT]
11. Character Set Selection
Page 52
52
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 6 Setting Up the Printer
Suppose you order the printer to print the character ASCII 124 dec. ASCII 124 will generate the following:
|, according to the Roman 8 character set,
ù, according to the French character set
ñ, according to the Spanish set, etc. In general, the Western European (Latin) character sets (numbers -
2 to 81 and number 351) are the same, with the exception of the few national characters. Each of the remaining character sets are spe­cific to a limited number of languages, and should be used in con­junction with fonts for those languages.
A special case is the standard fonts OCR-A BT, OCR-B 10 Pitch BT and Zapf Dingbats BT. Before using any of these fonts for the printing of text or bar code interpretations, you must switch to their respective character sets, and switch back a gain to the original char­acter set before selecting another font.
Choose the character set which best matches your data equipment and printout requirements. If any of the characters in this set do not have the ASCII value that you require, the MAP command can be used to asign that character to a different ASCII value (see chapter
6.10). The NASC setting is not reset by PRINTFEED|PF, nor by turning
the printer off. Once a NASC command has been issued, it affects the printed appearance of characters in any subsequent text field, but not in those text fields which have already been processed and stored in the print buf fer . The NASC setting can be changed sev eral times in one label, which allows labels to be multilingual.
Similarly, the NASC setting determines the appearance of the hu­man readable portion of bar codes. The pattern of the bars in a bar code is determined by the ASCII v alues of the input data, and so is not affected by the NASC setting.
User-defined character sets can be created and stored in the printer , and separate commands exist to control the appearance of Asian characters. These are discussed in chapter 9.2.
As an alternative to turning the printer off and on with the main switch, you can issue a REBOOT command. Any data or layout in the working memory that has not been saved will be deleted and the buffers will be emptied.
REBOOT
11. Character Set Selection, cont'd.
12. Printer Reboot
Note that counters and error messages will be lost and a number of commands will be reset to default.
Page 53
53
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 6 Setting Up the Printer
The verbosity level controls the amount of information to be re­turned from print to host:
SYSVAR (18) = <value>
<value> = -1 All le vels enabled (Default) <value> = 0 No verbosity (Recommended for best per-
formance) <value> = 1 Echo received character s <value> = 2 "Ok” after correct command lines <value> = 4 Echo input characters from communication
port <value> = 8 Error after failed line Bits can be combined, so e.g.
SYSVAR(18)=3
means both “Echo
received c har acters” and “Ok after correct command lines”.
Four types of error messages can be selected:
SYSVAR (19) = <value>
<value> = 1 <string>, e.g. Invalid f ont (Default) <value> = 2 Error <number> <string>,
e.g. Error 19 Invalid font <value> = 3 E<number>, e.g." E19” <value> = 4 Error <number>, e.g .“Error 19
By default, the UBI Direct Protocol error handler handles four error conditions:
Out of paper
Head lifted
Out of transfer ribbon
Next label not found All other errors are ignored unless specified by an ERROR com-
mand. When an error occurs, the standard IN channel is flagged as busy
and the Power LED changes from Green to Red. The message speci­fied for the error by the ERROR command is sent to the standard OUT channel. In the case of the four error conditions listed above, a standard message in English will be sent to the host computer if no other message is specified by an ERROR command.
When an error occurs, press Feed to acknowledge the error, then correct it, either in setup or physically , e.g. by changing the transfer ribbon.
13. V erbosity Level
14. Error Message Types
15. Error Handling
Page 54
54
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 6 Setting Up the Printer
The ERROR command acti vates error-handling for the specif ied error type and allows you to write an error message, which will be trans­mitted back to the host computer (according to selected verbosity and type of error message, see chapters 6.13 and 6.14):
ERROR <error number>, "<error message>"
<error number> error number (see chapter 12.1) <error messa g e> text string enclosed by double quotation
marks. Maximum 33 characters Example:
ERROR 43,"MEMORY OVERFLOW"
Four error conditions are always handled without ha ving to be acti­vated by an ERROR command:
Out of paper
The Power LED turns Red. The printer sends a message back to the host computer. The printer waits for the printhead to be lifted and lowered, then the error is cancelled.
Head lifted
The Power LED turns Red. The printer sends a message back to the host computer. The printer waits for the printhead to be lowered, then a formfeed is performed. If the error stopped a print operation, the operation will be restarted automatically.
Out of transfer ribbon
The Power LED turns Red. The printer sends a message back to the host computer. The printer waits for a ribbon to be loaded. If the error stopped a print operation, the operation must be restarted.
Next label not found
The Power LED turns Red. The printer sends a message back to the host computer . The printer performs a formfeed and then stops and waits for the operator to press Feed.
Note that error handling and
error messages specified by ERROR commands are not saved in the printer's battery backed­up memory, but must be trans­mitted to the printer after each power-up.
15. Error Handling,
cont'd.
Page 55
55
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 6 Setting Up the Printer
When printing large batches of labels, it is useful to be able to stop printing, for example, if an error is detected. You can stop printing via any serial communication channel.
Two commands allow you to issue a BREAK command:
BREAK specifies an individual break interrupt character for each
serial communication channel
BREAK ON/OFF enables/disables break interrupt and deletes the
break character for the corresponding devices.
BREAK <device>,<break char.>
<device> = 1 "uart1:" serial communication channel
(default) <device> = 4 "centronics:" parallel communication c han-
nel (IN channel only) <break c har.> is the ASCII decimal value of the desired
break c har acter.
(default on both channels: ASCII 03 dec.)
BREAK <device> ON | OFF
<device> the same parameter as in the BREAK com-
mand. Default: Communication channels disabled
The parameters in SETUP mode determine how the printer works. There are three ways to change the printer's setup:
Setup strings
Setup files
Bar Code Wand The various setup parameters are described in the EasyCoder 301
Installation and Operation manual.
Setup Strings
Setup strings allow you to change individual setup parameters di­rectly from the host:
SETUP "<setup string>"
<setup string> a string of data according to the special syn-
tax listed below and enclosed by double quo-
tation marks.
16. Break in Batch Printing
17. Printer Setup
Page 56
56
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 6 Setting Up the Printer
In the syntax description below, characters separated by vertical bars indicate alternatives, n–nnnnn indicate variable numeric input and underscored space characters indicate compulsory space char­acters:
17. Printer Setup,
cont'd.
SETUP "CONTRAST,5" SETUP "SER-COM,UART1,BAUDRATE,300|600|1200|2400|4800|9600|19200|38400" SETUP "SER-COM,UART1,PARITY,NONE|EVEN|ODD|MARK|SPACE" SETUP "SER-COM,UART1,CHAR_LENGTH,7|8" SETUP "SER-COM,UART1,STOPBITS,1|2" SETUP "SER-COM,UART1,FLOWCONTROL,RTS/CTS,ENABLE|DISABLE" SETUP "SER-COM,UART1,FLOWCONTROL,ENQ/ACK,ENABLE|DISABLE" SETUP "SER-COM,UART1,FLOWCONTROL,XON/XOFF,DATA_TO_HOST,ENABLE|DISABLE" SETUP "SER-COM,UART1,FLOWCONTROL,XON/XOFF,DATA_FROM_HOST,ENABLE|DISABLE" SETUP "SER-COM,UART1,NEW_LINE,CR/LF|LF|CR" SETUP "DETECTION,LSS_ADJUST,n|nnn" SETUP "DETECTION,FEEDADJ,STARTADJ,nnnn" SETUP "DETECTION,FEEDADJ,STOPADJ,nnnn" SETUP "SERVICE,MEDIA_SIZE,XSTART,nnn" SETUP "SERVICE,MEDIA_SIZE,WIDTH,nnnn" SETUP "SERVICE,MEDIA_SIZE,LENGTH,nnnn" SETUP "SERVICE,MEDIA_TYPE,LABEL_(w_GAPS)|TICKET_(w_MARK)|TICKET_(w_GAPS)|
FIX_LENGTH_STRIP|VAR_LENGTH_STRIP" SETUP "SERVICE,PRINT_DEFS,HEAD_RESIST,nnn" SETUP "SERVICE,PRINT_DEFS,PAPER_TYPE,<name of paper or transfer ribbon>" SETUP "SERVICE,PRINT_DEFS,NEW_SUPPLIES,<encoded value>" SETUP "SERVICE,PERFORMANCE,NORMAL|HIGH"
Page 57
57
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 6 Setting Up the Printer
17. Printer Setup,
cont'd.
Setup files
T wo commands are used to set a printer up from a setup file: SETUP WRITE and SETUP.
Use a setup string (as described above) to set up the printer. Then use the SETUP WRITE command to save the current printer setup to a file.
SETUP WRITE "<filename>"
<filename> the full name of the setup file, including stor-
age area, enclosed by double quotation marks.
You can then select the stor ed setup file, using the SETUP com­mand.
SETUP "<filename>"
<filename> the full name of the setup file, including stor-
age area, enclosed by double quotation marks.
Examples:
SETUP WRITE "setup1" SETUP "setup3"
Bar CodeWand
Setting up the printer with the Bar Code Wand does not involve using UBI Direct Protocol.
See the EasyCoder 301 Installation and Operation manual for de­tails on using the Bar Code Wand to set up the printer.
Page 58
58
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 7 Reading the Printer's Status
Chapter 7
Reading the Printer's Status
Provided that two-way communication is working between the printer and the host computer, the printer's status with regard to various functions can be returned to the host. This implies that the serial channel "uart1:" must be selected standard OUT channel (De­fault, see SETSTDIO command in chapter 6.2).
The PRINT command returns information about the printer's status via the standard OUT channel to the host, where it will usually be printed on the screen. A complementary command specifies the type of information to be returned. The shorthand version of PRINT is a question mark (?).
PRINT | ?
The current date and time according to the printer's clock/calendar can be read as follows:
? DATE$
or
? DATE$("F")
? TIME$
or
? TIME$("F")
Various parts of the printer's memory can be tested by reading the result of a FUNCTEST$ command:
? FUNCTEST$ ("<RAM>|<ROM1>|<ROM2>|<CARD1>|<CARD2>")
<RAM> returns the result of the power-up RAM test. <ROM1>|<ROM2> tests the ROM package and returns “ROM
OK” or “ROM FAIL”.
<CARD1>|<CARD2> c he cks an inserted memory card, performs
either a RAM or a ROM test depending on type of card and returns “CARD NOT PRESENT”, “CARD OK”, or “CARD FAIL”.
1. Introduction
2. Date and Time
3. Memory
Page 59
59
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 7 Reading the Printer's Status
The thermal printhead can be tested in three different ways:
FUNCTEST$ ("HEAD")
? HEAD (type of check)
? SYSVAR (<parameter>)
? FUNCTEST$ ("HEAD")
The returns from the FUNCTEST$ ("HEAD") command are: HEAD OK, SIZE:nnn DOTS (nnn is the number of dots) HEAD LIFTED (lower the printhead and try again) FAULTY PRINTHEAD (an error is detected)
? HEAD(<type of check>)
<type of check> = -1 Printhead. Returns -1 if OK, else 0 <type of check> = -7 Mean resistance of printhead in ohms
? SYSVAR (<parameter>)
<parameter> = 21 r eturns printhead density in dots per mm <parameter> = 22 r eturns the number of dots in the printhead
There are a number of counters in the printer's system, that can be read and returned to the host:
? SYSVAR (<parameter>)
<parameter> = 14 number of err ors detected since last startup <parameter> = 15 number of errors detected since last SYSV AR
(15)
<parameter> = 24 power-up status since last SYSVAR(24)
(0 = No; 1=Yes)
Note! SYSVAR (24) is important, since essential functions, like counters and error messa ges will be lost at power up and other functions will be reset to their default values. Save all such data in the host and retransmit them to the printer as soon as a power-up has been de­tected by a polling pr ogr am taking advantag e of SYSVAR(24).
4. Printhead
5. System Counters
Page 60
60
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 7 Reading the Printer's Status
6. Sensors
7. Printer's Status
8. Software and Hardware Versions
The printer has a number of sensors and setup parameters that can be read and their status or value returned to the host:
? SYSVAR (<parameter>)
<parameter> = 18 r eturns selected verbosity level (see 6.13) <parameter> = 19 r eturns selected type of error message
(see 6.14)
<parameter> = 20 r eturns printer's paper type setup
0= Direct thermal printing; 1= Thermal transfer printing
<parameter> = 23 r eturns status of the ribbon end sensor
(0=No ribbon; 1=Ribbon)
The printer's status with regard to various errors and other condi­tions can be read and returned to the host using the PRSTAT com­mand:
? (PRSTAT AND <parameter>)
<parameter> = 1 printhead lifted <parameter> = 2 label not removed <parameter> = 4 printer out of paper <parameter> = 8 printer out of transfer ribbon
P ar ameters can be combined, e .g.
<3>
checks for both “printhead lifted” and “label not removed” conditions. The printer will return 1 (= yes) or 0 (= no).
The version of EasyCoder 301 software, the type of printer family and the type of CPU board can be read using a VERSION$ com­mand:
? VERSION$[(type of info)]
<type of info> = 0 the version of EasyCoder 301 software <type of info> = 1 301 = EasyCoder 301 <type of info> = 2 1-301700 = CPU board 700
Page 61
61
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 8 File Handling
Chapter 8
File Handling
There are a number of commands for reading the printer's memory and returning the information to the host. This requires a working two-way serial communication (see SETSTDIO in chapter 6.1):
? FRE (1)
Returns the number of free bytes in the printer's RAM memory.
FONTS
Returns the names and size of all fonts files stored in the printer's memory, followed by a list of the bitmapped fonts retained for compatibilty with other EasyCoder printers (see chapter 4.3). It also returns information on the total memory used.
IMAGES
Returns the names of all image files (in .PCX format) stored in the printer's memory. It also returns information on the total memory used.
FILES ["<RAM:>|<ROM:>|<CARD1:>|<CARD2:>"]
Returns the names of all the files in the printer's RAM memory by default, if no storage device is specif ied, or optionall y in the ROM memory ("ROM:") or in an inserted DOS-formatted memory card ("CARD1:|CARD2:").It will also return information on the size of each file and the total number of used bytes in the RAM memory .
When images are loaded using IMAGE LOAD, they can either be loaded into the printer's volatile memory or as a f ile into the RAM memory. Images loaded into the volatile memory are removed us­ing REMOVE IMAGE. Images loaded into RAM are removed using KILL.
REMOVE↔IMAGE "<name>"
The name of the image must correspond exactly to the name re­turned when using the IMAGES command and be enclosed by dou­ble quotation marks.
1. Reading the Printer Memory
2. Removing Images, Files and Fonts
Page 62
62
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 8 File Handling
Files, including font files and images files, can be removed from the RAM memory or from an inserted DOS-formatted memory card:
KILL "<filename>|CARD1:<filename>|CARD2:<filename>"
The name of the file must correspond exactly to the name returned when using a FILES, IMAGES or FONTS command and be en­closed by double quotation marks. Since files will be remov ed from the RAM memory by default, it is not necessary to specify "RAM:". If the file name is preceded by "CARD1:" or "CARD2:", the f ile will be removed from the inserted memory card.
KILL cannot be used to remove images from the printer's volatile memory.
You can copy a file to the RAM memory ("RAM:") or to a DOS­formatted memory card ("CARD1:"|"CARD2:"). Y ou cannot copy to or from the ROM memory ( "ROM:"). Y ou can also use the COPY command to give the copy a new name.
COPY "[CARD1:|CARD2:]<original name>" [,"[CARD1:|CARD2:]<new name>"]
The filename can be up to 30 characters. Since files will be copied to the RAM memory by default, it is not necessary to specify
"RAM:".
Example:
COPY "CARD1:Logo.1","LOGO.1"
Binary files, e.g. font files, can be do wnloaded to the printer's RAM memory using the FILE& LOAD command. Before the transfer can be performed, the printer must be set up for two way communica­tion1.
FILE& LOAD"<file name>",<file size>
<file name> the name (including the drive) you want to
assign to the file, e.g . "CARD1:MYFILE.TXT".
<file size> the size in bytes of the original file in the host. Upon receiving this command, the printer waits for the specified
number of bytes to be received with a 25 second timeout between characters.
2. Removing Images, Files and Fonts, cont'd.
3. Copying Files
4. Downloading Binary Files
1
Suggested serial port setup:
Baudrate: 9600 No parity 8 bits per character 1 stop bit RTS/CTS enabled XON/XOFF: Data to Host disabled. XON/XOFF: Data from Host disabled.
Page 63
63
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 8 File Handling
Image files in .PCX format can be downloaded to "RAM:", "CARD1:" or "CARD2:" using the IMAGE LOAD command. Be-
fore the transfer can be performed, the printer must be set up for two way communication1.
IMAGE LOAD"<image name>",<file size>,"<flag>"
<file name> the name (including the drive) you want to
assign to the image, e.g . "CARD2:LOGO.1".
<file size> the size in bytes of the original .PCX file in
the host.
<flag> either "S" or an empty string " ":
S = the image will be saved in the battery backed-up part of the RAM memory; empty string ("") = the image will be saved in the volatile memory and will be deleted at next power-up.
Upon receiving this command, the printer waits for the specified number of bytes to be received with a 25 second timeout between characters.
We recommend that you add the extension .1 or .2 to the image name, so that you can tell which directions the image is suited for before you print it out, i.e.: IMA GE.1 is suited for directions acr oss the paper web, i.e. DIR 1 & DIR3. IMA GE.2 is suited for directions along the paper web, i.e. DIR 2 & DIR4.
5. Downloading Image Files
1/.
Suggested serial port setup:
Baudrate: 9600 No parity 8 bits per character 1 stop bit RTS/CTS enabled XON/XOFF: Data to Host disabled. XON/XOFF: Data from Host disabled.
IMAGE.1
DIR 1
IMAGE.1
DIR 3
IMAGE.2
DIR 4
IMAGE.2
DIR 2
Paper
Direction
Page 64
64
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 9 Advanced Features
Chapter 9
Advanced Features
Complex 2-dimensional bar or dot codes, e.g. PDF417, require many specifying parameters. Therefore, there is a complex command that allows all bar code parameters to be specified within a single com­mand. This command can also be used for one-dimensional bar codes (see chapter 4.4).
BARSET[#<start parameter>,]["<bar code name>"[,<ratio wide bars> [,<ratio narrow bars>[,<magnification>[,<height> [,<security level> [,<aspect ratio height>[,<aspect ratio width>[,<no. of rows>[,<no. of columns> [,<truncate flag>]]]]]]]]]]]
<start parameter> specifies first parameter in the command
(default 1)
<bar code name> specifies bar code
(default "INT2OF5")
<ratio wide bars> specifies ratio wide/narrow bars
(default 3)
<ratio narr ow bars> specifies ratio wide/narr ow bars
(default 1)
<magnification> specifies magnification
(default 2)
<height> specif ies height of bar s in dots
(default 100)
<security level> only used in PDF417 and Maxicode
(default 2)
<aspect height ratio> only used in PDF417 and Maxicode
(default 1)
<aspect height width> only used in PDF417 and Maxicode
(default 2)
<no. of rows> only used in PDF417 and Maxicode
(default 0)
<no. of columns> only used in PDF417 and Maxicode
(default 0)
<truncate flag> only used in PDF417 and Maxicode
(default 0)
1. Specifying Complex Bar Codes
Page 65
65
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 9 Advanced Features
The data input to text fields and bar codes takes the form of an ASCII string. Even compound data, such as...
PRTXT “Label No.”;CNT1$;” Date “;DATE$(“F”)
is expanded by the printer into a single ASCII string before any other processing occurs. This ASCII string is then converted to a string of international character codes according to the Unicode standard. Every character , whether it be a Latin “ A”, Greek “alpha” or Chinese “ren”, has a unique code in this standard, called its “unicode”.
Unicoded fonts
The EasyCoder 301 works with Unicoded fonts in either Bitstream Speedo or T rueT ype format: its font scaler accesses images of char­acters within these fonts according to the character’ s unicode. Some care is required when using fonts not built into the printer:
If a font is not Unicoded, the font scaler will access the wrong
characters.
A font may not include all the characters in the current character
set, as specified by the NASC command. If a text field contains a character which is not in the current font, then a replacement character will usually be printed instead. The replacement character for Speedo fonts is a space, while for TrueType fonts it is usually an unfilled rectangle.
NASC and NASCD tables
There are many national and international standards for mapping ASCII strings to strings of unicode. The EasyCoder 301 provides support for virtually all of these. There are two types of mappings:
Single-byte mappings, which map one ASCII character to a
unicode. The EasyCoder 301 supports these using “NASC tables”. For example, for each NASC setting listed in chapter 6.11, the EasyCoder 301 has an internally stored NASC table. User defined NASC tables can also be stored in the printer as a file (see later in this chapter).
Double-byte mappings, which map pairs of ASCII characters to
unicodes. The EasyCoder 301 supports these using “NASCD tables”. Currently, there are NASCD tables for the most common double-byte mappings used for the large Asian character sets: BIG5, GB, JIS and Shift-JIS.
2. Using International Character Sets
Page 66
66
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 9 Advanced Features
To be exact, the double-byte mappings allow an ASCII string to contain a mixture of single-byte and double-bytes codes. For exam­ple, in the BIG5 mapping, any ASCII character with value 160 or greater is the first byte of a double-byte code, while the remaining characters form single-byte codes. So, in BIG5, the ASCII string “ <160><64><65>” splits into the double-byte code “<160><64>” and the single-byte code “<65>”. In the EasyCoder 301, the current NASCD table specif ies both how to divide an ASCII string into single-byte and double-byte codes and also how the dou­ble-byte codes are mapped to unicodes. The current NASC table specifies how the single-byte codes are mapped to unicodes. The relevant commands ar e:
NASC <character set no.> | <"file name"> NASCD “<NASCD table file>”
<character set no.> one of the values listed in chapter 6.11 <"file name"> one of the character set names listed in chap-
ter 6.11 or the name of a user-defined N ASC table (see later in this chapter)
<NASCD table file> the file name of a N ASCD table. Default: NASCD "" (empty string; disables double-
byte interpretation of ASCII strings)
Double-byte fonts
As discussed above, the ASCII data input to text fields and human readable parts of bar codes can contain a mixture of single-byte and double-byte codes, which are mapped to unicodes by the NASC and NASCD settings respectiv ely . The characters for the single-byte codes are printed using the current single-byte font, as specified by the FONT command (see chapter 4.3). The characters for the double­byte codes are printed using the current double-byte font, as speci­fied by the following commands:
FONTD | FD “<font file name>” [,<font size>,<font slant>]
<font file name> the name of a Speedo or TrueT ype font f ile; it
must be enclosed by double quotation marks.
<font size> the height of the characters in points (a point
is a standard typogr aphic unit, equal to 1/72 inches).
<font slant> the italic angle of the characters in degrees;
a positive value slants the characters clock­wise away from the vertical. Default: 0.
Reset to default by: PRINTFEED|PF
2. Using International Character Sets,
cont'd.
Page 67
67
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 9 Advanced Features
The three double-byte font parameters can be specified separately using the following commands:
FONTD | FD “<font file name>” FONTDSIZE | FSD <font size> FONTDSLANT | FLD <font slant>
For each parameter, the v alue specif ied by these commands will be used in all text fields on the current label, until a ne w value is speci­fied. These parameters need only be specified if a NASCD file is specified, as otherwise double-byte interpretation is disabled.
Example:
NASC 1 NASCD "CARD1:BIG5.NCD" FONT "Swiss 721 BT",20,0 FONTD "CARD1:CHINESE.TTF",20,0 PP 100,100 PT "NASCD ON: ";CHR$(185);CHR$(235) NASCD "" PP 100,200 PT "NASCD OFF: ";CHR$(185);CHR$(235) PF
Double-byte fonts can also be used in the human readable parts of barcodes. The corresponding commands are:
BARFONTD | BFD “<font file name>”[,<font size>,<font slant>]
<font file name> the f ile name of the double-byte font to be use <font size> the height of the font in points. Default 12. <font slant> the italic angle of the font in degrees clock-
wise Default: 0.
Reset to default by: PRINTFEED|PF
The bar code font size and slant can be specified separately using the following commands:
BARFONTDSIZE | BFSD <font size> BARFONTDSLANT | BLFD <font slant>
Double-byte interpretation of human readables is disabled unless a NASCD file is specified. Also, note that many double-byte map­pings use ASCII characters greater than 127, although these char­acters are not allowed as input data to many bar code types. PDF 417 is one bar code type that does allow ASCII characters greater than 127 as input.
2. Using International Character Sets,
cont'd.
Label produced by the program example to the right.
Page 68
68
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 9 Advanced Features
User-defined NASC tables
A user-defined N ASC table can be used in place of one of the built­in NASC settings. It specif ies a unicode for each of the 256 ASCII characters, and determines the mapping of single-byte codes in text fields and human readable parts of bar codes. A user-defined N ASC table is specified using the command:
NASC "<file name>"
<file name> the name of a file containing a user-defined
NASC table.
Default: NASC 1 (the built-in Roman 8 N ASC table is
used)
Such a file can be created using some text editors, or by a user­written piece of software. It can be sent to the printer using the FILE& LOAD command (see page 65) or copied onto a MSDOS formatted memory card which can be inserted in one of the printer's PCMCIA slots. It is a binary file 516 bytes long, with the following format: Byte 0: N Byte 1: S Byte 2: C Byte 3: 1 Byte 4: high byte of unicode for ASCII 0 Byte 5: low byte of unicode for ASCII 0 Byte 6: high byte of unicode for ASCII 1 Byte 7: low byte of unicode for ASCII 1 ↓↓ Byte 514: high byte of unicode for ASCII 255 Byte 515: low byte of unicode for ASCII 255.
2. Using International Character Sets,
cont'd.
Page 69
69
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 9 Advanced Features
3. Font Scaling
In general, the EasyCoder 301 scales characters “on the fly” into bitmaps ready for printing. It stores as many character bitmaps as possible in a memory cache, to avoid having to rescale characters which are used more than once. Character bitmaps are deleted from the cache automatically by the printer, and so characters which are used often usually need to be rescaled frequently.
In some instances it can take a long time for the printer to scale characters, such as when using double-byte TrueType fonts on a card. The user can force the printer to hold character bitmaps in the cache using the following command:
PRESCALE | PS "<string of characters>"
<string of char.> an ASCII string specifying all the char acters
that are to be scaled from the current single­and double-byte fonts. It is interpreted accor d­ing to the current N ASC and NASCD settings.
Example: The 10 digits from a single-byte font and the ren character from a double-byte font are prescaled.
NASCD "CARD1:BIG5.NCD" FONT "Swiss 721 BT",50,10 FONTD "CARD1:HOMINCHO.TTF" DIR 2 MAG 2,1 PS "0123456789";CHR$(164);CHR$(56)
The contents of a character bitmap depend on all of the following settings:
Single-byte character:
DIR, MAG, NASC, FONT, FONTSIZE, FONTSLANT
Double-byte character:
DIR, MAG, NASCD, FONTD, FONTDSIZE, FONTDSLANT
The printer holds prescaled characters for the last 15 combinations of these settings. When a new combination is used, (for example, when the specification of DIR is changed), the prescaled characters for the 15th previous combination are lost. All prescaled characters are lost when the printer is turned off.
Page 70
70
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 10 Firmware Upgrade
Chapter 10
Firmware Upgrade
Firmware (software and resident fonts) can be upgraded using 1 or 2 PCMCIA cards, which may contain either printer software up­dates or fonts1. In either case, use the following procedure:
1 Print out a test label, which will contain all your printer settings
as these will be lost during the upgrade2.
2 Switch off the printer. 3 Insert the card in either slot with its top facing the ON/OFF
switch.
4 Switch on the printer. The data on the card is copied to the
printer's flash memory. The Power LED should go through the following sequence,
which takes about 30 seconds..
- Flash amber
- Continuous amber
- Flash amber
- Continuous amber
- Green
5 Switch off the printer. 6 Remove the card. 7 Insert the next card, if necessary, and repeat steps 4 – 6. 8 Switch on the printer. 9 Enter the settings shown on the test label you printed earlier (see
chapter 6.9).
10 Reset the printhead resistance setting using the command:
?Head (-1)
1/.
This chapter refers to cards containing fonts which will be loaded into the printer's flash memory. Font cartridges which are permanently fitted in the printer are not covered.
2/.
You cannot save your settings to a text file and use it later when you upgrade firmware or fonts, since all your files are lost and the printer settings are reset to factory defaults during the upgrade,
1. Software and Fonts
WARNING!
Do not switch off the printer until the
upgrading is completed
and the Power LED shines green!
Page 71
71
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 11 Character Set, Font and Bar Codes
Chapter 11
Character Set, Fonts and Bar Codes
This chapter contains the various single-byte character sets, that can be selected using the NASC statement. Double-byte character sets are not included, but are av ailable separately on special request.
The following information applies to all single-byte character sets:
Characters between ASCII 0 decimal and ASCII 31 decimal are unprintable control characters as listed below.
Characters between ASCII 32 decimal and ASCII 127 decimal can always be printed, regardless of 7-bit or 8-bit communica­tion protocol, provided that the selected font contains the char­acters in question.
Characters between ASCII 127 decimal and ASCII 255 deci­mal can only be printed if the selected font contains the charac­ters in question and an 8-bit communication protocol is used. If you use 7-bit communication, select another national character set (see NASC statement in chapter 6.11) or use a MAP state­ment to remap a character set (see chapter 6.10).
If a character, which does not exist in the selected font, is used, a space will be substituted in a Speedo font, and an empty rec­tangle in a T rueType font.
Non-printable control characters (ASCII 00 – 31 dec):
00 NUL 16 DLE 01 SOH 17 DC1 02 STX 18 DC2 03 ETX 19 DC3 04 EOT 20 DC4 05 ENQ 21 NAK 06 ACK 22 SYN 07 BEL 23 ETB 08 BS 24 CAN 09 HT 25 EM 10 LF 26 SUB 11 VT 27 ESC 12 FF 28 FS 13 CR 29 GS 14 SO 30 RS 15 SI 31 US
1. Character Sets
Page 72
72
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 11 Character Set, Font and Bar Codes
1. Character Sets, cont'd.
Roman 8 (NASC 1)
Page 73
73
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 11 Character Set, Font and Bar Codes
1. Character Sets, cont'd.
French (NASC 33)
Page 74
74
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 11 Character Set, Font and Bar Codes
1. Character Sets, cont'd.
Spanish (NASC 34)
Page 75
75
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 11 Character Set, Font and Bar Codes
1. Character Sets, cont'd.
Italian (NASC 39)
Page 76
76
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 11 Character Set, Font and Bar Codes
1. Character Sets, cont'd.
English (UK) (NASC 44)
Page 77
77
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 11 Character Set, Font and Bar Codes
1. Character Sets, cont'd.
Swedish (NASC 46)
Page 78
78
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 11 Character Set, Font and Bar Codes
1. Character Sets, cont'd.
Norwegian (NASC 47)
Page 79
79
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 11 Character Set, Font and Bar Codes
1. Character Sets, cont'd.
German (NASC 49)
Page 80
80
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 11 Character Set, Font and Bar Codes
1. Character Sets, cont'd.
Japanese Latin (NASC 81)
Page 81
81
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 11 Character Set, Font and Bar Codes
1. Character Sets, cont'd.
Portuguese (NASC 351)
Page 82
82
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 11 Character Set, Font and Bar Codes
1. Character Sets, cont'd.
MS-DOS Latin 1 (NASC 850)
Page 83
83
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 11 Character Set, Font and Bar Codes
1. Character Sets, cont'd.
MS-DOS Greek 1 (NASC 851)
Page 84
84
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 11 Character Set, Font and Bar Codes
1. Character Sets, cont'd.
MS-DOS Latin 2 (NASC 852)
Page 85
85
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 11 Character Set, Font and Bar Codes
1. Character Sets, cont'd.
MS-DOS Cyrillic (NASC 855)
Page 86
86
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 11 Character Set, Font and Bar Codes
1. Character Sets, cont'd.
MS-DOS Turkish (NASC 857)
Page 87
87
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 11 Character Set, Font and Bar Codes
1. Character Sets, cont'd.
Windows Latin 2 (NASC 1250)
Page 88
88
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 11 Character Set, Font and Bar Codes
1. Character Sets, cont'd.
Windows Cyrillic (NASC 1251)
Page 89
89
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 11 Character Set, Font and Bar Codes
1. Character Sets, cont'd.
Windows Latin 1 (NASC 1252)
Page 90
90
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 11 Character Set, Font and Bar Codes
1. Character Sets, cont'd.
Windows Greek (NASC 1253)
Page 91
91
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 11 Character Set, Font and Bar Codes
1. Character Sets, cont'd.
Windows Latin 5 (NASC 1254)
Page 92
92
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 11 Character Set, Font and Bar Codes
1. Character Sets, cont'd.
Windows Baltic Rim (NASC 1257)
Page 93
93
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 11 Character Set, Font and Bar Codes
1. Character Sets, cont'd.
PCMAP (NASC -1)
Page 94
94
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 11 Character Set, Font and Bar Codes
1. Character Sets, cont'd.
ANSI (NASC -2)
Page 95
95
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 11 Character Set, Font and Bar Codes
OCR-A BT (NASC "OCR-A.NSC")
1. Character Sets, cont'd.
Page 96
96
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 11 Character Set, Font and Bar Codes
OCR-B 10 Pitch BT (NASC "OCR-B.NSC")
1. Character Sets, cont'd.
Page 97
97
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 11 Character Set, Font and Bar Codes
Zapf Dingbats BT (NASC "ZAPF.NSC")
1. Character Sets, cont'd.
Page 98
98
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 11 Character Set, Font and Bar Codes
2. Resident Fonts
Century Schoolbook BT
Dutch 801 Roman BT
Dutch 801 Bold BT
Futura Light BT
Letter Gothic 12 Pitch BT
Monospace 821 BT
Monospace 821 Bold BT
OCR-A BT
OCR-B 10 Pitch BT
Prestige 12 Pitch Bold BT
Swiss 721 BT (default font)
Swiss 721 Bold BT
Swiss 721 Bold Condensed BT
Zapf Dingbats BT
Zurich Extra Condensed BT
Page 99
99
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 11 Character Set, Font and Bar Codes
3. Resident Bar Code Fonts
Bar Code Abbreviation
Codabar "CODABAR" Code 11 "CODE11" Code 16K "CODE16K" Code 39 "CODE39" Code 39 full ASCII "CODE39A" Code 39 w. checksum "CODE39C" Code 49 "CODE49" Code 93 "CODE93" Code 128 "CODE128" DUN-14/16 "DUN" EAN-8 "EAN8" EAN-13 "EAN13" EAN-128 "EAN128" Five-Character Supplemental Code "ADDON5" Industrial 2 of 5 "C2OF5IND" Industrial 2 of 5 w . checksum "C2OF5INDC" Interleaved 2 of 5 "INT2OF5" Interleaved 2 of 5 w. checksum "INT2OF5C" Interleaved 2 of 5 A "I2OF5A" Matrix 2 of 5 "C2OF5MAT" Maxicode "MAXICODE" MSI (modified Plessey) "MSI" PDF 417 "PDF417" Plessey "PLESSEY" Straight 2 of 5 "C2OF5" Two-Character Supplemental Code "ADDON2" UCC-128 Serial Shipping Container Code "UCC128" UPC-5 digits Add-On Code "SCCADDON" UPC-B "UPCB" UPC-A "UPCA" UPC-D1 "UPCD1" UPC-D2 "UPCD2" UPC-D3 "UPCD3" UPC-D4 "UPCD4" UPC-D5 "UPCD5" UPC-E "UPCE" UPC Shipping Container Code "UPCSCC"
Page 100
100
UBI EasyCoder 301 Direct Protocol – Programmer's Guide Ed. 1
Chapter 12 Error Messages
Code Description
0 No error 1 Syntax error. 2 Unbalanced parenthesis. 3 Feature not implemented. 5 Unrecognized token. 9 Undefined tok en. 12 Type mismatch. 15 Font not found. 17 Bar code type not implemented. 18 Disk full. 19 Error in file name. 24 Overflow in temporary string b uffer. 25 Wrong number of parameters. 26 Parameter too large. 27 Parameter too small. 30 Assign to a read-only variable. 34 File is not open. 37 Cutter device not found. 38 User break. 41 Parameter out of range. 43 Memory overflo w. 58 Field overflo w. 67 Error from communication channel. 78 Not allowed in execution mode. 79 Not allowed in a layout. 1001 Not implemented. 1003 Field out of label. 1005 Out of paper. 1009 Invalid parameter. 1010 Hardware error. 1011 I/O error. 1013 Device not found. 1015 File is read-only. 1018 Bad file descriptor. 1019 Invalid font. 1022 Head lifted. 1023 Incomplete label. 1025 File does not exist.
Chapter 12
Error Messages
1. Error Messages in Numerical Order
Loading...