1. Prior to using the printer, read this manual thoroughly for correct operation.After reading the manual, keep it
carefully at hand for your future reference.
2. The information herein is subject to change without prior notice due to technical improvements.Upon actual
use of the printer, inquire for the up-to-date specifications.
3. It is strictly prohibited to copy part or all of the information contained in this m anual without our prior
permission.
4. If you have any question about the information herein or notice any clerical erroror omission, please contact us.
5. We will not be responsible for the effects from the results of operating the printer, regardless of Section 4.
6. We cannot guarantee that the information herein does not infringe upon the industrial property, etc. of a third
party, except when there is a written agreement to that effect.
3.1 Shapes and Dimensions.................................................................................................................................. 7
3.3 Data Transfer Method .................................................................................................................................... 7
3.4 Printing Function ........................................................................................................................................... 7
3.5 Operating Voltage and Power Consumption.................................................................................................... 7
4.8 Head Control Circuit.....................................................................................................................................17
4.10 Motor Control Circuit ...................................................................................................................................19
4.11 Auto CutterControl Circuit...........................................................................................................................20
4.13 Serial Interface Circuit..................................................................................................................................23
4.16 Function Selection Circuit .............................................................................................................................27
5.PRINTER MECHANISM CONTROL SYSTEM ......................................................................................... 33
5.1 Head Drive...................................................................................................................................................33
5.1.2Thermal Head Application Energy....................................................................................................34
5.2 Motor Drive..................................................................................................................................................34
5.3 Auto Loading................................................................................................................................................35
11.3 International Character Codes Table..............................................................................................................88
4CITIZEN
CBM-202PC-04 User’s Manual
1.OUTLINE
This LSI is designed to control the line thermal printer LT-286 by using our Gate Array.It has the following
features.
(1) Capable of providing high-quality printing by detecting a temperature and automatically correcting
printingdensity.
(2) Capable of providing high-quality printing by detecting a voltage and automatically correcting printing
density .
(3) Capable of selecting the parallel or serial interface.
(4) Capable of selecting printing density via a function selectionterminal.
(5) Capable of printing a bar code.
(6) Capable of printing double-width/height characters, bit images, and so onby various commands.
1.1Applicable Printer
LSI NameApplicable Mechanism
CBM-202PC-04LT-286
5CITIZEN
CBM-202PC-04 User’s Manual
2.MAINTENANCE AND SERVICE
For the informationonmaintenance and service, please contact our dealer or at the following address.
Northern AmericaOther Areas
CBM America CorporationJapan CBM Corporation
Service CenterInformation Systems Division
365 VanNess WayCBM Bldg.,5-68-10 Nakano
Suit 510Nakno-ku, Tokyo 164-0001
Torrance, CA 90501, U.S.AJapan
4.4Gate Array (CBM202LA) Terminal Layout and Functions
PinNo.SignalI/OFunctionLogic
44D7InputParallel input data D7HIGH
45D6InputParallel input data D6HIGH
46D5InputParallel input data D5HIGH
47D4InputParallel input data D4HIGH
48D3InputParallel input data D3HIGH
49D2InputParallel input data D2HIGH
50D1InputParallel input data D1HIGH
51D0InputParallel input data D0HIGH
52STROBEInputParallel STROBELOW
55BUSYOutputParallel BUSYHIGH
58PAO7OutputNC
59ACKOutputParallel ACK
–
–
61PEOutputParallel paper endHIGH
62FAULTOutputParallel FAULTLOW
63CUTTERAOutputCutter A
64CUTT ERBOutputCutter B
65CUTT ERCOutputCutter C
67CUTTERDOutputCutter D
–
–
–
–
13CITIZEN
4.5Reset Circuit
The reset state is effectuated by setting the RES terminal to "Low."To surely reset, it is necessary to set it
to "Low" at least for 20ms at power-on and for 625ns while operating.
If an external reset is notused, the parts enclosed by dotted lines are not required.
CBM-202PC-04 User’s Manual
14CITIZEN
4.6Oscillation Circuit
The oscillation circuit incorporates a clock oscillator which generates a system clock and an internal clock.
There are two methods to supply a clock; one is to connect a ceramic oscillator, and the other is to input an
external clock.
When using the ceramic oscillator, we recommend the CSTCS16.00MXOC3 (With capacitor) made by
MURATA.When inputting the external clock, you may either open the XTAL terminal or input an
antiphase clock to the XTAL terminal.
CBM-202PC-04 User’s Manual
15CITIZEN
4.7Head-up Detection Circuit
Print head up/down is detected by a head-up sensor built in the printer so that the printer will not be energized
on with the head up.The circuit is "opened" when the print head is up, and "closed" when down.
When the print head is up, HEADUP (Pin 88) of the CPU is turned to "High," and if the printer is printing, it
will immediately stop printing and output an error.It resumes printing when the print head is down.
CBM-202PC-04 User’s Manual
16CITIZEN
CBM-202PC-04 User’s Manual
4.8Head Control Circuit
VP is controlled in order to prevent electrolytic corrosion of the printing head.HVC(Pin-4) of the Gate
Array is turned to "HIGH" when turning on VP , and turned to "LOW" when turning it off.
A temperature detection circuit is provided in order to prevent deterioration of the printing quality or breakage
of the printing head due to a temperature.This function detects a temperature by means of a thermistor
included in the printer and determines according to that temperature how much energy should be applied to
the printing head.If a temperature of the printing head exceeds 60•, it will stop printing to prevent breakage
of the printinghead.
As a protection when the CPU crashes, connect in such a manner that the Gate Array will be reset by an
output from the watchdog timer of the CPU.The CPU itself has been set so that it will be reset.So that
the head strobe will not be turned to ON at that time, be sure to insert one pull-up resistor into STRB1 through
STRB3, respectively.
17CITIZEN
4.9PaperEnd Detection Circuit
A paper sensor built in the printer detects whether there is the printing paper, so that the printer will not be
turned on when it has no paper.
When the printer has no paper,PAPER (Pin7) of the CPU is turned to "HIGH."If printing is
under way, it will stop after printing that line, and output an error.When the paper is set,
printingis automatically resumed.
CBM-202PC-04 User’s Manual
18CITIZEN
4.10Motor Control Circuit
Avoidrunning the motor continuously for 15 minutes or more.
CBM-202PC-04 User’s Manual
19CITIZEN
4.11Auto Cutter Control Circuit
This CPU has a function to control the auto cutter, using the Pin 33 of the Gate Array.
When the auto cutter is not used, set the Pin 33 of the Gate Array to "HIGH."If se t to "LOW,"
the printer will not function properly, resulting in an alarm.
CBM-202PC-04 User’s Manual
20CITIZEN
4.12ParallelInterface Circuit
The Gate Array ports are mainly used to provide an 8-bit parallel interface.
When the parallel interface is not used, pull up STB(Pin 52) of the Gate Array with a 10kΩ resistor.
STB(Pin 87) of the CPU should be connected to INTR(Pin 56) of the Gate Array or pulled up with a 10kΩ
resistor.
1) Circuit
CBM-202PC-04 User’s Manual
21CITIZEN
2) Gate Array Signals and Their Functions
SignalPin No.I/OFunctio n
STROBE52InputA signal to read in the data.(Negative logic)
D051
D150
D249
CBM-202PC-04 User’s Manual
D348
D447
D546
D645
D744
ACK59Output
BUSY55Output
PE61OutputA signal to be output when the paper runs out. (Positive logic)
FAULT62OutputA signal to indicate a printer error. (Negative logic)
GND
3)Timing chart
InputInput data (Positive logic)
A signal to indicate that the data has been read. (Negative
logic)
A signal to indicate that the data cannot be received. (Positive
logic)Send the data when at "LOW."
A serial interface is an asynchronous serial system.When the serial interface is not used, pull up RXD (Pin
15) and DSR (Pin 100) ofthe CPU with a 47kΩ resistor.
1) Circuit
2) Signal names and their functions
Signal NamePin No.Input/OutputFunction
Transmits the status.
TXD13Output
RXD15Input
DSR100Input
DTR12Output
If data reception is disabled when XON/XOFF is
selected, XOFF(13H) will be transmitted, and if data
reception is enabled, XON(11H) will be transmitted.
Received data signal.If a framing error or parity
error occurs, the relevant data will be printed "?".
With DTR/DSR selected, if this signal is "LOW," the
data will be transmitted from the CPU.If "HIGH,"
the data will be transmitted after the signal is turned
to "LOW."
Transmit the data when this signal is "LOW."If
written when it is "HIGH," an overrun error will
result, ignoring the data.
23CITIZEN
4.14 Switch Circuit
The printer has a switch input function for paper feed.Also provided is a function to perform self -printing,
using this switch. (Turn on the power while holding down this switch, or apply a reset with this switch held
down whenthe power has beenalready turned on.The printer automa ticallystarts self-printing and returns
to the normal waiting state after printing is completed.)
CBM-202PC-04 User’s Manual
24CITIZEN
4.15 ErrorOutput Circuit
The printer has two kinds of error outputs. (Up to a current of 10mA is available in order to mainly indicate
with the LEDs.If this limit is exceeded, the CPU may be destroyed.Select the current control resistors,
LEDs, etc. carefully.)
LEDPE(Pin 4) of the CPU is a paper error exclusive output."LOW" is output when the printing paper runs
out, and "HIGH" is output when new printing paper is set.LEDER(Pin 3) of the CPU outputs other errors
in the follow ing patterns.
1) Error output pattern
ErrorDisplay PatternDescription
Memory error
CBM-202PC-04 User’s Manual
Blinks at intervals of 200ms
Cutter lock
(Cutter error)
Head-up
VH voltageerror
Headtemperature
error
Macro execution wait
2) Error descriptions
ErrorDescription
Head-upThe head-up lever has been shifted up.
VH voltage errorWhenthe VH voltage is beyondan allowable range (4.2 ~ 8.5V)
HeadtemperatureerrorWhen a headtemperatureis less than 0°C or 65°C or more
Cutter lock
(ASC-220-5V)
Note)The upper-limit voltage of 8.5V for the VH voltage error is a voltage assumed only immediately after
When t he cutter is locked due to an external factor (Paper jam, etc.) at cutter
drive time
Blinks at intervals of 150 ms(6 times) and 500
ms(1 time) as one cycle.
Illuminated until the error is reset.
Illuminated until the error is reset.
Blinks at intervals of 1 sec.
Blinks at intervals of 500ms
charging the battery when the battery power is used and cannot be normally used.A maximum
normal voltage is 7.2V.
25CITIZEN
CBM-202PC-04 User’s Manual
3) Resetting methods
ErrorResettingMethod
No-paperSet the paper.See Note 1.
Head-upShift down the head-up lever.
VH voltageerror
Headtemperatureerror
Cutter lock(ACS-220-5v)
Set the VH voltage to within the allowable range(4.2 ~ 8.5 V) and turn on the
power again, or set the LFSW(Pin-2) of the CPU to Active.See Note 2.
At the lower limit(Less than 0°C), printing is enabled at 0°C or more.
At the upper limit(65°C or more), printing is enabled at 60°C or less.
Eliminate the paper jam and set LFSW(Pin-2) of the CPU to Active or turn
on the power again.
Note)
1.If auto loading has not been selected with the function selection J4(Jumper), set the paper manually.
If it has been selected, the auto loadingfunction will be enabledto facilitate pap e rreplac e ment.
2.The upper-limit voltage of 8.5V for the VH voltage error is a voltage assumed only immediately after
charging the battery when the battery power is used and cannot be normally used.A maximum
normal voltage is 7.2V.
26CITIZEN
4.16 Function Selection Circuit
The input port of the Gate Array has function selecting terminals.When connecting the DIP switch, and so
on, connect them as they are.When fixing with a Jumper, and so on, only the terminals you want to set to
"LOW" should be connected to GND.
ItemSymbolMINMAX
Clockcycle timet cyc62.5500
Clock pulse width "LOW" level time
Clock pulse width "HIGH" level time
Clock rise time
Clock fall time
Address delay time
Address hold time
Address strobe delay time
Write strobe delay time
Strobe delay time
Write data strobe pulse width 1
Write data strobe pulse width 2
Address setup time 1
Address setup time 2
Read data setup time
Readdatahold time
t
CL
t
CH
t
CR
t
CF
t
AD
t
AH
t
ASD
t
WSD
t
SD
t
WSW1
t
WSW2
t
AS1
t
AS2
t
RDS
t
RDH
20
20
10
35
65
10
40
20
–
–
–
–
–
10
10
30
–
–
–
–
30
30
30
–
–
–
–
–
0
–
Write data delay time
Write data setup tim e1
Write data setup tim e2
Write data hold time
Readdata accesstime 1
Readdata accesstime 2
t
WDD
t
WDS1
t
WDS2
t
WDH
t
ACC1
t
ACC2
–
35
5
20
–
–
60
–
–
–
55
115
Unit : ns
31CITIZEN
CBM-202PC-04 User’s Manual
32CITIZEN
CBM-202PC-04 User’s Manual
5.PRINTER MECHANISM CONTROL SYSTEM
5.1Head Drive
5.1.1ThermalHead Control System
The LT-286 is driven by this LSI has a 1-line printing head divided into 6 blocks of 64 dots each.With this
LSI, you can choose either a Fixed Division Number System which drives the printing head by always
dividing it into 6 blocks of 64 dots each ora Variable Division Number System which simultaneously drives it
by consolidatingseveral blocks according to the number of activate head dots.This selection is made with a
function selection terminal or command. For selecting withthe function selecting terminal, see "4.16 Function
SelectionCircuit. " For selectingwith the command, see "10.2 Co mmand Details."
(1) Fixed Division Number System
The blocks of the printing head to be simultaneously driven have been determined in advance.Printing is
performed, dividing into 6 blocks of 64 dots each from the left corner of the printing surface of the printing
paper.Since the printing head is always driven in the same order, this method can assure high-quality
printing.In the Fixed Division Number System, the blocks of the printing head driven in the 1st and 2nd
steps of the motor have been determined as shown in Fig. 5.1.
Fig. 5.1
1st Block;
64 Dots
2nd Block;
64 Dots
1st Step of Motor
3rd Block;
64 Dots
4th Block;
64 Dots
5th Block;
64 Dots
2nd Step of Motor
6th Block;
64 Dots
(2)Variable Division Number System
This method counts the number of printing dots for each block of each printing head in the printing dot line
and drives the blocks collectively in such a manner not to exceed the maximum number of driving dots(64
dots).Fig. 5.2 shows an example when the number of printing dots in every block of 1 to 6 is 64 dots or
less.
Fig. 5.2
1st Block;
64 Dots
2nd Block;
64 Dots
3rd Block;
64 Dots
1st Step of Motor
4th Block;
64 Dots
5th Block;
64 Dots
6th Block;
64 Dots
2nd Step of Motor
Different from the Fixed Division Number System, this method drives all the printing heads in the 1st
step of the motor and simply feeds the paper in the 2nd step of the motor.
33CITIZEN
CBM-202PC-04 User’s Manual
5.1.2Thermal Head Application Energy
This LSI automatically controls the energy applied to the thermal head according t o a temperature and Vp
voltage.Wi ththe function selection terminal, print density can be set to the following4 kinds of ranks listed
in Fig. 5.3.
1) Prevents heat generation of the motor and restrains current consumption through PWM control.
Rate
2) Controls acceleration at start time.
3) Capable of providing fine control according to a voltage(VH) applied to the motor to realize optimum
paper feed.
Table 5.1 lists the maximum drive speeds at major voltages.
Table 5.1
VH VoltageMax. Drive SpeedAt Auto Loading
5 V300 pps75 pps
6 V490 pps122 pps
7.2 V800 pps200 pps
Notes)
• The maximum drive speed may slightly differ depending on the actual processing time or voltage
detection accuracy.
• If the head drive time becomes longer tha n the 1-step time of the motor during printing, the motor
will be driven after the head.During printing, therefore, the drive speed will be slowed down due to
the head divided driving method.
• The drive speed at auto loading time is 1/4 of the m aximum drive speed at each VH voltage.
34CITIZEN
5.3Auto Loading
Autoloadingis a functionto facilitate replacement of the printing paper.
It is enabled by setting the function selection terminal(Gate Array Pin 38) to "LOW."
Functioning:
1)Make the PE sensor detect PE once.
2)Insert the printing paper into the printing paper insertion slot until the PE sensor detects the paper
again.When this is done, the paper should be inserted at a right angle to the insertion slot; insert it
until it comes to the end.
3)When this is done, if the head-up lever is shifted down, auto loading will be performed.If the
head-uplever is shiftedup, shift it down.Then, autoloading will be performed.
4)See Table 5.1 for the drivespeed.
CBM-202PC-04 User’s Manual
35CITIZEN
CBM-202PC-04 User’s Manual
6.SELF-PRINTING
This LSI displays the setting of the function selection terminal and has a test print function to print Kanji when
printing the half-size characters or using the specified Kanji ROM(CBM-202KG-01).
Theprocedureisasfollows:
1) Turn on the power, setting LFSW(Pin 2) of the CPU to "LOW."Turn on both Vcc and VH almost
simultaneously, or turn on Vcc, followed by VH(Within 500ms after Vcc).
Fig. 6.1 shows a print sample(A print differs from actual dimensions).
Fig. 6.1
36CITIZEN
7.OPERATION TIMINGS
The followingshows operation timings after resetting this CPU.
CBM-202PC-04 User’s Manual
37CITIZEN
8.SPECIFICATIONS OF PACKAGE
CBM-202PC-04 User’s Manual
38CITIZEN
9.PRECAUTIONS FOR MOUNTING
9.1Precautions
If a relative humidity drops, the LSI will be electrified with static electricity more easily.The surface
mounting package must be stored in a dry atmosphere to prevent humidity absorption, but while it is being
stored, it will not be electrified because it will not have friction, etc.When handling or mounting it onto the
PCB where friction or electric discharge may be expected, the relative humidity is desired to be 45~75%
from a viewpoint of prevention of electrification.
9.2Reflow Mounting
Using the screen printing method, etc., apply a constant amount of solder paste to the pattern on the PCB,
whichwas formed intothe specifiedshaperequired for solderingthelead pinstoa package mounting section,
and mount the package onto it.It will be temporarily fixed by the surface tension of the solder paste.
Then, if the solder is melted(reflow) again, the leads of the package and the pattern of the PCB will be
matched by a self-alignment effect through the surface tension of the molten solder.
Although the lead joint pattern design values of the PCB depend on the solder paste material used, reflow
condition, etc., they should be preferably 1.1~1.3 times larger than a soldered lead pin width.
CBM-202PC-04 User’s Manual
9.3Recommended Conditions for Different Mounting Methods
The most common mounting methods employed for the surface mounting devices are the infrared reflow
method, vapor phase reflow method, and flow solder method.As all of those mounting methods must heat
the entire package and apply a strong thermal stress, they require you tomanage not only a temperature at the
solder joints,but that on the package surface, froma viewpoint of maintenance of reliability.Therefore, the
recommended mounting conditions are given in terms of the package surface temperature for the reflow
method, and in terms of solder temperature and immersion time for the flow solder method.
The following describes the concepts of the recommended conditions, using Fig. 9.1.
Fig. 9.1
39CITIZEN
CBM-202PC-04 User’s Manual
1) Temperature gradient 1
If a temperature rises abruptly, each joint of the surface mounting device to the package will have
different t emperature.As a result, t he package may warp due to a difference in the thermal expansion
factor of the material, thus damaging the chip.Therefore, it is necessary to heed the upper limit of an
ascendingrate.The lower limit depends on the activity rate of the reflow unit.
2) Preheating
The temperature of the parts and PCB is adjusted under the melting temperature of the solder to stabilize
soldering and ease a thermal shock.Generally, set to near the rated temperature of the surface
mounting device.
3) Temperature gradient 2
The upper limit of the ascending temperature is the same as in 1).The lower limit is determined by
necessityto contain the peak temperature and time m e ntionedin 4) within the specifiedranges.
4) Peak tempe rature and time
In order to minimize damages on the package, the peak temperature and time must be most heeded.
Since the peak time has a direct effect on a drop of package strength and a steam pressure in the package,
it is desired to be kept as low as possible.The peak time is required to be minimized because the steam
pressure increases along with a lapse of time.The conditions mentioned here are provided at a
coincident point of the above-mentioned allowable range and a solderable range.As they are
represented by upper-limit values, not average values, care should be taken not to exceed the upper-limit
values when setting the conditions.Fig. 6.2 and Fig. 6.3 shows the recommended conditions for the
different m ounting methods.
Fig. 9.2Infrared Reflow and Air Reflow Recommended Conditions
40CITIZEN
Fig. 9.3Vapor Phase Reflow Recommended Conditions
CBM-202PC-04 User’s Manual
6.4Cleaning Method
After soldering, eliminate/clean remaining flux off the PCB because it affects reliability of the parts and PCB
wiring, as a rule.
As an example, ultrasonic cleaning is employed under the following conditions.In order to prevent
destruction of the device, pay attention to an applied frequency, electric power(particularly peak power), time
and resonance of the device.
• Frequency-----28~29kHz (The device should not resonate)
• Ultrasonic output-----15W/each time
• Time-----30sec or less
• Others-----The deviceandPCB should not directly touch a vibration source.
6.5Storage Method
The epoxy resin used for the plastic package cannot resist absorbing moisture when it is stored in a
high-humidity place.If more moisture is absorbed, it will be abruptly vaporized at the time of soldering
and cause exfoliation of the resin/lead frame interface, resulting in the cracks of the package in the worst case.
As it is important to store in a dry atmosphere(preferably normal temperature and humidity; 5~35°C and
45~75 % RH as guides), the package is packed damp-proof.After unpacking it, store it under a prescribed
environment in order to minimize moisture absorption, and perform reflow mounting as quickly as possible.
When you re-store it in damp-proof packing, put moisture-free silica gel in it and seal again.When you
want to eliminate moisture absorbed during transportation, storage, or handling, it is recommended to dry(At
125°C) for 16~24 hours.
The external terminals should be stored unprocessed.This is to avoid a soldering failure due to occurrence
of rust at the time of mounting.
41CITIZEN
CBM-202PC-04 User’s Manual
10.PRINT CONTROL FUNCTIONS
10.1 Commands List
Control CodeFunctionCodePage
1HTHorizontal tab command09H
2LFPrinting and paper feed0DH
3CRPrint command0DH
4ESC SPSetting th e right space amount of the character1BH 20H n
5ESC!Collective specifying printing mode1BH21H n
6ESC%Specifying/canceling download character set1BH 25Hn
7ESC&Defining download characters1BH 26H 5 n m[a p1 p2 ... psxa]m-n+1
8ESC*Specifying the bit image mode1BH 2AH mn1n2[d]k
9ESC–Specifying/canceling underline1BH 2DH n
10ESC2Specifying 1/6-inch line feed rate1BH 32H
11ESC3Setting line feed rate of minimum pitch1BH 33H n
12ESC=Data input control1BH 3DH n
13ESC@Initializing the Printer1BH 40H
14ESCDSetting horizontal tab position1BH 44H [n]k00H
15ESCESpecifying/canceling highligh ting1BH 45H n
16ESCGSpecifying/canceling double printing1BH 47H n
17ESCJPrinting and feeding paper n/203 inch1BH 4AH n
18ESCRSelecting the international character set1BH 52H n
19ESCV
20ESCaAligningthe characters1BH 61H n
21ESCc3NOP
22ESCc4NOP
23ESC c5Enabling/disabling the panel switches1BH 63H 35H n
24ESCdPrinting and feeding the paper by n lines1BH 64H n
25ESCiActivating auto cutter (Full cut)1BH 69H
26ESCmActivating auto cutter (Partial cut)1BH 6DH
27ESCpNOP
28ESCtSelecting the character code table1BH 74H n
29ESCuNOP
30ESCvTransmitting the printer status (Serial type)1BH 76H n
31ESC{Specifying/canceling the inverted characters1BH 7BH n
32ESC$Specifying the absolute positions1BH 24H n1 n2
33ESC¥Specifying the relative positions1BH5C n1 n2
34GSkPrinting the bar code1DH 6BH n [“d”]k00H
35GSw
36GShSelecting the height of the bar code1DH 68H n
37GSHSelecting of print position ofHRI code1DH 48H n
38GSfSelecting the font of HRI code1DH66H n
39GS*Defining the download bit image1DH2An1n2[d]n1xn2x8
40GS/Printing the download bit image1DH 2FH m
Specifying/Canceling90°-right- turned Characters
Selecting the horizontal size (scale factor) of bar
41GS:Starting/ending macro definition1DH 3AH
42GS^Executing the macro1DH5E n1n2 n3
43DC2ASelecting the Print drive system12H 41H n85
83
84
Notes: 1. In the table n, n1, n2, n3, m, a, s, p, and d denote the parameters for each command.
2. In the table, [ ]kdenotes a repeat count of k-times.
3. In the table, ’ ’ denotes an ASCII character.
43CITIZEN
CBM-202PC-04 User’s Manual
10.2Command Details
10.2.1 Description of Items
XXXXALL
[Function]Com m and Function
[Code]A sequence of code constituting a command is represented in hexadecimal number for <
>H, binary number for <>B, and decimal number for <>, respectively; []k
represents a repeat count of k-times.
[Range]Describes an argument value(Setting range) for the command.
[Outline]Describes a command outline.
[Caution]Describes a caution as required.
[Default]Describes an initial value for the commandwhen accompanied by an argu ment.
[See Also]Describes the associated commands for use.
[Sample Program]Describes a coding example in the Q-BASIC sample program.
This example is only for your reference and differs depending on the language used,
version, and so on.Fordetails, see themanual for the language used.
44CITIZEN
10.2.2 Details
HT
[Function]Horizontal Tab Command
[Code]<09>H
[Outline]Shifts the printing position to the next horizontal tab position.
• Ignored when the next horizontal tab position has not been set.
[Caution]• The horizontal tab position is set by ESC D.
• Initial setting of the horizontal tab position is each 8 characters in 9th, 17th, 25th,
[Function]Print Command
[Code]<0D>H
[Outline]1) When the func tion selecting terminal(Gate Array Pin 32) is HIGH.
This command is ignored.
2) When the functionselectingterminal(Gate Array Pin 32) is LOW.
Withdata heldinside the internalprint buffer, printing and line feed are performed.
Without data inside the internal print buffer, however, no printing is perfor med.
[Function]Se tting the right space amount of the character
[Code]<1B>H<20>H<n>
[Range]{ 0 ≤ n ≤ 20 }Data is described in Hex code.
[Outline]The rightward space amount is set in dot unit (1/20 3inch unit).
In the initial value, it is n=0.
[Caution]The rightward space amount in double wide mode is made double of the set volume.
[Default]n = 0
[Sample Program]
LPRINT CHR$ (&H1B) + " " + CHR$ (0) ;
LPRINT "AAAAA" + CHR$ (&HA) ;
LPRINT CHR$ (&H1B) + "" + CHR$ (1) ;
LPRINT "AAAAA" + CHR$ (&HA) ;
LPRINT CHR$ (&H1B) + "" + CHR$ (12) ;
LPRINT "AAAAA" + CHR$ (&HA) ;
[PrintResults]
46CITIZEN
ESC!n
[Function ]Collective SpecifyingPrintingMode
[Code]<1B>H<21>H<n>
[Range]{ 0 ≤ n ≤ FF }Data is described in Hex code.
[Outline]Printing modeis assigned.Each n bit indicates the following:
[Caution]• With double height and double width being specified simultaneously, double wide and
double high characters are consisted.
• An underline is attached to the full character width, which, however, is not attached to
the part having been skipped by the horizontal tab. Neither is it attached to 90°
-right-turned characters.
• The underline width is as having been specified by <ESC - >. (The default setting is 1
dot width. )
• Specification with this command is invalid to Kanji, except specification and
cancellation of highlighting
• In case that double height character and normal character exist in same one line, the
layout of underline is consistent one.
[Function]Specifying/Canceling Download Character Set
[Code]<1B>H<25>H<n>
[Range]{ 0 ≤ n ≤ FF }Data is described in Hex code.
[Outline]Specifying/canceling download characters. Further, only the lowest bit (n0) is valid for n.
The lowest bit (n0) indicates the following.
n0Function
0Canceling download character set
1Specifying download character set
[Caution]Download characters and download bitimages can not be defined simultaneously.
[Default]n = 0
[SeeAlso]ESC &
[Sample Program]
[Function]Sp ecifying1/6 inch line feedrate
[Code]<1B>H<32>H
[Outline]The line feed rate per line is specifie d by 1/6 inch.
[Sample Program][Print Results]
[Range]{0 ≤ n ≤ FFH}Data is described in Hex code.
{0 ≤ k ≤ 20H}Data is described in Hex code.
[Outline]Specifyinga horizontal tab position.
• "n" indicates the no. of columns from the beginning to the horizontal tab position. At
this time, n= set position•1 is to b e specified. For example, to set the position at 9th
column, n=8 is to be specified.
• k denotes the number of horizontal tab positions you want to set.
• The tab position is set at position where it is "character width x n" from the line
beginning. The character width, at this time, includes the rightward space amount.
In double wide characters, itis made double of the ordinary case.
• Tab positions can be specified are maximum32. Specifying exceeding this is ignored.
• <n> k, which denotes a setting position, is input in the increasing order and ends at
<00> H.
• ESC D NUL clears all the set tab positions. Following clearing, horizontal tab
command is ignored.
CBM-202PC-04 User’s Manual
[Caution]When the data, <n> k, is equal t o or smaller than its preceding data, <n> k-1, it is
assumed that tab setting is finished.If this is the case, the next data onward will be
processed as normal data.
When the data, <n> k, exceeds a 1-line print area, set the horizontal tab position,
assuming "Set column position = Maximum print column + 1."
The horizontal tab position does not change even if the character width is altered after
setting the horizontal tab position.
th
[Default]• Initial value is specified for each eight characters(9
.17th.25thcolumn)ofANK
characters.
[SeeAlso]HT
[Sample Program][Print Results]
SeeSample ProgramandPrint Results for HT onPage45.
58CITIZEN
ESCEn
[Function]Specifying/canceling highlighting
[Code]<1B>H<45>H<n>
[Range]{0 ≤ n ≤ FF}Data is described in Hex code.
[Outline]Specifying /c an c eling the highlightingcharacters.
• "n" is valid only for the lowest bit (n0).
• Control by the lowest bit (n0) is shown as follows:
[Function]Specifying/canceling Double Printing
[Code]<1B>H<47>H<n>
[Range]{0 ≤ n ≤ FF}Data is described in Hex code.
[Outline]Specifying/c anc eling the double printing.
[Function]Printing and feeding paper n/203 inch
[Code]<1B>H<4A>H<n>
[Range]{0 ≤ n ≤ FF}Data is described in Hex code.
[Outline]Prints data inside the print buffer and feeds paper by n/360 inch. Since an actual
mechanical pitch is 1/203 inch, it is internally converted approximate to the value
specifiedwiththis command.
• Specified volume does not remain.
• The beginningof the line is to be considered as the next printingstart position.
• Initial value is not defined.
[Sample Program][Print Results]
SeeSample ProgramandPrint Results for ESC 2 onPage 54.
60CITIZEN
CBM-202PC-04 User’s Manual
ESCRn
[Function]Sele c ting the International Character Set
[Code]<1B>H<52>H<n>
[Range]{0 ≤ n ≤ 0A)Data is described in Hex code.
[Outline]Dependingon the value of n, following character sets are specified.
[Function]Enabling/Disabling the Panel Switches
[Code]<1B>H<63>H<35>H<n>
[Range]{0 ≤ n ≤ FF}Data is described in Hex code.
[Outline]Selecting the LF switch valid/invalid by LFSW(Pin 2).
• "n" is valid only in the lowest bit (n0).
• "n" bit means the followings.
n0Conditio n
0LF SW valid.
1LF SW invalid.
[Caution]Whenthe panel switch is disabled withthis command, the LF switchis disabled.
Therefore, the paper cannot be fed by operating the LF switch.
[Default]• The initial value of n is "0".
[Sample Program]
LPRINTCHR$(&H1B)+"c5"+CHR$(0);············WhenenablingtheLFswitch
LPRINTCHR$(&H1B)+"c5"+CHR$(1);············Whendisabling the LF switch
ESCdn
[Function]Printing and Feeding the paper by n lines
[Code]<1B>H<64>H<n>
[Range]* {0 ≤ n ≤ FF}Data is described in Hex code.
[Outline]Prints data inside the buffer and feeds paper by n lines.
• Specified line does not remain.
• The beginningof the line is to be considered as the next printingstart position.
[Default]• The initial value is not defined.
[Sample Program]
[Function]Full Cut
[Code]<1B>H<69>H
[Outline]Activating auto cutter unit (Full cut)
[Caution]• This is valid only when n is inputted at the beginning of line.
• Prior to cutting the paper, feed the paper from the printing position to beyond the
paper cutting position of the cutter. Otherwise, the character just after print will remain
on this side of the cutter.
[Function]Partial Cut
[Code]<1B>H<6D>H
[Outline]Activating auto cutter unit (Partial cut)
[Caution]• This is valid only when n is inputted at the beginning of line.
• Prior to cutting the paper, feed the paper from the printing position to beyond the
paper cutting position of the cutter. Otherwise, the character just after print will remain
on this side of the cutter.
[Function]Selecting the Character Code Table
[Code]<1B>H<74>H<n>
[Range]{0 ≤ n ≤ 1}Data is described in Hex code.
[Outline]Selecting Page n on the character code table:
The character code table is selected depending on the value of n.
"n" means the followings.
LPRINT CHR$ (&H1B) + "t" + CHR$ (0) ;
LPRINT"n=0";
FOR C=&HB1 TO &HB5
LPRINT CHR$ (C) ;
NEXT C
LPRINT CHR$ (&HA) ;
LPRINT CHR$ (&H1B) + "t" + CHR$ (1) ;
LPRINT"n=1";
FOR C=&HB1 TO &HB5
LPRINT CHR$ (C) ;
NEXT C
LPRINT CHR$ (&HA) ;
[PrintResults]
67CITIZEN
CBM-202PC-04 User’s Manual
ESCv(Serial Interface Only)
[Function]Transmitting the printer status(Serial type)
[Code]<1B>H<76>H
[Outline]Current printer status is transmitted..
[Caution]• Status sent out consists of 1 byte whosecontent is as inthe table below.
• In DTR/DSR control, after receptible state of the host (DSR sign al being in SPACE
state) is confirmed, only 1 byte is transmitted.
InXON/XOFF control, DSR signal state not being confirmed, only 1 byteis transmitted.
• In DTR/DSR control, when the host is in unreceptible state(DSR signal being in
MARK state), it waits until receptible state is created.
• In paper end (paper near end) status, this command may be unreceptible state due to
BUSY state.
Remarks. This command is valid only for serial interface model.
Value
BitFunction01
0Not defined
1Not defined
2Paper endWith paperWithout paper
3Not defined
4Not usedFixed to 0–
5Not defined
6Not defined
7Not defined
[Sample Program]
OPEN "COM1:N81NN" AS #1 ;
PRINT #1, CHR$ (&H1B) + "v" ;
A$ = INPUT$ (1, #1) ;
CLOSE #1
68CITIZEN
ESC{n
[Function]Specifying/Canceling the Inverted Characters
[Code]<1B>H<7B>H<n>
[Range]{0 ≤ n ≤ FF}Data is described in Hex code.
[Outline]Specifying/c anc eling inverted characters.
[Outline]The printing start position is specified in the number of dots(1/203 inch unit) from the
current position.
• Rightward direction is taken as plus and leftward direction asminus.
• To specify N dot inminus (left) direction, use a complement of N for assignment.
• N dots = 65536 – N
• The number of dots is divided by 256, whose quotient is taken as n2 and the residual
as n1.
[Caution]• Specifying exceeding the topof line or the end of line is ignored.
[Default]• The initial value is not specified .
[SeeAlso]ESC $
[Sample Program][Print Results]
SeeSample ProgramandPrint Results for ESC $ onPage 70.
71CITIZEN
CBM-202PC-04 User’s Manual
GSkn[d]kNUL
[Function]Printing the Bar Code
[Code]<1D>H<6B>H<n> [ < d> ] k <00>H
[Range]{0 ≤ n ≤ 7}Data are described in Hex code.
[Outline]Specifyinga type of bar code and printing bar codes.
• The beginningof line is considered as the next printing start position.
• Depending on the value of n, the following bar cod e can be selected.
d indicates a character code to be printed and k indicates the number of character to be
printed.
[Caution]• When data being heldinthe printbuffer, thiscommand is ignored.
• Regardless of the specified feed pitch, this command feeds the paper to be required to
print a bar code.
• If the character code d cannot be printed in the respective bar code system, the bar
code so far willbe printed, processing thesubsequent data as normaldata.
• When a bar code whose number of characters to be printed is fixed has been selected,
the number of characters k have to be always made equal to the number of characters
to be printed.(The bar code is not printed when not matching.)
• When the horizontal direction exceeds one line length, the excess part is not printed.
[Default]• The initial value is not specified .
[Description of Bar Codes]<For print examples, see Page 75.>
UPC-AThis bar code, consisting of numerals only, has a fixed length of 12 columns; a 11 columns
number entered from the host or application software plus a check column(12th column)
automatically calculated inside the printer.If the 12th-column numeral is sent from the
host, the entire bar code will be printed as it is.
72CITIZEN
CBM-202PC-04 User’s Manual
UPC-EThis bar code, consisting of numerals only, has a fixed length of 8 columns; the first number
system character is "0" stationary.A 12 columns numeral entered from the host or
application software is compressed to 8 columns with a check column and printed.The
12th-column check column is automatically calculated inside the printer and sent from the
host, the entire bar code will be printed, compressed to 8 columns.
JAN-13(EAN) This bar code, consisting of numerals only, has a fixed length of 13 columns; a 12 columns
number entered from the host or application software plus a check column(13th column)
automatically calculated inside the printer.If the 13th-column numeral is sent from the
host, the entire bar code will be printed as it is.
JAN-8(EAN)This bar code, consisting of numerals only, has a fixed length of 8 columns; a 7-columns
number entered from the host or application software plus a check column(8th column)
automatically calculated inside the printer.If the 8th-column numeral is sent from the host,
the entire bar code will be printed as it is.
CODE39This bar code, consisting of uppercase alphabets and numerals, has a variable length of
column.A start/stop code "*" is automatically added by the printer.Available characters
include a space and "$, %, *, +, –, · , /, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9," and uppercase alphabets.
ITFThis bar code, consisting of numerals only, has a variable length of even columns. If an
odd-column code is transferred, nothing will be printed.
CODABAR (NW-7)
This bar code, consisting of alphanumerals, has a variable length of column.Available
charactersinclude"0,1,2,3,4,5,6,7,8,9,A,B,D,D,$,+,–,.,/,:." Astart/stopcodeis
required; any one of A, B, C, and D is used.
CODE128• This bar code consists of all of 128 ASCII code characters and has a variable length of column.
This printer supports the code subsets A, B, and C.By prefixing a transfer code with any
one character of A, B, and C, you can select the code subset to start from.If not p r efixed
with A, B, or C, the code subset B will be selected.
• The code subset A is the bar code consisting of standard uppercase alphabets, numerals,
symbols, and special codes.
• The code subset B is the bar code consisting of standard uppercase/lowercase alphabets,
numerals, symbols, control codes, and special codes.
• The code subset C is the bar code consisting of special characters and 100 kinds of
numbers ranging from 00 to 99.
73CITIZEN
CBM-202PC-04 User’s Manual
• The check column automatically calculated inside the print er is added to the end of the
entered digits to be printed.
• Processingof the special characters
The characters above the ASCII code number 96 are considered special characters.The
following lists the converted characters for entering these characters.
ASCII CodeConverted CharacterSubset CodeSubset Code BSubset Code C
8-columns fixed-length bar code consisting
of numerals only.Abbreviated version of
UPC-A
13-columns fixed-length bar code
consisting of numerals only•
8-columns fixed-length bar code consisting
of numerals only
V ariable-length bar code consisting of
alphabets and numerals.The start/stop
code "*" is automatically added.
Even-column variable-length bar code
consisting of numerals only22
•
•
13
CODABAR
(NE-7)
CODE128
Variable-length bar code consisting of
alphanumerals. AnyoneofA,B,C,and
D is required as the start/stop code.
Variable -lengthbar code consistingof all
128 ASCII code characters.
17
15
Printing is done depending on bar code specification type, number of print columns, bar
code height, width(Magnification), visible code presence, and bar code data specification.
75CITIZEN
GSwn
[Function]Selecting the width of the Bar Code
[Code]<1D>H <77>H<n>
[Range]{2 ≤ n ≤ 4}Data is described in Hex code.
[Outline]Selecting bar code width.
n denotes the number of dots in fine element width.
[Default]• The initial value of this width is "3".
[Sample Program]
n denotes the number of dots in the vertical direction.
[Default]• The initial value of n is "162".
[Sample Program][Print Results]
CBM-202PC-04 User’s Manual
See Sample Program and Print Results for GS w on page 76.
77CITIZEN
CBM-202PC-04 User’s Manual
GSHn
[Function ]Selecting the PrintingPositionof HRI Code
[Code]<1D>H<48>H<n>
[Range]{0 ≤ n ≤ 3}Data is described in Hex code.
[Outline]Selecting printing position of HRI codes in printing bar codes.
• "n" means the followings.
n (Hex)Printing Position
0No printing
1Above the bar code
2Below the bar code
3Both above and below the bar code
The HRI code refers to the bar code-turned characters so that you can read them.
[Caution]The HRI code is printed in the font selected with GS f. Specify before the GS k command.
[Default]• The initial value of n is "0".
[SeeAlso]GS f
[Sample Program][Print Results]
[Function]Selecting the font of HRI code
[Code]<1D>H<66>H<n>
[Range]n = 0, 1
[Outline]Selecting the font of HRI code in printing bar code.
The type of font can be printedby selecting n is as follows.
nFont
0Font A
1Font B
The HRI code refers to the bar code-turned characters so that you can read them.
[Caution]The HRI code is printed at the position specified with GS h.
[Default]The initial value of n is “0”.
[SeeAlso]GS H
[Sample Program]
LPRINT CHR$ (&H1D) + "h" + CHR$ (50) ;
LPRINT CHR$ (&H1D) + "H" + CHR$ (2) ;
LPRINT CHR$ (&H1D) + "f" + CHR$ (0) ;
GOSUB BC
LPRINT CHR$ (&H1D) + "f" + CHR$ (1) ;
GOSUB BC
END
BC :
LPRINT CHR$ (&H1D) + "k" ;
LPRINT CHR$ (4) ;
LPRINT "123" + CHR$ (0) ;
LPRINT CHR$ (&HA) ;
RETURN
[PrintResults]
CBM-202PC-04 User’s Manual
79CITIZEN
CBM-202PC-04 User’s Manual
GS*n1n2[d]n1× n2 × 8
[Function]Defining the Download Bit Image
[Code]<1D>H<2A>H<n1><n2> [ < d > ] n1 × n2 × 8
[Range]{1 ≤ n1 ≤ FF}
{1 ≤ n2 ≤ 30}
{n1 × n2 ≤ 51F}Data is described in Hex code.
[Outline]Defines downloading bit imagesof the number of dots specifiedby n1/n2.
• Thenumbersofdotsaren1x8inhorizontal direction and n2x8in vertical direction.
• d indicates bit imagedata.
• The download bit image thus defined remains effective until redefinition, ESC @
execution, ESC &, or power OFF takes place.
[Caution]• A download character and a download bit image can not be defined simultaneously.
With this command executed, defined content of a download character is cleared.
• Relations between the bit imagedataandthe dotdefined areshownbelow:
• If a download bit image is defined with this command while it is being printed (GS /),
printing operationmay become unstable (fluctuating print pitch).
[SeeAlso]GS /
80CITIZEN
[Sample Program][Print Results]
GOSUB IMG
LPRINT CHR$ (&H1D) + "/" + CHR$ (0) ;
LPRINT CHR$ (&H1D) + "/" + CHR$ (1) ;
LPRINT CHR$ (&H1D) + "/" + CHR$ (2) ;
LPRINT CHR$ (&H1D) + "/" + CHR$ (3) ;
END
IMG :
n1=10:n2=5
LPRINT CHR$ (&H1D) + "*" ;
LPRINT CHR$ (n1) + CHR$ (n2) ;
FOR J=1 TO n1 * 8
FOR I=1 TO n2
LPRINT CHR$ (J) ;
NEXT I
NEXT J
RETURN
CBM-202PC-04 User’s Manual
81CITIZEN
CBM-202PC-04 User’s Manual
GS/m
[Function]Printing the Download, Bit Image
[Code]<1D>H<2F>H<m>
[Range]{0 ≤ m ≤ 03}Data is described in Hex code.
[Outline]Prints downlo adbit image in a mode specified by m.