Epson TM-T20II-i ePOS-Device XML Users Manual For TM-i firmware v4.1
Epson TM-T20II-i Manual
View all Epson TM-T20II-i manuals
Add to My Manuals
Save this manual to your list of manuals |
Epson TM-T20II-i manual content summary:
- Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 1
ePOS-Device XML User's Manual Overview Describes the features and development environment. Building Environment Describes environment building for ePOS-Device Service I/F. Programming Guide Describes how to write programs in Web application development. ePOS-Device XML Describes the ePOS-Device XML. - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 2
with Seiko Epson Corporation's operating and maintenance instructions. • Seiko Epson Corporation shall not be liable against any damages or problems arising from only. ESC/POS® Proprietary Command System Epson took the initiative by introducing ESC/POS, a proprietary POS printer command system, - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 3
For Safety Key to Symbols The symbols in this manual are identified by their level of importance, as defined below. Read the following carefully before handling the product. Provides information that must be observed to - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 4
printers. • TM-T20II-i • TM-T82II-i • TM-T83II-i • TM-T70-i (TM-i firmware Ver.4.0 or later) • TM-T88V-i (TM-i firmware Ver.4.0 or later) • TM-U220-i Manual Content The manual is made up of the following sections: Chapter 1 Overview Chapter 2 Building Environment Chapter 3 Programming Guide - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 5
Environment ...21 Application Environment ...21 Application Terminal ...21 TM-Intelligent ...21 ePOS-Device Service Versions...21 TM Printer ...22 Customer Display...23 Peripheral Device ...23 ■ Contents in the Package 24 Manual...24 Sample Program ...24 Download ...24 ■ Restrictions ...25 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 6
Guide 33 ■ Programming Flow ...33 If Reconnecting to the TM-Intelligent when the Network was Cut Off 34 Programming flow for the Communication Box 35 ■ Using the Spooler Function 38 ■ Service Interface type> ...72 ■ Message Data for Printers 73 print ...73 onxmlresult ...74 Print - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 7
...80 micrread ...81 micrcleaning ...82 micrcancel ...82 eject ...82 onreceive ...83 ■ Printer Control XML ...85 ...85 ...87 ...90 ...96 ...98 ...100 ...101 ...105 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 8
for the POS Keyboard 140 That Can Run with a HID Driver 153 onDeviceData event (Serial Communication Device Installing ADT Plugin...170 Importing the Sample Program ...174 Setting the Barcode Scanner...176 ■ Building Environment for iOS 177 Environment ...177 Flow of environment construction for TM - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 9
■ Printer specifications...191 TM-H6000IV-DT/ TM-H6000IV ...191 TM-L90 ...193 TM-P20...195 TM-P60II/ TM-P60II with Peeler...197 TM-P80...199 TM-T20 ...200 TM-T20II-i/ TM-T20II ...201 TM-T70-i/ TM-T70 ...203 TM-T70II-DT/ TM-T70II ...204 TM-T82II-i/ TM-T82II ...205 TM-T83II-i/ TM-T83II ...207 TM-T88IV - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 10
10 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 11
product's printer) connected to TM-Intelligent using XML. Application in devices such as personal computers, smartphones, and tablet computers creates a request message in XML format and send it to TM-Intelligent using socket communication. ePOS-Device Service installed in TM-Intelligent executes - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 12
the printer sends an error response (PAPER END, COVER OPEN, etc.) or does not return a response. (Print forwarding) *3 For details, refer to Forwarding(p.20). ❏ You can shut down the TM-DT from the application. *1 (DeviceHubTerminal object) *1 TM-DT series is supported only. *2 TM-DT software Ver - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 13
Application Installed in Tablet Computer Chapter 1 Overview 1 1 Place and display the application in the tablet computer. 2 The application sends a request message to TM-Intelligent. 3 TM-Intelligent sends data to devices that can be controlled. 4 The devices and network printers connected to TM - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 14
Service is providing a virtual space and structure for sending and receiving data between applications. Create the data to be sent and received according to your application's specifications. App1 App2 The Communication Box can be used in the following ways. Using a tablet terminal as a POS - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 15
using the Communication Box Chapter 1 Overview App1 1 App2 1 The TM-Intelligent receives the barcode data scanned by the scanner. 2 The ePOS-Device Service I/F notifies App2 of the barcode data. 3 App2 acquires the barcode data and converts it to POS data. 4 App2 sends the display data to the - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 16
-App1 -App2 -App1 -App2 App2 The ePOS-Device Service I/F manages Communication Boxes with Box IDs (BoxID in the figure above). Data can be history that one Communication Box can maintain Size of data that can be sent at one time 20 20 10240 Byte 1024 Byte 16 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 17
Application A response containing the specified print job ID will be returned when sending a request from the application by specifying the print job ID. (ePOS-Device Service Ver. 2.6 or later versions) Job ID : ABC123 Print data Job ID : ABC123 Response data 1 17 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 18
in the response data to send an inquiry on the printing status. EPSON TMNet WebConfig is used to configure the spooler. Perform the following settings. For details, refer to the Technical Reference Guide for each TM-Intelligent printer. Settings to enable the spooler Print process retry settings - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 19
Intelligent will retrieve the print data B and issue a print command to printer A. 7 Print data A is complete. 8 A query on print data A results will be sent to the TM-Intelligent from the input terminal. 1 9 The TM-Intelligent will return response data back to the input terminal signifying that - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 20
EPSON TMNet WebConfig is used to configure forwarding settings. For details, refer to the Technical Reference Guide for each TM-Intelligent Printer. 1 Send print data to ePOS-Device Service I/F from the input terminal. 2 The TM - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 21
TM-H6000IV-DT ❏ TM-T70II-DT ❏ TM-T88V-DT TM-i Series ❏ TM-T20II-i ❏ TM-T70-i (TM-i firmware Ver.4.0 or later) ❏ TM-T83II-i ❏ TM-T82II-i ❏ TM-T88V-i (TM-i firmware Ver.4.0 or later) ❏ TM-U220-i ePOS-Device Service Versions The versions of the ePOS-Device service support the following TM-DT Software - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 22
Ver.4.0 or later) TM-T88V *1 TM-T90 *1 TM-U220-i TM-U220 *1 TM-DT Series 3 3 ✔ ✔ *3 3 ✔ ✔ ✔ *1 Ethernet model (UB-E02/ UB-E03), or wireless LAN model (UB-R03/ UB-R04). Other interface models are not supported. *2 TM-i firmware Ver.4.1 or later versions supported. *3 TM-DT software Ver.3.0 or - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 23
device USB device that can provide a control level equivalent to serial communication devices * TM-DT Series ✔ TM-i Series - * Will require separate installation of a serial-USB conversion driver. Serial-USB conversion drivers with certain specifications may not be usable. With the - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 24
with TM-DT. It is not used with the TM-i Series. Download For customers in North America, go to the following web site: http://www.epsonexpert.com/ and follow the on-screen instructions. For customers in other countries, go to the following web site: https://download.epson-biz.com/?service=pos 24 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 25
the printer supports the "ruled line command". ❏ The drawer and the buzzer cannot be used together. ❏ The buzzer function cannot be used if the printer is be registered in a TM-i Series printer. ❏ Serial communication devices cannot be used with a TM-i Series printer with the specification of - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 26
26 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 27
. For details, refer to the Technical Reference Guide for each TM-DT printer. 4. Registration of Device (p.29) Register the device to be connected into TM-DT. Make registration using a Web browser. Necessary step Optional step * TM-DT software Ver.2.5 or later, TM-i firmware Ver.4.3 or later 27 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 28
Easy Kitting When using HTTPS * communication, you can use EPSON TMNet WebConfig to make the SSL settings. 3.Registration of Device (p.29) Register the device to be connected into TM-i. Make registration using a Web browser. * TM-DT software Ver.2.5 or later, TM-i firmware Ver.4.3 or later 28 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 29
to the TM-DT printer. Printer Setting Setting Value Device ID Type Model no. Enter the ID (any character string) of the printer to be controlled. Select "Network printer". Select the model of the printer to be controlled. 2 IP Address Retry interval Specify the IP address of the printer for - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 30
Serial communications Setting Device ID Device name Control script Communication speed(bps) Data bit Parity Stop bit Flow control Other Setting Value Enter the device ID (any character string). Select the device name of the serial communication device. The name can be selected from the product - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 31
connected to the TM-i printer. Printer Setting Device ID Model IP Address Retry interval(ms) Customer Display Setting Value Enter the ID (any character string) of the printer to be controlled. Select the model of the printer to be controlled. Specify the IP address of the printer for each device - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 32
32 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 33
XML is as follows: Applications ePOS-Device 1 : Establishment of TCP/IP connection() TCP connection to Socket I/F from the native application 2 : connect message() Establish a communication path to ePOS-Device Service I/F Device 3 : open_device message(type_printer) 3.1 : Cmd() 4.1 : Response - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 34
If network communication with the TM-Intelligent is cut off, the -Device Device 1 : Establishment of TCP/IP connection() TCP connection to Socket I/F from message(client_id=0001) Establish a communication path to ePOS-Device Service I/F 3 : open_device message(buffer=true) Response(data_id=1) 4.1 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 35
Guide Programming flow for the Communication Box The following indicates the basic programming sequence using the Communication Box. Application A ePOS-Device Application B [1/2] 1 : Establishment of TCP/IP -Device Service I/F 3 : open_commbox message 1 : Establishment of TCP/IP connection() - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 36
5.1 : Deletes Application A from members [2/2] 5.3 : Response() 5 : close_commbox message 5.1 : Deletes Application B from members 5.2 : Ends the Communication Box 6 : disconnect message() Disconnection of TCP/IP connection 5.3 : Response() 6 : disconnect message() Disconnection of TCP - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 37
Guide If automatically reconnecting the network If network communication with the TM-Intelligent was reconnected, the Communication Box sequence is as follows. Application A ePOS-Device Application B 1 : Establishment of TCP/IP Service I/F 3 : open_commbox message() 1 : Establishment of TCP/IP - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 38
the application when the spooler function is enabled. Even if the output printer cannot complete the printing task, ePOS-Device Service I/F does not return an error to the application. Printing on a substitute printer can be done by enabling print forwarding. The application can obtain printing - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 39
Chapter 3 Programming Guide Service Interface Specifications To enable control using ePOS-Device XML, use the following interface: Transport layer TCP Port No. 8009 Format The format and description of each data item are as follows: Communication message Terminating character Any length 1 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 40
and ePOS-Device are as shown below, where the NULL character is indicated as "\0". Applications Establishment of TCP/IP connection "\0" keyboard01 type_keyboard true "\0" ePOS - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 41
Chapter 3 Programming Guide Applications keyboard01 setprefix 49 50 51 "\0" ePOS-Device Description - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 42
Applications keyboard01 "\0" sock3514555411 ePOS-Device Description Device close keyboard01 OK 5 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 43
Chapter 3 Programming Guide Communication Box Message Example Application A Opens the Communication Box 1 box1 member1 "\0" ePOS-Device 1 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 44
Application A ePOS-Device Forwards data to the Communication Box 2 send box1 send_message "\0" 2 onreceive box1 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 45
>3 box1 OK 4 "\0" Chapter 3 Programming Guide Application B 2 getcommhistory box1 "\0" 3 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 46
Array of elements in message The following programming method is used to describe an array in the tag: ❏ Specify the attribute array="true" at the beginning of the element to be used for the array. ❏ After that, specify a value with the same element name. Example: To - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 47
> Re-establish communication route with 52 the ePOS-Device Service I/F Cut off communication route with 53 ePOS-Device Service I/F Administrator information Acquires administrator and installation 54 location information Opens the Communication Box - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 48
be used are listed in the chart below. (in ePOS-Device Service Ver.2.5 and later) Value for element getcommhistory send onreceive Description can be used with each TM intelligent printer are as in the table below. Device type Device Hub Terminal Barcode Scanner Printer Value for - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 49
> Print data and setting data ✔ to receipt printers - 78 onxmlresult Data from receipt printers ✔ - 78 slipprint Print data and setting data ✔ to slip printers - 79 slipcancel Cancels the paper insert ✔ wait status during slip printing - 79 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 50
the serial device TM-DT Series ✔ ✔ ✔ ✔ ✔ ✔ ✔ TM-i Series ✔ ✔ ✔ ✔ ✔ ✔ ✔ Page 140 141 142 143 144 145 146 *1 ePOS-Device Service Ver. 2.5 or later versions supported. *2 ePOS-Device Service Ver. 3.0 or later versions supported. *3 Serial devices cannot be used with a TM-i Series printer with the - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 51
message. ❏ data Sub-element client_id protocol_version Data type string string Description ID of the connected client Version of the connected TM-Intelligent ❏ Example 4 1234567890 2.0 51 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 52
Notifies the confirmation of reconnection for network communication with the TM-Intelligent. Request Requests confirmation of reconnection to the TM-Intelligent. Sub-element Data type old_client_id string new_client_id string received_id int Description Specifies the - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 53
Chapter 4 ePOS-Device XML Closes the TCP connection with the TM-Intelligent. Request Requests that the TM-Intelligent close the connection. Sub-element Data type data string Description Client information to close the connection. For details, refer to the data below. ❏ data - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 54
in the TM-Intelligent. The information is set with EPSON TMNet WebConfig. Request Requests the administrator information from the TM-Intelligent. ❏ location Data type string string Description Administrator information Installation location information Character strings in received data Escape - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 55
❏ Example Normal OK Administrator A Counter1&Counter2 Error "PARAM_ERROR" Chapter 4 ePOS-Device XML 4 55 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 56
Opens the Communication Box and enables communication between applications. (in ePOS-Device Service Ver.2.5 and later) Request Requests opening of the Communication Box. Sub-element sequence data Data type string string Description Sequence number Information of the - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 57
Chapter 4 ePOS-Device XML Response Returns the Communication Box open result to the application. Sub-element sequence data Data type string string data_id string Description The sequence number designated with the request. Information of the Communication Box open result. For details, refer - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 58
Closes the Communication Box. (in ePOS-Device Service Ver.2.5 and later) Request Requests closing of the Communication Box. Sub-element sequence data Data type string string Description Sequence number Information of the Communication - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 59
Chapter 4 ePOS-Device XML Performs data communication between applications using the Communication Box. (in ePOS-Device Service Ver.2.5 and later) Request Communicates with the Communication Box. Sub-element sequence data Data type string string Description Sequence number - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 60
string data string Description The device ID designated with EPSON TMNet WebConfig. The customer display is "local_display". For Service Ver. 2.5 or later versions supported With TM-i, the following devices are not supported: "type_dt" "type_hybrid_printer" A TM-i Series printer - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 61
Chapter 4 ePOS-Device XML Response Returns the device open result to the application. Sub-element device_id code Data type string string data_id int Description The device ID designated with the request. The processing result. For details, refer to the code below. If "true" is designated for - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 62
Closes the opened device. Request Designates the device to close. Sub-element Data type device_id string Description The device ID designated with EPSON TMNet WebConfig. The customer display is "local_display". ❏ Example local_display 62 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 63
Chapter 4 ePOS-Device XML Response Returns the device close result to the application. Sub-element device_id code Data type string string data_id int Description The device ID designated with the request. The processing result. For details, refer to the code below. If "true" is designated for - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 64
Request Sends data to a device. Includes device control commands and print / display data. Sub-element Data type sequence string device_id data string string Description An arbitrary value to specify request messages during sending errors. If you designate a request message, it - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 65
device control message. Displays the error that occurred using a code. For details, refer to the following. The details of errors based on the driver are designated when a "DRIVER_ERROR" occurs. If "true" is designated for of the message, the sent data ID is set. If "false - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 66
transmission history of the communication box. For details, refer to the history_list below. * ePOS-Device Service Ver. 3.0 or later versions supported. ❏ history_list Element value "true" / "1" "false" / "0" ❏ Example Description Acquires the entire transmission history of the communication - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 67
Chapter 4 ePOS-Device XML Response Returns the transfer history of the Communication Box. Sub-element box_id code history_list Data type string string string Description Identifier of the Communication Box whose transfer history was acquired Result of the sent data. For details, refer to the - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 68
send Forwards data to the Communication Box. Request Forwards messages to the Communication Box. Sub-element box_id message member_id Data type string string string Description Identifier of the Communication Box to forward the message to. Message to forward. Member ID to forward. - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 69
Chapter 4 ePOS-Device XML onreceive Acquires the data forwarded to the Communication Box. Response Returns the message transfer result. Sub-element box_id Data type string sender_id receiver_id string string message string Description Identifier of the Communication Box that - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 70
Data for Device Hub Terminal • Cannot be used with TM-i Series. • Available with ePOS-Device Service Ver.2.5 or later. • If sending this message data, use EPSON TMNet WebConfig to perform shutdown settings for the TM-DT. ([Settings]-[System settings]-[Shutdown settings]-[ePOS-Device]) - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 71
local_dt restart epson onrestart ePOS-Device Service Ver.3.0 or later versions supported. 4 Response Returns the restart results of the device hub terminal (TM-DT) to the application. Sub-element Data type - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 72
Message Data for the Barcode Scanner ondata Response Returns the scan data from the barcode scanner to the application. Sub-element Data type input string Description Scan data string received. Character strings in received data Escape processing is performed for the following - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 73
75). Designates the data to print. For details, refer to Printer Control XML (p.85). * ePOS-Device Service Ver. 2.6 or later versions supported ❏ Example 4 print 10000 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 74
(p.17). For a programming example, refer to Print Job ID (p.75). Result of the sent data. For details, refer to (p.87). * ePOS-Device Service Ver. 2.6 or later versions supported ❏ Example onxmlresult 74 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 75
local_printer print 123 60000 Empty print data is sent when requesting the acquisition of - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 76
type>onxmlresult 123 • The TM intelligent printer will issue a print job ID if the print job ID is - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 77
4 ePOS-Device XML Message Data for Hybrid Printers • Cannot be used with TM-i Series. • Available with ePOS-Device Service Ver.2.5 or later. lock - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 78
print Request Sends the print data and setting data to the receipt printer. Sub-element Data type timeout int printdata string Description Sets the time out limit for requests in milliseconds. 1,000 to 60,000 (whole numbers) Designates - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 79
XML slipprint Request Sends the print data and setting data to the slip printer. Sub-element Data type timeout int printdata string Description Specifies the timeout time (ms) for the paper insert wait status. 60,000 to 900,000 (whole numbers) Designates the data to print - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 80
details, refer to the 40cplmode below. Specifies the timeout time (ms) for the paper insert wait status. 60,000 to 900,000 (whole numbers) Designates the data to print. For details, refer to Printer Control XML (p.85). ❏ 40cplmode true false Element value ❏ Example Description Enables the 40cpl - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 81
the ignoreerror below. Specifies the MICR font to read. For details, refer to the font below. Specifies the timeout time (ms) for the paper insert wait status. 60,000 to 900,000 (whole numbers) ❏ ignoreerror Element value true false ❏ font Description Replaces unreadable characters with '?' and - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 82
cleaning sheet to clean the MICR mechanism. Sub-element Data type timeout int Description Specifies the timeout time (ms) for the paper insert wait status. 60,000 to 900,000 (whole numbers) ❏ Example local_printer micrcleaning - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 83
) An autocutter error occurred A mechanical error occurred No paper in roll paper end sensor An unrecoverable error occurred (During receipt printing only) The request document contains a syntax error (During receipt printing only) The printer with the specified device ID does not exist (During - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 84
port Cancels the paper insert wait status Paper insert wait timeout Parameter error The endorse printer is not installed There is an TM printer Printing is successfully completed Status of the 3rd pin of the drawer kick-out connector = "H" Offline The cover is open Paper is being fed by a paper - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 85
Find the namespace below. http://www.epson-pos.com/schemas/2011/03/epos-print ❏ force This is the forced transmission mode. (in ePOS-Device Service Ver.2.2 and later) If you enable forced transmission mode, print commands are forcibly sent to the printer. Attribute value Description true or - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 86
Sounds a buzzer ● * Inserts a command Setting of paper layout ● ● * Recovers from an error ● * Resets the printer ● * ePOS-Device Service Ver. 2.2 or later versions supported ❏ Example ● 90 ● 96 ● 98 ● 100 ● 101 ● 105 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 87
function is enabled) * * ePOS-Device Service Ver. 2.6 or later versions supported ❏ code Obtains the error code. paper in roll paper end sensor 4 "EPTR_UNRECOVERABLE" An unrecoverable error occurred "SchemaError" The request document contains a syntax error "DeviceNotFound" The printer - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 88
An automatically recoverable error occurred No paper in roll paper near end sensor No paper in roll paper end sensor A buzzer is on (only for applicable devices) The spooler has stopped * ePOS-Device Service Ver. 2.6 or later versions supported ❏ battery Depending on the battery situation - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 89
status --> - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 90
text, to print content other than text content, execute line feed or paper feed. In page mode, characters are laid out in the current print position being the character baseline dot (Printer specifications (p.191)). Entity Reference To write symbols required for printer control such as horizontal tab, - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 91
Receipt/ Label printing Slip printing Endorse printing Endorse printing 40cpl mode Attribute Description Page lang Language ● ● ▲ ▲ 92 font Character font ● ● ● ▲ 93 smooth smoothing ● ▲ ▲ ▲ 93 dw Double-sized ● ● ● ● 95 Per-line paper feed amount ● ● ● ▲ 95 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 92
lang : Specifies the target language. Attribute value en (default) de fr it es ja ja-jp ko ko-kr Device Service Ver. 2.2 or later versions supported Characters not installed in a printer cannot be printed. For printable character code, refer to the Technical Reference Guide of your printer. - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 93
scale specification for the height attribute. width : Specifies the horizontal scale. Attribute value Integer from "1" to "8" (default : "1") Horizontal scale Description When the double-sized width attribute and the width attribute are specified in one element at the same time, priority is - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 94
Attribute value Integer from "1" to "8" (default : "1") Vertical scale Description When the double-sized height attribute and the height attribute are only will be moved. (Default : 21) Specifies the vertical print start position of the text in dots. (in ePOS-Device Service Ver.2.2 and later) - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 95
also applies to the rotate attribute in each of the barcode and symbol elements. linespc : (Default : Differ according to each model. Refer to "Printer specifications".) Specifies the per-line paper feed amount in dots. Example 4 To print a character string based on the following settings - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 96
paper feed amount ● ● ● ● 96 Paper feed position of label paper/black mark paper ● ▲ ▲ ▲ 96 Attribute unit : line : linespc : pos : Specifies the paper feed amount in dots. Specifies the paper feed amount in lines. (Default : Differ according to each model. Refer to "Printer - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 97
4 ePOS-Device XML Example Hello World - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 98
of 8 that does not exceed the printer paper width for the width attribute value. • Page mode does not support printing in multiple tones. Multiple tone graphics Specifies the character color. Attribute value "none" "color_1" (default) "color_2" "color_3" "color_4" Description Characters are not - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 99
attribute in each of the text, logo, barcode, and symbol elements. mode : (Optional attribute) Specifies the color mode. Attribute value "mono" (default) "gray16" Description Monochrome (two-tone) Multiple tones (16-tone) Example - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 100
printer. Page mode does not support printing in multiple tones. Multiple tone graphics can only be printed in standard mode. • Using model-dedicated utility or logo registration utility (TMFLogo), register a logo in the printer . Attribute value "left" (default) "center" "right" Description - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 101
xs:string) • A barcode will not be printed if settings not compliant with the barcode standard are made, or if the barcode becomes larger than the printer's print area. And an error response will not be returned, either. • In page mode, a barcode is laid out in the current print position with the - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 102
Barcode type CODE128 GS1-128 GS1 DataBar Omnidirectional GS1 DataBar Truncated GS1 DataBar Limited GS1 DataBar Expanded Barcode data specification procedure Specify a start character (CODE A, CODE B, CODE C). A stop character is automatically added. A check digit is automatically calculated and - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 103
" GS1 DataBar Truncated GS1 DataBar Limited 4 "gs1_databar_expanded" GS1 DataBar Expanded hri : Specifies the HRI position. Attribute value "none" (default) "above" "below" "both" Description HRI not printed Above the barcode Below the barcode Both above and below the barcode font - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 104
, image, logo, and symbol elements. rotate : (data type xs:boolean) Specifies the rotate printing. Attribute value "true" or "1" "false" or "0" (default) Description Specifies rotated printing of text. Cancels rotated printing of text. The rotate attribute set in this element also applies to - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 105
-code will not be printed if settings not compliant with the 2D-code standard are made, or if the 2D-code becomes larger than the printer's print area. And an error response will not be returned, either. • In standard mode, a more than 831 dot high 2D-code cannot be printed. • In - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 106
In Mode 3 Postal code (1 to 6 pieces of data convertible by Code Set A) GS:(\x1d) ISO country code (1- to 3-digit number) GS:(\x1d) Service class code (1- to 3-digit number) Convert the character string to the string in UTF-8, apply the escape sequence, and then encode the string. Specify - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 107
" *1 DataMatrix ECC200 rectangle, 8 lines "datamatrix_rectangle_12" *1 DataMatrix ECC200 rectangle, 12 lines "datamatrix_rectangle_16" *1 DataMatrix ECC200 rectangle, 16 lines *1 ePOS-Device Service Ver. 2.2 or later versions supported 4 *2 ePOS-Device Service Ver. 2.6 or later versions - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 108
Q QR Code error correction level H Aztec Code error correction level (Default : 23) Default level * ePOS-Device Service Ver. 2.2 or later versions supported • Select the level according to the 2D-code type. • Select the default for MaxiCode and two-dimensional GS1 DataBar. • Micro QR Code does - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 109
: 2D-Code PDF417 QR Code MaxiCode 2-dimentional GS1 DataBar (Expanded Stacked) (Others) Aztec Code DataMatrix size="0" Default Ignored size="0" (auto) Ignored Ignored Description Specifies the number of code words for each row Specifies the maximum width for the barcode (106 or above) align - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 110
the draw end position of the horizontal line (in dots). style : (Optional attribute) Specifies the line type. Attribute value "thin"(default) "medium" "thick" "thin_double" "medium_double" "thick_double" Solid line: Thin Solid line: Medium Solid line: Thick Double line: Thin Double line - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 111
) Specifies the start position of the horizontal line (in dots). (Optional attribute) Specifies the line type. Attribute value "thin"(default) "medium" "thick" "thin_double" "medium_double" "thick_double" Solid line: Thin Solid line: Medium Solid line: Thick Double line: Thin Double line - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 112
attribute) Specifies the end position of the horizontal line (in dots). (Optional attribute) Specifies the line type. Attribute value "thin"(default) "medium" "thick" "thin_double" "medium_double" "thick_double" Solid line: Thin Solid line: Medium Solid line: Thick Double line: Thin Double line - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 113
following elements can be used. Element Prints text Paper feed Prints a raster image Prints a NV logo Prints a barcode Prints a 2D-code Sets a print area Sets a print direction Sets a print - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 114
area. Absolute origin point Origin point(x, y) Width Height Print area Paper Specify the print area according to the print content. If print data area (in dots). (Required attribute, Default :Differ according to each model. Refer to "Printer specifications".) Specifies the height of the - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 115
area moves. Use this element inside the page element. Attribute dir : (Required attribute) Specifies the rotation direction. Attribute value "left_to_right" (default) Description Left to right (No rotation.Data is printed from the top left corner to the right.) "bottom_to_top" Bottom to - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 116
(Required attribute, Default "0") Specifies the origin of the horizontal axis (in dots). (Required attribute, Default "21") Specifies the . This can be omitted for left-aligned printing of standard-sized characters. To print double-sized height characters, specify a value equal to or greater than - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 117
drawing end position of the vertical line (in dots). (Optional attribute) Specifies the line type. Attribute value Description "thin" (default) Solid line: Thin "medium" Solid line: Medium 4 "thick" Solid line: Thick "thin_double" Double line: Thin "medium_double" Double line: Medium - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 118
) Specifies the drawing end position of the vertical line (in dots). (Optional attribute) Specifies the line type. Attribute value "thin" (default) "medium" "thick" "thin_double" "medium_double" "thick_double" Solid line: Thin Solid line: Medium Solid line: Thick Double line: Thin Double line - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 119
to "when at the top of a line". Attribute type : (Optional attribute) Specifies the paper cut type. Attribute value "no_feed" "feed" (default) "reserve" Description Cut without feeding (The paper is cut without being fed.) Feed cut (The paper is fed to the cut position and then is cut.) Cut - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 120
5 of the drawer kick-out connector time : (Optional attribute) Specifies the ON time of the drawer kick signal. Attribute value "pulse_100" (default) "pulse_200" "pulse_300" "pulse_400" "pulse_500" 100 ms 200 ms 300 ms 400 ms 500 ms Description Example - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 121
• This element is not available if the printer is not provided with the buzzer. Attribute Buzzer) "paper_end" Pattern when there is no paper (Optional Buzzer) "pattern_1" * Pattern 1 ePOS-Device Service Ver. 2.2 or later versions supported repeat : (Optional attribut, Default: "1") - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 122
cycle : (in ePOS-Device Service Ver.2.2 and later) Specifies the buzzer sounding cycle (in units of milliseconds) "cycle" is enabled by any of "pattern_1" to "pattern_10" for the buzzer pattern. - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 123
Chapter 4 ePOS-Device XML Insert the ESC / POS command. ESC / POS command is specified in hexadecimal encoding. Refer to the following URL for details of the ESC/POS command. https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=2 4 123 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 124
It specifies paper layout. (in ePOS-Device Service Ver.2.2 and later) Cannot be written in the tag. Attribute type : Specifies the paper type. Attribute value "receipt" (default) "receipt_bm" "label" "label_bm" Description Receipt (without black mark) Receipt (with black mark) - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 125
black mark to the cutting position offset-label : Specifies label bottom position (sd) per 0.1 mm unit. Paper Type Valid value range Description 4 Receipt "0" (without black mark) Receipt (with black mark) "0" Setup not necessary Die-cut label "0" (without black mark) Die-cut label - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 126
See below for the parameters that can be specified for each type of paper, and the positions for those parameters. Mark sf sa sb se sc sd Parameter width height margin_top margin_bottom offset_cut offset_label sf Receipt Top position Cut sf sb sc sa Top - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 127
) to use this element. Example Resets the printer. (in ePOS-Device Service Ver.2.2 and later) Cannot be written in the tag. Other printing commands in the print document are ignored. 4 Example - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 128
Message Data for the Customer Display For the display data, refer to Customer Display Control XML (p.130). display Request Sends the display data and setting data to the customer display. Sub-element Data type timeout int displaydata string Description Sets the time out limit - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 129
Chapter 4 ePOS-Device XML onxmlresult Response Returns the result of sending to the customer display to the application. Sub-element Data type resultdata string Description Receives the response from the data sent to the customer display. For details, refer to (p.131). - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 130
for controlling the customer display. Attribute ❏ xmlns We're announcing the epos-display namespace. Find the namespace below. http://www.epson-pos.com/schemas/2012/09/epos-display Sub-element Sub-element - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 131
Chapter 4 ePOS-Device XML This is the XML document that returns from the customer display to the application. Attribute ❏ success Acquires the display result. Attribute value "true" or "1" "false" or "0" Successfully displayed Failed to display Description ❏ code Acquires the - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 132
is created. When defining the window, define it so that it does not overlap with an already defined window. Specify the size to fit in the customer display size (20 digits x 2 rows). ❏ If "true" is designated for attribute number destroy, the designated window is deleted. ❏ If an attribute that - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 133
at the right end. ❏ destroy Designates whether to delete the window designated with number. Attribute value "true" or "1" "false" or "0" (Default) Description Executes deletion Does not execute deletion Error conditions 4 The following values are returned in the event of an error. Error - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 134
text display (1 to 2) in a whole number ❏ reverse Designates whether to shade displayed characters Attribute value "true" or "1" "false" or "0" (Default) Description Performs shading Does not perform shading ❏ lang Designates the language of displayed text. If omitted, the current settings - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 135
Chapter 4 ePOS-Device XML Controls the cursor location and display settings. ❏ Designates the cursor coordinates in the customer display using the x, y designations. ❏ Designates the cursor location in the current window using the moveto designation. ❏ If x and y and moveto are - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 136
Controls screen blinking. Blinking is repeated at the interval designated by interval. The actual blinking interval is rounded up in 50 ms units. For example, if interval is 1 to 50, the actual interval is 50 ms, if 51 to 100, then 100 ms. Attribute ❏ interval Designates the interval - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 137
Controls the customer display brightness. Attribute ❏ value Designate brightness in percentage. Attribute value "20" "40" "60" "100" Brightness 20% Brightness 40% Brightness 60% Brightness 100% ❏ Example - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 138
rwait, and then displays the character string again from the start. Attribute ❏ format Designates the display pattern for the marquee. Attribute value "walk" (Default) "place" Description Displays the string from the right end of the window. Displays the string from the left end of the window - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 139
corner of the customer display screen. The local time managed by the TM-Intelligent's OS is displayed. ❏ Example Clears default conditions. ❏ Example Executes any ESC/POS command. Designate a command with a hexadecimal character string. For details on ESC/POS - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 140
to the application. Sub-element Data type keycode int ascii string Description Receives the key code decimals input with the POS keyboard. For key code details, refer to the List of KeyCode (p.189) Receives the characters created by key codes. Characters converted into symbols and capital - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 141
key code to determine the start of character strings to detect input from the POS keyboard. If a key code designated by this message is input, the as the onstring message. This is used, for example, when using the POS keyboard for barcode alternate input. To stop the onstring message, send a - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 142
onstring Response Returns the input data from the POS keyboard to the application. Notifies you that input from one of the key codes designated with setprefix to Enter is detected. The detected key code - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 143
Chapter 4 ePOS-Device XML setMSRPrefix Specifies the key code to determine the card information reception with a keyboard with an MSR. If the key code specified by this message was input, the character strings of the card information received from there will be notified as an ondata - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 144
track2 Expiration date of JIS1 track2 Surname First name Middle name/initial Title Service code Desired data of JIS1track1 Desired data of JIS1track2 Character strings in received ❏ Example B4205296141577006^EPSON/TARO ^160410100000 00573000000 9999296999977006 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 145
Chapter 4 ePOS-Device XML Message Data for the Serial Device This message data cannot be used with a TM-i Series printer with the specification of "without a Serial port". sendcommand Request Sends commands to the serial device. Sub-element Data type command string ❏ Example - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 146
oncommandreply Response data from the device may be sent split up. If so, oncommandreply events will occur multiple times. Use the oncommandreply events to check that the whole of the response data has been received. If there is data still to be received, wait for it to arrive before - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 147
ClientConnection 5 Device When "open_device" message (p.60) is sent, an object is created so that the ePOS- Device Service I/F on TM-DT can use the device control script supported by the requested device. The device can be controlled with the created object. Device Control Script Object The - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 148
Object type :String) Set value group_hid group_serial group_other Description Specify this to use an input device that can run with an HID driver. Specify this to use a serial communication device. Specify this to use other device. ❏ The "onDeviceData" method is provided to receive data generated - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 149
Chapter 5 Device Control Script Configuration Example of Device Control Script exports.Keyboard_Generic = Keyboard_Generic; function Keyboard_Generic(clientConn, deviceConn){ this.DEVICE_TYPE = 'type_keyboard'; this.DEVICE_GROUP = 'group_hid'; this.clientConn = clientConn; this.deviceConn = - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 150
. Page 152 Device Control Script Name object Element Event API onDeviceData onDeviceData Any event Description Key input receipt event Data receipt event from a serial communication device API execution result receipt event of a device object that runs with a browser Page 153 153 154 150 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 151
Chapter 5 Device Control Script ClientConnection Object The object passed to the first parameter of the constructor of the device control script. send Sends data to a device object that can run with a browser. Syntax send(event, data); Parameter event data :Object type : (String) - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 152
the device control script. send Sends data to a serial communication device. No data is sent when an input device that can run with an HID driver is used. Syntax send(data); Parameter data :Object type : (Buffer) Specifies the data to be sent to the device. 152 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 153
Chapter 5 Device Control Script Device Control Script Name Object onDeviceData event (Input Device That Can Run with a HID Driver) The event used to receive the data detected from a key input device. For the device control script for a key input device, describe an event in - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 154
Any event The event used to receive the API execution results of the device object that can run with a browser. Syntax Name specified with callEvent(data); Parameter data :Object type : (Object) Receives the object specified with callEvent of the device object. 154 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 155
6 Sample Program Sample Program This chapter describes the sample program. A sample program for an Android/ iOS environment is provided in the ePOS-Device XML. Outline The sample program provides the function to scan data with the barcode scanner and print this data. 6 155 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 156
Building Environment for Android Environment Device ❏ TM-Intelligent TM-DT Series TM-i Series (TM-i firmware Ver.4.0 or later) ❏ Barcode Scanner Execution environment This section explains the following environments. Information such as the webpage URLs and versions of files to - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 157
for TM-DT Series The following illustrates the flow of constructing the environment for the sample program. If the Windows Security screen appears while using EPSON TMNet WebConfig, enter your user name and password. The default values are as follows: User name : epson Password : epson 1. Installing - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 158
7. Connection of barcode scanner to TM-DT Connect a barcode scanner to TM-DT. 8. Setting the Barcode Scanner (p.176) Register the barcode scanner to be connected into TM-DT. Make registration using an EPSON TMNet WebConfig. 158 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 159
for TM-i Series The following illustrates the flow of constructing the environment for the sample program. If the Windows Security screen appears while using EPSON TMNet WebConfig, enter your user name and password. The default values are as follows: User name : epson Password : epson 1. Installing - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 160
7. Network Settings Make the network settings for the TM-i, using EPSON TMNet WebConfig. 8. Setting the Barcode Scanner (p.176) Register the barcode scanner to be connected into TM-i. Make registration using an EPSON TMNet WebConfig. 160 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 161
Java SE Development Kit Download and install JDK (Java Development Kit). Downloading JDK 1 Access the following URL Select [Accept License Agreement] and select the file to be installed. Save the file to a desired location. (In this manual, download Windows x86 to construct the environment.) 6 161 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 162
] button. 2 Select the function to install and click the [Next] button. To change the installation destination, click the [Change] button and change the destination. (In this manual, the default destination is used.) 3 Installation starts. 4 When installation completes, the following window appears - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 163
this manual, download and set up Eclipse Classic) http://www.eclipse.org/downloads/ Installing Eclipse and manual, extract the file under "C:".) 2 Double-click "eclipse.exe" to start Eclipse. 3 Set up the work folder during Eclipse startup process. Click the [OK] button. (In this manual, the default - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 164
Setting Proxy for Eclipse Use this operation when proxy setting is required for Internet connection. If not required, this operation is unnecessary. 1 Select [Window] - [Preferences]. 2 Select [General]-[Network Connections] from the left column. Set the proxy and click the [OK] button. 164 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 165
. Downloading Android SDK Manager Access the following URL and download Android SDK Manager. (In this manual, download the installer for Windows.) http://developer.android.com/sdk/index.html Installing Android SDK Manager 1 Start the downloaded file. The following window appears. Click the [Next - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 166
the user destination. Click the [Next] button. (In this manual, the default settings are used.) 4 Specify the Install location destination. Click the [Next] button. (In this manual, the default settings are used.) 5 Specify the name to be registered to Start Menu. Click the [Install] button. 166 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 167
6 When installation completes, click the [Next] button. Chapter 6 Sample Program 7 Clear the [Start SDK Manager] checkbox. Click the [Finish] button. 6 167 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 168
[Tools]-[Options]. 3 The proxy setting window appears. Set the proxy and click the [Close] button. 4 Select the version of the device to develop and [Android Support Library] inside [Extras], then click [Install XX packages...]. 168 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 169
Chapter 6 Sample Program 5 Select [Accept All] and click the [Install] button. Installation of Virtual Device starts. 6 169 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 170
. If the proxy setting is required for Internet connection, refer to Setting Proxy for Eclipse (p.164). 1 Start Eclipse. Select [Help]-[Install New Software]. 2 Click the [Add] button. 3 Enter [Name] and [Location], and click the [OK] button. Item Description Name ADT Plugin Location https - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 171
Chapter 6 Sample Program 4 Select the [Developer Tools] checkbox and click the [Next] button. 5 Confirm the plugin to be installed, and click the [Next] button. 6 After confirming the terms of the license agreement, select the [I accept...] checkbox and click the [Finish] button. 6 171 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 172
to restart Eclipse. 9 Select [Window] - [Preferences]. 10Select [Android] from the left column. Click the [Browse...] button to display the Android folder where SDK Manager is installed. (In this manual, display "C:\Program Files\Android\android-sdk".) 172 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 173
Chapter 6 Sample Program 11Click the [Apply] button. Confirm that the installed package is displayed. 6 173 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 174
Importing the Sample Program Import the sample program to Eclipse. 1 Extract ePOS-Device_Sample_XML_Vx.x.x.zip, and save it to any folder. 2 Start Eclipse. Select [File]-[Import]. 3 Select [General]-[Existing Projects into Workspace]. Click the [Next] button. 174 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 175
Chapter 6 Sample Program 4 Click the [Browse...] button to display the saved sample program. Select the [Copy projects into workspace] checkbox and click the [Finish] button. 5 Confirm that the application has been properly imported. 6 175 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 176
be controlled by ePOS-Device XML into TM-Intelligent. Configure the settings using EPSON TMNet WebConfig. EPSON TMNet WebConfig can be launched from your web browser. For details on settings used, refer to the Technical Reference Guide for each TM-Intelligent. Set the following. Setting Device ID - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 177
Chapter 6 Sample Program Building Environment for iOS Environment Device ❏ TM-Intelligent TM-DT Series TM-i Series (TM-i firmware Ver.4.0 or later) ❏ Barcode Scanner Execution environment This section explains the following environments. Information such as the webpage URLs and versions of files - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 178
. The default values are as follows: User name : epson Password : epson 1. Network Settings Configure the system and TM-DT network settings. For the TM-DT network settings, use either of the following procedures: Configuring the Windows network settings with TM-DT Installing TMNet WinConfig - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 179
flow of constructing the environment for the sample program. 1. Connection of barcode scanner to TM-i Connect a barcode scanner to TM-i. 2. Network Settings Make the network settings for the TM-i, using EPSON TMNet WebConfig. 3. Setting the Barcode Scanner (p.180) Register the barcode scanner to be - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 180
be controlled by ePOS-Device XML into TM-Intelligent. Configure the settings using EPSON TMNet WebConfig. EPSON TMNet WebConfig can be launched from your web browser. For details on settings used, refer to the Technical Reference Guide for each TM-Intelligent. Set the following. Setting Device ID - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 181
is opened, the project settings and source files will be displayed. 4 From the options displayed when [Set Active Executable] is selected, select an iPhone or iPad file. 6 181 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 182
Executing Sample Program The iOS can be run with iOS Simulator. Androiod You can execute the sample program using the following methods. ❏ Executing with an emulator(p.182) ❏ Executing with an Android device(p.185) Executing with - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 183
Chapter 6 Sample Program 2 Select the name of the virtual device to create and the OS version of the virtual device. Input any value for [Name], and make selections for [Target] and [CPU/ ABI]. Then click the [Create AVD] button. 3 The created virtual device is displayed. 4 Click the button to run - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 184
5 For the initial startup, the window to confirm the execution type appears. Select [Android Application] and click the [OK] button. 6 The emulator starts and the application is executed. 184 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 185
Android device Execute the program using the following procedure. 1 Install the USB driver for the Android Debug Bridge (ADB) for the Android device you are using. For more information about USB drivers for Android devices and their installation, see the site at the following URL. http://developer - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 186
5 Click the Run button in Eclipse. If it is being run for the first time, the following window will appear. Select [Android Application], and click the [OK] button. 6 The sample application is installed and run on the Android device. 186 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 187
procedure. 1 Perform application settings. Chapter 6 Sample Program Set as follows. Setting Item IP Address DeviceID Printer DeviceID Scanner Description Input the TM-Intelligent's IP address. Input "local_printer". Input "local_scanner". 2 Click or tap [connect]. 3 Confirm that "Connect to - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 188
5 If the barcode is properly scanned, the scan result is displayed in [OnData]. 6 Click or tap [print] to print the scan result. 7 If it is printed properly, "Print success" is displayed on the bottom of the screen. 188 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 189
Appendix Appendix List of KeyCode Key KeyCode (Decimal) Backspace 8 Tab 9 Enter 13 Shift 16 Ctrl 17 Alt 18 Caps Lock 20 Esc 27 Space 32 PgUp 33 PgDn 34 End 35 Home 36 ! 37 # 38 ! 39 $ 40 Insert 45 Delete 46 Numbers on the keyboard 0 48 1 49 2 50 3 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 190
Key KeyCode (Decimal) Alphabets on the keyboard Q 81 R 82 S 83 T 84 U 85 V 86 W 87 X 88 Y 89 Z 90 Numeric keypad * 106 + 107 / 109 Function key F1 112 F2 113 F3 114 F4 115 F5 116 Key Function key F6 F7 F8 F9 F10 F11 F12 Caps Lock KeyCode (Decimal) 117 118 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 191
Appendix Printer specifications TM-H6000IV-DT/ TM-H6000IV Resolution Print Width Characters in a Line Font A Font B Character Size Character Baseline Font A Font B Font A Font B Default Line Feed Space Color Specification Page Mode Default Area Page Mode Maximum Area Raster Image - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 192
Not supported Page Mode Line Not supported Rectangle Paper Cut Cut, Feed cut Not supported Drawer Kick-Out Supported Buzzer Not supported Paper Layout Settings Not supported Command Supported MICR Supported 192 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 193
TM-L90 Resolution Print Width Characters in a Line Font A Font B Font C Character Size Font A Font B Font C Character Baseline Font A Font B Font C Default Line Feed Space Color Specification Page Mode Default settings of the printer using the memory switch setting utility.) UPC-A, UPC - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 194
Receipt Die-cut Label Page Mode Line Not supported Rectangle Paper Cut Cut, Feed cut Drawer Kick-Out Supported Buzzer Not supported Paper Layout Settings Not supported (With automatic setup mode) Command Supported 194 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 195
TM-P20 Resolution Print Width Characters in a Line Font A Font B Font C Font D Font E Character Size Font A Font B Font C Font D Font E Character Baseline Font A Font B Font C Font D Font E Default Line Feed Space Color Specification Page Mode Default Symbology Not supported 195 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 196
58 mm Page Mode Line Supported (Only solid line) Rectangle Paper Cut Feeds paper to cutting position Drawer Kick-Out Not supported Buzzer Supported Paper Layout Settings Supported Command Supported 196 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 197
Ruled Line , , Not supported Page Mode Line Supported (Only solid line) Rectangle Paper Cut Feed cut (Feeds paper to cutting position) Drawer Kick-Out Not supported Buzzer Support (Pattern 1 ~ Pattern 10, Stop) 197 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 198
Paper Layout Settings Command Receipt Supported Supported Die-cut label 198 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 199
Ruled Line , , Not supported Page Mode Line Not supported Rectangle Paper Cut Feed Drawer Kick-Out Not supported Buzzer Supported Paper Layout Settings Supported Command Supported 199 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 200
Not supported Page Mode Line Not supported Rectangle Paper Cut Cut, Feed cut Drawer Kick-Out Supported Buzzer Supported (Pattern A ~ Pattern E, Error, No paper, Stop) Paper Layout Settings Not supported Command Supported 200 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 201
TM-T20II-i/ TM-T20II ) (ANK: 31 characters) (ANK: 60 characters) Character Size Font A ANK: 12 dots x 24 dots (W x character Default Line Feed Space 30 dots Color Specification First color Page Mode Default Area supported Page Mode Line Not supported Rectangle Paper - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 202
Buzzer Paper Layout Settings Command 58 mm Supported Not supported Supported 80 mm 202 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 203
Line , , Not supported Page Mode Line Not supported Rectangle Paper Cut Cut, Feed cut Drawer Kick-Out Supported Buzzer Not supported Paper Layout Settings Not supported Command Supported 203 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 204
Ruled Line , , Not supported Page Mode Line Not supported Rectangle Paper Cut Cut, Feed cut Drawer Kick-Out Supported Buzzer Supported Paper Layout Settings Not supported Command Supported 204 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 205
Appendix TM-T82II-i/ TM-T82II 80 mm Resolution 203 dpi x 203 dpi (W x H) Print Width (42 Column Mode) 576 dots (546 dots) Characters in a Line Font A ANK: 48 characters (42 Column Mode) (ANK: 42 characters) Font B ANK: 64 characters (42 Column Mode) (ANK: 60 characters) Character Size - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 206
Paper Cut Drawer Kick-Out Buzzer Paper Layout Settings Command Cut, Feed cut Supported Supported Not supported Supported 80 mm 206 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 207
> PDF417, QR Code, MaxiCode, GS1 DataBar Stacked, GS1 DataBar Stacked Omnidirectional, GS1 DataBar Expanded Stacked Ruled Line , , Not supported Page Mode Line Not supported Rectangle Paper Cut Cut, Feed cut Drawer Kick-Out - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 208
Buzzer Paper Layout Settings Command Supported Not supported Supported 80 mm 208 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 209
switch setting utility.) Bar Code UPC-A, UPC-E, EAN13, JAN13, EAN8, JAN8, CODE39, ITF, CODABAR, CODE93, CODE128, GS1-128 2D-Code PDF417, QR Code Ruled Line , , Not supported Page Mode Line Not supported Rectangle Paper Cut - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 210
Command 80 mm Supported 58 mm 210 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 211
TM-T88V-DT/ TM-T88V-i/ TM characters A* 42 characters Special font 40 characters B* 56 characters Character Size Font A ANK: 12 dots x 24 dots (W x H) of the character B* Default Line Feed Space 30 dots Color Specification First color Page Mode Default Area 360 dots x 831 supported) 211 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 212
-begin>, Not supported Page Mode Line Not supported Rectangle Paper Cut Cut, Feed cut Drawer Kick-Out Supported Buzzer Supported Paper Layout Settings Not supported Command Supported * Only for South Asia model - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 213
TM-T90 Resolution Print Width Characters in a Line Font A Font B Font C Character Size Font A Font B Font C Character Baseline Font A Font B Font C Default Line Feed Space Color Specification Page Mode Default settings of the printer using the memory switch setting utility.) UPC-A, UPC - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 214
>, , Not supported Page Mode Line Not supported Rectangle Paper Cut Cut, Feed cut Drawer Kick-Out Supported Buzzer Not supported Paper Layout Settings Not supported Command Supported 60 mm 80 mm 214 - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 215
When using a two-color ribbon cassette ) Page Mode Default Area Not supported Page Mode Maximum Area Not supported Raster Image Monochrome image Logo Not supported Barcode Not supported 2D-Code Not supported Ruled Line , , - Epson TM-T20II-i | ePOS-Device XML Users Manual For TM-i firmware v4.1 - Page 216
216
ePOS-Device XML
User’s Manual
M00055606
Rev.G
Overview
Building Environment
Programming Guide
ePOS-Device XML
Device Control Script
Describes the features and development environment.
Describes environment building for ePOS-Device
Service I/F.
Describes how to write programs in Web application
development.
Describes the ePOS-Device XML.
Describes the device control script.
Sample Program
Describes the sample program.
Appendix