Star Micronics SLIP SP298 SERIES Programmer's Manual

SLIP PRINTER
SP298 SERIES
Programmer’s Manual
Trademark acknowledgments
SP298 : Star Micronics Co. Ltd. ESC/POS, TM-295, TM-290 : Seiko Epson Corporation
Notice
All rights reserved. Reproduction of any part of this manual in any form whatsoever, without STAR’s express per­mission, is strictly forbidden.
The contents of this manual are subject to change without notice.
All efforts have been made to ensure the accuracy of the contents of this manual at the time of printing. However, should any errors be found, STAR would greatly appreciate being informed of them.
The above notwithstanding, STAR can assume no responsibility for any errors in this manual.
Copyright 1998 Star Micronics Co., Ltd.
TABLE OF CONTENTS
Chapter 1: DIP Switch Settings ................................................................. 1
Accessing the DIP switches ....................................................... 1
Available DIP switch settings (Serial Interface) ........................ 3
Available DIP switch settings (Parallel Interface) ..................... 4
Chapter 2: Memory Switch Settings.......................................................... 5
Chapter 3: Control Panel Operations ....................................................... 6
Indicator lights ........................................................................... 6
Buttons ....................................................................................... 7
Producing a test print ................................................................. 7
Adjusting the dot alignment ....................................................... 7
Hexadecimal dump .................................................................... 9
Errors ....................................................................................... 10
Chapter 4: Interface .................................................................................. 11
Serial Interface ......................................................................... 11
Serial interface pins and signal names ..................................... 12
Pins and Signal Names ............................................................ 12
Interface connections ............................................................... 13
Data protocol ............................................................................ 14
Parallel Interface ...................................................................... 17
Connectors and Signals ............................................................ 17
Chapter 5: Peripheral Unit Driver Circuit ............................................. 19
Modular plug ............................................................................ 19
Drive circuit ............................................................................. 20
Chapter 6: Control Codes ......................................................................... 21
Star Mode Commands ............................................................. 21
ESC/POS Mode Commands (TM-295 emulation) .................. 26
ESC/POS Mode Commands (TM-290 emulation) .................. 28
TM-295 mode emulation cautionary items .............................. 60
Appendix: Character Code Tables ............................................................ 62
Please access the following URL http://www.star-micronics.co.jp/service/sp_sup_e.htm for the lastest revision of the manual.
Chapter 1: DIP Switch Settings
The printer’s DIP switches let you change communications parameters, input buffer size, and emulation. This chapter explains the settings you can make and tells you how to actually change DIP switch settings.
Accessing the DIP switches
The DIP switches are located inside the printer, underneath the document table. Use the following procedure to remove the document table so you can operate the DIP switches.
Make sure that the printer is turned off and unplugged from its wall outlet.
Remove the printer cover.
While using a screwdriver or other similar instrument to press down at the location marked (a) in the illustration below, carefully slide the document table in the direction indicated by the arrow until it is out of the way.
a
2
It is not necessary to remove the document table completely, just move it enough so you can get at the DIP switches inside.
Note:
If the document table seems to be getting caught on the rollers, it means that you are not pressing down at point (a) enough. Pressing at point (a) should separate the rollers to the document table can slide freely.
After the document table is opened sufficiently, use a thin flat-blade screwdriver or some other similar object to change DIP switch settings.
Note:
See the following section for details on available DIP switch settings.
After making the settings you want, slide the document table back into place while pressing down at point (a). Make sure that the document table is correctly seated in place before releasing point (a).
Replace the printer cover.
ON
OFF
ON
OFF
12345678
(For Serial Interface)
(For Parallel Interface)
ON
OFF
12345678910
3
Available DIP switch settings (Serial Interface)
The following table shows all the possible settings for the DIP switch. The factory default settings are ON for switches 1 through 7 and OFF for switches 8 through 10.
*1: Never set switch 7 to OFF at the same time that switch 8 is set to ON.
Switch Parameter ON OFF
1
Baud Rate See table below.
2 3 Data Length 8 bits 7 bits 4 Parity Check Disabled Enabled 5 Parity Odd Even 6 Handshake DTR/DSR XON/XOFF 7
Command Emulation See table below.
8 9 Pin 6 (DSR) Reset Signal Enabled Disabled
10 Pin 25 (INIT) Reset Signal Enabled Disabled
Baud Rate Switch 1 Switch 2
1200BPS OFF OFF 2400BPS ON OFF 4800BPS OFF ON 9600BPS ON ON
Command Emulation Switch 7 Switch 8
Star mode ON ON ESC/POS (TM-295) ON OFF ESC/POS (TM-290) OFF OFF
Not used (*1) OFF ON
4
Available DIP switch settings (Parallel Interface)
The following table shows all the possible settings for the DIP switch. The factory default settings are ON for switches 1 through 7 and OFF for switch 8.
A reset can be performed with pin 31 on the interface by setting DIP switch 1 to ON (the factory default setting). In addition, when a reset can be performed with pin 31, setting DIP switch 2 to OFF sets up the unit to perform a reset when pin 31 and pin 36 are “LOW”.
*1: Never set switch 7 to OFF at the same time that switch 8 is set to ON.
Switch Parameter ON OFF
1
Pin 31 / Pin 36 Reset Signal See table below.
2 3
Not used (Always ON)
4 5 6 7
Command Emulation See table below.
8
Reset Signal Switch 1 Switch 2
Pin 31 is enabled. ON ON
Pin 31/Pin 36 are enabled. ON OFF
Disabled OFF ON Disabled OFF OFF
Command Emulation Switch 7 Switch 8
Star mode ON ON ESC/POS (TM-295) ON OFF ESC/POS (TM-290) OFF OFF
Not used (*1) OFF ON
5
Chapter 2: Memory Switch Settings
Each memory switch is a 16-bit word store in EEPROM. For details on the functions and settings of memory switches, refer to “Chapter 6”.
The table below shows the factory settings for the memory switches.
Warning!
Changing the memory switch settings can cause the printer to fail to operate correctly.
Memory Switch Hexadecimal Code
0 0000 1 0000 2 0000 3 0000 4 0000 5 0000
6
Chapter 3: Control Panel Operations
The control panel gives you some push-button control over the slip printer operation. It also includes indicator lights, which tell you the current status of the printer at a glance.
Indicator lights
The following table describes the meaning of indicator lights when it is on, off, or flashing.
Indicator Light Off On Flashing
POWER
Power off Power on
Dot Alignment Adjust
Mode
PAPER OUT
Paper inserted No paper Insert paper prompt
RELEASE
Slip paper engaged Slip paper released Mechanical error
FORWARD
POWER RELEASE PAPER
OUT
REVERSE
RELEASE
7
Buttons
The following table describes the function of the three control buttons of the control panel.
Producing a test print
The following procedure can be used at any time to test the printer.
Turn on the printer and insert a piece of paper (page 6, 11).
Turn off printer power.
While holding down RELEASE , turn printer back on. Keep RELEASE depressed for a few moments until the printer beeps and the printer test print starts.
The printer test will continue until it reaches the end of the paper.
Adjusting the dot alignment
You may never have to use the procedure described in this section, but after you have been using your printer for some time you may find that the dots of some graphics do not align correctly. For example, what should look like:
may come out looking like one of the following:
Button Description
FORWARD
Feeds the slip paper forward, toward the back of the printer. One press feeds one line, holding down performs continuous feed.
REVERSE
Feeds the slip paper back, toward the front of the printer. One press feeds one line, holding down performs continuous feed.
RELEASE
Activates the printer's paper release (the paper is not held in place by the paper feed roller). Clears recoverable errors.
or like this
8
This is caused when mechanical parts of the printer get out of alignment. This happens only rarely and you may never experience it at all throughout the life of the printer. If you do have problems, use the following procedure to correct it.
Turn on the printer and insert a piece of paper.
Turn off printer power.
While holding down the control panel’s FORWARD and REVERSE buttons, turn the printer back on to enter the Dot Alignment Adjust Mode, which is indicator by a flashing POWER indicator flashes.
Entering the Dot Alignment Adjust Mode causes seven blocks to be printed, each of which indicates a dot alignment setting, as shown below. An asterisk to the left of the blocks indicates which block is currently selected.
Use FORWARD to specify the block that appears to have the best aligned characters. Press FORWARD once to specify the first block, twice to specify the second block, and so on up to seven times to specify the se v enth block.
Warning beep will sound if you press FORWARD more than seven times.
After specifying a block, press REVERSE to register your selection and exit the Dot Alignment Adjust Mode.
9
The dots alignment adjustment setting you selected is stored in printer memory and a pattern is printed using the selected setting followed by the message “Adjust Complete!” The printer ejects the paper after printing is complete.
Note:
You setting is not registered if you turn off printer power before pressing REVERSE to exit the Dot Alignment Adjust Mode. If a paper feed error occurs during this mode, the printer ejects the paper and this mode is cancelled.
Hexadecimal dump
This procedure prints in hexadecimal format all codes (character codes and control codes) that are sent to the printer by the computer. The printer does not execute any control codes (such as 0A - linefeed), it just prints them out. The hexadecimal dump is useful when you are writing programs for printer control.
Turn on the printer and insert a piece of paper.
Turn off printer power.
While holding down the control panel’s FORWARD buttons, turn the printer back on to enter the Hex Dump Mode.
To exit the Hex Dump Mode, turn the printer off.
Note:
The printer will not responde to any commands you send it while it is in the Hex Dump Mode.
10
Errors
There are three types of errors: recoverable errors that require some action by you before they clear, non-recoverable errors that require servicing by an authorized service provider, and a data receive error. Errors are indicated by and audible buzzer and the indicators.
Recoverable Errors
Non-recoverable Errors
Data Receive Error
This type of error is caused whenever a problem is encountered during data receipt. The method used by the printer to recover from a data receive error depends on the current command mode.
Error Type
Indicators
Recovery
POWER RELEASE PAPER OUT
Paper jam
Flashing
Correct the cause of the problem and then press RELEASE.
Carriage motor lockup Abnormal home position signal Abnormal timing signal
Error Type
Indicators
Recovery
POWER RELEASE PAPER OUT
RAM read/write
Off On On
Turn off the printer, then after waiting a few minutes, turn the printer back on. If the printer does not recover, contact your nearest service provider.
CPU lockup
Command mode Data Receive Error Recover Procedure
Star mode The printer prints a question mark.
ESC/POS mode
Memory switch 4-0=0 : The printer prints a question mark. Memory switch 4-0=1 : The printer discards the received data.
11
Chapter 4: Interface0
Serial Interface
This chapter provides detailed specifications for the printer’ s standard serial interface (Connector Type: D-sub 25-pin). Set the transmission parameters with DIP Switch.
Transmission type............Asynchronous serial interface
Baud rate (bps).................1200, 2400, 4800 or 9600
(Selected by DIP switch)
Word format
Start bit:................1
Data bits: ..............7 or 8 (Selected by DIP switch)
Parity:...................Odd, Even, or None
(Selected by DIP switch)
Stop bit:................1
Signal polarities
RS-232C...............Mark = Logic “1” (–3V to –15V)
Space = Logic “0” (+3V to +15V)
Handshaking ....................DTR/DSR or XON/XOFF mode (Selected by DIP
switch)
Input (RXD, DSR, INIT)
Output (DTR, TXD, RTS)
b0 b1 b2 b3 b4 b5 b6 (b7)
ABCD
Mark [1]
Space [0]
A: Start bit B: Data bits C: Vertical parity bit D: Stop bit
Printer Host computer
75188 or equivalent
Printer Host computer
12
Serial interface pins and signal names
Pins and Signal Names
Pin No.
Signal Name
Direction Function
1 FG Frame ground 2 TXD OUT Transmission data 3 RXD IN Receive data
4 RTS OUT
STAR Mode
When Memory Switch 4-D = 0: Same as DTR signal When Memory Switch 4-D = 1: Always SPACE
ESC/POS Mode
Same as DTR signal 5 N.C. Not connected 6 DSR IN • DIP Switch 9 = OFF
STAR Mode
Status of this signal is not checked.
ESC/POS Mode
In DTR/DSR communication mode when Memory Switch4-5 = 0, indicates whether data
receive from host is enabled or disabled.
Space: Receive enabled
Mark: Receive disabled
This signal is not checked in the X-ON/X-OFF communication mode.
• DIP Switch 9 = ON
This signal used for external reset. Printer is reset whenever signal is in mark state with
pulse width of 1mS or more. 7 SG Signal ground
8 - 1 9 N.C. Not connected
13
25
1
14
13
Interface connections
Refer to the interface specifications for the host computer for details on connecting to its interface connector. The following illustration shows a typical connection configuration.
20 DTR OUT Indicates whether data receive from host is enabled or disabled.
DTR/DSR Communication Mode
Space when receive is enabled.
X-On/X-Off Communication Mode
Always space, except during following conditions:
• Period between reset and communication enabled
• During self-test printing and dot alignment adjustment
2 1 - 2 4 N.C. Not connected
25 INIT IN • DIP Switch 10 = OFF
This signal not used.
• DIP Switch 10 = ON
This signal becomes reset signal. Printer is reset whenever signal is in mark state with pulse
width of 1mS or more.
Pin No.
Signal Name
Direction Function
1 2 3 4
6
1 2 3 4 5
6 7
8
20
F-GND TXD RXD RTS
DSR
20 25
7
S-GND DTR
INIT
Printer side
(D-sub 25 pin)
IBM PC side
3 2 7 8
6 5
1 4
F-GND TXD RXD RTS CTS DSR S-GND DCD DTR
9 pin25 pin
14
Data protocol
Outline of DTR/DSR mode operations
This communication mode is set when dip switches 1 to 6 are set at ON. The DTR signal shakes hands with the DSR signal (DSR signal: ESC/POS mode only) and performs communications. The DTR signal is assumed as the BUSY signal and then the control for the printer’s data receiving operations are carreied out, and a “space” means that the printer is to receive the data, and a “mark” means that the printer is not to receive the data.
The DTR signal line is set a “space” when the power supply is switched on and no error occurs with the printer. The host confirms that the DTR signal line is set at “space”, and then transmits the text data to the RXD signal line.
The printer sets the DTR signal line at “mark” when the empty area in the data buffer is less that the prescribed number of bytes (*1: nearly full buffer condition.) The host confirms that the DTR signal line is set at “mark” and suspends text data transmission, but it is possible for the printer to continue receiving data for the amount of space remaining in the data buffer’s empty area at this point. If the DTR signal is ignored and data transmitted, the data that exceeds the amount of space available in the empty area will be discarded. The empty area in the data buffer will increase as printing is carried out, and the DTR signal line will be set at “space” if the amount of empty space in the data buffer is more than the prescribed number of bytes (*2: near empty condition.)
In addition to this, the host will confirm that receiving is possible (DSR signal = “space”) and transmit the data only when memory switches 4 and 5 are set at 0 during printer status transmission in the ESC/POS mode’s DTR/DSR communication mode. (With the exception of certain status transmission commands. Also, dip switches 1 to 9 must be at OFF when the DSR signal is
confirmed.) *1 Refer to the nearly full buffer conditions for details on nearly full buffer conditions. *2 Refer to the nearly empty buffer conditions for details on nearly empty buffer
conditions.
RXD
DTR
Data Data Data
Buffer full Buffer empty
Printing
Power ON
15
Outline of X-ON/X-OFF mode operations
This communication mode is set when dip switches 1 to 6 are set at OFF.
This mode notifies the host of X-0N (DC1) data when receiving is possible
and X-OFF (DC3) data when printing is not possible with the TXD signal.
The timing conditions for the output of X-ON and X-ON in the STAR mode
are set with the 4-C memory switch. When memory switch 4-C = 0 (set when
the unit is shipped from the factory,) only one byte is output by X-ON during
fluctuations from on-line (printer BUSY) to on-line (printer READY), and
only one byte is output by X-OFF during fluctuations from on-line (printer
READY) to on-line (printer BUSY). The same functions as above occur when
in the ESC/POS mode regardless of the 4-C memory switch setting.
When memory switch 4-C = 1, X-ON is output at regular three-second
intervals.
X-ON (DC1 with the control code name and 11H with hexadecimal display)
is output by the TXD signal line when the power supply is switched on and no
error occurs with the printer. The text data is transmitted to the RSD signal line
after the host has received X-ON.
X-OFF (DC3, 13H) is output when the empty area in the data buffer is less that
the prescribed number of bytes (*1: nearly full buffer condition.) Also, if
memory switch 4-C = 1, X-OFF is output for every byte of data received. The
host that receives X-OFF suspends text data transmission, but it is possible for
the printer to continue receiving data for the amount of space remaining in the
data buffer’s empty area at this point. If data that exceeds the amount of space
available in the empty area is transmitted, it will be discarded.
The empty area in the data buffer will increase as printing is carried out, and X-
ON is output if the amount of empty space in the data buffer is more than the
prescribed number of bytes (*2: near empty condition.) *1 Refer to the nearly full buffer conditions for details on nearly full buffer conditions. *2 Refer to the nearly empty buffer conditions for details on nearly empty buffer
conditions.
TXD
RXD
X–ON X–OFF X–ON X–OFF X–ON
Printing
Data Data Data
16
Nearly full buffer conditions
Nearly empty buffer conditions
Emulation
(DSW8)
Buffer size
(DSW7)
Available area
(during fluctuations)
STAR mode
2K byte
When 256 bytes or less are
available
35 byte
When 16 bytes or less are
available
ESC/POS mode 512/35 bytes
When 10 bytes or more are
available
Emulation
(DSW8)
Buffer size
(DSW7)
Available area
(during fluctuations)
STAR mode
2K byte
When 1792 bytes or less are
available
35 byte
When 20 bytes or less are
available
ESC/POS mode 512/35 bytes
When 20 bytes or more are
available
17
Parallel Interface Connectors and Signals
Pin No.
Signal Name IN/OUT Function
1 STROBE IN
Signals when data is ready to be read. Signal goes from HIGH to LOW (for at least 0.5 microsec.) when the data is available.
2-9 DATA1-8 IN
These signals provide the information of the first to eighth bits of parallel data. Each signal is at HIGH level for a logical 1 and at a LOW level for a logical 0.
10 ACK OUT A 9 microsecond LOW pulse acknowledges receipt of the data.
11 BUSY OUT
When this signal goes to LOW, the printer is ready to accept data. When the printer is in one of the conditions below, “HIGH” is set.
1. Data is being entered
2. Off line
3. Error condition
12 PAPER OUT OUT
This signal indicates the status of the paper sensor. [In Star mode] This signal goes to HIGH when either the TOF or the BOF sensor detects that there is no paper. The signal will go to LOW when both the TOF and BOF sensor detect that there is paper installed. [In the ESC/POS mode] This signal outputs the status of the sensor selected using the <ESC> “c3” command.
13 SELECTED OUT This signal is HIGH when the printer is online.
14-15 N/C Unused
16 SIGNAL GND Signal ground 17 CHASSIS GND Chassis ground, isolated from logic ground 18 LOGIC HIGH 3.9 k
pull-up
19-30 GND Twisted pair return the signal to ground level.
31 RESET IN
This becomes a reset signal when DIP switch 1 is set to ON. (See page 4 for details.) When this signal goes to LOW (for at least 0.5 microsec.), the printer is reset to its power-on condition.
32 ERROR OUT
This signal is normally HIGH. This signal goes to LOW to signal that the printer
cannot print due to an error condition. 33 EXT GND External ground 34 COMPULSION OUT Compulsion signal (See page 20.) 35 +5VDC 2.2 kΩ pull-up
18
36 SELECT IN IN
Unused (However, this becomes a reset signal when DIP switch 1 is set to ON
and DIP switch 2 is set to OFF. See page 4 for details.)
Pin No.
Signal Name IN/OUT Function
This connector mates with an Amphenol 57-30360 connector
Parallel interface connector (printer side)
19
Chapter 5: Peripheral Unit Driver Circuit
This printer is equipped with a circuit for driving peripheral units, such as cash drawers. A 6-pin modular connector for connection of the peripheral unit is located on the back of the printer. To connect to the drive circuit, connect the peripheral unit to the modular connector using a cable supplied by you like that one shown in the figure below.
Important!
Never connect any other type of plug to the peripheral unit connector.
Modular plug
16
Modular plug: MOLEX 90075-0007, AMP641337, or JAPAN BURNDY B-66-4
Shield
Wire lead
20
Drive circuit
The recommended drive unit is shown below.
Notes
• Peripheral Units 1 and 2 cannot be driven simultaneously.
• For continuous driving, do not use drive duty greater than 20%.
• When using a serial interface, the compulsion switch status is available as status data. When using a parallel interface, the compulsion switch status can be worked out from the position of the number 34 pin of the interface connector . The switch status is ON when the number 34 pin is at LOW level.
• Minimum resistance for coils L1 and L2 is 24Ω.
• Absolute maximum ratings for diodes D1 and D2 (Ta = 25°C) are: Average Rectified Current Io = 1A Maximum forward surge current (60Hz, 1-cycle sine wave) I
FSM
= 40A
• Absolute maximum rating for transistors TR1 and TR2 (Ta = 25°C) are: Collector current Ic = 2A Collector loss Pc = 1.2W
7824
F.G
TR1
M-GND
TR2
M-GND
TR3
+5V
+24V
R1
R2
6
5
4
3
2
1
L1
L2
R3
4.7k 1/4W
Frame ground
Printer side User side
D1
D2
Peripheral unit 1
With shield
Peripheral unit 2
Compulsion switch
Drive output: 24V, 1.0A max.
21
Chapter 6: Control Codes
This printer supports two different command modes: the Star mode and the ESC/POS mode.
The Star mode emulates previous Star printers. The ESC/POS mode emulates the Epson TM-295 or TM-290 slip printer.
This chapter provides you with all of the commands supported by this printer.
Important!
Access the following URL for the latest version of this manual and for updates on supported commands: http://www.star-micronics.co.jp/service/ sp_sup_e.htm
Star Mode Commands
The following tables show the Star mode commands that are supported by this printer.
Character Selection
Control Codes
Hexadecimal
Codes
Function Page
<ESC> “R”
n
1B 52
n
Selects the international character set 30
<ESC> “/” “1” <ESC> “/” <1>
1B 2F 31 1B 2F 01
Selects slash zero 30
<ESC> “/” “0” <ESC> “/” <0>
1B 2F 30 1B 2F 00
Selects normal zero 30
<ESC> <GS> “t”
n
1B 1D 74
n
Selects the character code table 30 <ESC> “M” 1B 4D Selects the 7 × 9 (half dot) font 31 <ESC> “P” 1B 50 Selects the 5 × 9 (2 pulses per dot) font 31 <ESC> “:” 1B 3A Selects the 5 × 9 (3 pulses per dot) font 31 <ESC> <SP>
n
1B 20
n
Sets character spacing 31 <SO> 0E Sets the printing magnified double in character width 31 <DC4> 14 Resets the printing magnified in character width 31
Loading...
+ 55 hidden pages