(5) About the balloon message when the Java application is started on Windows Vista / 2008 / Windows7 / 2008R2
When you start the Java application when the operating system is Windows Vista / 2008 / Windows7 / 2008R2,
and the Aero function is effective, balloon message "The color scheme has been changed" might be displayed.
There is no influence in the operation of the application though the Aero function temporarily becomes invalid
when this message is displayed. Please click the balloon, and check "Don’t show me this again." when you do
not want to make this message be displayed from next time.
figuration '
2
(6) About the arrangement of Jav
Please put the Java application in the same hard disk drive as the JavaPOS driver. Please copy the following file
in the JavaPOS driver storage folder (The example: \JavaPOS\Okidata\PT) to the following folder of J2SDK and
use it when you put the Java application in a drive different from the JavaPOS driver.
(7) About the "Found New Hardware Wizard" in Windows
When the printer is connected to PC in USB interface and "Found New Hardware Wizard" was displayed, set it in
the following procedures.
For Windows 8 / Server 2012
1. "Device Setup" in the task bar is displayed, but no operation is required.
For Windows 7 / Server 2008 R2
1.The message "Installing device driver software" is displayed in a balloon(lower right corner of the
screen).
2.After a while, the message "Device driver software was not successfully installed" is displayed.
This is not a problem.
For Windows Vista / Server 2008
1. The "Found New Hardware" is displayed, select [Don't show this message again for this device].
* When "User Account Control" screen is displayed, select [Continue].
For Windows XP / Server 2003 / WEPOS / WEPOS2009
1.The "Found New Hardware Wizard" screen is displayed. Select [No, not this time] and then click
[Next].
2.When "What do you want the wizard to do?" is displayed, select [Install from a list or specific location]
and then click [Next].
3. Select [Search for the best driver in these locations], clear all checkboxes and then click [Next].
4.When "Cannot Install this Hardware" is displayed, click [Don't prompt me again to install this software]
and then click [Finish].
aPOS driver and Java application in Windows.
3
1. Outline
POS Printer JavaPOS Driver and Drawer JavaPOS Driver that control POS Printer ("PT340-341") and Drawer
connected to the printer are JavaPOS Driver conforming to JavaPOS Driver 1.10 POS Printer Devise and Drawer
Device. When using this JavaPOS Driver, refer to "UifiedPOS Specification Version 1.10 Version", as well.
1.1. Subject Scope of this document
These instructions (Interface Instructions) aim for the main reference of programmers who develop the application for
the use of this JavaPOS Driver, and describe the following conten ts necessary for that.
· Installation way of this JavaPOS Driver
Please refer to the installation text being bundled by the driver for the installation method.
Windows : "opinstall_win.txt"
· Restrictions of this JavaPOS Driver
· Useage of this JavaPOS printer setup tool
· Usage of this JavaPOS Driver
· Restrictions of this JavaPOS Driver
· Interface (Property/Method/Event) Remarks of this JavaPOS Driver
· Item Setting Remarks of this JavaPOS Driver
4
1.2. JavaPOS Driver Outline
1) JavaPOS Driver Configuration Drawing
JavaPOS Driver provides the properties, methods and events to the application. The driver is invisible on UI during
application execution. Only the application, which uses it, requests to process through the method and property. The
application receives the processing result through the parameter, property, event and error.
*This JavaPOS Driver supports to control
connected to on
*Multiple numbers of interface and printers can be set to the driver. For details, refer to Chapter 7 "Using Multiple
Printers."
e printer.
POSPrinter Device
Control
POSPrinter Device
Service
PrinterDrawer
Serial Interface
the Serial and USB Interface Printer and of at most two drawers each,
Application
CashDrawer
Device Control
CashDrawer
Device Service
Java VM
OS / Device Driver
PrinterDrawer
USB Interface
5
2) Terminology
a. Device Control (DC)
According
This Document explains these API.
b. Device Service (Device Service; DS)
It executes the function which is called from Device Control and which is prescribed by JavaPOS for each
device.
to each device class, it provides application with the set of the properties, methods, and events.
6
1.3. Restrictions
The following restrictions are applied:
1) POS Printer
[Restrictions on JavaPOS specifications]
1. All interface of the JavaPOS POS Printer Device are provided, but there are the following restrictions:
a. It does not support property setting concerning journal printing and journal.
b. It does not support property setting concerning slip printing and slip.
c. It does not support functions of Italic, custom color, shading printing, and cartridge.
d. It does not support change of receipt printing character font. (Printing font change)
e. The following methods always return JPOS_E_ILLEGAL(106) after enabling.
2. For USB Interface connection, there are the following restrictions:
· The behavior to set the DeviceEnabled property = true to the same printer from the application
running on other VM is not supported.
3. The behavior after recovering from Suspend/Stand by is not supported.
The Suspend/Stand by mode should not be used.
2) Drawer
[Restrictions of JPOS specifications JavaPOS]
1. All the interfaces of JPOS Drawer Device are provided, but there are the following restrictions.
a. PowerNotify Property (Power source notifying function setting)
Setting is only for JPOS_PN_DISABLED(0) (Impossible to notify)and unchangeable.
b. PowerState Property (Power source state)
Only JPOS_PS_UNKNOWN(2000)(Unclear) is set.
c. DirectIO Method (Particular-to-Device function)
It is not supported. After enabling, it always returns JPOS_E_ILLEGAL(106).
d. WaitForDrawerClose Method (Waiting for the drawer to close)
It is not supported. After enabling, it always returns JPOS_E_ILLEGAL(106).
7
e. DirectIOEvent Event
It is not supported.
f. DrawerOpened Property, StatusUpdateEvent Event
Status notification of the Drawer is available only when CapStatus is true and the driver is
enabled (DeviceEnabled=true) for the printer connected to the drawer. In case these
conditions are not met, the status of the drawer is not notified.
2. For USB Interface connection, there are the following restrictions:
· The behavior to set the DeviceEnabled property = true to the same printer from the application
running on other VM is not supported.
3. The behavior after recovering from Suspend/Stand by is not supported.
The Suspend/Stand by mode should not be used.
[Restriction of Drawer Hardware Specifications]
It does not support the function to notify the drawer power source condition.
3) Restriction when Windows driver and JavaPOS driver are installed in the same system
Problems such as failure to print correctly from the JavaPOS driver may occur if the Windows driver and
JavaPOS driver are both installed in the same system.
In this case, it is recommended that you uninstall the driver that is not being used.
(Particular- to-Device event)
8
1.4. Connection Way to POS Printer
Set the POS Printer to the following settings (in gray highlight). Rest of the values can be set in the setting file
attached with jpos.xml or the installer.
Memory Swith 1
No. Setting Item Setting Contents
1 Power On Status *Set form the registry
2 Receive Buffer 4 KB
3 Busy Condition Bufferfull
4 Receive Error ? Print
5 Auto LF Disable
6 DSR (#6) RESET Disable
7 USB Soft Reset Enable
Memory Swith 2
No. Setting Item Setting Contents
1 Cover Open Error Auto Recovery
2 Error Recovery by CMND
3 Batch (COM IF) Disable
4 Batch (Other IF) Disable
5 Serial Number Enable
6 ASB Enable
7 Font-B Mode1
Print
No. Setting Item Setting Contents
1 Paper Width *Set from the setting program
2 Max Speed *Set from the setting program
3 Print Density *Set from the setting program
9
Hardware
No. Setting Item Setting Contents
1 Error Alert *Set from the setting program
2 Buzzer Interval *Set from the setting program
3 Buzzer Repetition *Set from the setting program
4 User NV Memory 192KB
5 Graphic Memory 384KB
6 Cut at CoverClose *Set from the setting program
7 PNE Detect *Set from the setting program
Interface
No. Setting Item Setting Contents
1 Protocol XON/XOFF
2 USB Printer
10
1.5. About install
For Windows:
See the "opinstall_win.txt" and install the JavaPOS according to it.
11
1.6. Setting Program Usage
Operation Conditions
This Java-POS must be installed.
Screen and function
Setting Program is executed as the following procedure.
1. Compile
>javac Setup.java
2. Execution
>java Setup
The following screen is displayed.
<< Serial interface setting screen >>
12
<< USB interf
Selec
t serial num
(Refer to "9. Serial number confirm method of printer" for serial number of printer.)
OK button becomes effective by selecting serial number.
When the Reload button is pushed, the serial number of the connected printer is reread, and displayed in “Serial
Number".
ber of printer from "Serial Number".
ace setting screen >>
13
When an error occurred with OK button pushed, the following messages are display
Confirm an error factor, and setup again.
<An error factor>
- A cable is not connected.
- The printer is not switched on.
- A cover opens.
- There is not paper.
- A port is already used in others.
- A communication condition does not accord with a printer. (Serial connection)
- Serial number input is wrong. (USB connection)
W
hen the printer
After confirming the setting, execute the setting program, and then follow the procedure again.
status is "error" and this setting program is executed, the setting is not reflected in the printer.
ed.
14
In case the "jpos.xml
Select the "jpos.xml" file from this dialog.
" file cannot be located when the setting program is executed, the following dialog is displayed.
15
2. Using JavaPOS Driver
2.1. Common
The application uses the OPOS control in the steps as follows:
1. open method: Called to link the control object to the service object.
2. claim method: Called to enable exclusive access to the device. For the device of exclusive use, this method is
required, and foe the device of sharable use, it is optional.
3. DeviceEnabled property: Set to true to operate the device.
4. Use the device. (Each property, method, event)
5. DeviceEnabled property: Set to false to disable the device.
6. release method: Called to clear exclusive access to the device.
7. close method: Called to release the service object from t h e control object.
2.2. POS Printer
The POS printer supports only "Receipt." For the methods and properties of other than that (Journal or Slip), interface
is supplied but behavior is not supported.
According to the general output model, synchronous and asynchronous output is available for the POS printer.
The POS printer is the device to be used exclusively.
2.3. Drawer
The Drawer can be used in the same way as the POS printer, but all features are executable without executing the
claim method. However, when exclusive permission is acquired for particular application by the claim method, the
openDevice method cannot be executed by the application enabled with the same name. If there is no application
with exclusive permission, this is not the case.
2.4. Notes
- When the application using this JavaPOS driver is started, you should set the New area of the memory to 10MBy te
or more. ( java command option -Xmn10m). When the New area is a little, the memory utilization might increase
because a large amount of object generated with the communication is not liberated for a long term.
- If the JPOS_E_TIMEOUT is returned when you enable the application, increase and adjust the value of
ResetTimeout of jpos.xml (Refer to Chapter 5.3).
16
3. JavaPOS Interface Specifications (Printer)
3.1. List
Properties
Common Type Access May Use After Initial Value, Conditions
CapCompareFirmwareVersion boolean R open true
CapPowerReporting int R open JPOS_PR_STANDARD (1)
CapStatisticsReporting boolean R open false
CapUpdateFirmware boolean R open true
CapUpdateStatistics boolean R open false
CheckHealthText String R open ""
Claimed boolean R open false
DeviceEnabled boolean R/W open & claim false
FreezeEvents boolean R/W
open
OutputID int R open 1
PowerNotify int R/W open JPOS_PN_DISABLED (0)
PowerState int R open JPOS_PS_UNKNOWN
State int R --- 1
DeviceControlDescription String R --- "POS Printer JavaPOS
DeviceControlVersion int R --- 1010XXX
DeviceServiceDescription String R open "POS Printer JavaPOS
DeviceServiceVersion int R open 1010XXX
PhysicalDeviceDescription String R open "OP 1 Station Thermal
PhysicalDeviceName String R open "OP 1 Station Thermal
false
open
false
Made writable after open.
Made writable after open,
and unwritable after
enabled.
(2000)
Device Control"
Device Service"
POSPrinter"
POSPrinter "
17
Specific
CapCharacterSet int R open PTR_CCS_KANJI (11)
CapConcurrentJrnRec boolean R open false
CapConcurrentJrnSlp boolean R open false
CapConcurrentPageMode boolean R open false
CapConcurrentRecSlp boolean R open false
CapCoverSensor boolean R open true
CapMapCharacterSet boolean R open true
CapTransaction boolean R open true
CapJrnPresent boolean R open false
CapJrn2Color boolean R open false
CapJrnBold boolean R open false
CapJrnDhigh boolean R open false
CapJrnDwide boolean R open false
CapJrnDwideDhigh boolean R open false
CapJrnEmptySensor boolean R open false
CapJrnItalic boolean R open false
CapJrnNearEndSensor boolean R open false
CapJrnUnderline boolean R open false
CapJrnCartridgeSensor int R open 0
CapJrnColor int R open 0
Type Access May Use After
Initial Value,
Conditions
Type Access May Use After Initial Value, ConditionSpecific
CapRecPresent boolean R open true
CapRec2Color boolean R open The initial value may vary
according to the contents
of jpos.xml.
CapRecBarCode boolean R open true
CapRecBitmap boolean R open true
CapRecBold boolean R open true
CapRecDhigh boolean R open true
CapRecDwide boolean R open true
CapRecDwideDhigh boolean R open true
CapRecEmptySensor boolean R open true
CapRecItalic boolean R open false
CapRecLeft90 boolean R open true
18
CapRecMarkFeed int
R open 0
Type Access May Use After Initial Value, ConditionSpecific
CapRecNearEndSensor boolean R open The initial value may vary
according to the contents
of jpos.xml.
CapRecPapercut boolean R open true
CapRecRight90 boolean R open true
CapRecRotate180 boolean R open true
CapRecStamp boolean R open false
CapRecUnderline boolean R open true
CapRecCartridgeSensor int R open 0
CapRecColor
CapRecMarkFeed
CapRecPageMode boolean R open false
int
int
R open 0
R open 0
Type Access May Use After Initial Value, ConditionSpecific
CapSlpPresent boolean R open false
CapSlpFullslip boolean R open false
CapSlp2Color boolean R open false
CapSlpBarCode boolean R open false
CapSlpBitmap boolean R open false
CapSlpBold boolean R open false
CapSlpDhigh boolean R open false
CapSlpDwide boolean R open false
CapSlpDwideDhigh boolean R open false
CapSlpEmptySensor boolean R open false
CapSlpItalic boolean R open false
CapSlpLeft90 boolean R open false
CapSlpNearEndSensor boolean R open false
CapSlpRight90 boolean R open false
CapSlpRotate180 boolean R open false
CapSlpUnderline boolean R open false
CapSlpBothSidesPrint boolean R open false
CapSlpCartridgeSensor int R open 0
CapSlpColor int R open 0
CapSlpPageMode boolean R open false
19
Type Access May Use After Initial Value, Condition Specific
AsyncMode boolean R/W
open
CartridgeNotify int R/W open PTR_CN_DISABLED (0)
CharacterSet int R/W open, claim
CharacterSetList String R open "101,102,103,437,850,851,852
CoverOpen boolean R open, claim
ErrorLevel int R open 1
ErrorStation int R open 0
ErrorString String R open ""
FontTypefaceList String R open ""
FlagWhenIdle boolean R/W open false
MapCharacterSet boolean R/W open true
MapMode int R/W open PTR_MM_DOTS (1)
PageModeArea String R open ""
PageModeDescriptor int R open 0
PageModeHorizontalPosition int R open 0
PageModePrintArea String R/W open ""
PageModePrintDirection int R/W open 0
PageModeStation int R/W open 0
PageModeVerticalPosition int R/W open 0
RotateSpecial int R/W open PTR_RP_NORMAL (1)
Specific Type Access May Use After Initial Value, Condition
JrnLineChars int R/W open, claim
& Enable
JrnLineCharsList String R open ""
JrnLineHeight int R open, claim
& Enable
JrnLineSpacing int R/W open, claim
& Enable
20
0
Unwritable
0
Unwritable
0
Unwritable
Specific Type Access May Use After Initial Value, Condition
JrnLineWidth int R open, claim
& Enable
JrnLetterQuality boolean R/W open, claim
& Enable
JrnEmpty boolean R open, claim
& Enable
JrnNearEnd boolean R open, claim
& Enable
JrnCartridgeState int R open, claim
& Enable
JrnCurrentCartridge int R/W open, claim
& Enable
0
false
Unwritable
false
false
0
0
Unwritable
Specific Type Access May Use After Initial Value, Condition
RecLineChars int R/W open, claim
& Enable
RecLineCharsList String R open The initial value may vary
RecLineHeight int R/W open, claim
& Enable
RecLineSpacing int R/W
RecLineWidth int R open, claim
RecLetterQuality boolean R/W open, claim
RecEmpty boolean R open, claim
RecNearEnd boolean R open, claim
RecSidewaysMaxLines int R open, claim
RecSidewaysMaxChars int R open, claim The initial value may vary
open, claim
& Enable
& Enable
& Enable
& Enable
& Enable
& Enable
The initial value may vary
according to the jpos.xml
contents.
Made writable after open.
according to the jpos.xml
contents.
The initial value may vary
according to the jpos.xml
contents.
Unwritable
The initial value may vary
according to the jpos.xml
contents.
Made writable after open.
The initial value may vary
according to the jpos.xml
contents.
true
Made writable after open.
false
false
The initial value may vary
according to the jpos.xml
contents.
21
Specific Type Access May Use After Initial Value, Condition
& Enable according to the jpos.xml
contents.
RecLinesToPaperCut int R open, claim
& Enable
RecBarCodeRotationList String R open "0,R90,L90,180"
RecCartridgeState int R open 268435456
RecCurrentCartridge int R/W open 0
RecBitmapRotationList String R open "0"
The initial value may vary
according to the jpos.xml
contents.
Unwritable
Specific Type Access May Use After Initial Value, Condition
SlpLineChars int R/W open 0
Unwritable
SlpLineCharsList String R open, claim
& Enable
SlpLineHeight int R/W open, claim
& Enable
SlpLineSpacing int R/W
open
SlpLineWidth int R open, claim
SlpLetterQuality boolean R/W open, claim
SlpEmpty boolean R open, claim
SlpNearEnd boolean R open, claim
SlpSidewaysMaxLines int R open, claim
SlpSidewaysMaxChars int R open, claim
SlpMaxLines int R open, claim
SlpLinesNearEndToEnd int R open, claim
SlpBarCodeRotationList String R open ""
SlpPrintSide int R open, claim
open, claim
& Enable
& Enable
& Enable
& Enable
& Enable
& Enable
& Enable
& Enable
& Enable
& Enable
""
0
Unwritable
0
Unwritable
0
false
Unwritable
false
false
0
0
0
0
0
22
Specific Type Access May Use After Initial Value, Condition
SlpCartridgeState int R open, claim
& Enable
SlpCurrentCartridge int R/W open, claim
& Enable
SlpBitmapRotationList String R open ""
* In the Access column, R indicates Read-Only, R/W indicates Read/Write. The item in May Use After is the method
and property required for initialization, open indicates the open method, claim indicates the claim method and Enable
indicates setting the DeviceEnabled property to true. If required procedure is not executed, JposException may be
notified. For the property with open & claim or open, claim & Enable in May Use After, it is available for acquisition
after the open method is executed, but the value may not be initialized until all open, claim & Enable are executed. To
acquire such property, access it after the conditions are met.
Methods
PTR_CART_UNKNOWN
(268435456)
0
Unwritable
Common Initialization
open none
close open
claim open
release open & claim
clearOutput open, claim & Enable
checkHealth open, claim & Enable
compareFirmwareVersion open, claim & Enable
directIO open, claim & Enable
resetStatistics open, claim & Enable
retrieveStatistics open, claim & Enable
updateFirmware open, claim & Enable
updateStatistics open, claim & Enable