Select your printer model

Parameters are refined by the selected printer.

<open_device>


Establishes communication between a device connected to the printer and the application to enable to use the device. Requests for using the specified device and notifies the application of the acquired request result.

Request

Element

Data type

Description

device_id

string

Specifies the device ID.

data

string

Specifies the device category name and buffer setting upon disconnection.

data

Child element

Data type

Description

type

string

Specifies the device category name.

  • "type_dt": Device hub terminal (TM-DT)
  • "type_scanner": Barcode scanner
  • "type_keyboard": Keyboard
  • "type_poskeyboard": POS keyboard
  • "type_msr": MSR
  • "type_printer": Printer
  • "type_hybrid_printer": Hybrid printer
  • "type_display": Customer display
  • "type_simple_serial": Serial communication device
  • "type_storage": German fiscal element (TSE)
  • "type_other_peripheral": Other peripheral device

buffer

string

Specifies the buffer function upon disconnection.

  • "true": Enabled
  • "false": Disabled

Sample program

 
<open_device>
	<device_id>scanner_001</device_id>
	<data>
		<type>type_scanner</type>
	</data>
</open_device>

Response

Element

Data type

Description

device_id

string

Device ID specified in the request

code

string

Processing result

data_id

int

One of the following values is set depending on the value set in <buffer> of the <open_device> message.

  • true: ID of sent data
  • false: Null string

code

Element value

Description

"OK"

Process succeeded.

“DEVICE_NOT_FOUND"

The specified device does not exist.

“DEVICE_IN_USE”

The specified device is in use.

“DEVICE_OPEN_ERROR”

Failed to open the specified device.

“DRIVER_ERROR”

Error occurred in the device control script.

“SYSTEM_ERROR”

A system error occurred.

“DEVICE_TYPE_INVALID”

The device type of the specified device is different.

“PARAM_ERROR”

A parameter error occurred.

Sample program

  • Normal case
  •  
    <open_device>
    	<device_id>scanner_001</device_id>
    	<code>OK</code>
    	<data_id>2</data_id>
    </open_device>
    
  • Abnormal case
  •  
    <open_device>
    	<code>DEVICE_NOT_FOUND</code>
    	<device_id>scanner_001</device_id>
    	<data_id>2</data_id>
    </open_device>
    

Supplementary explanation

  • When <open_device> is executed successfully, devices other than the printer are exclusively locked.
  • When specifying type_display in the child element type of data, specify local_display in device_id.
  • When specifying storage in the child element type of data, specify local_TSE in device_id.
  • For the device categories that can be specified with ‘data’, refer to the Device Messages list.
  • Executing <open_device> again for the same device after <open_device> has already been executed sometimes generates the DEVICE_OPEN_ERROR depending on when processed, which results in termination of the connection with the device. Execute <open_device> again to reestablish the connection.
 

Quick Access

  • [Name]
  • [Format]
  • [Range]
  • [Description]
  • [Notes]

ePOS-Device XML includes patented or patent pending functions. The contents must not be disclosed to third parties.


ePOS-Device XML

Jump to the top