Professional Documents
Culture Documents
1 New Feature:
New command added:
1. “Clear Buffers of 1D (21)”. See 3.3.11
CONTENTS
CONTENTS............................................................................................................................................ I
CHAPTER 1 Connecting the Printer.................................................................................................... 1
1.1 RS232...................................................................................................................................1
1.2 Ethernet...............................................................................................................................1
CHAPTER 2 Data Format.....................................................................................................................2
2.1 Format Length..................................................................................................................... 2
2.2 Command............................................................................................................................ 2
2.3 Reply.................................................................................................................................... 3
2.4 Checksum Calculation......................................................................................................... 4
CHAPTER 3 Command Introduction...................................................................................................5
3.1 Print End Signal................................................................................................................... 5
3.2 Summary............................................................................................................................. 5
3.3 Description.......................................................................................................................... 6
3.3.1 Send Print Message(01).......................................................................................... 6
3.3.2 Lock Printer(02).......................................................................................................7
3.3.3 Unlock Printer(03)................................................................................................... 7
3.3.4 Start Print(11)..........................................................................................................8
3.3.5 Stop Print(12).......................................................................................................... 9
3.3.6 Download Message Data(1C)..................................................................................9
3.3.7 Download Remote Field Data(1D).......................................................................... 3
3.3.8 Load Print Message(1E).......................................................................................... 5
3.3.9 Request Message Names(1F)..................................................................................5
3.3.10 Set Print Mode(20)................................................................................................7
3.3.11 Clear Buffers of 1D(21)..........................................................................................8
CHAPTER 4 Code Descriptions........................................................................................................... 9
4.1 Command Status Code........................................................................................................9
4.1.1 Summary................................................................................................................. 9
4.1.2 Description.............................................................................................................. 9
4.2 Printer Status Code........................................................................................................... 10
4.2.1 Summary............................................................................................................... 10
4.2.2 Description............................................................................................................ 10
I
CHAPTER 1 Connecting the Printer
1.1 RS232
For remote communications, TIJ printers use a hardware connection based on the RS232
standard. If the remote host is a PC,using USB-to-RS232 is recommend.For successful
transmission and reception, both the transmitter and receiver must use the same serial port
parameters(Baud Rate,Stop Bits,Parity and Data Bits). The serial port parameters show as Figure
1-1 (Machine Parameters→Communication Settings→Serial Port Settings).
1.2 Ethernet
For remote communications, TIJ printer is also compatible with Ethernet connection. The
printer runs as TCP server, and the remote host as TCP client. To connecting a printer, at most one
TCP client is allowed at any time(but the remote host can create N clients to connect N printers).
The Ethernet settings show as Figure 1-2 (Machine Parameters → Communication Settings →
Ethernet Settings).
The length of the whole format data must not be greater than FFFFFF(hex) bytes sending
each time, otherwise the format will be discard.
2.2 Command
2.3 Reply
If the integrity of the received command is correct and was successfully actioned, the printer
reply as follows:
1B(ESC)
06 (ACK)
Slave Address 1 byte
P_Status 1 byte
Command ID 1 byte
(Data) >=0 byte
1B(ESC)
03(ETX)
Checksum 1 byte
1B06: Means acknowledge.
Slave Address: The slave address is a single byte which is the last byte of IP address.
P_Status:The printer status byte indicates the fault status of the printer:
00 Indicates no fault
>00 Specific fault code.See 4.2.1
Command ID:Returns the same command id in the command.
Data:Optional data, is required by the command.
1B03: Means the end of command.
Checksum: The checksum is a single byte placed at the end of each data transmission. See
2.4 for a description of how to calculate the checksum.
If the integrity of the received command is not correct,the printer reply as follows:
1B(ESC)
15 (NAK)
Slave Address 1 byte
C_Status 1 byte
Command ID 1 byte
1B(ESC)
03(ETX)
Checksum 1 byte
1B15: Means negative acknowledge.
C_Status:The command status byte indicates fault code of the command. See 4.1.
The data checksum is the 2s-complement value of the modulo-256 sum of all the bytes in
the message.The following example shows the data sent to the printer to populate a specific
remote field in a message using the command “1D”. Assumes that the slave address is “00”.
1B 02 00 1D 01 01 0B 54 49 4A 20 50 72 69 6E 74 65 72 1B 03
Step 1
1B(ESC)
02(STX)
00
1D
01
01
0B
54
49
4A
20
50
72
69
6E
74
65
72
1B(ESC)
03(ETX)
______
Total value 450hex
Step 2
The Boolean AND operation (modulo-256) is applied to the total value and 0FFh to give a
single byte value:
450h AND 0FFh = 50h
Step 3
The 2s-complement of 50h is then calculated as follows:
100h - 50h = B0h
Therefore the checksum for the above message is B0h.Add it to the end of the command.
The “photocell triggered signal” is issued by the printer when photocell triggered in the case
of “ready to print message” containing protocol data and “Triggered Signal” setting also set to
“open”(Machine Parameters→Comm. Setting):
Reply
1B(ESC)
06(ACK)
Slave Address
P_Status
AA
1B(ESC)
03(ETX)
Checksum
P_Status:
00: No errors.
AA: Photocell triggered signal ID.
3.2 Summary
Description ID(hex)
Send Print Message 01
Lock Printer 02
Unlock Printer 03
Start Print 11
Stop Print 12
Download Message Data 1C
Download Remote Field Data 1D
Load Print Message 1E
Request Message Names 1F
Set Print Mode 20
Clear Buffers of 1D 21
...... ......
Reply
1B(ESC)
06(ACK)
Slave address
P_Status
03
1B(ESC)
03(ETX)
Checksum
P_Status:
00: Unlock successfully。
FE: Printer has been unlocked before this command。
0F: Wrong user name or password。
01: One or more printer errors exist.
12: Print not started.
Command
1B(ESC)
02(STX)
Slave Address
11
1B(ESC)
03(ETX)
Checksum
Reply
1B(ESC)
06(ACK)
Slave Address
P_Status
11
1B(ESC)
03(ETX)
Checksum
P_Status:
00: Print started successfully.
01: One or more printer errors exist.
11: Print not idle. The print has been started already.
13: The editing area’s message is being edited when going to start print in grouping
mode.
Command
1B(ESC)
02(STX)
Slave Address
12
1B(ESC)
03(ETX)
Checksum
Reply
1B(ESC)
06(ACK)
Slave Address
P_Status
12
1B(ESC)
03(ETX)
Checksum
P_Status:
00: Print stopped successfully.
12: Print not started. The print has been stopped.
v571.
This command is sent to download a whole message data into printer from computer and
the message will displayed in editing area. Message data consists of the length of message data
in bytes, message name strings, the number of modules and various module data such as text
module, logo module. Compared with command 1D, this command is more flexible, allowing
more module to be downloaded, but is slower to execute. Command is less flexible but is faster.
When sending this command, using Ethernet connection or higher Baud Rate of RS232 to
achieve faster execution is recommended.
Command
1B(ESC)
02(STX)
Slave Address
1C
Length of Data 3 bytes
Number of Message Name’s bytes 1 byte
Message Name string >=1 byte
Number of Module 1 byte
Module 1
Reply
1B(ESC)
06(ACK)
Slave Address
P_Status
1C
1B(ESC)
03(ETX)
Checksum
P_Status:
00: Downloaded successfully.
0B: The number of submodules of QR code module more than 7.
15: Failed to save message file.
01: One or more printer errors exist.
12: Print not started.
C_Status:
0A: Invalid module type.
Text module 01
Reserve 02
Reserve 03
QR code module 04
Reserve 05
Reserve 06
Logo module 07
X,Y:
0XXXXXXX positive number
1XXXXXXX negative number
Rotation:
00 0°
01 90°
02 180°
03 270°
Space:
value 00 01 02 03 04 05 06 07 08 09 0A
space 30 20 10 5 2 0 -2 -5 -10 -20 -30
Font size:
X,Y:
0XXXXXXX Positive number
1XXXXXXX Negative number
Scale/10:
03~A0 (30~1600)/10
Type+Fault tolerance level:
Submodule Data:
Text submodule:
01 Text submodule
04 Number of text string’s bytes
74 65 78 74 Text string: “text”
X,Y:
0XXXXXXX Positive number
1XXXXXXX Negative number
Rotation + Inverse:
bit 7~bit 4
0 0°
1 90°
2 180°
3 270°
bit 3~ bit0
0 Normal
1 Inverse
Default: 00
Scale/10:
01~32 (10~500)/10
Load or download:
00 Loading picture file that stored in the printer according to file name,
then Width,height and Picture data is none.
01 Downloading picture file into printer’s storage and save it with file
FA 18 61 FA 18 61 F8
09 1 byte
X 2 bytes
Y 2 bytes
Rotation 1 byte
Space 1 byte
Font size 2 bytes
Number of font string’s bytes 1 byte
Font string >=1 byte
Serial number 1 byte
Leading zero 1 byte
X,Y:
0XXXXXXX Positive number
1XXXXXXX Negative number
Rotation:
00 0°
01 90°
02 180°
03 270°
Space:
value 00 01 02 03 04 05 06 07 08 09 0A
space 30 20 10 5 2 0 -2 -5 -10 -20 -30
Font size:
0005~04B0 5~1200
Serial number:
01~18 1~24Hex
Leading zero:
00 No
According to Figure 3-8, the serial number module data shows as follows:
09 ID
003C X
009E X
00 Rotation: 0°
05 Space: 0
0040 Font: 64
04 Font name string bytes:4
4C 61 74 6F Font name string: “Lato”
01 Serial number: SN 1
01 Leading zero: Yes
This command is send to the printer to populate the Remote Fields, which are already set up
in the printed message, with text characters. Printing ASCII only.
Command
1B(ESC)
02(STX)
Slave Address
1D
Number of Fields① 1 byte
Field ID_1② 1 byte
Number of Message_1 bytes③ 1 byte
Message_1 string④ >=1 byte
Field ID_2②
......
1B(ESC)
03(ETX)
Checksum
Reply
1B(ESC)
06(ACK)
Slave Address
P_Status
1D
1B(ESC)
03(ETX)
Checksum
P_Status:
00: No errors.
42: Remote buffer now full.
This command is sent to load the message which are stored in the File Storage of the printer.
The message required is identified by its message name.
Every time loads a message, using command “Send Print Message(01)” to update print
message.
Command
1B(ESC)
02(STX)
Slave Address
1E
Number of Message Name’s bytes 1 byte
Message Name string >=1 byte
1B(ESC)
03(ETX)
Checksum
Reply
1B(ESC)
06(ACK)
Slave Address
P_Status
1E
1B(ESC)
03(ETX)
Checksum
P_Status:
00: Message name exist.
10: Message name doesn’t exist.
01: One or more printer errors exist.
12: Print not started.
v633.
Request all the names of message file in Figure 3-11. If there are more than 255 message
files, return the first 255 ones.
Command
1B(ESC)
02(STX)
Slave address
20
Print Mode 1 byte
(Mode Parameters) >=0 byte
1B(ESC)
03(ETX)
Checksum
Print Mode:
00: Standard mode.
01: Continuous mode.
02: Counting mode.
Mode Parameters:
Standard mode(00):
Mode parameters = 0 byte
Continuous mode(01):
Print interval 2 bytes 0-65535
Update variables each repeat 1 byte 00:No, 01:Yes
Last message print all 1 byte 00:No, 01:Yes
Counting Mode(01):
Print interval 2 bytes 0-65535
Update variables each repeat 1 byte 00:No, 01:Yes
Last message print all 1 byte 00:No, 01:Yes
Use product end 1 byte 00:No, 01:Yes
Print count 2 byte 0-65535
V644.
This command is to clear the buffers of Remote Field Data(1D). It equals clicking the ‘clear’
button on Figure 3-10.
Command
1B(ESC)
02(STX)
Slave address
21
1B(ESC)
03(ETX)
Checksum
Reply
1B(ESC)
06(ACK)
Slave address
P_Status
21
1B(ESC)
03(ETX)
Checksum
P_Status:
4.1.1 Summary
Description Code(hex)
Invalid command start 06
Invalid command end 07
Invalid checksum 08
Invalid number of field 09
Invalid module type 0A
Invalid command ID 11
Invalid print mode 3C
...... .....
4.1.2 Description
4.2.1 Summary
Description Code(hex)
Printer errors exist 01
Number of QR code’s submodule 0B
Too few fields 0E
Account 0F
Message name doesn’t exist 10
Print not idle 11
Print not started 12
Grouping mode 13
Print interval 14
Failed to save message 15
Buffer now full 42
Buffer still full 43
Service expired FD
Printer unlocked FE
Printer locked FF
...... ......
4.2.2 Description
Printer errors(01)
The printer went wrong.
Number of QR code’s submodule(0B)
The number of QR code’s submodule was more than 7.
Too few fields(0E)
Number of Fields in the command is less than the number of field set in the printer.
Account/Password(0F)
Wrong user name or password.
Message name doesn’t exist(10)
Load Print Message failed, message name doesn’t exist.
Print not idle(11)
Print is in progress.
Print not started(12)
Print is idle.
Grouping mode(13)
Command is not valid while current print mode is ”Grouping mode”.
Print interval(14)