POS Printer OPOS Control that control Label Printer "LD670" is OPOS Controls conforming to
OPOS 1.13 POS Printer Devise. When using OPOS Control, refer to "OLE for Retail POS
Application Programmer's Guide Instructions The 1.13 Version" (OPOS-APG V1.13), too.
In this guide, "OPOS Control" means same as "OPOS OCX".
1.1. Subject Scope of this document
These instructions (Application Programmer's Guide) aim for the main reference of programmers
who develop the application for the use of OPOS Control, and describe the following contents
necessary for that.
- Installation way of OPOS Control
- Usage of OPOS Control
- Restrictions of OPOS Control
- Interface (Property/Method/Event) Remarks of OPOS Control
- Item Setting Remarks of OPOS Control
1
r
1.2. OPOS Control Outline
1) OPOS Control Configuration Drawing
OPOS Control co
nforms to ActiveX specifications and provides Property, Method, and Event to
application. Control cannot be seen on UI in application execution. Only application, which uses it,
requests to process through Method and Property. Application receives processing result through
Method return value, parameter, Property, and Event. This OPOS Control is implemented as
in-process server.
<Serial, Parallel, USB Interface>
Application
POSPrinter
Control
Object
CashDrawer
Control Object
POSPrinter
Service
Object
CashDrawer
Service Object
OPSharedPort.exe
OS / Device Drive
Printer
Printer
Printer
Serial Interface
Parallel Interface
USB Interface
2
n
<LAN Interface>
Applicatio
POSPrinter Control
Object
POSPrinter Service
Object
SxJcp32.dll
DLL used to communicate
with printer in LAN
OS / Device Driver
Printer
LAN Interface(10Base-T, 100Base-T)
*This
S
Driver supports the control of Serial/Parallel/USB/LAN Interface Printer.
OPO
*Multiple numbers of interface and printers can be set to the driver. For details, refer to
Chapter 8 "Using Multiple Printers."
* In case of LD670, OPOS Driver doesn’t support drawer connection.
* In case of LAN Interface, OPOS Driver doesn’t support drawer connection.
*This OCX works with Thread Model of STA(Single, Thread or Apartment). To work with
several processes, the setting value of "Apartment" in Registry should be set as "1".
*Regarding LAN interface, Network Connection corresponds to 10Base-T, 100Base-T.
3
2) Terminology
a. Control Obj
According to each device class, it provides application with the set of Property, Method, and Event.
This Document explains these API.
b. Service Ob ject (Service Object; SO)
It executes the function which is called from Control Object and which is prescribed by OPOS for
each device.
ect (Control Object; CO)
4
1.3. Restrictions
Followings are restrictions.
1) POS Printer
[Restriction
restrictions.
s on OPOS specifications]
All the interfaces of OPOS POS Printer Device are provided, but there are the following
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 OPOS_E_ILLEGAL(106) after enabling.
(Limitation of Cable disconnection and connection)
There are conditions for disconnection and connection of LAN cable under printer
"enable" status:
1)When LAN cable is disconnected from PC, printer cannot support any actions. When the
cable is disconnected during "enable" status, OCX may fail to be "enable" even though the
application restarts.
2)When LAN cable is disconnected from Printer, and while OCX and printer is connecting,
printer cannot support any actions even if "disable" is sent. If "disable" is sent in above
situation, even though the application is restarted, OCX may fail to enable.
When the LAN cable is disconnected, connect the LAN cable again, and switch off and on
the power of Printer.
5
2) Common Restrictions on POS Printer
The OPOS Control is not
different thread, unexpected result may occur. In the multithread environment,
implementation of exclusive processing for the critical sections is required for accessing
the property and executing the method in order to avoid the method and property are
executed at the same time.
3) Setting of Apartment ="0" with connecting LAN interface cable
Apart
ment is set as "0" in Registry setting, one process can control several printers. But
the several processes do "Open" OCX (LAN Interface) at the same time, unexpected
results may happen.
4) Setting of Apartment ="1" with connecting LAN interface cable
Apartment is set as "
In this case, the number of printers (LAN interface) should be guaranteed that one process
should be less than one unit. If more than 2 printers per one process were used, unexpected
results might occur. The following chart shows the examples of the case that Apartment
="1" can work, and the case that Apartment ="1" cannot work. (OCX uses LAN interface.)
thread-safe. When the method or property is accessed from the
0" in Registry setting, several processes can control printers.
examples of the case that Apartment ="1" can work
ProcessA---PrinterOCX
ProcessB---PrinterOCX
examples of the case that Apartment ="1" cannot work---1
5) About the "Found New Hardware Wizard" in Windows
When the printer is connected to PC in USB or Parallel interface and "Found New
Hardware Wizard" was displayed, set it in the following procedures.
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].
For Windows 2000
1. The "Found New Hardware Wizard" screen is displayed, click [Next].
2. When "What do you want the wizard to do?" is displayed, select [Search for a suitable driver for my
device] and then click [Next].
3. When [Locate Driver Files] is displayed, clear all checkboxes and then click [Next].
4. When "Driver Files Search Results" is displayed, select [Disable the device] and then click [Finish].
6) About parallel interface
LD670 has not parall
el interface. So LD670 do not support parallel interface.
7
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
registry or the setting program attached with installer.
No. Setting Item Setting Contents
1 POWER ON STATUS *Set form the registry
2 RECEIVE BUFFER 4 KB
3 RECEIVE ERROR HANDLING Print ?
4 AUTO LINEFEED Not available at any time
5 DSR (#6) RESET Not available
6 INT (#25) RESET Not available
7 INT (#31) RESET Available
8 POSITIONING ON POWER ON Execute
9 COVER OPEN Auto Recover
10 BUSY CONDITION Bufferfull
Customize Value
No. Setting Item Setting Contents
1 USER NV MEMORY 192 KB
2 GRAPHIC MEMORY 384 KB
3 PAPER WIDTH *Set from the setting program
4 PRINT LEVEL *Set from the setting program
5 PRINTING COLOR *Set from the setting program
6 BACK LEVEL ON TWO COLOR
PRINT
7 PRINT SPEED *Set from the setting program
8 POWER SAVE *Set from the setting program
*Set from the setting program
Others
No. Setting Item Setting Contents
1 ACK PULSE WIDTH 1 microsecond
2 CUTTER MOVEMENT *Set from the setting program
3 BM SENSOR *Set from the setting program
4 CUT FOR POSITIONING *Set from the setting program
5 ERROR RECOVERY Command
6 PROCESS ID Normal
7 PNE DETECTION *Set from the setting program
8 FONT B Mode 1
9 USB Printer
10 BUZZAR It depends on the printer setting.
11 BATCH PRINT Disable
8
2. Installation
OPOS Control can be installed just like in the following procedures.
2.1. Installation Condition
Operation Environment
OS: Microsoft Windows 2000, XP, 2003Server, Vista, WEPOS, POSReady2009 Windows7, Server 2008, Server 2008 R2
CPU: Pentium3 550MHz and more is recommended
RAM: 128MB and more is recommended
HDD: Space 2MB and more
*To install on WEPOS, "Local Management Support" must be installed in the minimum
configuration of WEPOS.
* To install on POS Ready 2009 using Batch Installer, "Command-line Application" component
must be installed on POS Ready 2009.
(Note)
When OPOS control (POS PRINTER OPOS OCX) is already installed,
please install this OPOS control aft er uninstallation of OPOS control.
Please refer how to uninstall to 2.4. uninstallation procedures.
9
2.2. Installation Media
Installation media is provided as CD.
Configuration of CD is just the following.
\(root) \Drivers\OPOS
\ Driver........................ The root folder of the Installer (x32)
- setup32.exe : Installer for 32bit OS
- setup64.exe : Installer for 64bit OS
\Driver_x32................. The folder of the driver (x32)
* Use this when you do not use the installer for 32bit.
\Driver_x64................. The folder of the driver (x64)
* Use this when you do not use the installer for 64bit
10
2.3. Installation Procedure
Installation using installer
1. Set the installation Media CD to the Drive. After that, start "My Computer" or "Explorer"
and refer to the Drive.
In case of CD: Open \Driver folder, and if OS is 32bit, double click Setup32.exe. If OS
is 64bit, double click Setup64.exe
2. After the dialogue below is shown, Setup Program starts.
click "Next"
11
3. Installation
[System Drive]:\OPOS\Okidata\PT\
starts. Installation folder is:
click "Next"
12
click "Install"
click "Finish"
13
4. Start setting
If the [User Account Control] dialog box is displayed,
【For Windows 7 / Windows Vista】
1) Click the button indicated with the Windows logo
2) Go to [All programs] →
【For Windows XP / Windows Server 2008 R2 / Windows Server 2008 /
Go to [Start]→[All programs] →
program.
[Windows 7 / Server 2008 R2]
click [Yes].
[Windows Vista / Server 2008]
click [Allow].
desktop.
[Okidata]→[OPOS]→[Printer OPOS Setup].
Windows Server 2003 / WEPOS/POS Ready 2009】
[Okidata]→[OPOS]→[Printer OPOS Setup].
at the left bottom of the
【For Windows 2000】
Go to [Start]→[Program] →
[Okidata]→[OPOS]→[Printer OPOS Setup].
*As for how to use setting program, refer to 2.6. Setting Pr ogram Usage.
5. After setting, installation finishes.
14
Installation using batch file
* If OS is 32bit, us
folder
Installation method for Windows Vista or Windows 7
1. Copy driver folder ("\Driver_x64" or "\Driver_x32") onto an arbitrary folder.
2. The button that attaches the Windows logo under the left of a desktop screen is clicked.
3. Select [All Programs]->[Accessories]->[Command Prompt], and right-click in the icon of
the [Command Prompt], click "Run as administrator (A)", and execute the command
prompt by the administrator authority.
4. Change the current directory of the command prompt to the directory that copied by 1, and
execute the batch file "Install.bat".
5. The Registry Editor and additional confirmation message to the registry is displayed, and
click [yes]. The additional completion message to the registry is displayed when the
addition to the registry is completed, and click [OK].
6. The driver is installed in the folder "C:\OPOS\Okidata\PT\".
7. Please execute "C:\OPOS\Okidata\PT\OPPrinterSetup.exe", and execute the setup.
*As for how to use setting program, refer to 2.6. Setting Program Usage.
e batch file of \Driver_x32 folder. If OS is 64bit, use batch file of \Driver_x64
8. After setting, installation finishes.
Installation methods except Windows Vista and Windows 7
1. Driver folder ("\Driver_x64" or "\Driver_x32") onto an arbitrary folder.
2. The button that attaches the Windows logo under the left of a desktop screen is clicked.
3. Select [All Programs]->[Accessories]->[Command Prompt], and execute the command
prompt.
4. Change the current directory of the command prompt to the directory that copied by 1, and
execute the batch file "Install.bat". (Use "Install_Win2k.bat" for Windows 2000.)
5. The Registry Editor and additional confirmation message to the registry is displayed, and
click [yes]. The additional completion message to the registry is displayed when the
addition to the registry is completed, and click [OK].
6. The driver is installed in the folder "C:\OPOS\Okidata\PT\".
7. Please execute "C:\OPOS\Okidata\PT\OPPrinterSetup.exe", and execute the setup.
*As for how to use setting program, refer to 2.6. Setting Program Usage.
8. After setting, installation finishes.
15
2.4. Uninstallation Procedure
Uninstallation when installing it with installer (Setup32.exe or Setup64.exe)
1. Follow the steps blow to display the uninstalling screen.
【For Windows 7 / Windows Vista】
・Click the button indicated with the Windows logo
desktop.
・Go to [Control Panel]→[Uninstall program] or [Uninstall a program].
【For Windows Server 2008 R2】
・Go to [Start]→[Control Panel]→[Uninstall a program]
【For Windows Server 2008】
・Go to [Start]→[Control Panel]→[Programs and Functions].
【For Windows XP / Server 2003 / WEPOS】
・Go to [Start]→[Control Panel]→[Add or Remove Progra ms].
【For Windows 2000】
・Go to [Start]→[Settings]→[Control Panel]→[Add or Remove Programs].
at the left bottom of the
16
2. Select "POSPrint
3. The dialogue to confirm Uninstallation is displayed. Click [Yes].
4. Uninstallation is executed.
er OPOS OCX" and click "Uninstall" or "Remove".
5. Sometimes there are some files that could not be deleted by uninstaller in Installed folder
([System Drive]:\OPOS\Okidata\PT), so please delete manually.
That is all of uninstallation.
17
Uninstallation when OPOS is installed with batch file
Uninstall
1. The button that attaches the Windows logo under the left of a desktop screen is clicked.
2. Select [All Programs]->[Accessories]->[Command Prompt], and right-click in the icon of
the [Command Prompt], click "Run as administrator (A)", and execute the command
prompt by the administrator authority.
3. Execute batch file "uninstall.bat" with the folder of "C:\OPOS\Okidata\PT\".
4. Delete "C:\OPOS\Okidata\PT" folder manually.
5. It is an end.
Uninstallation methods except Win dows Vista and Windows 7
1. The button that attaches the Windows logo under the left of a desktop screen is clicked.
2. Execute batch file "uninstall.bat" with the folder of "C:\OPOS\Okidata\PT\".
3. Delete "C:\OPOS\Okidata\PT" folder manually.
4. It is an end.
ation method for Winodws Vista or Windows 7
18
2.5. Installation File List
File groups of POS Printer OPOS-OCX Control are arranged just like the following.
[System Drive]:\OPOS\Okidata\PT\
OPPOSPrinterCO.ocx POS Printer Control Object
OPPOSPrinterSO.dll POS Printer Service Object
OPPrinterSetup.exe Setting Program
oposdef.ini OPOS display string definition file
OPSharedPort.exe Shared Port Program
SxJcp32.dll DLL used to communicate with printer in
LAN
19
The module to be ins
File Version
Remarks
Copyright "Copyright (C) 2011 Oki Data Corporation"
Comment
Special Built Information(Not written specially)
Private Built Information(Not written specially)
Company "Oki Data Corporation"
Language "English (U.S.)"
Trademark (Not written specially)
Formal File Name (Object File Name of the subject)
Product Version Same as File Version
Product Name "OPOS POSPrinter"
Inside name (Formal File Name without extension)
talled has set property according to the following standard.
Item Remarks
OPOS Version (for each release, the third and the
forth characters are incremental numbers of version)
In case of files except CO/SO, successive increment
from 1.0.0.1
- In case of CO; "POSPrinter OPOS Control Object
Module".
- In case of SO; "POSPrinter OPOS Service Object
Module".
- The other cases; "[exe file name part without
extension] XXX (any wording)".
(Not written specially; If necessary, written
specially)
20
2.6. Setting Program Usage
Operation Conditions
OPOS must be installed
Screen and function
Setting Program is executed as the following procedure.
1. Execution
If the [User Account Control] dialog box is displayed,
[Windows 7 / Server 2008 R2]
click [Yes].
[Windows Vista / Server 2008]
click [Allow].
【For Windows 7 / Windows Vista】
1) Click the button indicated with the Windows logo
desktop.
2) Go to [All programs] →
[Okidata]→[OPOS]→[Printer OPOS Setup].
【For Windows XP / Windows Server 2008 R2 / Windows Server 2008 /
Windows Server 2003 / WEPOS/ POS Ready 2009】
Go to [Start]→[All programs] →
[Okidata]→[OPOS]→[Printer OPOS Setup].
【For Windows 2000】
Go to [Start]→[Program] →
[Okidata]→[OPOS]→[Printer OPOS Setup].
at the left bottom of the
21
2. Selecting Pri
Select “POS Printer” and “Interface”, and then click [OK].
When LAN interface is selected, Searching printers screen is displayed.
When other interface is selected, POS printer detail setting screen is displayed.
3. Searching printers
nter and Interface
22
- Printer
- Batch Setting Of Printers
- Printer Setting
When POS printer is selected in the list, "Setting printer" shows own IP address, then
press "Printer Setting" button for moving to POS printer detail setting screen page.
Double click on a printer in the list for jumping to POS printer detail setting screen page
Detection
When "Print
name of the found POS printer is displayed. When Device name is "Unsetting", Printer is
disabled on OCX control. There are 2 solutions to enable Printer on OCX control. One is
to set all Unsetting POS printers to default setting by "Batch Setting Of Printers", and
another one is to entry Unsetting Printers one by one by "Printer Setting".
When "Batch Setting Of Printers" button is pressed, OCX gives "Device name" to every
single "Unsetting" printer. In that case, registry setting value will be the same as "5.
Registry Used by OCX ". IP address and Device name is set depending on each printer's
setting.
er Detection" is pressed, the list of IP address, MAC address and Device
directly.
23
4. POS printer
detail setting
When an error occurred with [OK] clicked, the following messages are displayed.
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)
24
1) Device Name
Specify the device to be set which may differ depending on the OCX installed. The items to
be displayed is as follows:
Device Name Interface
LD670SERPRT For Serial Interface
LD670PARPRT For Parallel Interface
LD670USBPRT For USB Interface
LD670SER2PRT For Second Serial Interface
LD670PAR2PRT For Second Parallel Interface
LD670USB2PRT For Second USB Interface
LD670LANPRT_xxx.xxx.xxx.xxx For LAN Interface
2) Port Name
(xxx.xxx.xxx.xxx : IP Adress.)
For XXXSERPRT or XXXSER2PRT, the port can be selected from "COM1" to "COM9"
and for XXXPARPRT or XXXPAR2PRT, from "LPT1" to "LPT9." The port number other
than above can be entered into the Dropdown list. "COM1" or "LPT1" is set as the default
setting after installation.
3) IP Adress
IP address of the set device is displayed.
4) Serial Number
For XXXUSBPRT or XXXUSB2PRT, select the serial number of the printer from "Serial
Number" by all means.
When the serial number of the printer is set by "123456", please select "123456" from
"Serial Number".
5) Baud Rate
Perform the baud rate setting. This setting is available only when XXXSERPRT or
XXXSER2PRT is selected in the “Port Name”. Set the baud rate set in the Printer.
25
6) Format
rm the co
Perfo
XXXSER2PRT is selected in the “Port Name”. Set the communication format set in the
Printer.
The communication protocol is fixed to XON/XOFF.
* Special attention is required to perform the following settings:
1. Specifying 7bit Even (7bit Even 1) is not available from 8bit None (8 None 1) setting.
To perform this setting, specify Even (8 Even 1) first, and then specify 7bit Even.
2. Specifying 7bit Odd (7bit Odd 1) is not available from 8bit None (8 None 1) setting.
To perform this setting, specify Odd (8 Odd 1) first, and then specify 7bit Even.
3. To specify 8bit None (8 None 1) from 7bit Even (7 Even 1), specify 8bit Even (8 Even
1) first, and then specify 7bit Even.
4. To specify 8bit None (8 None 1) from 7bit Odd (7 Odd 1), specify 8bit Even (8 Odd 1)
first, and then specify 7bit Odd.
7) Print Columns
Set the width of receipt and the number of the characters to be set in a single line.
mmunication format. This setting is available only when XXXSERPRT or
8) Drawer Status
With some drawer, the drawer open/close event from the Drawer OCX may be reversed. To
acquire the event properly and avoid such behavior, change the setting to "Invert."
9) Smoothing
Select whether smoothing processing is performed when the RecLetterQuality property is
set to TRUE while printing double byte or more is specified for the font printing. When
Mode1 or Mode2 is selected, smoothing processing is performed. With smoothing
processing, the quality of double byte printing is improved, but printing performance may
be declined slightly.
10) Color
When red is specified in the escape sequence with special paper, printing in the second
color on the receipt is available. When "Mono" is specified, the second color printing is not
performed even the escape sequence setting is specified.
26
11) PNE Sence
Set whet
12) Print Level
Specifies the printing thickness.
The default's printing level of black is taken as 130 %. The percentage can be set from 70
to 130 by 5 %.
13) Black Level
Specifies the thickness of black when 2-color printing is set.
The default's printing level of black is taken as 130 %. The percentage can be set from 70
to 130 by 5 %.
14) Print Speed
Specifies the printing speed. It can be set to the numbers form 1 to 9. The default is set to
"5" that is highest printing speed.
15) Power Save
her to notify
the paper near end.
Set whether to reduce power consumption.
"Normal" is standard (the default value), and power consumption is not reduced.
"Mode1" reduces the power consumption setting to 80%.
"Mode2" changes the division numbers of strobe (The printing speed is declined)
16) Cutter Mode
This is valid only for the full cut model.
"Full" (a default value) sets movement of a full cut command on a full cut.
"Partial" sets movement of a full cut command on a partial cut.
17) Extension Font
Set whether to use Extension font.
This is valid only for the Extension font model.
"Off" uses normal size font.
"On" uses Extension font, which is larger than normal size font.
27
18) Apartment
The method of initialization and the termination of DLL is specified.
19) Black Mark
The setting is available only in the case of black mark specifications.
Set whether to mount the black mark sensor. The setting is valid when "Enable" is selected.
20) BM Feed Cut
This is valid only when the blackmark sensor is mounted.
When "Enable" is selected, cut operation is executed at black mark positioning.
When "Disable" is selected, cutting operation is not executed.
21) BM Check at Power on
This is valid only when the blackmark sensor is mounted.
"Enable" feeds the paper to black mark position, when the printer turns on.
22) Roll Paper Unit
This is valid only when the Roll Paper Unit is installed.
When "Uninstall" is selected, the Roll Paper Unit is invalid.
When "Installed" is selected, the Roll Paper Unit is valid.
23) Roll Paper Unit PE
This is valid only when the Roll Paper Unit is installed.
The sensor that detects PE of the Roll Paper Unit is specified.
When "PE" is selected, PE sensor detects PE.
When "PNE" is selected, PNE sensor detects PE.
24) Cancel, OK buttons
When the OK button is pressed, the settings are written into the registry and the command
to change the settings is sent to the Printer. To run this program, connect the printer and
turn on the power beforehand. (If the printer is not connected, the power is not turned on or
the printer is in the error status, the settings are not set in the Printer and only the registry is
set.)
25) Reload button
When the Reload button is pressed, the serial number of the printer connected with USB is
acquired again.
28
26) Layout Setting button
the Layout Sett
When
ing button is pressed, the Paper layout setting screen is displayed.
29
5. Paper
- Paper Type
layout setting
.
Specifies the paper type used by LD670.
Selection value: “Normal” / “Black Mark” / “Label”
Default value: “Normal”
- Paper Width
Specifies the paper width used by LD670.
Input range: 25.4 – 70, 80, 83mm *
Default value: 70mm
- Left Margin
Specifies the left margin of the paper used by LD670.
Input range: 1.0 – 69.0mm *
Default value: 3.0mm
* When [Print Width] of the following calculation comes off from the range from 12 to
80mm, the input value is corrected to a proper value.
[Print Width] = Paper Width – Left Margin – Right Margin
When focus comes off from each input box, the check and the correction of the input
value are done.
When the calculation value of [Print Width] becomes small more than 12mm, the input
value is corrected to the value that [Print Width] becomes 12mm.
When the calculation value of [Print Width] exceeds 80mm, the input value is corrected
to the value that [Print Width] becomes 80mm.
Default Port of the USB is set by "USB", and the set value adds it after "USB" and writes
in it at the following registry. (Please set the serial number of the printer to connect)
(An example: When the serial number is set to "123456", "USB123456" is written in the
registry.)
Based on the setting values, the combination of Baud Rate and Format is written to the
registry. For example, when Baud Rate = "19200" and Format = "8 None 1",
"19200,N,8,1,x" is written into the value. When Format = "7 Odd 1", "19200.O,7,1,x", and
when Format = "8 Even 1", "19200,E,8,1,x" are written into the following values:
Based on the setting values set, the number of the characters per line, available line
character width and paper width are set in the following values:
When the value is set to Normal, "S" is written into the following registry, and when the
value is set to Mode1, "1" is written, and when the value is set to Mode2, "2" is written.
When Normal is selected, "48" is written into the following registry, and when Black Mark
is selected, "49" is written, snd when Label is selected, "64" is written.
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. ClaimDevice method: Called to enable exclusive access to the device. For the device of
exclusive use, this method is required, and foe the dev i ce of sharable use, it is opt io nal.
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. ReleaseDevice method: Called to clear exclusive access to the device.
7. Close method: Called to release the service object from the control object.
For details of other usage, refer to "OPOS-APG V1.13" document.
3.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.
39
3.3. How to Implement the OPOS Control
The following steps describe how to implement the OPOS-OCX control in the application.
To Implement Using Visual Basic 6.0
1. Start Visual Basic 6.0 and select the type of the project to be created. In this example,
[Standard EXE] is selected. After selection, select [Project] from the menu, and select
[Component].
40
2. When the Co
OLE Control (1.13) module], and press the [OK] button.
3. Paste the OCX displayed in the toolbar on the form. After this procedure, use it in the
mponent dialog box is displayed, select the [Control] tab -> [POSPrinter
same manner as normal OCX.
41
To Implement Using Visual C++ 6.0
1. Start Visual C++ 6.0, select [Create New] -> [MFC AppWizard(exe)], and press [OK].
2. In the MFC AppWizard Step 1, select [Dialog Base] and press the [Next] button.
42
3. Select the ActiveX
to the type of the project to be created. Select [Next] and perform appropriate setting
as required for the rest of the instruction.
Control checkbox to be supported. Change other settings according
4. When
n the proje
ct is created, select [Resource View] to display the main dialog box.
43
5. On the dialo
Control]. When the dialog box is displayed, select [POSPrinter OLE Control (1.13)
module] and select [OK].
6. When OCX is inserted on the dialog box, select the control and right-click it. From the
pop-up menu, select [Property]. Check the ID of the OCX. Clear the [Visible] and
g box, right-click to display the pop-up menu, and select [Insert ActiveX
[Tab Stop] check boxes.
44
7. Close [Property
Variable] tab, select the control ID checked in the step 6, and press [Add Variable].
8. When th
e
], repeat the step 6 and select [ClassWizard]. Select the [Member
wing dialog box is displayed, press [OK].
follo
45
9. Set the mem
Use this member variable for the properties and methods with the OCX.
Example: m_POSPrinter.Open(“LD670SERPRT”)
ber variable corresponding to the OPOS control, and exit Class Wizard.
* 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 ClaimDevice method and Enable indicates setting the
DeviceEnabled property to TRUE. If required procedure is not executed, the error may be
set in the ResultCode property. When May Use After is Open & Claim or Open, Claim &
Enable, the property 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.
*1: Items required for initialization are different from "OLE for Retail POS Application
Programmer's Guide Instructions The 1.13 Version".
56
4.2. Printing Data and Escape Sequence
This OCX supports the following Escape Sequence.
1) Escape Sequence which operates only when assigned time
Name Data Contents
Paper Cut ESC |#P It cuts the receipt paper. The character '#' is the
character string of ASCII decimal number which
shows the percentage of required cutting. It is
possible to omit '#'. When the value is between '1' to
'99', partial cutting is performed. When the value is
'100' or omitted, full cutting is performed. When the
value is other than any value between '1' to '100', it is
ignored
In addition to that, if there are data buffered to POS
Printer, (in the case that POS Printer does not print
even though printing request is done) it cannot do
cutting. To execute cutting, it must be at the head of
the line.
It is also unavailable in 90 degrees rotating to the left
or to the right by RotatePrint Method, and back in
operation after clearing 90 degrees rotating to the left
or to the right.
When PTR_MF_TO_CUTTER(2) is included in the
CapRecMarkFeed property, the cutting is executed
after the paper is fed to the cutter position, and the
paper is fed to the next mark position.
Feed and Paper Cut ESC |#fP It cuts the receipt paper after feeding the paper for
the lines of RecLinesToPaperCut. Character '#' is
defined by "Paper Cut" Escape Sequence. In addition
to that, if there are data buffered to POS Printer, (in
case that POS Printer does not print even though
printing request is done) it cannot do cutting. To
execute cutting, it must be at the head of the line.
It is also unavailable in 90 degrees rotating to the left
or to the right by RotatePrint Method, and back in
operation after clearing 90 degrees rotating to the left
or to the right.
When PTR_MF_TO_CUTTER(2) is included in the
CapRecMarkFeed property, the paper is fed for the
lines of RecLinesToPaperCut, and the cutting is
executed after the paper is fed to the cutter position,
and the paper is fed to the next mark position.
Feed, Paper Cut,
and Stamp
ESC |#sP It is not supported.
57
Name Data Contents
Print bitmap ESC |#B It prints the bitmap saved by SetBitmap Method. '#'
is the Bitmap number and supports 20 bitmap
printing '1' to '20'. It is possible to change printing
quality by changing RecLetterQuality property
value in printing. As for handling printing quality, it
is same as PrintBitmap Method. When '#' is
omitted, it is handled as character string.
Printing is available during 90 degrees rotating to the
left or to the right by the RotatePrint method, but
printing may not be performed properly because
printing area of the bitmap size is not calculated.
When '#' is omitted, it is regarded character string
data starting with the character "B".
When the number that is not stored in the SetBitmap
method, the print command is issued to the printer,
but printing is not performed.
Print top logo ESC |tL It prints the top logo saved by SetLogo Method.
Print bottom logo ESC |bL It prints the bottom logo saved by SetLogo Method.
Fire stamp ESC |sL It is not supported.
Feed line ESC |#lF Feeds the paper forward by lines. The character '#' is
replaced by an ASCII decimal string telling the
number of lines to be fed. If '#' is omitted, then one
line is fed. '#' supports the values from '1' to '255'. (If
the value is smaller than '1', the command is not
executed, and if the value is larger than '255', the
command is executed regarding that '255' is
assigned.)
If print data is not presence, line feed operation is
executed according to the amount of line feed, and if
print data is presence, the height of the print data is
fed.
If the value specified for "#" exceeds 35.4 in
(approx. 900 mm), the command is executed feeding
the paper by 35.4 in (approx. 900 mm)..
In 90 degrees rotating to the left or to the right by
RotatePrint Method, it prints next printing location
after Returns of feed-assigned lines.
58
Name Data Contents
Feed unit ESC |#uF Feeds the paper forward by the units defined with
MapMode. The character '#' is replaced by an
ASCII decimal string telling the number of units to
be fed. If '#' is omitted, then one unit for each
MapMode is fed.
MapMode = PTR_MM_DOTS(1)
'#' supports the values from '1' to '127'. (If the value
is smaller than '1', the command is not executed, and
if the value is larger than '127', the command is
executed regarding that '127' is assigned.)
MapMode = PTR_MM_TWIPS(2)
'#' supports the values from '1' to '903'. (If the value
is smaller than '1', the command is not executed, and
if the value is larger than '903', the command is
executed regarding that '903' is assigned.)
MapMode = PTR_MM_ENGLISH(3)
'#' supports the values from '1' to '627'. (If the value
is smaller than '1', the command is not executed, and
if the value is larger than ''627', the command is
executed regarding that ''627' is assigned.)
MapMode = PTR_MM_METRIC(4)
'#' supports the values from '1' to '1594'. (If the value
is smaller than '1', the command is not executed, and
if the value is larger than '1594', the command is
executed regarding that '1594' is assigned.)
The line feed setting of the printer does not affect the
amount of line feed. It is executed on the halfway of
the line, and when the specified amount of line feed
is less than 1 line, then 1 line is fed
In 90 degrees rotating to the left or to the right by
RotatePrint Method, it will print after the interval of
the value of next printing location assigned by unit
feed.
Feed reverse ESC |#rF It is not supported.
59
Name Data Contents
Send embedded data ESC |#rE The successive character string of "#E" is passed to
the device without any change. The character '#' is
replaced by an ASCII decimal string specifying the
number of bytes following the escape sequence to be
passed directly to the device. If '#' is omitted, it is not
regarded as the escape sequence, and handled as
print data. Character string cannot output a control
code and the cord of 80H - FFH as expected. In this
case, set it in either of OPOS_BC_NIBBLE(1),
OPOS_BC_DECIMAL(2) by a BinaryConversion
property, and set printing data.
When the print data specified by '#' is not set after
the escape sequence is specified, available print data
is sent. (Example: When ESC|2E"a" is specified,
only "a" is sent because the character string is set
only for one byte.)
In rotate printing 90 degrees to the left or to the right
by the RotatePrint method, the data column
specified by Send embedded data is not counted as
the character string, the width cannot be calculated.
Adjust the printing width by inserting empty space
and so on.
Barcode printing
(Refer to the next page)
ESC |#rR Prints the barcode. The character ‘#’ is replaced by
an ASCII decimal string and the number of
characters following the R to use in the definition of
the characteristics of the barcode to be printed. See
details below.
The barcode may be printed during rotate printing 90
degrees to the left or to the right by the RotatePrint
method, but printing may not be performed normally
because the print area is not calculated by the
specified barcode width. When the other character
string data specified exceeds the barcode width,
printing is executed.
In the RotatePrint method, please use it without
specifying PTR_RP_BARCODE.
Even if the RotateSpecial property is specified, the
rotation print is not done.
The available width that can be set by the parameter
is up to the value of the RecLineWidth property and
is not affected by the RotateSpecial property.
60
Starting with
barcodes in-line with other print commands. The character ‘#’ is the number of characters
following the R to use in the definition of the characteristics of the barcode to be printed.
In the data following the R, other lower case letters and numbers are used to identify
different values. The same value definitions as defined for the printBarCode method
headers and definitions are used for the various barcode values. Converting to string the
values from the definitions are consistent.
The attribute symbols are defined as follows:
s symbology
h height
w width
a alignment
t human readable text position
d start of data
e end of sequence
The attributes must appear in the order specified in the above list. (It cannot be omitted)
Release 1.13, the application can use the ESC|#R escape sequence to print
Using a basic UPCA, center aligned, with bottom text, 200 dots height and 40 0 dots wide,
the command is as follows:
ESC|33Rs101h200w400a-2t-13d123456789012e
The followings are excerption of the definitions of the constants used in the example above
from the header file.
const LONG PTR_BCS_UPCA = 101; // Digits
const LONG PTR_BC_CENTER = -2;
const LONG PTR_BC_TEXT_BELOW = -13;
61
In addition, the thres
hold of each parameter is as follows. When the threshold exceeded it,
the barcode is not printed.
Width(dot) Height(dot) Alignment Barcode
except PDF417 The most narrow width
of the individual barcod
– RecLineWidth
PDF417
172 - RecLineWidth
PDF417
172 - 831 12 –
During right and left
90 degrees turn by
RotatePrint method.
2) Escape Sequence Operating in Printing
1 - 255 All values defined by
PrintBarcode method are
available.
12 - 831 All values defined by
PrintBarcode method are
available.
As well as an appointed
RecLineWidth
value, all values become
the left hotchpotch
It has characteristics that are remembered until explicitly changed.
Name Data Contents
Font typeface selection ESC |#fT It is not supported.
62
3) Escape Sequence Operating at the Time of Printing
It has the characteristics that are reset at the end of each print method, by an explicit reset (where
applicable), or by a “Normal” sequence.
Name Data Contents
Bold ESC |bC Prints in bold. If ‘!’ is specified then bold is disabled.
Underline ESC |#uCPrints with underline. The character ‘#’ is replaced by an
ASCII decimal string telling the thickness of the underline
in printer dot units. Underlines of one dot or two dots are
only supported. If it is omitted, underline of one dot is
printed.
Italic ESC |iC It is not supported.
Alternate color ESC |#rCIt is not supported.
Red ESC |rC It prints with the second color of the receipt.
Printing is possible only when "Printing Color" of Printer
Setting is "Two Colors".
When Color = mono is set in the setting program, printing
is not affected by specifying this escape sequence.
Reverse video ESC |rvCPrints in a reverse video format. If ‘!’ is specified then
reverse video is disabled.
Shadowing ESC |#sCIt is not supported.
Single high and
wide
Double wide ESC |2C Prints double-wide characters.
Double high ESC |3C Prints double-high characters.
Double high and
wide
Scale horizontally ESC |#hCIt prints characters, enlarging them horizontally. The
Scale vertically ESC |#vCIt prints characters, enlarging them vertically. The character
RGB Color ESC |#fCIt is not supported.
Center ESC |cA It aligns the text, from there after, in the center. It is not
Right justify ESC |rA It aligns the text, from there after, to the right. It is not
Normal ESC |N It regains POS Printer attribute to the normal state. It is
ESC |1C Prints normal size.
ESC |4C Prints double-high/double-wide characters.
character '#'is the ASCII decimal character string which
shows horizontally enlarging rate. It supports form one to
eight times.
If "#" is omitted, it prints in life-size.
'#' is the ASCII decimal character string which shows
vertically enlarging rate. It supports form one to eight
times.
At the time of "#" abbreviation, it prints in life-size.
available unless you assign at the head of the line.
It is unavailable in 90 degrees rotating to the left or to the
right by RotatePrint Method.
available unless you assign at the head of the line.
It is unavailable in 90 degrees rotating to the left or to the right
by RotatePrint Method.
impossible to regain from Centering or Align Right, unless
you assign at the head of the row.
63
Name Data Contents
SubScript ESC |tbCIt is not supported.
SuperScript ESC |tpCIt is not supported.
64
4.3. Common Properties
The following sections describe the properties provided commonly to the POS printer.
We have two kinds of properties: Read-Only and Read/Write. If a property is for writing, R/W will
be shown at the side of each property.
Only if return value has a special meaning, it will be shown. As for error, in case that access is done
without satisfying initializing condition, refer to ResultCod e pr operty .
BinaryConversion Property R/W
Syntax
LONG BinaryConversion;
Remarks
OPOS passes multi-character input and output using BStrings. BStrings may be safely
used for text data. As the BStrings are passed between the application and the OPOS
Control, OLE may perform language-specific translations to or from Unicode. When
BStrings are used to pass binary data, then these translations may alter the original data
such that the data byte in a BString character at the application does not match the
corresponding byte at the Control. This mismatch is more likely when BString pointers are
used, since the Unicode characters are presented to the application and/or Control, and a
language difference between them may cause misinterpretation.
Characters between 0x00 and 0x7F may be sent without fear of language-specific
translation. Only characters between 0x80 and 0xFF sometimes cause incorrect
translations.
This document specifies those properties and method parameters that are affected by
BinaryConversion in the individual property and method descriptions. The following line
is added to their description:
"In the OPOS environment, the format of this data depends upon the value of the
BinaryConversion property. See BinaryConversion property."
65
The val
V
OPOS_BC_NONE (0) Data is not converted and one character of Bstring is
OPOS_BC_NIBBLE(1) Each byte is converted to two characters. (By this
OPOS_BC_DECIMAL(2) Each byte is converted to three characters. VAL(string)
ues of BinaryConversion are as follows.
alue Meaning
contained for one byte. (Default)
option, conversion between Binary and ASCII is the
fastest.)
Each data byte is converted just like below.
The first character = 0x30 + 7-4 byte of data byte
The second character = 0x30 + 3-0 byte of data
byte
Example: 154=0x9A (byte value) is converted to 0x39
0x3A (character) (character string "9:"). So this
conversion way is deferent from usual hexadecimal
ASCII character conversion to convert byte value
(154=0x9A) to code (0x39 0x41)(character string
"9A").
is used with three characters for converting from ASCII
to Binary. RIGHT("^^"+STR(byte),3) is used to form
three ASCII characters from each byte. '^' means space
character.
When BinaryConversion is on (that is, not OPOS_BC_NONE) and the property or
method parameter description specifies that BinaryConversion applies, then the
application has the responsibilities to convert the character string to the format assigned to
BinaryConversion, before setting property and delivering method parameter.
This property is initialized to OPOS_BC_NONE(0) by Open Method.
66
Return V
alue
When th
Property
Value Meaning
OPOS_SUCCESS(0) It succeeds s in Property setting.
OPOS_E_ILLEGAL(106) Illegal value is assigned.
is property is set, either of the following values will be contained in ResultCode
67
CapCompareFirmwareVersion Property
Syntax
BOOL CapCompareFirmwareVersion;
Remarks
If TRUE, then the Service/device supports comparing the version of the firmware in the
physical device against that of a firmware file.
This property is initialized to TRUE by the Open method.
CapPowerReporting Property
Syntax
LONG CapPowerReporting;
Remarks
It identifies power reporting ability. The value to show power reporting ability is just the
following.
Value Meaning
OPOS_PR_STANDARD(1) SO can judge two kinds of power states and can report
it. (ONLINE and OFF_OFFLINE)
This property is initialized by Open Method.
CapStatisticsReporting Property
Syntax
BOOL CapStatisticsReporting;
Remarks
This property is initialized to FALSE by the Open method. Statistics reporting is not
supported.
68
CapUpdateFirmware Property
Syntax
BOOL CapUpdateFirmware;
Remarks
This property is initialized to TRUE by the Open method. The device’s firmware can be
updated.
CapUpdateStatistics Property
Syntax
BOOL CapUpdateStatistics;
Remarks
This property is initialized to FALSE by the Open method. Statistics reporting is not
supported.
CheckHealthText Property
Syntax
BSTR CheckHealthText;
Remarks
It keeps the CheckHealth Method result called just before. The following are examples of
the check.
- In case of Internal "Internal HCheck: Successful", "Internal HCheck:
OFF/OFFLINE"
- In case of External "External HCheck: Not Supported"
- In case of Interactive "Interactive HCheck: Not Supported"
This value is initialized to null character before the first CheckHealth method call.
69
Claimed Property
Syntax
BOOL Claimed;
Remarks
TRUE: The device is claimed for exclusive access.
FALSE: The device is released for sharing with other applications.
Claimed Property value is initialized to FALSE by Open Method.
ControlObjectDescription Property
Syntax
BSTR ControlObjectDescription;
Remarks
"POS Printer OPOS Control Object." is set.
Identifies the Control Object . It is a charact er string identifyi ng the Control Object and the
company that produced it and always readable.
This property is readable at any time.
70
ControlObjectVersion Property
Syntax
LONG ControlObjectVersion;
Remarks
"1013XXX" is set. Holds the Control Object version number. Following three version
levels are specified:
Version Level Description
Major The "millions" place.
Holds the OPOS major version level.
Minor The "thousands" place.
Holds the OPOS minor version level. This is always set
to 10 since this OPOS control conforms to OPOS
version 1.13.
Build The "units" place. Updated when corrections are made
to the Control Object.
This property is always readable. (XXX varies depending on the time the Control Object is
distributed.)
DeviceDescription Property
Syntax
BSTR DeviceDescription;
Remarks
"OP 1 Station Thermal POSPrinter" is set.
This property is a character string identifying the device, and holds the device and any
pertinent information about it
This property is initialized by the Open method.
71
DeviceEnabled Property R/W
Syntax
BOOL DeviceEnabled;
Remarks
TRUE:
The device is made to enable (Operation state). If converted to TRUE, it is made to
enable.
FALSE:
The device is made to disable. If converted to FALSE, it is made to disable.
Before this device is used, application must set this property TRUE.
Also, while DeviceEnable is TRUE, Device Connection State (PowerReporting) is
reported. This property is initialized to FALSE by Open Method.
72
Return V
alue
When this pr
Value Meaning
OPOS_SUCCESS(0) It succeeds in Property setting.
OPOS_E_NOTCLAIMED(103) In order to make exclusive use device enable, it must
OPOS_E_NOHARDWARE(107) POS Printer is OFF or OFFLINE or the cable is not
OPOS_E_FAILURE(111) Th e connection to the device is failed. Carry out once
For USB interface, confirm two unsetting printers or
The mistake might be found in the setting of plural
OPOS_E_TIMEOUT(112) Connection to the POS Printer could not be established.
OPOS_E_BUSY(113) Setting the property is failed because processing . Set
The others Refer to ResultCode Property.
operty is set, the following value is placed in the ResultCode property:.
acquire exclusive access right, before that.
connected. Clear the problem, and then execute the
property again. (* In the case of USB interface, even if
a POS printer is connected, this error occurs when a
serial number set by registry is different from a serial
number set by a POS printer.)
*In case of LAN interface model, same error occurs that
if both of POS printer's IP addresses and the registry's
are different, even the POS printer is connected in
network.
again after having confirmed whether there is a
connection port and whether a connection port is not
used by other programs.
more are not connected at the same time, and confirm it
is not a printer used in the other port (for instance, when
XXXUSBPRT is used, XXXUSB2PRT).
connection. Set up one again.
There is the possibility of cover open or running out of
paper.
the property after processing.
73
DeviceName Property
Syntax
BSTR DeviceName;
Remarks
"OP 1 Station Thermal POSPrinter" is set up.
This property shows the device and the any pertinent information about it. This is a short
version of DeviceDescription property and should be limited to 30 characters.
This property is initialized by the Open method.
FreezeEvents Property R/W
Syntax
BOOL FreezeEvents;
Remarks
Return Value
Property.
In case of TRUE, Event is not reported from Control.
Event is kept by Control till the freeze is terminated.
In case of FAL SE, if Event is reported from Control. If there is any Event kept during
freeze, that Event is reported when FreezeEvents are converted to FALSE.
If interrupt by Event is undesirable, Application can select Event freeze. In case that
ErrorEvent is frozen, State Property becomes OPOS_S_BUSY(3). In such case, Control
cannot be closed. In this case, cancel the event frozen by ClearOutput Method, or set
TRUE and execute Close Method after ErrorEventis originated.
This property is initialized to FALSE by Open Method.
At the time of this property setting, the following values will be contained to ResultCode
Value Meaning
OPOS_SUCCESS(0) It succeeds in property setting.
74
OpenResult Property
Syntax
LONG OpenResult;
Remarks
It keeps the latest result by Open Method. The values of OpenResult are just the
following.
Value Meaning
OPOS_SUCCESS(0) Open is succeeded.
EOPEN_ALREADYOPEN(301) It is already opened.
EOPEN_REGBADNAME(302) There is no assigned Device Name Key in the registry,
or Device Name is not assigned.
EOPEN_REGPROGID(303) Default value of Device Name Key is not readable, or it
could not convert Programmatic ID kept there to
effective Class ID.
EOPEN_CREATE(304) It could not generate Service Object Instance, or could
not obtain IDispatch Interface.
EOPEN_BADIF(305) Service Object does not support one or more methods
required by assignment version. It is possible that
Device Name setting differs from POS Printer Service
Object.
It has the identifier to uniquely identify asynchronous request. (Asynchronous Respond
Method Call when AsyncMode Property is set to TRUE.)
When a method successfully initiates a synchronous or asynchronous output, the Control
assigns an identifier to the request. For asynchronous output, when the output completes,
the Control will fire an OutputCompleteEvent passing this output ID as a parameter.
Output ID Number is numbered cyclically between 1 and 65535.
This is the Power Notify Function type set by Application.
The values to show Power Notify Function are just the following.
Value Meaning
OPOS_PN_DISABLED(0) Control does not give any power notification to
Application. StatusUpdateEvent concerning Power
Notification is not given and any setting is not done to
PowerState Property.
(Default Value)
OPOS_PN_ENABLED(1) When DeviceEnabled is set to TRUE, Control does
StatusUpdateEvent notification and PowerState
Property update.
PowerNotify Property can be set during Device is disable, which means when
DeviceEnabled Property is FALSE.
Return Value
When this property is set, one of the following values is contained in ResultCode
Property.
Value Meaning
OPOS_SUCCESS(0) It succeeds in property setting.
OPOS_E_ILLEGAL(106) One of the following happens:
Device is already enabled.
Property setting value is illegal.
The others Refer to ResultCode items.
76
PowerState Property
Syntax
LONG PowerState;
Remarks
While PowerNotify is OPOS_PN_ENABLED(1), Present Device Power State is set up.
The values to show power state are just the following.
Value Meaning
OPOS_PS_UNKNOWN(2000) It cannot judge the device power state according to one
of the following reasons. (Default Value)
When PowerNotify = OPOS_PN_DISABLED(0),
Power Notify Function is disable.
When DeviceEnabled = FALSE, Power State Monitor
does not operate till Device becomes enable.
OPOS_PS_ONLINE(2001) Device power is ON and at the same time is ready.
OPOS_PS_OFF_OFFLINE(2004) Device power is OFF, or is not connected to the body.
As for recovery way, refer to ResultCode Property,
OPOS_E_NOHARDWARE(107).
This property is initialized to OPOS_PS_UNKNOWN by the Open method.
When PowerNotify is set to OPOS_PS_ENABLED(1) and DeviceEnabled is TRUE,
then this property is updated as the SO detects power condition changes.
77
ResultCode Property
Syntax
LONG ResultCode;
Remarks
Each property sets this property. It is set when it obtains property, or when it set writable
property.
This property is always readable. It returns OPOS_E_CLOSED(101) till it calls up Open
Method.
The result code values are just the following.
Value Meaning
OPOS_SUCCESS(0) Normal Operation
OPOS_E_CLOSED(101) You try to access the closed device.
OPOS_E_NOTCLAIMED(103) You try to access Exclusive Use Device for which you
need to obtain exclusive access right before using
method/property setting process.
OPOS_E_NOSERVICE(104) Control cannot communicate to Service Object. Perhaps,
you must correct Set Up Error or Configuration Error.
OPOS_E_DISABLED(105) It cannot be executed when Device is disabled.
OPOS_E_ILLEGAL(106) You try to execute unavailable operation to Device or
operation not supported. Or you use unavailable
parameter value.
OPOS_E_NOHARDWARE(107) POS Printer is OFF or OFFLINE.
OPOS_E_FAILURE(111) Even though Device is connected to System, Power is
ON, and it is ONLINE, Device cannot execute the
requested process.
OPOS_E_TIMEOUT(112) The Service Object waiting for the response from
Device does time-out, or the Control waiting for the
response from Service Object does time-out.
OPOS_E_BUSY(113) Present SO state cannot accept this request. For
example, when asynchronous Output is executed, some
methods cannot accept it.
OPOS_E_EXTENDED(114) Particular Error State occurs. Error State Code can be
confirmed with ResultCodeExtended Property
78
ResultCodeExtended Property
Syntax
LONG ResultCodeExtended;
Remarks
When ResultCode is OPOS_E_EXTENDED(114), particular-to-class error information
value described in device class explanation to this property is set.
When ResultCode is another value, Service Object can set particular-to-SO value to this
property. These values have meaning only when Application processes them adding
particular-to-SO values.
Printer Cover is open.
To recover from Error,
close the cover. In this case,
you don't have to make
OPOS disable,
ReleaseDevice, Close. If
Cover opens in printing,
after closing cover, the
not-yet-printed data will be
printed. However, there is
the possibility of
interrupted printing space
among the printing data.
Run-out-of-receipt-paper.
To recover from error, feed
receipt paper. At this time,
there is no need to make
OPOS disable, and
ReleaseDevice, Close. If
run-out-of-paper happens in
printing, the printing data
not yet printing will be
printed after feeding receipt
paper.
Bitmap is too big for the
Printer to process.
Check the bitmap file.
The format is not correct as
a bitmap file.
There is a possibility that
the file name is not correct
or the contents of the file
are corrupt.
The format is not correct as a
firmware file.
There is a possibility that the file
name is not correct or the contents of
the file are corrupt.
The paper layout eorror occurs in
Printer. At this time, there is no need
to make OPOS disable, and
ReleaseDevice, Close. Please change
printing paper appropriately.
Fatal error occurs in Printer. There is
no recover way. Do OPOS Close.
Printer Header Overheat Error
happened. To recover from the error,
leave it for a while until the head
temperature cools down and the error
does not occur again. At such time,
there is no need to make OPOS
disable, and ReleaseDevice, Close.
If Head Overheat occurs in printing,
the printing data not yet printing will
be printed after the head temperature
recovery. However, there is the
possibility of interrupted space of
printing of the printing data.
80
ServiceObjectDescription Property
Syntax
BSTR ServiceObjectDescription;
Remarks
"POS Printer OPOS Service Object" is set. This property is initialized by the Open method
ServiceObjectVersion Property
Syntax
LONG ServiceObjectVersion;
Remarks
"1013XXX" is set. Holds the Service Object version number. (XXX varies depending on
the time the Control Object is distributed.) This property is initialized by the Open
method.
State Property
Syntax
LONG State;
Remarks
It shows the present state of Control.
Value Meaning
OPOS_S_CLOSED(1) Control is closed. (Default)
OPOS_S_IDLE(2) Control is in normal state and not busy.
OPOS_S_BUSY(3) Control is in normal state and busy because it is
outputting.
OPOS_S_ERROR(4) Error is reported, and if you want to restart usual I/O,
Application must return Control into normal state.
This property is always readable.
81
4.4. Common Methods
The following section describes the methods provided commonly to the POS printer.
CheckHealth Method
Syntax
LONG CheckHealth (LONG Level);
Level parameter shows the type of health check executed with device. The following
values can be assigned.
Value Meaning
OPOS_CH_INTERNAL(1)Performs on line check. The result is set to the
CheckHealthText property as follows:
When the POS Printer is connected to POS and the
power is turned on, "Internal HCheck: Successful" is
set in the CheckHealth property.
When the POS Printer is not connected to POS, or the
power is turned off, "Internal HCheck: OFF/OFFLINE"
is set in the CheckHealth property.
Returns OPOS_SUCCESS(0).
OPOS_CH_EXTERNAL(2) It is not supported with this OCX..
"Internal HCheck: NOT Supported" is set in the
CheckHealth property.
Returns OPOS_ILLEGAL(106).
OPOS_CH_INTERACTIVE(3) It is not supported with this OCX..
"Internal HCheck: NOT Supported" is set in the
CheckHealth property.
Returns OPOS_ILLEGAL(106).
Remarks
It is called at the time of device condition test. The result of this method is contained in
CheckHealthText Property. CheckHealth Method is always synchronous.
82
Return V
alue
Any of the fol
Value Meaning
OPOS_SUCCESS(0) It shows that Health Check Procedure starts properly
OPOS_E_ILLEGAL(106) Level parameter not supported is assigned.
OPOS_E_NOHARDWARE(107) After assigning and executing
OPOS_E_BUSY(113) It cannot be executed while Output is ON.
The others Refer to the items of ResultCode.
lowing values will be returned and be contained in ResultCode.
and that, when confirmed that, the device is working
properly. However you cannot decide about its
properness until you see the result of the test.
OPOS_CH_INTERNAL(1), it is Offline.
83
ClaimDevice Method
Syntax
LONG ClaimDevice (LONG Timeout);
Timeout Parameter shows maximum waiting time (in ms.) till it acquires exclusive access
right.
In case of zero, even if it cannot acquire the Device Exclusive Access Method, it returns
the result immediately.
If OPOS_FOREVER(-1) is set, Method waits as long as till it can acquire exclusive
access right.
Remarks
This method is called when exclusive access is required to device.
POS Printer Device cannot be used without acquiring exclusive access right.
In case of success, Claimed Property is set to TRUE.
Return Value
If ClaimDevice Method is executed, it establishes connection to POS Prin ter Device, and
confirms the process possibility. If the process is possible, it requires particular data and
ClaimDevice Method, and ends normally.
One of the following values will be returned and contained to ResultCode Property.
Value Meaning
OPOS_SUCCESS(0) Exclusive access right is confirmed. Claimed Property
is TRUE. If this application has already accessed the
device exclusively, it is returned, too.
OPOS_E_ILLEGAL(106) Unavailable Timeout Parameter is assigned.
OPOS_E_TIMEOUT(112) Othe r application tries to access the device exclusively
and waits for being released. But Timeout Time (in ms.)
has passed. Or, POS Printer Device does not become
POS-Printer-Device-Process-Possible State even after
Timeout Time (in ms.) passes.
OPOS_E_EXTENDED(114) Refer to the ResultCodeExtended property.
84
ClearOutput Method
Syntax
LONG ClearOutput ();
Remarks
It is called when to clear all the output devices buffered by asynchronous issue of each
method of PrintNormal, CutPaper, RotatePrint, PrintBarCode, PrintBitmap, TransactionPrint. Also, it does release when it is in rotation mode or in batch processing
mode by RotatePrint Method or TransactionPrint Method.
Pending Output Error Event (which is in case that FreezeEvents are wanting for being set
to FALSE) is also cleared.
Return Value
Following values will be returned and contained to ResultCode Property.
Value Meaning
OPOS_SUCCESS(0) Output is cleared.
OPOS_E_FAILURE(111) Device is accessed exclusively by other process.
The others Refer to items of ResultCode.
Close Method
Syntax
LONG Close ();
Remarks
It is called when to release Device and its resource.
If DeviceEnabled Property is TRUE, Device is forced to disable.
If Claimed Property is TRUE, at first, exclusive access will be released.
Don't execute at the time of Event Processing. (within Event Handler)
Return Value
One of the following values will be returned and contained to ResultCode Property.
Value Meaning
OPOS_SUCCESS(0) Device is disabled and closed.
OPOS_E_BUSY(113) Asynchronous processing is under way.
The others Refer to items of ResultCode.
85
CompareFirmwareVersion Method
Syntax
LONG CompareFirmWareVersion (String FirmWareFileName, Long result);
Parameter Meaning
FirmWareFileNameHolds the name of the firmware file whose version is to
be compared against the firmware version of the device.
resultReturns the result of the comparison..
OPOS_CFV_FIRMWARE_OLDER (1)
Indicates that the version of one or more of the
firmware files is older than the firmware in the device.
OPOS_CFV_FIRMWARE_SAME(2)
Indicates that the versions of all of the firmware files
are the same as the firmware in the device.
OPOS_CFV_FIRMWARE_NEWER(3)
Indicates that the version of one or more of the
firmware files is newer than the firmware in the device.
OPOS_CFV_FIRMWARE_UNKNOWN(5)
Indicates that a relationship between the two firmware
versions could not be determined.
Remarks
This method determines whether the version of the firmware contained in the specified file
is newer than, older than, or the same as the version of the firmware in the POS printer.
The version of the firmware is represented by the value of first six successive numbers
found in the FirmWareFileName parameter. For example, when "01rm012345.hx5" is set
in the FirmWareFileName parameter, "012345" is recognized as the version of the
firmware file to be compared. The version of the POS printer can be acquired by sending
the command to the POS printer every time this method is executed.
In the first step of comparison, first four places in the version acquired from the POS
printer and first four places in the version of the firmware file are compared as the
character strings. When those are different, OPOS_CFV_FIRMWARE_UNKNOWN(5 ) is
set in the result parameter.
When the first four places are equal, then last two places are compared as the values.
When the version of the firmware file is smaller, OPOS_CFV_FIRMWARE_OLDER (1)
is set. When the version of the POS printer is smaller,
OPOS_CFV_FIRMWARE_NEWER(3) is set. When those are equal,
OPOS_CFV_FIRMWARE_SAME(2) is set.
86
Return Value
One of the following values will be returned and contained to ResultCode Property.
Value Meaning
OPOS_SUCCESS(0) Compare firmware successful.
OPOS_E_BUSY(113) Specified argument is invalid as the firmware file name.
Other Values Refer to ResultCode.
87
DirectIO Method
Syntax
LONG DirectIO (LONG Command, LONG* pData, BSTR* pString);
Remarks
In this OPOS, synchronous/asynchronous transmission of binary character string, and
conversional synchronous/asynchronous transmission of hexadecimal character string are
supported.
Synchronous transmission of binary character string
Command
OPOS_FIT_DIO_BIN_SYNC(0)
pData
pString
Function
OPOS_FIT_DIO_BIN_IMMIDIATE(1)
OPOS_FIT_DIO_BIN_REALTIME(2)
No
t in use
IN Binary character stri
It synchronou
not influenced by present BinaryConvertion (Equivalent to
OPOS_BC_NONE transmission). With this command, it becomes
possible to directly transmit command to POS Printer
Binary Character String is the following format.
&H00 - &Hff(&HFF)
The following are set when to transmit Partial Cut Command (1BH
6DH) to the printer side.
"&H1B&H6D" (Small letters in the alphabet except "&H" are
acceptable)
sly transmits binary character string to POS Printer,
ng
It ignores the characters not admittable as HEX.
Example:
When "ABCD&H00EFG" is transmitted, only "0x00" is
transmitted to Printer side.
88
Conversional
Command
pData
pString
Function
synchronous transmission of hexadecimal character string
OPOS_FIT_DIO_HEX_SYNC(5)
Not y
IN hexadecim
It synchronou
Printer, not influenced by present BinaryConvertion (Equivalent
to OPOS_BC_NONE transmission). With this command, it
becomes possible to directly transmit command to POS Printer
One byte character is displayed in 2 byte character.
Charact ers ranging from '0' – '9', 'A' – 'F', and 'a' – 'f' are available.
If there is any character except the above, it returns
OPOS_E_ILLEGAL1(106) without transmitting the command.
used
et
al character string
sly transmits hexadecimal character string to POS
&H00 -> '00'
89
Asynchron
Command
pData
pString
Function
ous transmission of binary character string
OPOS_FIT_DIO_BIN_ASYNC(6)
Not yet used
IN Binary character string
It asynchronou
not influenced by present BinaryConversion (Equivalent to
OPOS_BC_NONE transmission). With this command, it becomes
possible to directly transmit command to POS Printer. After
execution OutputCompleteEvent is up.
Binary character string is just like the following format.
&H00 - &Hff(&HFF)
The following are set when to transmit Partial Cut Command (1BH
6DH) to the printer side.
sly transmits binary character string to POS Printer,
"&H1B&H6D" (Small letters in the alphabet except "&H" are
acceptable)
It ignores characters not admittable as HEX.
Example:
When "ABCD&H00EFG" is transmitted, only "0x00" is
transmitted to Printer side.
90
Conversional
Command
pData
pString
Function
asynchronous transmission of hexadecimal character string
OPOS_FIT_DIO_HEX_ASYNC(7)
Not yet used
IN
hexadecim
It asynchronously transmits hexadecimal character string to POS
Printer, not influenced by present BinaryConvertion (Equivalent
to OPOS_BC_NONE transmission). With this command, it
becomes possible to directly transmit command to POS Printer.
After execution OutputCompleteEvent is up.
One byte character is displayed in 2 byte character.
&H00 -> '00'
Characters ranging from '0' - '9', 'A' - 'F', and 'a' - 'f' are available.
If there is any character except the above, it returns
OPOS_E_ILLEGAL1(106) without transmitting the command.
al character string
91
Setting of error correctio
Command
pData
pString
Function
n level of QR code
OPOS_FIT_DIO_SET_QRERRORLV(20)
IN error correction level of QR code
Not y
et used
Specifies error correction level of QR code.
The default value is “0”. The default value is set when
returns OPOS_E_ILLEGAL(106) And DirectIO Method is buffered in TransactionPrint
and RotatePrint. In this case, as for synchronous/asynchronous transmission of DirectIO
Method, its synchronous/asynchronous execution depends on synchronous/asynchronous
execution of TransactionPrint Method and RotatePrint Method
r correction level of Micro QR code
Command
pData
pString
Function
OPOS_FIT_DIO_
OUT error correction level of Micro QR c
Not yet used
The error correction level of the Micro QR code is returned.
Error correction level (0-2) of the Micro QR code is set to pData.
g after Enable, if these values except command are set to Command, it
GET_MICROQRERRORLV(23)
ode
93
Value Meaning
OPOS_E_ILLEGAL(106) This method is unavailable.
OPOS_E_NOHARDWARE(107) POS Printer is OFF or OFFLINE.
OPOS_E_FAILURE(111) OPOS Control is in error state. After releasing error
state, execute it.
OPOS_E_BUSY(1 13) It cannot be executed because it is outputting.
OPOS_E_EXTENDED(114) ResultCodeExtended =
OPOS_EPTR_COVER_OPEN(201): POS Printer cover
is open. (Only when synchronous method is executed.)
ResultCodeExtended =
OPOS_EPTR_REC_EMPTY(203): Run out of receipt
paper . (Only when synchronous method is executed.)
ResultCodeExtended =
OPOS_FIT_EPTR_PAPERLAYOUT(10001): Paper
Layout Error occurs. (Only when synchronous method
is executed.)
ResultCodeExtended = OPOS_FIT_EPTR_FATAL
(10003): Fatal error occurs. (Only when synchronous
method is executed.)
ResultCodeExtended =
OPOS_FIT_EPTR_OVERHEAT (10006): Head
Overheat Error occurs. (Only when synchronous
method is executed.)
The others Refer to the items of ResultCode.
94
Open Method
Syntax
LONG Open (BSTR DeviceName);
DeviceName Parameter assigns the name of the device which opens.
Set up the following values according to interface of the POS Printer connected to.
- Serial Interface "LD670SERPRT"
"LD670SER2PRT
- Parallel Interface "LD670PARPRT"
"LD670PAR2PRT"
- USB Interface "LD670USBPRT"
"LD670USB2PRT"
- LAN Interface "LD670LANPRT_[IP Address]"
*In case of LAN interface model, enter IP address of the POS printer in [IP address]
Remarks
Return Value
part, in the next part of "Device name". Setting Program (ref. 2. 6. Setting Program
Usage) helps to find each enabled Device name.
Example: Open ("LD670LANPRT_192.168.1.1")
It is called to open the device.
When the Open method is successful, the Common properties and other Specific-to-Class
Properties are initialized.
Following values are returned and contained to ResultCode Property.
Value Meaning
OPOS_SUCCESS(0) It succeeds in Open.
OPOS_E_NOSERVICE(104) It cannot be connected to corresponding Service Object.
OPOS_E_ILLEGAL(106) The applicable Control has already opened.
OPOS_E_NOEXIST(109) It cannot find assigned DeviceName.
OPOS_E_FAILER(111) It failed to initialize OPOS. This error occurs when
OCX cannot find SxJcp32.dll. When Registry has
Apartment = "0" setting, and also another process is
using Open Method for Printer with LAN interface
connection, same error will occur.
95
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.