Opos Apg140
Opos Apg140
Opos Apg140
International Standard
Core Companies
Epson
Fujitsu/ICL
Microsoft
NCR
plus
OPOS-Japan
OPOS-Europe
C H A P T E R 3
CASH CHANGER...................................................................................................................97
SUMMARY .......................................................................................................................... 97
GENERAL INFORMATION............................................................................................... 100
PROPERTIES ..................................................................................................................... 103
M ETHODS......................................................................................................................... 111
EVENTS ............................................................................................................................. 115
C H A P T E R 4
CASH DRAWER ................................................................................................................. 117
SUMMARY ........................................................................................................................ 117
GENERAL INFORMATION............................................................................................... 120
PROPERTIES ..................................................................................................................... 121
M ETHODS......................................................................................................................... 122
EVENTS ............................................................................................................................. 124
C H A P T E R 5
CAT - CREDIT AUTHORIZATION TERMINAL........................................................... 125
SUMMARY ........................................................................................................................ 125
GENERAL INFORMATION............................................................................................... 128
PROPERTIES ..................................................................................................................... 136
M ETHODS......................................................................................................................... 157
EVENTS ............................................................................................................................. 167
C H A P T E R 6
COIN DISPENSER.............................................................................................................. 169
SUMMARY ........................................................................................................................ 169
GENERAL INFORMATION............................................................................................... 171
PROPERTIES ..................................................................................................................... 172
M ETHODS......................................................................................................................... 174
EVENTS ............................................................................................................................. 175
C H A P T E R 7
FISCAL PRINTER............................................................................................................... 177
SUMMARY ........................................................................................................................ 177
GENERAL INFORMATION............................................................................................... 184
PROPERTIES ..................................................................................................................... 198
M ETHODS......................................................................................................................... 228
EVENTS ............................................................................................................................. 298
C H A P T E R 8
HARD TOTALS................................................................................................................... 303
SUMMARY ........................................................................................................................ 303
GENERAL INFORMATION............................................................................................... 307
PROPERTIES ..................................................................................................................... 311
M ETHODS......................................................................................................................... 314
C H A P T E R 9
KEYLOCK............................................................................................................................. 329
SUMMARY ........................................................................................................................ 329
GENERAL INFORMATION............................................................................................... 331
PROPERTIES ..................................................................................................................... 332
M ETHODS......................................................................................................................... 333
EVENTS ............................................................................................................................. 334
C H A P T E R 1 0
LINE DISPLAY .................................................................................................................... 335
SUMMARY ........................................................................................................................ 335
GENERAL INFORMATION............................................................................................... 338
PROPERTIES ..................................................................................................................... 341
M ETHODS......................................................................................................................... 363
C H A P T E R 1 1
MICR - MAGNETIC INK CHARACTER RECOGNITION READER......................... 377
SUMMARY ........................................................................................................................ 377
GENERAL INFORMATION............................................................................................... 380
MICR CHARACTER SUBSTITUTION ............................................................................ 384
PROPERTIES ..................................................................................................................... 385
M ETHODS......................................................................................................................... 390
EVENTS ............................................................................................................................. 396
C H A P T E R 1 2
MSR - MAGNETIC STRIPE READER............................................................................. 399
SUMMARY ........................................................................................................................ 399
GENERAL INFORMATION............................................................................................... 402
PROPERTIES ..................................................................................................................... 404
EVENTS ............................................................................................................................. 417
C H A P T E R 1 3
PIN PAD................................................................................................................................ 421
SUMMARY ........................................................................................................................ 421
GENERAL INFORMATION............................................................................................... 424
PROPERTIES ..................................................................................................................... 428
M ETHODS......................................................................................................................... 440
EVENTS ............................................................................................................................. 446
C H A P T E R 1 4
POS KEYBOARD................................................................................................................ 449
SUMMARY ........................................................................................................................ 449
GENERAL INFORMATION............................................................................................... 451
PROPERTIES ..................................................................................................................... 453
EVENTS ............................................................................................................................. 455
C H A P T E R 1 5
POS PRINTER..................................................................................................................... 457
SUMMARY ........................................................................................................................ 457
GENERAL INFORMATION............................................................................................... 463
DATA CHARACTERS AND ESCAPE SEQUENCES ......................................................... 467
PROPERTIES ..................................................................................................................... 471
M ETHODS......................................................................................................................... 514
EVENTS ............................................................................................................................. 548
C H A P T E R 1 6
REMOTE ORDER DISPLAY............................................................................................. 551
SUMMARY ........................................................................................................................ 551
GENERAL INFORMATION............................................................................................... 555
PROPERTIES ..................................................................................................................... 562
M ETHODS......................................................................................................................... 575
EVENTS ............................................................................................................................. 605
C H A P T E R 1 7
SCALE................................................................................................................................... 611
SUMMARY ........................................................................................................................ 611
GENERAL INFORMATION............................................................................................... 614
PROPERTIES ..................................................................................................................... 616
M ETHODS......................................................................................................................... 623
EVENTS ............................................................................................................................. 626
C H A P T E R 1 8
SCANNER (BAR CODE READER).................................................................................. 629
SUMMARY ........................................................................................................................ 629
GENERAL INFORMATION............................................................................................... 631
PROPERTIES ..................................................................................................................... 633
EVENTS ............................................................................................................................. 638
C H A P T E R 1 9
SIGNATURE CAPTURE..................................................................................................... 641
SUMMARY ........................................................................................................................ 641
GENERAL INFORMATION............................................................................................... 643
PROPERTIES ..................................................................................................................... 646
M ETHODS......................................................................................................................... 651
EVENTS ............................................................................................................................. 653
C H A P T E R 2 0
TONE INDICATOR............................................................................................................. 655
SUMMARY ........................................................................................................................ 655
GENERAL INFORMATION............................................................................................... 658
PROPERTIES ..................................................................................................................... 662
M ETHODS......................................................................................................................... 667
A P P E N D I X A
CHANGE HISTORY............................................................................................................ 669
RELEASE 1.01................................................................................................................... 669
RELEASE 1.1..................................................................................................................... 672
RELEASE 1.2..................................................................................................................... 674
RELEASE 1.3..................................................................................................................... 678
RELEASE 1.4..................................................................................................................... 681
A P P E N D I X B
OPOS REGISTRY USAGE ................................................................................................ 683
A P P E N D I X C
OPOS APPLICATION HEADER FILES......................................................................... 687
OPOS.H : MAIN OPOS HEADER FILE .......................................................................... 688
OPOSBB.H: BUMP BAR HEADER FILE......................................................................... 691
OPOSCASH.H : CASH DRAWER HEADER FILE............................................................ 692
OPOSCAT .H : CAT HEADER FILE................................................................................ 693
OPOSCHAN.H : CASH CHANGER HEADER FILE ......................................................... 695
OPOSCOIN.H : COIN DISPENSER HEADER FILE ......................................................... 696
OPOSDISP.H : LINE DISPLAY HEADER FILE .............................................................. 697
OPOSFPTR .H : FISCAL PRINTER HEADER FILE ......................................................... 699
OPOSKBD.H : POS KEYBOARD HEADER FILE ........................................................... 702
OPOSLOCK.H : KEYLOCK HEADER FILE .................................................................... 703
OPOSM ICR.H : MICR HEADER FILE............................................................................ 704
OPOSM SR.H : MSR HEADER FILE ............................................................................... 705
OPOSPPAD.H : PIN PAD HEADER FILE ....................................................................... 707
OPOSPTR .H : POS PRINTER HEADER FILE ................................................................ 709
OPOSROD.H : REMOTE ORDER DISPLAY HEADER FILE........................................... 714
OPOSSCAL.H : SCALE HEADER FILE........................................................................... 717
OPOSSCAN.H : BAR CODE SCANNER HEADER FILE ................................................. 718
OPOSSIG.H : SIGNATURE CAPTURE HEADER FILE .................................................. 719
OPOSTONE.H : TONE INDICATOR HEADER FILE ...................................................... 720
OPOSTOT .H : HARD TOTALS HEADER FILE .............................................................. 721
A P P E N D I X D
TECHNICAL DETAILS...................................................................................................... 723
SYSTEM STRINGS (BSTR).............................................................................................. 723
END OF APPLICATION PROGRAMMER’S GUIDE................................................ 728
1
POS may also refer to Point-of-Service – a somewhat broader category than Point-of-Sale.
2
Other future operating systems that support OLE Controls may also support OLE for Retail
POS, depending upon software support by the hardware manufacturers or third-party
developers.
This guide assumes that the reader is familiar with the following:
The OLE for Retail POS software is implemented using the layers shown in the
following diagram:
Application
Interface: Methods
OLE Events
Properties
Control
Control Object
OPOS Control
One per Device Class
Device Independent
System
Registry Interface: Event
OLE Methods Methods
- Mapping Automation
- Parameters Service Object
Device Dependent
OPOS Definitions
Device Class
A device class is a category of POS devices that share a consistent set of properties,
methods, and events. Examples are Cash Drawer and POS Printer.
Some devices support more than one device class. For example, some POS Printers
include a Cash Drawer kickout. Also, some Bar Code Scanners include an
integrated Scale.
Control Object or CO
A Control Object exposes a set of properties, methods, and events to an application
for its device class. This guide describes these APIs.
Service Object or SO
A Service Object is called by a Control Object to implement the OPOS-prescribed
functionality for a specific device.
A Service Object may include multiple sets of methods in order to support devices
with multiple device classes.
Several applications may have an OPOS Control open at the same time. Therefore,
after the device is opened, the application will often need to call the Claim method
to gain exclusive access to the device. Many devices must be Claimed before the
Control allows access to its methods and properties. Claiming the device ensures
that other applications do not interfere with the use of the device. The application
may Release the device when the device can be shared by other applications – for
instance, at the end of a transaction.
Before using the device, the application must set the DeviceEnabled property to
TRUE. This value brings the device to an operational state, while FALSE disables
the device. For example, if a scanner Control is disabled, then the device will be
physically disabled (when possible). Whether physically disabled or not, any input
from the device will be discarded until the device is enabled.
After the application has finished using the device, the Close method should be
called to release the device and associated resources. If the DeviceEnabled
property is TRUE, then Close disables the device. If the Claimed property is
TRUE, then Close releases the lock. Before exiting, an application should close all
open OPOS Controls.
• Open method: Call to link the Control Object to the Service Object.
• Claim method: Call to gain exclusive access to the device. Required for
exclusive-use devices; optional for some sharable devices. (See “Device
Sharing Model”, page 20 for more information).
• DeviceEnabled property: Set to TRUE to make the device operational. (For
sharable devices, the device may be enabled without first Claiming it.)
• Use the device.
• DeviceEnabled property: Set to FALSE to disable the device.
• Release method: Call to release exclusive access to the device.
• Close method: Call to release the Service Object from the Control Object.
Exclusive-use devices require the application to call the Claim method and to set the
DeviceEnabled property to TRUE before most other methods may be called.
Sharable devices require the application to set the DeviceEnabled property to TRUE
before most other methods may be called.
The “Summary” section of each device class’ chapter should be consulted for the
specific prerequisites for each method.
Properties
Before a successful Open, the values of most properties are not initialized. An
attempt to set writable properties will be ignored.
Property Value
State OPOS_S_CLOSED
ResultCode OPOS_E_CLOSED
ControlObjectDescription Control Object dependent string.
ControlObjectVersion Control Object dependent number.
Exclusive use devices require the application to call the Claim method and to set the
DeviceEnabled property to TRUE before some other properties are initialized or
may be written.
Sharable devices require the application to set the DeviceEnabled property to TRUE
before some other properties are initialized or may be written.
Setting writable properties before the prerequisites are met will cause the write to be
ignored, and will set the ResultCode property to either OPOS_E_NOTCLAIMED or
OPOS_E_DISABLED.
After properties have been initialized, subsequent claims and enables do not
reinitialize the properties. They remain initialized until the Close method is called.
Name Meaning
Status Model
The rules of the status model are as follows:
• The only aspect of the status model that is common to all device classes is the
means of alerting the application, which is through the firing of the
StatusUpdateEvent.
• Each device class specifies the status changes that cause it to fire the event.
Examples of device class-specific status changes are:
♦ A change in the cash drawer position (for example, a transition from
open to closed).
♦ A change in a POS printer sensor (for example, activation of a “form
present” sensor, indicating that a slip has been inserted).
• Every method returns a result code. This code is also placed into ResultCode.
• Setting a writable property causes a result code to be placed into ResultCode.
• The ResultCode OPOS_SUCCESS is assigned the value of zero. Non-zero
values indicate an error or warning.
• The Control must select one of the result codes listed on page 51. If the
Control sets ResultCode to OPOS_E_EXTENDED, then it must set
ResultCodeExtended to one of the values specified in the device class
documentation. (That is, when this ResultCode value is selected, then
ResultCodeExtended may only contain one of the values listed in this
document for the device class, in the appropriate method or property section.)
If the Control sets ResultCode to a value other than OPOS_E_EXTENDED,
then the Service Object may set the ResultCodeExtended property to any SO-
specific value. If an application uses these values, it will, of course, need to add
Service Object-specific code. (If the application needs to add such code, then
the ServiceObjectDescription, DeviceDescription, or DeviceName property
may be interrogated to determine the Service Object with which it is dealing.)
State Model
The rules of the state model are as follows:
Exclusive-Use Devices
The most common device type is called an “exclusive-use device.” An example is
the POS printer. Due to physical or operational characteristics, this device can only
be used by one application at a time. The application must call the Claim method to
gain exclusive access to the device before most methods, properties, or events are
legal. Until the device is claimed, calling methods or setting properties cause an
OPOS_E_NOTCLAIMED error, and events are not fired to the application.
When the Claim method is called again, settable device characteristics are restored
to their condition at Release. Examples of restored characteristics are the line
display’s brightness, the MSR’s tracks to read, and the printer’s characters per line.
State characteristics are not restored, such as the printer’s sensor properties.
Instead, these are updated to their current values.
Sharable Devices
Some devices are “sharable devices.” An example is the keylock. A sharable device
allows multiple applications to call its methods and access its properties. Also, it
may fire its events to all applications that have opened it. A sharable device may still
limit access to some methods or properties to an application that has Claimed it, or
may fire some events only to this application.
3
This document assumes that an application consists of only one process. Multi-process
applications are possible to create but uncommon. Technically, device sharing is performed on
a process basis. However, with single-process applications we can view sharing as application-
level.
Note
One might argue that all devices should be defined as sharable to allow maximum flexibility
to applications. In practical use, this flexibility is unlikely to be useful. The downside is
an implementation that may be significantly more complex and less likely to be accurate.
In the interest of a specification that is both sufficiently robust for application
development, plus implementable by hardware manufacturers, this document defines most
devices as exclusive-use, and defines as sharable only those devices that have a
significant potential for simultaneous use by multiple applications.
Events
OLE for Retail POS uses events to inform an application of various activities or
changes with the OPOS Control. The five event types follow. Subsequent sections
will clarify their definitions.
• DataEvent: Input data has been placed into device class-specific properties.
• ErrorEvent: An error has occurred during event-driven input or asynchronous
output.
• StatusUpdateEvent: Reports a change in the device’s status.
• OutputCompleteEvent: An asynchronous output has successfully completed.
• DirectIOEvent: This event may be defined by a Service Object provider for
purposes not covered by the specification.
The Service Object enqueues events as they occur. Often these events will be
enqueued by worker threads, rather than the application’s thread. Enqueued events
are delivered to the application when conditions are correct. Conditions which delay
the delivery of events include:
If the oldest enqueued event is blocked for one of these reasons, then all newer
events may also be blocked. That is, the delivery of enqueued events is typically in a
strict first in, first out order. Priority is not given to any event types on the queue.
Note – Terminology
The following event terminology is used rather consistently in this document. Some
implementations may vary from the model described here, but the net effect is similar:
• Enqueue: When the Service Object determines that an event needs to be fired to the
Application, it enqueues the event on an internal event queue. Event queuing
typically occurs from one or more internal Service Object worker threads.
• Deliver: When the event queue is non-empty and all conditions are met for the top
event on the queue, this event is removed from the queue and delivered to the
Application. Event delivery is typically managed by a dedicated internal Service
Object worker thread. This thread ensures that events are delivered in the context of
the thread that created the Control, in order to adhere to the Apartment Threading
model.
• Fire: The combination of enqueuing and delivering an event.
Sometimes, the term is used more loosely and may only refer to one of these steps.
The reader should differentiate these cases by context.
• The Control may only enqueue new events while the device is enabled.
• The Control may deliver enqueued events until the application calls the Release
method (for exclusive-use devices) or the Close method (for any device), at
which time any remaining events are deleted.
• For input devices, the ClearInput method clears data and error events.
While within an event handler, the application may access properties and call
methods. However, the application must not call the Release or Close methods
from an event handler, since Release may shut down event handling (possibly
including a thread that caused the event to be delivered) and Close must shut down
event handling before returning.
Input Model
The OLE for Retail POS input model supports event-driven input. Event-driven
input allows input data to be received after DeviceEnabled is set to TRUE.
Received data is enqueued as a DataEvent, which is delivered to the application
when preconditions are correct. If the AutoDisable property is TRUE when data is
received, then the control will automatically disable itself, setting DeviceEnabled to
FALSE. This will inhibit the Control from enqueuing further input and, when
possible, physically disable the device.
When the application is ready to receive input from the device, it sets the
DataEventEnabled property to TRUE. Then, when input is received (usually as a
result of a hardware interrupt), the Control enqueues and delivers a DataEvent. (If
input has already been enqueued, the DataEvent will be delivered.) This event may
include input status information through a numeric parameter. The Control places
the input data plus other information as needed into device specific-specific
properties just before the event is fired.
Just before delivering this event, the Control disables further data events by setting
the DataEventEnabled property to FALSE. This causes subsequent input data to
be enqueued by the Control while the application processes the current input and
associated properties. When the application has finished the current input and is
ready for more data, it reenables events by setting DataEventEnabled to TRUE.
If the input device is an exclusive-use device, the application must both claim and
enable the device before the device begins reading input.
For sharable input devices, one or more applications must open and enable the
device before the device begins reading input. An application must call the Claim
method to request exclusive access to the device before the Control will send data to
it using the DataEvent. If event-driven input is received, but no application has
claimed the device, then the input is buffered until an application Claims the device
(and the DataEventEnabled property is TRUE). This behavior allows orderly
sharing of the device between multiple applications, effectively passing the input
focus between them.
For some Controls, the Application must call a method to begin event driven input.
After the input is received by the Control, then typically no additional input will be
received until the method is called again to reinitiate input. Examples are the MICR
and Signature Capture devices. This variation of event driven input is sometimes
called “asynchronous input.”
All input enqueued by a Control may be deleted by calling the ClearInput method.
ClearInput may be called after Open for sharable devices and after Claim for
exclusive-use devices.
The general event-driven input model does not specifically rule out the definition of
device classes containing methods or properties that return input data directly.
Some device classes will define such methods and properties in order to operate in a
more intuitive or flexible manner. An example is the Keylock device. This type of
input is sometimes called “synchronous input.”
Output Model
The OLE for Retail POS output model consists of two output types: synchronous
and asynchronous. A device class may support one or both types, or neither type.
Synchronous Output
This type of output is preferred when device output can be performed quickly. Its
merit is simplicity.
The application calls a class-specific method to perform output. The Control does
not return until the output is completed.
Asynchronous Output
This type of output is preferred when device output requires slow hardware
interactions. Its merit is perceived responsiveness, since the application can
perform other work while the device is performing the output.
The application calls a class-specific method to start the output. The Control
buffers the request, sets the OutputID property to an identifier for this request, and
returns as soon as possible. When the device completes the request successfully,
OPOS fires an OutputCompleteEvent. A parameter of this event contains the
OutputID of the completed request.
All output buffered by the Control may be deleted by calling the ClearOutput
method. OutputCompleteEvents will not be fired for cleared output. This method
also stops any output that may be in progress (when possible).
Applications frequently need to know the power state of the devices they use.
Earlier versions of OPOS had no consistent method for reporting this information.
Note: This model is not intended to report PC or POS Terminal power conditions
(such as “on battery” and “battery low”). Reporting of these conditions is left to PC
power management standards and APIs.
Model
OPOS segments device power into three states:
• ONLINE: The device is powered on and ready for use. This is the
“operational” state.
• OFF: The device is powered off or detached from the terminal. This is a “non-
operational” state.
• OFFLINE: The device is powered on but is either not ready or not able to
respond to requests. It may need to be placed online by pressing a button, or it
may not be responding to terminal requests. This is a “non-operational” state.
• OFF_OFFLINE: The device is either off or offline, and the Service Object
cannot distinguish these states.
Power reporting only occurs while the device is Open, Claimed (if the device is
exclusive-use), and Enabled.
Properties
The OPOS device power reporting model adds the following common elements
across all device classes:
• When the Control changes from DeviceEnabled FALSE to TRUE, then begin
monitoring the power state:
♦ If the device is ONLINE, then:
§ PowerState is set to OPOS_PS_ONLINE.
§ A StatusUpdateEvent is fired with Status parameter set to
OPOS_SUE_POWER_ONLINE.
♦ If the device power state is OFF, OFFLINE, or OFF_OFFLINE, then
the Control may choose to fail the enable, setting ResultCode to
OPOS_E_NOHARDWARE or OPOS_E_OFFLINE.
However, if there are no other conditions that cause the enable to fail,
and the Control chooses to return success for the enable, then:
§ PowerState is set to OPOS_PS_OFF, OPOS_PS_OFFLINE,
or OPOS_PS_OFF_OFFLINE.
§ A StatusUpdateEvent is fired with Status parameter set to
OPOS_SUE_POWER_OFF, OPOS_SUE_POWER_OFFLINE,
or OPOS_SUE_POWER_OFF_OFFLINE.
• When the Control changes from DeviceEnabled TRUE to FALSE, then OPOS
assumes that the Control is no longer monitoring the power state. Therefore:
PowerState is set to OPOS_PS_UNKNOWN.
The following chapters provide interface descriptions for the following OLE for
Retail POS OLE Controls:
The parameter and return types specified in the descriptions are as follows:
Type Meaning
Summary
Properties
Name Type Access
AutoDisable 1.2 Boolean R/W
BinaryConversion 1.2 Long R/W
CapPowerReporting 1.3 Long R
CheckHealthText 1.0 String R
Claimed 1.0 Boolean R
DataCount 1.2 Long R
DataEventEnabled 1.0 Boolean R/W
DeviceEnabled 1.0 Boolean R/W
FreezeEvents 1.0 Boolean R/W
OutputID 1.0 Long R
PowerNotify 1.3 Long R/W
PowerState 1.3 Long R
ResultCode 1.0 Long R
ResultCodeExtended 1.0 Long R
State 1.0 Long R
Methods
Name
Open 1.0
Close 1.0
Claim 1.0
Release 1.0
CheckHealth 1.0
ClearInput 1.0
ClearOutput 1.0
DirectIO 1.0
Events
Name
DataEvent 1.0
DirectIOEvent 1.0
ErrorEvent 1.0
OutputCompleteEvent 1.0
StatusUpdateEvent 1.0
General Information
This section lists properties, events, and methods that are common to many of the
subsequent device categories.
The summary section of each device class marks those common properties, events,
and methods that do not apply to that class as “Not Supported.” These are not
present in the class’ controls.
Properties
AutoDisable Property R/W Added in Release 1.2
Syntax BOOL AutoDisable;
Remarks This property applies to event-driven input devices. It provides the application with
an additional option for controlling the receipt of input data. If an application wants
to receive and process only one input, or only one input at a time, then this property
may be set to TRUE.
When TRUE, then as soon as the Service Object receives and enqueues data to be
fired as a DataEvent, then it sets DeviceEnabled = FALSE. Before any additional
input can be received, the application must set DeviceEnabled = TRUE.
When FALSE, the Service Object does not automatically disable the device when
data is received. This is the behavior of OPOS controls prior to Release 1.2.
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
Remarks OPOS passes multicharacter 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
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. (This was first reported with Japanese, which uses the MBCS
Code Page 932, but can occur with other languages, also.)
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:
The format of this data depends upon the value of the BinaryConversion
property. See page 37.
Value Meaning
• Before setting the property or passing the method parameter, convert the string
data into the format specified by the BinaryConversion value.
• After getting the property or receiving the method parameter, convert the string
data from the format specified by the BinaryConversion value.
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
Value Meaning
OPOS_PR_STANDARD
The Service Object can determine and report two of the
power states – OFF_OFFLINE (that is, off or offline) and
ONLINE.
OPOS_PR_ADVANCED
The Service Object can determine and report all three
power states – OFF, OFFLINE, and ONLINE.
See Also “Device Power Reporting Model”; PowerState Property, PowerNotify Property
CheckHealthText Property
Syntax BSTR CheckHealthText;
Remarks Holds the results of the most recent call to the CheckHealth method. The
following examples illustrate some possible diagnoses:
Claimed Property
Syntax BOOL Claimed;
Many devices must be claimed before the Control will allow access to many of its
methods and properties, and before it will fire events to the application.
See Also “General OLE for Retail POS Control Model”; “Device Sharing Model”; Claim
Method; Release Method
ControlObjectDescription Property
Syntax BSTR ControlObjectDescription;
Remarks String identifying the Control Object and the company that produced it.
The property identifies the Control Object. A sample returned string is:
“POS Printer OLE Control, (C) 1995 Epson”
ControlObjectVersion Property
Syntax LONG ControlObjectVersion;
This property holds the Control Object version number. Three version levels are
specified, as follows:
This value may be displayed as version “1.2.38”, and interpreted as major version 1,
minor version 2, build 38 of the Control Object.
Note
A Control Object for a device class will operate with any Service Object for that class, as
long as its major version number matches the Service Object’s major version number. If
they match, but the Control Object’s minor version number is greater than the Service
Object’s minor version number, then the Control Object may support some new methods
or properties that are not supported by the Service Object’s release.
The following rules apply to APIs supported by the Control Object’s release but not
supported by the Service Object’s older release:
• Reading an unsupported property: The Control Object returns the property’s
uninitialized value. (See page 14 for uninitialized property default values.)
• Writing an unsupported property: The Control Object returns, but must remember that
an unsupported property write or method call occurred. Then, if the application reads
the ResultCode property, the Control Object must return a value of
OPOS_E_NOSERVICE (rather than reading the current ResultCode from the Service
Object). It must do this until the next property write or method call, at which time
ResultCode is set by that API.
• Calling an unsupported method: The Control Object returns a value of
OPOS_E_NOSERVICE , and must remember that an unsupported property write or
method call occurred. Then, if the application reads the ResultCode property, the
Control Object must return a value of OPOS_E_NOSERVICE (rather than reading the
current ResultCode from the Service Object). It must do this until the next property
write or method call, at which time ResultCode is set by that API.
Remarks When TRUE, a DataEvent will be delivered as soon as input data is enqueued. If
changed to TRUE and some input data is already queued, then a DataEvent is
delivered immediately. (Note that other, less likely, conditions may delay
“immediate” delivery: If FreezeEvents is TRUE or another event is already being
processed at the application, the DataEvent will remain enqueued at the Service
Object until the condition is corrected.)
When FALSE, input data is queued for later delivery to the application. Also, if an
input error occurs, the ErrorEvent is not delivered while DataEventEnabled is
FALSE.
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
DeviceDescription Property
Syntax BSTR DeviceDescription;
The property identifies the device and any pertinent information about it. A sample
returned string is:
“NCR 7192-0184 Printer, Japanese Version”
Remarks When TRUE, the device has been placed in an operational state. If changed to
TRUE, then the device is brought to an operational state.
When FALSE, the device has been disabled. If changed to FALSE, then the device
is physically disabled when possible, any subsequent input will be discarded, and
output operations are disallowed.
Changing this property usually does not physically affect output devices. For
consistency, however, the application must set this property to TRUE before using
output devices.
Release 1.3 and later: The device’s power state may be reported while
DeviceEnabled is TRUE. See “Device Power Reporting Model” for details.
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
OPOS_E_NOTCLAIMED
An exclusive use device must be claimed before the device
may be enabled.
DeviceName Property
Syntax BSTR DeviceName;
The property identifies the device and any pertinent information about it. This is a
short version of DeviceDescription and should be limited to 30 characters.
Remarks When TRUE, the application has requested that the Control not deliver events.
Events will be held by the Control until events are unfrozen.
When FALSE, the application allows events to be delivered. If some events have
been held while events were frozen and all other conditions are correct for delivering
the events, then changing FreezeEvents to FALSE will cause these events to be
delivered.4
An application may choose to freeze events for a specific sequence of code where
interruption by an event is not desirable.
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
4
Firing of events can also be deferred by the containing application. A control container may
request controls to freeze event firing. For example, this feature is utilized by Visual Basic
when modal dialog boxes are active. Therefore, events are fired when both FreezeEvents is
FALSE and the container has not requested event freezing.
Container-initiated event freezing is not referenced elsewhere in this document, since an
Application will seldom if ever notice it and cannot directly control it.
OutputID Property
Syntax LONG OutputID;
Remarks Holds the identifier of the most recently started asynchronous output.
The output ID numbers are assigned by the Control and are guaranteed to be unique
among the set of outstanding asynchronous outputs. No other facts about the ID
should be assumed.
Remarks Contains the type power notification selection made by the Application.
Value Meaning
OPOS_PN_DISABLED The Control will not provide any power notifications to the
application. No power notification StatusUpdateEvents
will be fired, and PowerState may not be set.
PowerNotify may only be set while the device is disabled, that is, while
DeviceEnabled is FALSE.
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
Value Meaning
OPOS_PS_UNKNOWN Cannot determine the device's power state, for one of the
following reasons:
• CapPowerReporting = OPOS_PR_NONE. Device
does not support power reporting.
• PowerNotify = OPOS_PN_DISABLED. Power
notifications are disabled.
• DeviceEnabled = FALSE. Power state monitoring
does not occur until the device is enabled.
OPOS_PS_ONLINE The device is powered on and ready for use.
Can be returned if CapPowerReporting =
OPOS_PR_STANDARD or OPOS_PR_ADVANCED.
OPOS_PS_OFF_OFFLINE
The device is either off or offline.
Can only be returned if CapPowerReporting =
OPOS_PR_STANDARD.
ResultCode Property
Syntax LONG ResultCode;
Remarks This property is set by each method. It is also set when a writable property is set.
This property is always readable. Before the Open method is called, it returns the
value OPOS_E_CLOSED.
Value Meaning
OPOS_E_NOTCLAIMED
Attempt was made to access an exclusive-use device that
must be claimed before the method or property set action
can be used.
If the device is already claimed by another process, then
the status OPOS_E_CLAIMED is returned instead.
OPOS_E_NOEXIST The file name (or other specified value) does not exist.
OPOS_E_EXISTS The file name (or other specified value) already exists.
OPOS_E_TIMEOUT The Service Object timed out waiting for a response from
the device, or the Control timed out waiting for a response
from the Service Object.
OPOS_E_BUSY The current Service Object state does not allow this
request. For example, if asynchronous output is in
progress, certain methods may not be allowed.
ResultCodeExtended Property
Syntax LONG ResultCodeExtended;
When the ResultCode is set to any other value, this property may be set by the
Service Object to any SO-specific value. These values are only meaningful if the
application adds Service Object-specific code to handle them.
ServiceObjectDescription Property
Syntax BSTR ServiceObjectDescription;
Remarks String identifying the Service Object supporting the device and the company that
produced it.
ServiceObjectVersion Property
Syntax LONG ServiceObjectVersion;
This property holds the Service Object version number. Three version levels are
specified, as follows:
This value may be displayed as version “1.2.38”, and interpreted as major version 1,
minor version 2, build 38 of the Service Object.
Note
A Service Object for a device class will operate with any Control Object for that class, as
long as its major version number matches the Control Object’s major version number. If
they match, but the Service Object’s minor version number is greater than the Control
Object’s minor version number, then the Service Object may support some methods or
properties that cannot be accessed from the Control Object’s release.
If the application requires such features, then it will need to be updated to use a later
version of the Control Object.
State Property
Syntax LONG State;
Value Meaning
Methods
CheckHealth Method
Syntax LONG CheckHealth (LONG Level);
The Level parameter indicates the type of health check to be performed on the
device. The following values may be specified:
Value Meaning
Return One of the following values are returned by the method, and also placed in the
ResultCode property.
Value Meaning
See Also “General OLE for Retail POS Control Model”; CheckHealthText Property
Claim Method
Syntax LONG Claim (LONG Timeout);
The Timeout parameter gives the maximum number of milliseconds to wait for
exclusive access to be satisfied.
If zero, the method attempts to claim the device, then returns the appropriate status
immediately.
If OPOS_FOREVER (-1), the method waits as long as needed until exclusive access
is satisfied.
Remarks Call this method to request exclusive access to the device. Many devices require an
application to claim them before they can be used.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
ClearInput Method
Syntax LONG ClearInput ();
Remarks Called to clear all device input that has been buffered.
Any data events or input error events that were enqueued – usually waiting for
DataEventEnabled to be set to TRUE and FreezeEvents to be set to FALSE – are
also cleared.
Return The following value is returned by the method and placed in the ResultCode
property.
Value Meaning
OPOS_E_NOTCLAIMED
The device must be claimed before this method can be
used.
ClearOutput Method
Syntax LONG ClearOutput ();
Remarks Called to clear all device output that has been buffered. Also, when possible, halts
outputs that are in progress.
Any output error events that were enqueued – usually waiting for FreezeEvents to
be set to FALSE – are also cleared.
Return The following value is returned by the method and placed in the ResultCode
property.
Value Meaning
OPOS_E_NOTCLAIMED
The device must be claimed before this method can be
used.
Close Method
Syntax LONG Close ();
If the Claimed property is TRUE, then exclusive access to the device is first
released.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
See Also “General OLE for Retail POS Control Model”; Open Method
DirectIO Method
Syntax LONG DirectIO (LONG Command, LONG* pData, BSTR* pString);
Parameter Description
This method provides a means for a Service Object to provide functionality to the
application that is not otherwise supported by the standard Control Object for its
device class. Depending upon the Service Object’s definition of the command, this
method may be asynchronous or synchronous.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
Open Method
Syntax LONG Open (BSTR DeviceName);
The device name specifies which of one or more devices supported by this Control
Object should be used. The DeviceName must exist in the system registry for this
device class. The relationship between the device name and physical devices is
determined by entries within the operating system registry; these entries are
maintained by a setup or configuration utility. (See the appendix “APPENDIX B
OPOS Registry Usage”, page 683.)
Value Meaning
Note
The value of the ResultCode property after calling the Open method may not be the same
as the Open method return value for the following two cases:
1. The Control was closed and the Open method failed: The ResultCode property will
continue to return OPOS_E_CLOSED.
2. The Control was already opened: The Open method will return OPOS_E_ILLEGAL,
but the ResultCode property may continue to return the value it held before the Open
method.
See Also “General OLE for Retail POS Control Model”; Close Method
Release Method
Syntax LONG Release ();
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
Events
DataEvent Event
Syntax void DataEvent (LONG Status);
The Status parameter contains the input status. Its value is Control-dependent, and
may describe the type or qualities of the input.
Remarks Fired to present input data from the device to the application. The
DataEventEnabled property is changed to FALSE, so that no further data events
will be generated until the application sets this property back to TRUE. The actual
input data is placed in one or more device-specific properties.
If DataEventEnabled is FALSE at the time that data is received, then the data is
queued in an internal OPOS buffer, the device-specific input data properties are not
updated, and the event is not delivered. (When this property is subsequently
changed back to TRUE, the event will be delivered immediately if input data is
queued and FreezeEvents is FALSE.)
DirectIOEvent Event
Syntax void DirectIOEvent (LONG EventNumber, LONG* pData, BSTR* pString);
Parameter Description
This event provides a means for a Service Object to provide events to the application
that are not otherwise supported by the Control Object.
ErrorEvent Event
Syntax void ErrorEvent (LONG ResultCode, LONG ResultCodeExtended,
LONG ErrorLocus, LONG* pErrorResponse);
Parameter Description
ResultCode Result code causing the error event. See ResultCode for
values.
Value Meaning
OPOS_EL_INPUT_DATA
Error occurred while gathering or processing event-driven
input, and some previously buffered data is available.
The contents at the location pointed to by the pErrorResponse parameter are preset
to a default value, based on the ErrorLocus. The application may change them to
one of the following:
Value Meaning
OPOS_ER_CONTINUEINPUT
Use only when locus is OPOS_EL_INPUT_DATA.
Remarks Fired when an error is detected and the Control’s State transitions into the error
state.
Input error events are not delivered until the DataEventEnabled property is TRUE,
so that proper application sequencing occurs.
OutputCompleteEvent Event
Syntax void OutputCompleteEvent (LONG OutputID);
StatusUpdateEvent Event
Syntax void StatusUpdateEvent (LONG Status);
The Status parameter is for device class-specific data, describing the type of status
change.
Remarks Fired when a Control needs to alert the application of a device status change.
Examples are a change in the cash drawer position (open vs. closed) or a change in
a POS printer sensor (form present vs. absent).
When a device is enabled, then the Control may fire initial StatusUpdateEvents to
inform the application of the device state. This behavior, however, is not required.
Release 1.3 and later – Power State Reporting
All device classes may fire StatusUpdateEvents with at least the following Status
parameter values, if PowerNotify = OPOS_PN_ENABLED:
Value Meaning
OPOS_SUE_POWER_ONLINE
The device is powered on and ready for use.
Can be returned if CapPowerReporting =
OPOS_PR_STANDARD or OPOS_PR_ADVANCED.
OPOS_SUE_POWER_OFF
The device is off or detached from the terminal.
Can only be returned if CapPowerReporting =
OPOS_PR_ADVANCED.
OPOS_SUE_POWER_OFFLINE
The device is powered on but is either not ready or not
able to respond to requests.
Can only be returned if CapPowerReporting =
OPOS_PR_ADVANCED.
OPOS_SUE_POWER_OFF_OFFLINE
The device is either off or offline.
Can only be returned if CapPowerReporting =
OPOS_PR_STANDARD.
The common property PowerState is also maintained at the current power state of
the device.
See Also “Status, Result Code, and State Model”; “Device Power Reporting Model”;
CapPowerReporting Property, PowerNotify Property
Bump Bar
Summary
Properties
Common Type Access Initialized After
AutoDisable 1.3 Boolean R/W Not Supported
BinaryConversion 1.3 Long R/W Open
CapPowerReporting 1.3 Long R Open
CheckHealthText 1.3 String R Open
Claimed 1.3 Boolean R Open
DataCount 1.3 Long R Open
DataEventEnabled 1.3 Boolean R/W Open
DeviceEnabled 1.3 Boolean R/W Open; Claim
FreezeEvents 1.3 Boolean R/W Open
OutputID 1.3 Long R Open
PowerNotify 1.3 Long R/W Open
PowerState 1.3 Long R Open
ResultCode 1.3 Long R --
ResultCodeExtended 1.3 Long R Open
State 1.3 Long R --
Properties (continued)
Specific Type Access Initialized After
AsyncMode 1.3 Boolean R/W Open, Claim, & Enable
Timeout 1.3 Long R/W Open
UnitsOnline 1.3 Long R Open, Claim, & Enable
Methods
Common Prerequisites
Open 1.3 None
Close 1.3 Open
Claim 1.3 Open
Release 1.3 Open, Claim
CheckHealth 1.3 Open, Claim, & Enable
ClearInput 1.3 Open, Claim
ClearOutput 1.3 Open, Claim
DirectIO 1.3 Open
Specific
BumpBarSound 1.3 Open, Claim, & Enable
SetKeyTranslation 1.3 Open, Claim, & Enable
Events
Name May Occur After
DataEvent 1.3 Open, Claim, & Enable
DirectIOEvent 1.3 Open, Claim
ErrorEvent 1.3 Open, Claim, & Enable
OutputCompleteEvent 1.3 Open, Claim, & Enable
StatusUpdateEvent 1.3 Open, Claim, & Enable
General Information
The Bump Bar Control’s OLE Programmatic ID is “OPOS.BumpBar”.
This device was added in OPOS Release 1.3.
Capabilities
The Bump Bar Control has the following minimal set of capabilities:
• Broadcast methods that can communicate with one, a range, or all bump bar
units online.
• Supports bump bar input (keys 0-255).
The Bump Bar Control may also have the following additional capabilities:
Model
The general model of a bump bar is:
• The bump bar device class is a subsystem of bump bar units. The initial
targeted environment is food service, to control the display of order preparation
and fulfillment information. Bump bars typically are used in conjunction with
remote order displays.
The subsystem can support up to 32 bump bar units.
One Application on one PC or POS Terminal will typically manage and control
the entire subsystem of bump bars. If Applications on the same or other PCs
and POS Terminals will need to access the subsystem, then this Application
must act as a subsystem server and expose interfaces to other Applications.
• All specific methods are broadcast methods. This means that the method can
apply to one unit, a selection of units or all online units. The Units parameter is
a LONG, with each bit identifying an individual bump bar unit. (One or more of
the constants BB_UID_1 through BB_UID_32 are bitwise ORed to form the
bitmask.) The service object will attempt to satisfy the method for all unit(s)
indicated in the Units parameter. If an error is received from one or more units,
the ErrorUnits property is updated with the appropriate units in error. The
ErrorString property is updated with a description of the error or errors
received. The method will then return with the corresponding OPOS error. In
the case where two or more units encounter different errors, the service object
should determine the most severe OPOS error to return.
• The common methods CheckHealth, ClearInput, and ClearOutput are not
broadcast methods and use the unit ID indicated in the CurrentUnitID
property. (One of the constants BB_UID_1 through BB_UID_32 are selected.)
See the description of these common methods to understand how the current
unit ID property is used.
• When the current unit ID property is set by the application, all the
corresponding properties are updated to reflect the settings for that unit.
If the CurrentUnitID property is set to a unit ID that is not online, the
dependent properties will contain non-initialized values.
The CurrentUnitID uniquely represents a single bump bar unit. The definitions
range from BB_UID_1 to BB_UID_32. These definitions are also used to create
the bitwise parameter, Units, used in the broadcast methods. See the Examples
section below for usage.
The Bump Bar Control must supply a method for translating its internal key scan
codes into user-defined codes which are returned by the data event. Note that this
translation must be end-user configurable. The default translated key value is the
scan code value.
Output – Tone
The bump bar follows the general “Output Model”, with some enhancements:
Example
Sounds one tone on unit ID 1 and unit ID 4. The frequency is set to 64 Hertz and
will sound for 100 milliseconds.
BB.BumpBarSound( BB_UID_1 | BB_UID_4, 64, 100, 1, 0 )
Device Sharing
The bump bar is an exclusive-use device. Its device sharing rules are:
• The application must claim the device before enabling it.
• The application must claim and enable the device before accessing many bump
bar specific properties.
• The application must claim and enable the device before calling methods that
manipulate the device.
• When a Claim method is called again, settable device characteristics are
restored to their condition at Release.
• See the “Summary” table for precise usage prerequisites.
Properties
AsyncMode Property R/W
Syntax BOOL AsyncMode;
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
Remarks Sets the duration (in milliseconds) of the automatic tone for the bump bar unit
specified by the CurrentUnitID property.
This property is initialized to the default value for each online bump bar unit when
the device is first enabled following the Open method.
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
Remarks Sets the frequency (in Hertz) of the automatic tone for the bump bar unit specified
by the CurrentUnitID property.
This property is initialized to the default value for each online bump bar unit when
the device is first enabled following the Open method.
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
BumpBarDataCount Property
Syntax LONG BumpBarDataCount;
Remarks Indicates the number of DataEvents enqueued for the bump bar unit specified by
the CurrentUnitID property.
CapTone Property
Syntax BOOL CapTone;
Remarks If TRUE, the bump bar unit specified by the CurrentUnitID property supports an
enunciator; otherwise it is FALSE
This property is initialized when the device is first enabled following the Open
method.
Remarks Selects the current bump bar unit ID. Some properties and methods apply only to
the selected bump bar unit ID as noted. Up to 32 units are allowed for one bump
bar device. The unit ID definitions range from BB_UID_1 to BB_UID_32.
The following properties and methods apply only to the selected bump bar ID:
Setting CurrentUnitID will update these properties to the current values for the
specified unit.
• Methods: CheckHealth, ClearInput, ClearOutput.
This property is initialized to BB_UID_1 when the device is first enabled following
the Open method.
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
Remarks Indicates the total number of DataEvents enqueued at the control. All units online
are included in this value. The number of enqueued events for a specific unit ID is
stored in the BumpBarDataCount property.
ErrorString Property
Syntax BSTR ErrorString;
Remarks When an error occurs for any method that acts on a bitwise set of bump bar units,
the ErrorString will contain a description of the error which occurred to the unit(s)
specified by the ErrorUnits property.
ErrorUnits Property
Syntax LONG ErrorUnits;
Remarks When an error occurs for any method that acts on a bitwise set of bump bar units,
the ErrorUnits will contain a bitwise mask of the unit(s) that encountered an error.
EventString Property
Syntax BSTR EventString;
Remarks When an ErrorEvent is delivered, this property is set to a description of the error
which occurred to the unit(s) specified by the EventUnits property.
EventUnitID Property
Syntax LONG EventUnitID;
Remarks Just before the Control delivers a DataEvent to the Application, it sets this property
to the bump bar unit ID causing the event. The unit ID definitions range from
BB_UID_1 to BB_UID_32.
EventUnits Property
Syntax LONG EventUnits;
Keys Property
Syntax LONG Keys;
Remarks Indicates the number of keys on the bump bar unit specified by the CurrentUnitID
property.
This property is initialized when the device is first enabled following the Open
method.
Remarks Timeout value in milliseconds used by the bump bar device to complete all output
methods supported. If the device cannot successfully complete an output method
within the timeout value, then the method returns a failure status if AsyncMode is
FALSE, or enqueues an ErrorEvent if AsyncMode is TRUE.
This property is initialized to a Service Object dependent timeout following the Open
method.
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
UnitsOnline Property
Syntax LONG UnitsOnline;
Remarks Bitwise mask indicating the bump bar units online, where zero or more of the unit
constants BB_UID_1 (bit 0 on) through BB_UID_32 (bit 31 on) are bitwise ORed.
32 units are supported.
This property is initialized when the device is first enabled following the Open
method. This property is updated as changes are detected, such as before a
StatusUpdateEvent is fired and during the CheckHealth method.
Methods
BumpBarSound Method
Syntax LONG BumpBarSound (LONG Units, LONG Frequency, LONG Duration,
LONG NumberOfCycles, LONG InterSoundWait);
Parameter Description
Remarks Sound the bump bar enunciator for the bump bar(s) specified by the Units
parameter.
Duration parameter +
InterSoundWait parameter (except on the last tone cycle)
After the bump bar has started an asynchronous sound, then the sound may be
stopped by using the ClearOutput method. (When an InterSoundWait value of
OPOS_FOREVER was used to start the sound, then the application must use
ClearOutput to stop the continuous sounding of tones.)
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
The Level parameter indicates the type of health check to be performed on the
device. The following values may be specified:
Value Meaning
OPOS_CH_INTERNAL Perform a health check that does not physically change the
device. The device is tested by internal tests to the extent
possible.
OPOS_CH_EXTERNAL Perform a more thorough test that may change the device.
The UnitsOnline property will be updated with any changes before returning to the
application.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
Remarks Called to clear the device input that has been buffered for the unit specified by the
CurrentUnitID property.
Any data events that are enqueued – usually waiting for DataEventEnabled to be
set to TRUE and FreezeEvents to be set to FALSE – are also cleared.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_NOTCLAIMED
The device must be claimed before this method can be
used.
Remarks Called to clear the tone outputs that have been buffered for the unit specified by the
CurrentUnitID property.
Any output complete and output error events that are enqueued – usually waiting for
DataEventEnabled to be set to TRUE and FreezeEvents to be set to FALSE – are
also cleared.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_NOTCLAIMED
The device must be claimed before this method can be
used.
SetKeyTranslation Method
Syntax LONG SetKeyTranslation (LONG Units, LONG ScanCode, LONG LogicalKey);
Parameter Description
Units Bitwise mask indicating which bump bar unit(s) to set key
translation for.
ScanCode The bump bar generated key scan code. Valid values 0-
255.
Remarks This method will assign a logical key value to a device-specific key scan code for
the bump bar unit(s) specified by the Units parameter. The logical key value is used
during translation during the DataEvent.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
Events
DataEvent Event
Syntax void DataEvent (LONG Status);
The Status parameter is divided into four bytes. Depending on the Event Type,
located in the low word, the remaining 2 bytes will contain additional data. The
diagram below indicates how the parameter Status is divided:
Remarks Fired to present input data from a bump bar unit to the Application. The low word
contains the Event Type. The high word contains additional data depending on the
Event Type. When the Event Type is BB_DE_KEY, the low byte of the high word
contains the LogicalKeyCode for the key pressed on the bump bar unit. The
LogicalKeyCode value is device independent; it has been translated by the Service
Object from its original hardware specific value. Valid ranges are 0-255.
OutputCompleteEvent Event
Syntax void OutputCompleteEvent (LONG OutputID);
StatusUpdateEvent Event
Syntax void StatusUpdateEvent (LONG Status);
The Status parameter reports a change in the power state of a bump bar unit.
Remarks Fired when the bump bar device detects a power state change.
• Before delivering the event, the EventUnits property is set to the units for
which the new power state applies.
• When the bump bar device is enabled, then the Control will fire a
StatusUpdateEvent to specify the bitmask of online units.
• While the bump bar device is enabled, a StatusUpdateEvent is fired when the
power state of one or more units change. If more than one unit changes state at
the same time, the Service Object may choose to either fire multiple events or to
coalesce the information into a minimal number of events applying to
EventUnits.
ErrorEvent Event
Syntax void ErrorEvent (LONG ResultCode, LONG ResultCodeExtended,
LONG ErrorLocus, LONG* pErrorResponse);
Parameter Description
ResultCode Result code causing the error event. See ResultCode for
values.
Value Meaning
The contents at the location pointed to by the pErrorResponse parameter are preset
to a default value, based on the ErrorLocus. The application may change the value
to one of the following:
Value Meaning
OPOS_ER_CLEAR Clear the buffered input data. The error state is exited.
Default when locus is OPOS_EL_INPUT.
OPOS_ER_CONTINUEINPUT
Use only when locus is OPOS_EL_INPUT_DATA.
Acknowledges the error and directs the Control to continue
processing. The Control remains in the error state, and
will deliver additional DataEvents as directed by the
DataEventEnabled property. When all input has been
delivered and the DataEventEnabled property is again set
to TRUE, then another ErrorEvent is delivered with locus
OPOS_EL_INPUT.
Default when locus is OPOS_EL_INPUT_DATA.
Remarks Fired when an error is detected while trying to read bump bar data.
Input error events are not delivered until the DataEventEnabled property is TRUE,
so that proper application sequencing occurs.
See Also “Status, Result Code, and State Model”; DataEventEnabled Property; EventUnits
Property; EventString Property
Cash Changer
Summary
Properties
Common Type Access Initialized After
AutoDisable 1.2 Boolean R/W Not Supported
BinaryConversion 1.2 Long R/W Open
CapPowerReporting 1.3 Long R Open
CheckHealthText 1.2 String R Open
Claimed 1.2 Boolean R Open
DataCount 1.2 Long R Not Supported
DataEventEnabled 1.2 Boolean R/W Not Supported
DeviceEnabled 1.2 Boolean R/W Open & Claim
FreezeEvents 1.2 Boolean R/W Open
OutputID 1.2 Long R Not Supported
PowerNotify 1.3 Long R/W Open
PowerState 1.3 Long R Open
ResultCode 1.2 Long R --
ResultCodeExtended 1.2 Long R Open
State 1.2 Long R --
Methods
Common May Use After
Open 1.2 --
Close 1.2 Open
Claim 1.2 Open
Release 1.2 Open & Claim
CheckHealth 1.2 Open, Claim, & Enable
ClearInput 1.2 Not Supported
ClearOutput 1.2 Not Supported
DirectIO 1.2 Open
Specific
DispenseCash 1.2 Open, Claim, & Enable
DispenseChange 1.2 Open, Claim, & Enable
ReadCashCounts 1.2 Open, Claim, & Enable
Events
Name May Occur After
DataEvent 1.2 Not Supported
DirectIOEvent 1.2 Open , Claim
ErrorEvent 1.2 Not Supported
OutputCompleteEvent 1.2 Not Supported
StatusUpdateEvent 1.2 Open, Claim, & Enable
General Information
The Cash Changer Control’s OLE programmatic ID is “OPOS.CashChanger”.
This device was added in OPOS Release 1.2.
Capabilities
The Cash Changer has the following capabilities:
• Supports reporting the cash units and corresponding unit counts available in the
Cash Changer.
• Supports dispensing of a specified amount of cash from the device in either
bills, coins, or both into a user-specified exit.
• Supports dispensing of a specified number of cash units from the device in
either bills, coins, or both into a user-specified exit.
• Supports reporting of jam conditions within the device.
• Support for more than one currency.
The Cash Changer may also have the following additional capabilities:
• Reporting the fullness levels of the Cash Changer’s cash units. Conditions
which may be indicated include empty, near empty, full, and near full states.
• Reporting of a possible (or probable) cash count discrepancy in the data
reported by the ReadCashCounts method.
Model
The general model of a Cash Changer is:
• The Cash Changer may support several cash types such as coins, bills, and
combinations of coins and bills. The supported cash type for a particular
currency is noted by the list of cash units in the CurrencyCashList property.
• A Cash Changer device may consist of any combination of features to aid in the
cash processing functions such as a cash entry holding bin, a number of slots
or bins which can hold the cash, and cash exits.
• The current model of the Cash Changer device class provides programmatic
control only for the dispensing of cash. The accepting of cash by the device
(for example, to replenish cash) cannot be controlled by the APIs provided in
this model. The application can call the ReadCashCounts method to retrieve
the current unit count for each cash unit, but cannot control when or how cash
is added to the device.
• A Cash Changer device may have multiple exits. The number of exits is
specified in the DeviceExits property. The application chooses a dispensing
exit by setting the CurrentExit property. The cash units which may be
dispensed to the current exit are indicated by the ExitCashList property. When
the CurrentExit value is 1, the exit is considered the “primary exit” which is
typically used during normal processing for dispensing cash to a customer
following a retail transaction. When CurrentExit is a value greater than 1, the
exit is considered an “auxiliary exit”. An “auxiliary exit” typically is used for
special purposes such as dispensing quantities or types of cash not targeted for
the “primary exit”.
• Dispensing of funds into the exit specified by the CurrentExit property is
performed by calling either the DispenseChange or DispenseCash method.
With the DispenseChange method, the application specifies a total amount to
be dispensed, and it is the responsibility of the Cash Changer device or the
Control to dispense the proper amount of cash from the various slots or bins.
With the DispenseCash method, the application specifies a count of each cash
unit to be dispensed.
• Cash dispensing can be performed either synchronously or asynchronously,
depending on the value of the AsyncMode property.
When AsyncMode is FALSE, then the cash dispensing methods are performed
synchronously and the dispense method returns the completion status to the
application.
Device Sharing
The Cash Changer is an exclusive-use device. Its device sharing rules are:
Properties
AsyncMode Property R/W
Syntax BOOL AsyncMode;
Remarks If TRUE, then the DispenseCash and DispenseChange methods will be performed
asynchronously.
If FALSE, these methods will be performed synchronously.
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
AsyncResultCode Property
Syntax LONG AsyncResultCode;
Remarks When methods are asynchronously performed, they return their completion status to
the application in this property. This property is set by the control before a
StatusUpdateEvent event is delivered with a Status value of
CHAN_STATUS_ASYNC.
The value of this property is same as the value that would have been in the
ResultCode property had the method been performed synchronously.
AsyncResultCodeExtended Property
Syntax LONG AsyncResultCodeExtended;
Remarks When methods are asynchronously performed, they return their extended
completion status to the application in this property. This property is set by the
control before a StatusUpdateEvent event is delivered with a Status value of
CHAN_STATUS_ASYNC. The value of this property is same as the value that
would have been in the ResultCodeExtended property had the method been
performed synchronously.
CapDiscrepancy Property
Syntax BOOL CapDiscrepancy;
Remarks If TRUE, the ReadCashCounts method can report effective pDiscrepancy value;
otherwise it is FALSE.
CapEmptySensor Property
Syntax BOOL CapEmptySensor;
Remarks If TRUE, the Cash Changer can report the condition that some cash slots are empty;
otherwise it is FALSE.
CapFullSensor Property
Syntax BOOL CapFullSensor;
Remarks If TRUE, the Cash Changer can report the condition that some cash slots are full;
otherwise it is FALSE.
CapNearEmptySensor Property
Syntax BOOL CapNearEmptySensor;
Remarks If TRUE, the Cash Changer can report the condition that some cash slots are nearly
empty;
otherwise it is FALSE.
CapNearFullSensor Property
Syntax BOOL CapNearFullSensor;
Remarks If TRUE, the Cash Changer can report the condition that some cash slots are nearly
full;
otherwise it is FALSE.
CurrencyCashList Property
Syntax BSTR CurrencyCashList;
Remarks A string value denoting the cash units supported in the Cash Changer for the
currency represented by the CurrencyCode property.
The string consists of an ASCII numeric comma delimited values which denote the
units of coins, then the ASCII semicolon character (“;”) followed by ASCII numeric
comma delimited values for the bills that can be used with the Cash Changer. If a
semicolon (“;”) is absent, then all units represent coins.
• “1,5,10,50,100,500” —
1, 5, 10, 50, 100, 500 yen coin.
• “1,5,10,50,100,500;1000,5000,10000” —
1, 5, 10, 50, 100, 500 yen coin and 1000, 5000, 10000 yen bill.
• “;1000,5000,10000” —
1000, 5000, 10000 yen bill.
Remarks Contains the active currency code to be used by Cash Changer operations.
This property is initialized to an appropriate value by the Open method. This value
is guaranteed to be one of the set of currencies specified by the CurrencyCodeList
property.
Return When this property is set, one of the following values is placed in the ResultCode
property.
Value Meaning
CurrencyCodeList Property
Syntax BSTR CurrencyCodeList;
This property is initialized by the Open method. The string consists of a list of
ASCII three-character ISO 4217 currency codes separated by commas.
For example, if the string is “JPY,USD”, then the Cash Changer supports both
Japanese and U.S. monetary units.
Remarks The current cash dispensing exit. The value 1 represents the primary exit (or
normal exit), while values greater then 1 are considered auxiliary exits. Legal values
range from 1 to DeviceExits.
• Cash Changer supports both coins and bills; an auxiliary exit is used for larger
quantities of bills :
CurrencyCashList = “1,5,10,50,100,500;1000,5000,10000”
DeviceExits = 2
When CurrentExit = 1 : ExitCashList = “1,5,10,50,100,500;1000,5000”
When CurrentExit = 2 : ExitCashList = “;1000,5000,10000”
• Cash Changer supports bills; an auxiliary exit is used for larger quantities of bills
:
CurrencyCashList = “;1000,5000,10000”
DeviceExits = 2
When CurrentExit = 1 : ExitCashList = “;1000,5000”
When CurrentExit = 2 : ExitCashList = “;1000,5000,10000”
Return When this property is set, one of the following values is placed in the ResultCode
property.
Value Meaning
DeviceExits Property
Syntax LONG DeviceExits;
DeviceStatus Property
Syntax LONG DeviceStatus;
Remarks Holds the current status of the Cash Changer. It may be one of the following:
Value Meaning
CHAN_STATUS_EMPTY
Some cash slots are empty.
CHAN_STATUS_NEAREMPTY
Some cash slots are nearly empty.
This property is initialized and kept current while the device is enabled. If more than
one condition is present, then the order of precedence starting at the highest is fault,
empty, and near empty.
ExitCashList Property
Syntax BSTR ExitCashList;
Remarks A string value denoting the cash units which may be dispensed to the exit which is
denoted by CurrentExit property. The supported cash units are either the same as
CurrencyCashList, or a subset of it. The string format is identical to that of
CurrencyCashList.
FullStatus Property
Syntax LONG FullStatus;
Remarks Holds the current full status of the cash slots. It may be one of the following:
Value Meaning
CHAN_STATUS_OK All cash slots are neither nearly full nor full.
CHAN_STATUS_NEARFULL
Some cash slots are nearly full.
This property is initialized and kept current while the device is enabled.
Methods
DispenseCash Method
Syntax LONG DispenseCash (BSTR CashCounts);
The CashCounts parameter contains the dispensing cash units and counts,
represented by the format of “cash unit:cash counts, ..;.., cash unit:cash counts”.
Units before “;” represent coins, and units after “;” represent bills. If “;” is absent,
then all units represent coins.
Remarks Dispenses the cash from the Cash Changer into the exit specified by CurrentExit.
The cash dispensed is specified by pairs of cash units and counts.
• “10:5,50:1,100:3,500:1”
Dispense 5 ten yen coins, 1 fifty yen coins, 3 one hundred yen coins, 1 five
hundred yen coins.
• “10:5,100:3;1000:10”
Dispense 5 ten yen coins, 3 one hundred yen coins, and 10 one thousand yen
bills.
• “;1000:10,10000:5”
Dispense 10 one thousand yen bills and 5 ten thousand yen bills.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_EXTENDED ResultCodeExtended =
OPOS_ECHAN_OVERDISPENSE :
The specified cash cannot be dispensed because of a cash
shortage.
DispenseChange Method
Syntax LONG DispenseChange (LONG Amount);
Remarks Dispenses the specified amount of cash from the Cash Changer into the exit
represented by CurrentExit.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_EXTENDED ResultCodeExtended =
OPOS_ECHAN_OVERDISPENSE :
The specified change cannot be dispensed because of a
cash shortage.
ReadCashCounts Method
Syntax LONG ReadCashCounts (BSTR* pCashCounts, BOOL* pDiscrepancy);
Parameter Description
pCashCounts The cash count data is placed into the string pointed to by
pCashCounts.
Remarks The format of the string pointed to by pCashCounts is the same as CashCounts in
the DispenseCash method. Each unit in pCashCounts matches a unit in the
CurrencyCashList property, and is in the same order.
For example if the currency is Japanese yen and string returned at the pCashCounts
parameter is set to
1:80,5:77,10:0,50:54,100:0,500:87
as a result of calling the ReadCashCounts method, then there would be 80 one yen
coins, 77 five yen coins, 54 fifty yen coins, and 87 five hundred yen coins in the
Cash Changer.
Usually, the cash total calculated by pCashCounts parameter is equal to the cash total
in a Cash Changer. But, there are some cases where a discrepancy may occur
because of existing uncountable cash in a Cash Changer. An example would be
when a cash slot is “overflowing” such that the device has lost its ability to
accurately detect and monitor the cash.
Return One of the following values is returned by this method and placed in the
ResultCode property:
Value Meaning
Events
StatusUpdateEvent
Syntax void StatusUpdateEvent (LONG Status);
Value Meaning
For changes in the fullness levels, the Cash Changer is only able to fire
StatusUpdateEvents when the device has a sensor capable of detecting the full,
near full, empty, and/or near empty states and the corresponding capability
properties for these states are set.
Jam conditions may be reported whenever this condition occurs; likewise for
asynchronous method completion.
Cash Drawer
Summary
Properties
Common Type Access Initialized After
AutoDisable 1.2 Boolean R/W Not Supported
BinaryConversion 1.2 Long R/W Open
CapPowerReporting 1.3 Long R Open
CheckHealthText 1.0 String R Open
Claimed 1.0 Boolean R Open
DataCount 1.2 Long R Not Supported
DataEventEnabled 1.0 Boolean R/W Not Supported
DeviceEnabled 1.0 Boolean R/W Open
FreezeEvents 1.0 Boolean R/W Open
OutputID 1.0 Long R Not Supported
PowerNotify 1.3 Long R/W Open
PowerState 1.3 Long R Open
ResultCode 1.0 Long R --
ResultCodeExtended 1.0 Long R Open
State 1.0 Long R --
Methods
Common May Use After
Open 1.0 --
Close 1.0 Open
Claim 1.0 Open
Release 1.0 Open & Claim
CheckHealth 1.0 Open & Enable; Note
ClearInput 1.0 Not Supported
ClearOutput 1.0 Not Supported
DirectIO 1.0 Open
Specific
OpenDrawer 1.0 Open & Enable; Note
WaitForDrawerClose 1.0 Open & Enable; Note
Note: Also requires that no other application has claimed the cash drawer.
Events
Name May Occur After
DataEvent 1.0 Not Supported
DirectIOEvent 1.0 Open
ErrorEvent 1.0 Not Supported
OutputCompleteEvent 1.0 Not Supported
StatusUpdateEvent 1.0 Open & Enable
General Information
The Cash Drawer Control’s OLE programmatic ID is “OPOS.CashDrawer”.
Capabilities
The Cash Drawer Control has the following capability:
• Drawer status reporting: Can determine whether the drawer is open or closed.
Device Sharing
The cash drawer is a sharable device. Its device sharing rules are:
• After opening and enabling the device, the application may access all properties
and methods and will receive status update events.
• If more than one application has opened and enabled the device, all applications
may access its properties and methods. Status update events are fired to all of
the applications.
• If one application claims the cash drawer, then only that application may call the
OpenDrawer and WaitForDrawerClose methods. This feature provides a
degree of security, such that these methods may effectively be restricted to the
main POS application if that application claims the device at startup.
• See the “Summary” table for precise usage prerequisites.
Properties
CapStatus Property
Syntax BOOL CapStatus;
DrawerOpened Property
Syntax BOOL DrawerOpened;
If the capability CapStatus is FALSE, then the device does not support status
reporting, and DrawerOpened is always FALSE.
This property is initialized and kept current while the device is enabled.
Methods
OpenDrawer Method
Syntax LONG OpenDrawer ()
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
WaitForDrawerClose Method
Syntax LONG WaitForDrawerClose (LONG BeepTimeout, LONG BeepFrequency,
LONG BeepDuration, LONG BeepDelay);
Parameter Description
Remarks Call to wait until the cash drawer is closed. If the drawer is still open after
BeepTimeout milliseconds, then the system alert beeper is started.
Unless an error occurs, this method will not return to the application while the
drawer is open. When the cashier closes the drawer, the beeper is turned off.
If the capability CapStatus is FALSE, then the device does not support status
reporting, and this method will return immediately with a successful status.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
Events
StatusUpdateEvent Event
Syntax void StatusUpdateEvent (LONG Status);
Value Meaning
CASH_SUE_DRAWERCLOSED ( = 0 )
The drawer is closed.
CASH_SUE_DRAWEROPEN ( = 1 )
The drawer is open.
If the capability CapStatus is FALSE, then the device does not support status
reporting, and this event will never be fired.
Summary
Properties
Common Type Access Initialized After
AutoDisable 1.4 Boolean R/W Not Supported
BinaryConversion 1.4 Long R/W Open
CapPowerReporting 1.4 Long R Open
CheckHealthText 1.4 String R Open
Claimed 1.4 Boolean R Open
DataCount 1.4 Long R Not Supported
DataEventEnabled 1.4 Boolean R/W Not Supported
DeviceEnabled 1.4 Boolean R/W Open & Claim
FreezeEvents 1.4 Boolean R/W Open
OutputID 1.4 Long R Open
PowerNotify 1.4 Long R/W Open
PowerState 1.4 Long R Open
ResultCode 1.4 Long R --
ResultCodeExtended 1.4 Long R Open
State 1.4 Long R --
Methods
Common May Use After
Open 1.4 --
Close 1.4 Open
Claim 1.4 Open & Claim
Release 1.4 Open & Claim
CheckHealth 1.4 Open, Claim, & Enable
ClearInput 1.4 Not Supported
ClearOutput 1.4 Open & Claim
DirectIO 1.4 Open & Claim
Specific
AccessDailyLog 1.4 Open, Claim, & Enable
AuthorizeCompletion 1.4 Open, Claim, & Enable
AuthorizePreSales 1.4 Open, Claim, & Enable
AuthorizeRefund 1.4 Open, Claim, & Enable
AuthorizeSales 1.4 Open, Claim, & Enable
AuthorizeVoid 1.4 Open, Claim, & Enable
AuthorizeVoidPreSales 1.4 Open, Claim, & Enable
CheckCard 1.4 Open, Claim, & Enable
Events
Name May Use After
DataEvent 1.4 Not Supported
DirectIOEvent 1.4 Open & Claim
ErrorEvent 1.4 Open, Claim, & Enable
OutputCompleteEvent 1.4 Open, Claim, & Enable
StatusUpdateEvent 1.4 Open, Claim, & Enable
General Information
The CAT Control’s OLE programmatic ID is “OPOS.CAT”.
Description of terms
• Authorization method
Methods defined by this device class that have the Authorize prefix in their
name. These methods require communication with an approval agency.
• Authorization operation
The period from the invocation of an authorization method until the
authorization is completed. This period differs depending upon whether
operating in synchronous or asynchronous mode.
• Credit Authorization Terminal (CAT) Device
A CAT device typically consists of a display, keyboard, magnetic stripe
card reader, receipt printing device, and a communications device. CAT
devices are predominantly used in Japan where they are required by law.
Essentially a CAT device can be considered a device that shields the
encryption, message formatting, and communication functions of an
electronic funds transfer (EFT) operation from an application.
• Purchase
The transaction that allows credit card payment at the POS. It is
independent of payment methods (for example, lump-sum payment,
payment in installments, revolving payment, etc.).
• Cancel Purchase
The transaction to request voiding a purchase on the date of purchase.
• Refund Purchase
The transaction to request voiding a purchase after the date of purchase.
This differs from cancel purchase in that a cancel purchase operation can
often be handled by updating the daily log at the CAT device, while the
refund purchase operation typically requires interaction with the approval
agency.
• Authorization Completion
The state of a purchase when the response from the approval agency is
“suspended”. The purchase is later completed after a voice approval is
received from the card company.
• Pre-Authorization
The transaction to reserve an estimated amount in advance of the actual
purchase with customer’s credit card presentation and card entry at CAT.
• Cancel Pre-Authorization
The transaction to request canceling pre-authorization.
• Card Check
The transaction to perform a negative card file validation of the card
presented by the customer. Typically negative card files contain card
numbers that are known to fail approval. Therefore the Card Check
operation removes then need for communication to the approval agency in
some instances.
• Daily log
The daily log of card transactions that have been approved by the card
companies.
• Payment condition
Condition of payment such as lump-sum payment, payment by bonus,
payment in installments, revolving payment, and the combination of those
payments. See the PaymentCondition and PaymentDetail properties for
details.
• Approval agency
The agency to decide whether or not to approve the purchase based on the
card information, the amount of purchase, and payment type. The approval
agency is generally the card company.
Capabilities
The CAT control is capable of the following general mode of operation:
• This standard defines the application interface with the CAT control and does
not depend on the CAT device hardware implementation. Therefore, the
hardware implementation of a CAT device may be as follows:
♦ Separate type (POS interlock)
The dedicated CAT device is externally connected to the POS (for
instance, via an RS-232 connection).
♦ Built-in type
The hardware structure is the same as the separate type but is installed
within the POS housing.
• The CAT device receives each authorization request containing a purchase
amount and tax from CAT control.
• The CAT device generally requests the user to swipe a magnetic card when it
receives an authorization request from CAT control.
• Once a magnetic card is swiped at the CAT device, the device sends the
purchase amount and tax to the approval agency using the communications
device.
• The CAT device returns the result from the approval agency to the CAT
control. The returned data will be stored in the authorization properties by the
CAT control for access by applications.
Model
The general models for the CAT control are shown below:
• The CAT control basically follows the output device model. However, multiple
methods cannot be issued for asynchronous output; only 1 outstanding
asynchronous request is allowed.
• The CAT control issues requests to the CAT device for different types of
authorization by invoking the following methods.
• The CAT control issues requests to the CAT device for special processing local
to the CAT device by invoking the following methods.
• The CAT control stores the authorization results in the following properties
when an authorization operation sucessfully completes:
• Sequence numbers are used to validate that the properties set at completion of a
method are indeed associated with the completed method. An incoming
SequenceNumber argument for each method is compared with the resulting
SequenceNumber property after the operation associated with the method has
completed. If the numbers do not match, or if an application fails to identify the
number, there is no guarantee that the values of the properties listed in the two
tables correspond to the completed method.
Synchronous Mode:
- Open
- Claim
- DeviceEnabled=TRUE
- Definition of the argument SequenceNumber
- AuthorizeSales()
- Check ResultCode
- Verify that the SequenceNumber property matches the value of the
AuthorizeSales() SequenceNumber argument
- Access the properties set by AuthorizeSales()
- DeviceEnabled=FALSE
- Release
- Close
Asynchronous Mode:
- Open
- Claim
- DeviceEnabled=TRUE
- AsyncMode=TRUE
- Definition of the argument SequenceNumber
- AuthorizeSales()
- Check ResultCode
– Wait for OutputCompleteEvent
- Check the argument ResultCode
- Verify that the SequenceNumber property matches the value of the
AuthorizeSales() SequenceNumber argument
- Access the properties set by AuthorizeSales()
- DeviceEnabled=FALSE
- Release
- Close
Device sharing
The CAT is an exclusive-use device, as follows:
• After opening the device, properties are readable.
• The application must claim the device before enabling it.
• The application must claim and enable the device before calling methods that
manipulate the device.
• See the“Summary”table for precise usage prerequisites.
Properties
AccountNumber Property R
Syntax BSTR AccountNumber;
Remarks This property is initialized to NULL by the Open method and is updated when an
authorization operation successfully completes.
Remarks An application can send data to the CAT device by setting this property before
issuing an authorization method. Also, data obtained from the CAT device and not
stored in any other property as the result of an authorization operation (for example,
the account code for a loyalty program) can be provided to an application by storing
it in this property. Since the data stored here is device specific, this should not be
used for any development that requires portability. The format of this data depends
on BinaryConversion property. See BinaryConversion property for more details.
ApprovalCode Property R
Syntax BSTR ApprovalCode;
Remarks This property is initialized to NULL by the Open method and is updated when an
authorization operation successfully completes.
Return When this property is set, the following value is placed in the ResultCode property.
Value Meaning
CapAdditionalSecurityInformation Property
Syntax BOOL CapAdditionalSecurityInformation;
CapAuthorizeCompletion Property
Syntax BOOL CapAuthorizeCompletion;
CapAuthorizePreSales Property
Syntax BOOL CapAuthorizePreSales;
CapAuthorizeRefund Property
Syntax BOOL CapAuthorizeRefund;
CapAuthorizeVoid Property
Syntax BOOL CapAuthorizeVoid;
Remarks If TRUE, the AuthorizeVoid method has been implemented; otherwise it is FALSE.
CapCenterResultCode property
Syntax BOOL CapCenterResultCode;
CapCheckCard Property
Syntax BOOL CapCheckCard;
Remarks If TRUE, the CheckCard method has been implemented; otherwise it is FALSE.
CapDailyLog Property
Syntax LONG CapDailyLog;
Value Meaning
CAT_DL_NONE The CAT device does not have the daily log functions.
CAT_DL_SETTLEMENT
The CAT device only has the “final total” and “erase daily
log” functions.
CAT_DL_REPORTING_SETTLEMENT
The CAT device has both the intermediate total function
and the final total and erase daily log function.
CapInstallments Property
Syntax BOOL CapInstallments;
Remarks If TRUE, the item “Installments” which is stored in the DailyLog property as the
result of AccessDailyLog will be provided; otherwise it is FALSE.
CapPaymentDetail Property
Syntax BOOL CapPaymentDetail;
CapTaxOthers Property
Syntax BOOL CapTaxOthers;
Remarks If TRUE, the item “TaxOthers” which is stored in the DailyLog property as the
result of AccessDailyLog will be provided; otherwise it is FALSE.
Note that this property is not related to the “TaxOthers” argument used with the
authorization methods.
CapTransactionNumber Property
Syntax BOOL CapTransactionNumber;
CapTrainingMode Property
Syntax BOOL CapTrainingMode;
Remarks If TRUE, the TrainingMode property has been implemented; otherwise it is FALSE.
CardCompanyID Property R
Syntax BSTR CardCompanyID;
Remarks This property is initialized to NULL by the Open method and is updated when an
authorization operation successfully completes.
The length of the ID string varies depending upon the CAT device.
CenterResultCode Property R
Syntax BSTR CenterResultCode;
Remarks Contains the code from the approval agency. Check the approval agency for the
actual codes to be stored.
This property is initialized to NULL by the Open method and is updated when an
authorization operation successfully completes
DailyLog Property R
Syntax BSTR DailyLog;
Remarks Stores the result of the AccessDailyLog method. The data is delimited by
CR(13)+LF(10) for each transaction and is stored in ASCII code. The detailed data
of each transaction is comma separated [i.e. delimited by “,” (44)].
Note 1)
Note 3)
Note 5)
Note 3)
1) Format
Item Format
Some CAT devices may not support seconds by the internal clock. In that
case, the seconds field of the transaction date is filled with “00”
2) Additional data
The area where the CAT device stores the vendor specific data. This enables
an application to receive data other than that defined in this specification. The
data stored here is vendor specific and should not be used for development
which places an importance on portability.
4) Amount
5) Purchase date
The date manually entered for the purchase transaction after approval.
13:45:30
Number of payments 2 2
102,10,19980116134530,123456,61,12345,0123456,,12341234123412
34,12345,,2,12345678[CR][LF]
PaymentCondition Property R
Syntax LONG PaymentCondition;
Remarks Holds the payment condition of the most recent successful authorization operation.
This property will be set to one of the following values. See PaymentDetail for the
detailed payment string that correlates to the following PaymentCondition values.
Value Meaning
CAT_PAYMENT_LUMP Lump-sum
CAT_PAYMENT_BONUS_1 Bonus 1
CAT_PAYMENT_BONUS_2 Bonus 2
CAT_PAYMENT_BONUS_3 Bonus 3
CAT_PAYMENT_BONUS_4 Bonus 4
CAT_PAYMENT_BONUS_5 Bonus 5
CAT_PAYMENT_INSTALLMENT_1 Installment 1
CAT_PAYMENT_INSTALLMENT_2 Installment 2
CAT_PAYMENT_INSTALLMENT_3 Installment 3
PaymentDetail Property R
Syntax BSTR PaymentDetail;
PaymentCondition PaymentDetail
CAT_PAYMENT_LUMP NULL
CAT_PAYMENT_BONUS_1 NULL
CAT_PAYMENT_BONUS_4* Number of bonus payments, 1st bonus month, 2nd bonus month, 3rd
bonus month, 4th bonus month, 5th bonus month, 6th bonus month
CAT_PAYMENT_BONUS_5* Number of bonus payments, 1st bonus month, 1st bonus amount, 2nd
bonus month, 2nd bonus amount, 3rd bonus month, 3rd bonus amount, 4th
bonus month, 4th bonus amount, 5th bonus month, 5th bonus amount, 6th
bonus month, 6th bonus amount
CAT_PAYMENT_INSTALLMENT_2* 1 st billing month, Number of payments, 1st amount, 2nd amount, 3rd
amount, 4th amount, 5th amount, 6th amount
CAT_PAYMENT_REVOLVING NULL
*Maximum 6 installments
The payment types and names vary depending on the CAT device. The following are
the payment types and terms available for CAT devices. Note that there are some
differences between OPOS terms and those used by the CAT devices. The goal of
this table is to synchronize these terms.
CAT CAT
Payment Condition Value
CAT)
Entry item
OPOS
Bonus
month (2)
Bonus
month (3)
Bonus
month (4)
Bonus
month (5)
Bonus
month (6)
Number of 25 Bonus 5 Bonus 5 Does not Does not Does not Bonus 5
bonus exist. exist. exist.
payments
Bonus
month (1)
Bonus
amount (1)
Bonus
month (2)
Bonus
amount (2)
Bonus
month (3)
Bonus
amount (3)
Bonus
month (4)
Bonus
amount (4)
Bonus
month (5)
Bonus
amount (5)
Bonus
month (6)
Bonus
amount (6)
Number of
payments
Payment 62 Installment 2 Installment 2 Does not Does not Does not Does not
start exist. exist. exist. exist.
month
Number of
payments
Installment
amount (1)
Installment
amount (2)
Installment
amount (3)
Installment
amount (4)
Installment
amount (5)
Installment
amount (6)
Number of
payments
Initial
amount
Bonus
amount
Bonus
month (1)
Bonus
month (2)
Bonus
month (3)
Bonus
month (4)
Bonus
month (5)
Bonus
month (6)
Bonus
month (1)
Bonus
amount (1)
Bonus
month (2)
Bonus
amount (2)
Bonus
month (3)
Bonus
amount (3)
Bonus
month (4)
Bonus
amount (4)
Bonus
month (5)
Bonus
amount (5)
Bonus
month (6)
Bonus
amount (6)
SequenceNumber Property R
Syntax LONG SequenceNumber;
Remarks Stores a “sequence number” as the result of each method call. This number needs to
be checked by an application to see if it matches with the argument
SequenceNumber of the originating method.
If the “sequence number” returned from the CAT device is not numeric, the CAT
control set this property to zero (0).
This property is initialized to zero (0) by the Open method and is updated when an
authorization operation successfully completes
SlipNumber Property R
Syntax BSTR SlipNumber;
This property is initialized to NULL by the Open method and is updated when an
authorization operation successfully completes
Remarks If TRUE, each operation will be run in training mode; otherwise each operation will
be run in normal mode.
Return When this property is set, the following value is placed in the ResultCode property.
Value Meaning
TransactionNumber Property R
Syntax BSTR TransactionNumber;
This property is initialized to NULL by the Open method and is updated when an
authorization operation successfully completes
TransactionType Property R
Syntax LONG TransactionType;
This property is initialized to zero (0) by the Open method and is updated when an
authorization operation successfully completes.
Value Meaning
CAT_TRANSACTION_SALES Sales
CAT_TRANSACTION_VOID Cancellation
CAT_TRANSACTION_PRESALES Pre-authorization
Methods
AccessDailyLog Method
Syntax LONG AccessDailyLog (LONG SequenceNumber, LONG Type, LONG Timeout);
Parameter Description
When Timeout is OPOS_FOREVER(-1), timeout never occurs and the device waits
until it receives response from the CAT.
Application must specify one of the following values for Type for daily log type
(either intermediate total or adjustment). Legal values depend upon the CapDailyLog
value.
Value Meaning
Return One of the following values is returned by the method and placed in the ResultCode
property.
Value Meaning
AuthorizeCompletion Method
Syntax LONG AuthorizeCompletion (LONG SequenceNumber, CURRENCY Amount,
CURRENCY TaxOthers, LONG Timeout);
Parameter Description
Sales after approval for Amount and TaxOthers is intended as the approval specified
by SequenceNumber.
When Timeout is OPOS_FOREVER(-1), timeout never occurs and the device waits
until it receives response from the CAT.
Return One of the following values is returned by the method and placed in the ResultCode
property.
Value Meaning
AuthorizePreSales Method
Syntax LONG AuthorizePreSales (LONG SequenceNumber, CURRENCY Amount,
CURRENCY TaxOthers, LONG Timeout);
Parameter Description
When Timeout is OPOS_FOREVER(-1), timeout never occurs and the device waits
until it receives response from the CAT.
Return One of the following values is returned by the method and placed in the ResultCode
property.
Value Meaning
AuthorizeRefund Method
Syntax LONG AuthorizeRefund (LONG SequenceNumber, CURRENCY Amount,
CURRENCY TaxOthers, LONG Timeout);
Parameter Description
Refund purchase approval for Amount and TaxOthers is intended as the approval
specified by SequenceNumber.
When Timeout is OPOS_FOREVER(-1), timeout never occurs and the device waits
until it receives response from the CAT.
Return One of the following values is returned by the method and placed in the ResultCode
property.
Value Meaning
AuthorizeSales Method
Syntax LONG AuthorizeSales (LONG SequenceNumber, CURRENCY Amount,
CURRENCY TaxOthers, LONG Timeout);
Parameter Description
Normal purchase approval for Amount and TaxOthers is intended as the approval
specified by SequenceNumber.
When Timeout is OPOS_FOREVER(-1), timeout never occurs and the device waits
until it receives response from the CAT.
Return One of the following values is returned by the method and placed in the ResultCode
property.
Value Meaning
AuthorizeVoid Method
Syntax LONG AuthorizeVoid (LONG SequenceNumber, CURRENCY Amount,
CURRENCY TaxOthers, LONG Timeout);
Parameter Description
When Timeout is OPOS_FOREVER(-1), timeout never occurs and the device waits
until it receives response from the CAT.
Return One of the following values is returned by the method and placed in the ResultCode
property.
Value Meaning
AuthorizeVoidPreSales Method
Syntax LONG AuthorizeVoidPreSales (LONG SequenceNumber, CURRENCY Amount,
CURRENCY TaxOthers, LONG Timeout);
Parameter Description
When Timeout is OPOS_FOREVER(-1), timeout never occurs and the device waits
until it receives response from the CAT.
Normal cancellation could be used for CAT control and CAT devices which have
not implemented the pre-authorization approval cancellation. Refer to the
documentation supplied with CAT device and / or CAT control.
Return One of the following values is returned by the method and placed in the ResultCode
property.
Value Meaning
CheckCard Method
Syntax LONG CheckCard (LONG SequenceNumber, LONG Timeout);
Parameter Description
When Timeout is OPOS_FOREVER(-1), timeout never occurs and the device waits
until it receives response from the CAT.
Return One of the following values is returned by the method and placed in the ResultCode
property.
Value Meaning
Events
ErrorEvent Event
Syntax void ErrorEvent (LONG ResultCode, LONG ResultCodeExtended, LONG
ErrorLocus, LONG* pErrorResponse);
Parameter Description
ResultCodeExtended The extended code which caused the error event. Remarks
the value below for the value.
Value Meaning
OPOS_ECAT_CENTERERROR
An error was returned from the approval agency. The
detail error code is defined in CenterResultCode.
OPOS_ECAT_COMMANDERR
The command sent to CAT is wrong. This error is never
returned so long as CAT control is working correctly.
OPOS_ECAT_COMMUNICATIONERROR
Communication error has occurred between the approval
agency and CAT.
OPOS_ECAT_DAILYLOGOVERFLOW
Daily log was too big to be stored. Keeping daily log has
been stopped and the value of DailyLog property is
uncertain.
The content of the position specified by pErrorResponse will be preset to the default
value of OPOS_ER_RETRY. An application sets one of the following values.
Value Meaning
Remarks Fired when an error is detected while processing an asynchronous authorize group
method or the AccessDailyLog method. The control’s State transitions into the
error state.
Coin Dispenser
Summary
Properties
Common Type Access Initialized After
AutoDisable 1.2 Boolean R/W Not Supported
BinaryConversion 1.2 Long R/W Open
CapPowerReporting 1.3 Long R Open
CheckHealthText 1.0 String R Open
Claimed 1.0 Boolean R Open
DataCount 1.2 Long R Not Supported
DataEventEnabled 1.0 Boolean R/W Not Supported
DeviceEnabled 1.0 Boolean R/W Open & Claim
FreezeEvents 1.0 Boolean R/W Open
OutputID 1.0 Long R Not Supported
PowerNotify 1.3 Long R/W Open
PowerState 1.3 Long R Open
ResultCode 1.0 Long R --
ResultCodeExtended 1.0 Long R Open
State 1.0 Long R --
Methods
Common May Use After
Open 1.0 --
Close 1.0 Open
Claim 1.0 Open
Release 1.0 Open & Claim
CheckHealth 1.0 Open, Claim, & Enable
ClearInput 1.0 Not Supported
ClearOutput 1.0 Not Supported
DirectIO 1.0 Open
Specific
DispenseChange 1.0 Open, Claim, & Enable
Events
Name May Occur After
DataEvent 1.0 Not Supported
DirectIOEvent 1.0 Open, Claim
ErrorEvent 1.0 Not Supported
OutputCompleteEvent 1.0 Not Supported
StatusUpdateEvent 1.0 Open, Claim, & Enable
General Information
The Coin Dispenser Control’s OLE programmatic ID is “OPOS.CoinDispenser”.
Capabilities
The coin dispenser has the following capability:
• Coin dispenser status reporting, which indicates empty coin slot conditions, near
empty coin slot conditions, and coin slot jamming conditions.
Model
The general model of a coin dispenser is:
• A coin dispenser consists of a number of coin slots which hold the coinage to
be dispensed. The programmer using the Coin Dispenser Control is not
concerned with controlling the individual slots of coinage, but rather calls a
method with the amount of change to be dispensed. It is the responsibility of
the coin dispenser device or the Control to dispense the proper amount of
change from the various slots.
Device Sharing
The coin dispenser is an exclusive-use device. Its device sharing rules are:
Properties
CapEmptySensor Property
Syntax BOOL CapEmptySensor;
CapJamSensor Property
Syntax BOOL CapJamSensor;
Remarks If TRUE, the coin dispenser can report a mechanical jam or failure condition;
otherwise it is FALSE.
CapNearEmptySensor Property
Syntax BOOL CapNearEmptySensor;
Remarks If TRUE, the coin dispenser can report when it is almost out of coinage;
otherwise it is FALSE.
DispenserStatus Property
Syntax LONG DispenserStatus;
Remarks Holds the current status of the dispenser. It may be one of the following:
Value Meaning
COIN_STATUS_OK Ready to dispense coinage. This value is also set when the
dispenser is unable to detect an error condition.
COIN_STATUS_EMPTY
Cannot dispense coinage because it is empty.
COIN_STATUS_NEAREMPTY
Can still dispense coinage, but it nearly empty.
This property is initialized and kept current while the device is enabled.
Methods
DispenseChange Method
Syntax LONG DispenseChange (LONG Amount);
Remarks Call to dispense change. The value represented by the Amount parameter is a count
of the currency units to dispense (such as cents or yen).
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
Events
StatusUpdateEvent
Syntax void StatusUpdateEvent (LONG Status);
Value Meaning
COIN_STATUS_OK Ready to dispense coinage. This value is also set when the
dispenser is unable to detect an error condition.
COIN_STATUS_EMPTY
Cannot dispense coinage because it is empty.
COIN_STATUS_NEAREMPTY
Can still dispense coinage, but is nearly empty.
The coin dispenser is only able to fire status event changes for the sensor types
supported by the values described in the capabilities properties.
Fiscal Printer
Summary
Properties
Common Type Access Initialized After
AutoDisable 1.3 Boolean R/W Not Supported
BinaryConversion 1.3 Long R/W Open
CheckHealthText 1.3 String R Open
Claimed 1.3 Boolean R Open
DataCount 1.3 Long R Not Supported
DataEventEnabled 1.3 Boolean R/W Not Supported
DeviceEnabled 1.3 Boolean R/W Open & Claim
FreezeEvents 1.3 Boolean R/W Open
OutputID 1.3 Long R Open
PowerState 1.3 Long R Open
PowerNotify 1.3 Long R/W Open
ResultCode 1.3 Long R --
ResultCodeExtended 1.3 Long R Open
State 1.3 Long R --
Methods
Common May Use After
Open 1.3 --
Close 1.3 Open
Claim 1.3 Open
Release 1.3 Open & Claim
CheckHealth 1.3 Open, Claim, & Enable
ClearInput 1.3 Not Supported
ClearOutput 1.3 Open & Claim
DirectIO 1.3 Open
Specific - Non-Fiscal
BeginFixedOutput (1) 1.3 Open, Claim, & Enable
BeginNonFiscal 1.3 Open, Claim, & Enable
BeginTraining 1.3 Open, Claim, & Enable
EndFixedOutput (1) 1.3 Open, Claim, & Enable
EndNonFiscal 1.3 Open, Claim, & Enable
EndTraining 1.3 Open, Claim, & Enable
PrintFixedOutput (1) 1.3 Open, Claim, & Enable
PrintNormal 1.3 Open, Claim, & Enable
Events
Name May Occur After
DataEvent 1.3 Not Supported
DirectIOEvent 1.3 Open
ErrorEvent 1.3 Open, Claim, & Enable
OutputCompleteEvent 1.3 Open, Claim, & Enable
StatusUpdateEvent 1.3 Open, Claim, & Enable
All methods and properties marked with (1) are specific to at least one particular
country and are not required by the fiscal legislation of all countries.
Properties and methods marked with (2) are adapted from the POS Printer device.
General Information
The Fiscal Printer Control’s OLE programmatic ID is “OPOS.FiscalPrinter”.
This device was added in OPOS Release 1.3.
The fiscal printer OLE Control does not attempt to encapsulate the generic Windows
graphics printer. Rather, for performance and ease of use considerations, the
interfaces are defined to directly control a printer.
Since fiscal rules differ between countries, this interface tries to generalize the
common requirements at the maximum extent specifications. This interface is based
upon the fiscal requirements of the following countries, but it may fit the needs of
other countries as well:
• Brazil
• Greece
• Hungary
• Italy
• Poland
• Turkey
The printer model defines three stations with the following general uses:
• Journal Used to log transaction information. Must be kept by the store for
audit.
• Receipt Used to print transaction information. It is mandatory to give a printed
fiscal receipt to the customer. Contains either a knife to cut the paper between
transactions, or a tear bar to manually cut the paper.
• Slip Used to print information on a form. Usually given to the customer.
Also used to print “validation” information on a form. The form type is typically
a check or credit card slip.
Configuration and initialization of the fiscal memory of the printer are not covered in
this specification. These low level operations must be performed by technical
assistance personnel.
Device Sharing
The Fiscal Printer is an exclusive-use device, as follows:
General requirements
Fiscal printers do not simply print text as standard printers do, they are used to
monitor and memorize all fiscal information about a sale transaction. A fiscal printer
has to accumulate totals, discounts, number of canceled receipts, taxes, etc. In
order to do this, it is not sufficient to send unformatted strings of text to the printer;
there is a need to separate each individual field in a receipt line item, thus
differentiating between descriptions, prices and discounts. Moreover, it is necessary
to define different printing commands for each different sale functionality (such as
refund, item or void).
Fiscal rules are different among countries. This interface tries to generalize these
requirements by summarizing the common requirements. Fiscal law requires that:
Printer Modes
According to fiscal rules, it is possible for a fiscal printer to also offer functionality
beyond the required fiscal printing mode. These additional modes are optional and
may or may not be present on any particular fiscal printer.
• Fiscal: This is the only required mode for a fiscal printer. In this mode the
application has access to all the methods needed to manage a sale transaction
and to print a fiscal receipt. It is assumed that any lines printed to the receipt
station while in fiscal mode are also printed on the journal station.
• Training: In this mode the printer is used for training purposes (such as
cashier training). In this mode the printer will accept fiscal commands but the
printer will indicate on each receipt or document that the transaction is not an
actual fiscal transaction. The printer will not update any of its internal fiscal
registers while in training mode. Such printed receipts are usually marked as
“training” receipts by fiscal printers.
The CapTrainingMode property will be set to TRUE if the printer supports
training mode, FALSE otherwise.
• Non-Fiscal: In this mode the printer can be used to print simple text on the
receipt station (echoed on the journal station) or the slip station. The printer will
print some additional lines along with the application requested output to indicate
that this output is not of a fiscal nature. Such printed receipts are usually
marked as “non-fiscal” receipts by fiscal printers.
The CapNonFiscalMode property will be set to TRUE if the printer supports
non-fiscal printing, FALSE otherwise.
Model
The Fiscal Printer follows the general output model, with some enhancements:
• Most of the fiscal printer error conditions are reported by setting the
ResultCode to OPOS_E_EXTENDED and then setting ResultCodeExtended
to one of the following error conditions:
OPOS_EFPTR_COVER_OPEN
The printer cover is open.
OPOS_EFPTR_JRN_EMPTY
The journal station has run out of paper.
OPOS_EFPTR_REC_EMPTY
The receipt station has run out of paper.
OPOS_EFPTR_SLP_EMPTY
The slip station has run out of paper.
OPOS_EFPTR_MISSING_DEVICES:
Some of the other devices which according to the local fiscal legislation
are to be connected are missing. In some countries in order to use a
fiscal printer a full set of peripheral devices are to be connected to the
POS (such as cash drawer and customer display). In case one of these
devices is not present sales are not allowed.
OPOS_EFPTR_WRONG_STATE
The requested method could not be executed in the printer’s current
state.
OPOS_EFPTR_TECHNICAL_ASSISTANCE
The printer has encountered a severe error condition. Calling for printer
technical assistance is required.
OPOS_EFPTR_CLOCK_ERROR
The printer’s internal clock has failed.
OPOS_EFPTR_FISCAL_MEMORY_FULL
The printer’s fiscal memory has been exhausted.
OPOS_EFPTR_FISCAL_MEMORY_DISCONNECTED
The printer’s fiscal memory has been disconnected.
OPOS_EFPTR_FISCAL_TOTALS_ERROR
The Grand Total in working memory does not match the one in the
EPROM.
OPOS_EFPTR_BAD_ITEM_QUANTITY
The Quantity parameter is invalid.
OPOS_EFPTR_BAD_ITEM_AMOUNT
The Amount parameter is invalid.
OPOS_EFPTR_BAD_ITEM_DESCRIPTION
The Description parameter is either too long, contains illegal characters
or contains a reserved word.
OPOS_EFPTR_RECEIPT_TOTAL_OVERFLOW
The receipt total has overflowed.
OPOS_EFPTR_BAD_VAT
The Vat parameter is invalid.
OPOS_EFPTR_BAD_PRICE
The Price parameter is invalid.
OPOS_EFPTR_BAD_DATE
The date parameter is invalid.
OPOS_EFPTR_NEGATIVE_TOTAL
The printer’s computed total or subtotal is less than zero.
OPOS_EFPTR_WORD_NOT_ALLOWED
The description contains the reserved word.
• Other printer errors are reported by setting the ResultCode to
OPOS_E_FAILURE or another standard error status. These failures are
typically due to a printer fault or jam, or to a more serious error.
Printer States
As previously described, a fiscal printer is characterized by different printing modes.
Moreover, the set of commands that can be executed at a particular moment
depends upon the current state of the printer.
The current state of the fiscal printer is kept in the PrinterState property.
• Monitor:
This is a neutral state. From this state it is possible to move to most of the
other printer states. After a successful call to the Claim method and successful
setting of the DeviceEnabled property to TRUE the printer should be in this
state unless there is a printer error.
• Fiscal Receipt:
The printer is processing a fiscal receipt. All PrintRec… methods are available
for use while in this state. This state is entered from the Monitor state using
the BeginFiscalReceipt method.
• Fiscal Receipt Total:
The printer has already accepted at least one payment method, but the receipt’s
total amount has not yet been tendered. This state is entered from the Fiscal
Receipt state by use of the PrintRecTotal method. The printer remains in this
state while the total remains unpaid. This state can left by using the
PrintRecTotal, PrintRecNotPaid or PrintRecVoid methods.
• Fiscal Receipt Ending:
The printer has completed the receipt up to the Total line. In this state it may be
possible to print general messages using the PrintRecMessage method if it is
supported by the printer. This state is entered from the Fiscal Receipt state via
the PrintRecVoid method or from the Fiscal Receipt Total state using either
the PrintRecTotal, PrintRecNotPaid or PrintRecVoid methods. This state is
exited using the EndFiscalReceipt method at which time the printer returns to
the Monitor state.
• Fiscal Document:
The printer is processing a fiscal document. The printer will accept the
PrintFiscalDocumentLine method while in this state. This state is entered
from the Monitor state using the BeginFiscalDocument method. This state is
exited using the EndFiscalDocument method at which time the printer returns
to the Monitor state.
If the printer is not in the FPTR_PS_MONITOR state, the state reflects the printer's
interrupted operation and the PowerState property is set to OPOS_PS_OFF. In this
situation it is necessary to force the printer to a normal state by calling the
ResetPrinter method.
This means that a power failure occurred or the last application which accessed the
device left it in a not clear state.
Notice that even in this case the ResultCode property will be set to
OPOS_SUCCESS after setting DeviceEnabled to TRUE. It is required that the
application check the PowerState property and checks for a received
StatusUpdateEvent with the value OPOS_SUE_POWER_OFF in the Data
argument after successfully setting the DeviceEnabled property.
Document Printing
Using a fiscal printer’s slip station it may be possible (depending upon the printer’s
capabilities and on special fiscal rules) to print the following kinds of documents:
• Fiscal Documents:
In order to print fiscal documents an amount value must be sent to the printer
and recorded by it. The CapSlpFiscalDocument property will be set to TRUE
if the printer supports printing fiscal documents, and FALSE otherwise. If
fiscal documents are supported they may be either full length (if CapSlpFullSlip
is TRUE) or validation (if CapSlpValidation is TRUE). The actual selection is
made using the SlipSelection property but only one totalizer is assigned to all
the fiscal documents.
• Non-Fiscal Full Length Documents:
Full length slip documents may be printed if CapSlpFullSlip is TRUE and
SlipSelection is set to FPTR_SS_FULL_LENGTH.
• Non-Fiscal Validation Documents:
Validation documents may be printed if CapSlpValidation is TRUE and
SlipSelection is set to FPTR_SS_VALIDATION.
• Fixed Text Documents:
Fixed text documents may be printed if CapFixedOutput is TRUE. If fixed text
documents are supported they may be either full length (if CapSlpFullSlip is
TRUE) or validation (if CapSlpValidation is TRUE). The actual selection is
made using the SlipSelection property.
Before selling the first line item it is possible to exit from the fiscal receipt state by
calling the EndFiscalReceipt method. If header lines have already been printed, this
method will cause also receipt voiding.
Once the first line item has been printed and the printer remains in the Fiscal Receipt
state, the following fiscal print methods are available:
PrintRecItem
PrintRecItemAdjustment
PrintRecNotPaid
PrintRecRefund
PrintRecSubtotal
PrintRecSubtotalAdjustment
PrintRecTotal
PrintRecVoid
PrintRecVoidItem
While in the Fiscal Receipt Total state the following fiscal print methods are
available:
PrintRecNotPaid
PrintRecTotal
PrintRecVoid
While in the Fiscal Receipt Ending state the following fiscal methods are available:
PrintRecMessage
EndFiscalReceipt
Be aware that at no time can the printer’s total for the receipt be negative. If this
occurs the printer will generate an error.
Receipt Layouts
The following is an example of a typical receipt layout:
• Header Lines:
Header lines contain all of the information about the store, such as telephone
number, address and name of the store. All of these lines are fixed and are
defined before selling the first item (using the SetHeaderLine method). These
lines may either be printed when the BeginFiscalReceipt method is called or
when the first fiscal receipt method is called.
• Transaction Lines:
All of the lines of a fiscal transaction, such as line items, discounts and
surcharges.
• Total Line:
The line containing the transaction total, tender amounts and possibly change
due.
• Trailer Lines:
These are fixed promotional messages stored on the printer (using the
SetTrailerLine method). They are automatically printed when the
EndFiscalReceipt method is called. Note that the fiscal logotype, date and time
and serial number lines are not considered part of the trailer lines. In fact,
depending upon fiscal legislation and upon the printer vendor, the relative
position of the trailer and the fiscal logotype lines can vary. Information which
has to be inserted in the receipt due to fiscal legislation is automatically printed at
receipt closure.
VAT Tables
Some fiscal printers support storing VAT (Value Added Tax) tables in the printer’s
memory. Some of these printers will allow the application to set and modify any of
the table entries. Others allow only adding new table entries but do not allow
existing entries to be modified. Some printers allow the VAT table to bet set only
once.
If the printer supports VAT tables, the CapHasVatTable property is set to TRUE.
If the printer allows the VAT table entries to be set or modified the CapSetVatTable
property is set to TRUE. The maximum number of different vat rate entries in the
VAT table is given by the NumVatRates property. VAT tables are set through a
two step process. First the application uses the SetVatValue method to set each
table entry to be sent to the printer. Next, the SetVatTable method is called to send
the entire VAT table to the printer at one time.
Receipt Duplication
In some countries fiscal legislation can allow printing more than one copy of the
same receipt. The CapDuplicateReceipt property will be set to TRUE if the printer
is capable of printing duplicate receipts. Then, setting the DuplicateReceipt to
TRUE causes the buffering of all receipt printing commands. DuplicateReceipt
property is set to FALSE after receipt closing In order to print the receipt again the
PrintDuplicateReceipt method has to be called.
The fractional part used in the calculation unit of a Fiscal Printer may differ
from the CURRENCY data type. The number of digits in the fractional part is
stored in the AmountDecimalPlaces property and determined by the Fiscal
Printer. The application has to take care that calculations in the application use
the same fractional part for amounts.
• If the CapHasVatTable property is TRUE, VAT rates are passed using the
indexes that were sent to the SetVatValue method.
If the CapHasVatTable property is FALSE, VAT rates are passed as amounts
with the data type LONG. The number of digits in the fractional part is implicitly
assumed to be four.
• Percentage amounts are used in methods which allow also surcharge and/or
discount amounts. If the amounts are specified to be a percentage value the
value is also passed in a parameter of type CURRENCY.
On a Win32-based platform the percentage value has then (as given by the
CURRENCY data type) four digits in the fractional part.
It is the percentage ( 0.0001% to 99.9999% ) multiplied by 10000.
• Quantity amounts are passed as values with the data type LONG. The number
of digits in the fractional part is stored in the QuantityDecimalPlaces property
and determined by the Fiscal Printer.
Properties
AmountDecimalPlaces Property
Syntax LONG AmountDecimalPlaces;
Remarks Holds the number of decimal digits that the fiscal device uses for calculations.
For the complete list of method which are performed either synchronously or
asynchronously see Printer States Model on page 187.
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
CapAdditionalLines Property
Syntax BOOL CapAdditionalLines;
Remarks If TRUE, then the printer supports the printing of application defined lines on a fiscal
receipt between the total line and the end of the fiscal receipt, FALSE otherwise.
If this property is TRUE, then after all totals lines are printed it is possible to print
application-defined strings, such as the ones used for fidelity cards. In this case,
after the total lines are printed, the PrinterState property is set to ReceiptEnding
and PrintRecMessage can be called.
CapAmountAdjustment Property
Syntax BOOL CapAmountAdjustment;
Remarks If TRUE, then the printer handles fixed amount discounts or fixed amount
surcharges on items, FALSE otherwise.
CapAmountNotPaid Property
Syntax BOOL CapAmountNotPaid;
Remarks If TRUE, then the printer allows the recording of not paid amounts, FALSE
otherwise.
CapCheckTotal Property
Syntax BOOL CapCheckTotal;
Remarks If TRUE, then automatic comparison of the printer’s total and the application’s total
can be enabled and disabled. If FALSE, then the automatic comparison cannot be
enabled and is always considered disabled.
CapCoverSensor Property
Syntax BOOL CapCoverSensor;
CapDoubleWidth Property
Syntax BOOL CapDoubleWidth;
Remarks If TRUE, then the printer can print double width characters, FALSE otherwise.
CapDuplicateReceipt Property
Syntax BOOL CapDuplicateReceipt;
Remarks If TRUE, then the printer allows printing more than one copy of the same fiscal
receipt, FALSE otherwise..
CapFixedOutput Property
Syntax BOOL CapFixedOutput;
Remarks If TRUE, then the printer supports fixed format text printing through the
BeginFixedOutput, PrintFixedOutput and EndFixedOutput methods, FALSE
otherwise.
CapHasVatTable Property
Syntax BOOL CapHasVatTable;
Remarks If TRUE, then the printer has a tax table, FALSE otherwise.
CapIndependentHeader Property
Syntax BOOL CapIndependentHeader;
Remarks If TRUE, then the printer supports printing the fiscal receipt header lines before the
first fiscal receipt command is processed, FALSE otherwise.
CapItemList Property
Syntax BOOL CapItemList;
Remarks If TRUE, then the printer can print a report of items of a specified VAT class,
FALSE otherwise.
CapJrnEmptySensor Property
Syntax BOOL CapJrnEmptySensor;
CapJrnNearEndSensor Property
Syntax BOOL CapJrnNearEndSensor;
CapJrnPresent Property
Syntax BOOL CapJrnPresent;
Unlike POS printers, on fiscal printers the application is not able to directly access
the journal. The fiscal printer itself prints on the journal if present.
CapNonFiscalMode Property
Syntax BOOL CapNonFiscalMode;
Remarks If TRUE, then the printer allows printing in non-fiscal mode, FALSE otherwise.
CapOrderAdjustmentFirst Property
Syntax BOOL CapOrderAdjustmentFirst;
If FALSE, the application has to call PrintRecItem first and then call
PrintRecItemAdjustment to give a discount or a surcharge for a single article.
If TRUE, the application has to call PrintRecItemAdjustment first and then call
PrintRecItem .
CapPercentAdjustment Property
Syntax BOOL CapPercentAdjustment;
Remarks If TRUE, then the printer handles percentage discounts or percentage surcharges on
items, FALSE otherwise.
CapPositiveAdjustment Property
Syntax BOOL CapPositiveAdjustment;
CapPowerLossReport Property
Syntax BOOL CapPowerLossReport;
Remarks If TRUE, then the printer can print a power loss report using the
PrintPowerLossReport method, FALSE otherwise.
CapPredefinedPaymentLines Property
Syntax BOOL CapPredefinedPaymentLines;
Remarks If TRUE, the printer can store and print predefined payment descriptions, FALSE
otherwise.
CapReceiptNotPaid Property
Syntax BOOL CapReceiptNotPaid;
Remarks If TRUE, then the printer supports using the PrintRecNotPaid method to specify a
part of the receipt total that is not paid, FALSE otherwise.
CapRecEmptySensor Property
Syntax BOOL CapRecEmptySensor;
CapRecNearEndSensor Property
Syntax BOOL CapRecNearEndSensor;
CapRecPresent Property
Syntax BOOL CapRecPresent;
CapRemainingFiscalMemory Property
Syntax BOOL CapRemainingFiscalMemory;
Remarks If TRUE, then the printer supports using the RemainingFiscalMemory property to
show the amount of Fiscal Memory remaining If FALSE, the printer does not
support reporting the Fiscal Memory status of the printer.
CapReservedWord Property
Syntax BOOL CapReservedWord;
Remarks If TRUE, then the printer prints a reserved word (for example, “TOTALE”) before
printing the total amount, FALSE otherwise.
CapSetHeader Property
Syntax BOOL CapSetHeader;
Remarks If TRUE, then it is possible to use the SetHeaderLine method to initialize the
contents of a particular line of the receipt header, FALSE otherwise.
CapSetPOSID Property
Syntax BOOL CapSetPOSID;
Remarks If TRUE, then it is possible to use the SetPOSID method to initialize the values of
POSID and CashierID, FALSE otherwise.
CapSetStoreFiscalID Property
Syntax BOOL CapSetStoreFiscalID;
Remarks If TRUE, then it is possible to use the SetStoreFiscalID method to set up the Fiscal
ID number which will be printed on each fiscal receipt, FALSE otherwise.
CapSetTrailer Property
Syntax BOOL CapSetTrailer;
Remarks If TRUE, then it is possible to use the SetTrailerLine method to initialize the
contents of a particular line of the receipt trailer, FALSE otherwise.
CapSetVatTable Property
Syntax BOOL CapSetVatTable;
Remarks If TRUE, then it is possible to use the SetVatValue and SetVatTable methods to
modify the contents of the printer’s VAT table, FALSE otherwise.
Some printers may not allow existing VAT table entries to be modified. Only new
entries may be set on these printers.
CapSlpEmptySensor Property
Syntax BOOL CapSlpEmptySensor;
CapSlpFiscalDocument Property
Syntax BOOL CapSlpFiscalDocument;
Remarks If TRUE, then the printer allows fiscal printing to the slip station, FALSE otherwise.
CapSlpFullSlip Property
Syntax BOOL CapSlpFullSlip;
Remarks If TRUE, then the printer supports printing full length forms on the slip station,
FALSE otherwise.
It is possible to choose between full slip and validation documents by setting the
SlipSelection property.
CapSlpNearEndSensor Property
Syntax BOOL CapSlpNearEndSensor;
Remarks If TRUE, then the slip has a “slip near end” sensor;
otherwise it is FALSE.
CapSlpPresent Property
Syntax BOOL CapSlpPresent;
Remarks If TRUE, then the printer has a slip station, FALSE otherwise.
CapSlpValidation Property
Syntax BOOL CapSlpValidation;
Remarks If TRUE, then the printer supports printing validation information on the slip station,
FALSE otherwise.
It is possible to choose between full slip and validation documents by setting the
SlipSelection property.
In some countries, when printing non fiscal validations using the slip station a limited
number of lines could be printed.
CapSubAmountAdjustment Property
Syntax BOOL CapSubAmountAdjustment;
Remarks If TRUE, then the printer handles fixed amount discounts on the subtotal, FALSE
otherwise.
CapSubPercentAdjustment Property
Syntax BOOL CapSubPercentAdjustment;
Remarks If TRUE, then the printer handles percentage discounts on the subtotal, FALSE
otherwise.
CapSubtotal Property
Syntax BOOL CapSubtotal;
Remarks If TRUE, then it is possible to use the PrintRecSubtotal method to print the current
subtotal, FALSE otherwise.
CapTrainingMode Property
Syntax BOOL CapTrainingMode;
Remarks If TRUE, then the printer supports a training mode, FALSE otherwise.
CapValidateJournal Property
Syntax BOOL CapValidateJournal;
Remarks If TRUE, then it is possible to use the PrintNormal method to print a validation
string on the journal station, FALSE otherwise.
CapXReport Property
Syntax BOOL CapXReport;
Remarks If TRUE, then it is possible to use the PrintXReport method to print an X report,
FALSE otherwise.
Remarks If TRUE, automatic comparison between the fiscal printer’s total and the
application’s total is enabled. If FALSE, automatic comparison is disabled.
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
OPOS_E_ILLEGAL Setting this property is not valid for this service object (see
CapCheckTotal).
CountryCode Property
Syntax LONG CountryCode;
Remarks Holds a value identifying which countries are supported by this Service Object. It
can contain any of the following values logically ORed together:
Value Meaning
CoverOpen Property
Syntax BOOL CoverOpen;
If the CapCoverSensor property is FALSE, then the printer does not have a cover
open sensor, and this property always returns FALSE.
This property is initialized and kept current while the device is enabled.
DayOpened Property
Syntax BOOL DayOpened;
Remarks If TRUE, then the fiscal day has been started on the printer, FALSE otherwise.
The Fiscal Day of the printer can be either opened or not opened. The DayOpened
property reflects whether or not the printer considers its Fiscal Day to be opened or
not.
Some methods may only be called while the Fiscal Day is not yet opened
(DayOpened is FALSE). Methods that can be called after the Fiscal Day is opened
change from country to country. Usually all the configuration methods are to be
called only before the Fiscal Day is opened.
Depending on fiscal legislation, some of the following methods may be allowed only
if the printer has not yet begun its Fiscal Day:
SetDate
SetHeaderLine
SetPOSID
SetStoreFiscalID
SetTrailerLine
SetVatTable
SetVatValue
This property is initialized and kept current while the device is enabled.
DescriptionLength Property
Syntax LONG DescriptionLength;
Remarks Holds the maximum number of characters that may be passed as a description
parameter.
DuplicateReceipt Property
Syntax BOOL DuplicateReceipt;
Remarks If this property is set to TRUE all the printing commands inside a fiscal receipt will
be buffered and they can be printed again via the PrintDuplicateReceipt method.
ErrorLevel Property
Syntax LONG ErrorLevel;
Values are:
Value Meaning
FPTR_EL_RECOVERABLE
A recoverable error has occurred.
(Example: Out of paper.)
This property is set by the Control just before delivering an ErrorEvent. When the
error is cleared, then the property is changed to FPTR_EL_NONE.
ErrorOutID Property
Syntax LONG ErrorOutID;
Remarks The identifier of the output in the queue which raised an error event, when using
asynchronous printing.
ErrorState Property
Syntax LONG ErrorState;
Remarks Holds the current state of the printer when firing an error event for an asynchronous
output.
ErrorStation Property
Syntax LONG ErrorStation;
Remarks Holds the station or stations that were printing when an error was detected.
ErrorString Property
Syntax BSTR ErrorString;
Remarks If TRUE, the Control will fire a StatusUpdateEvent if it is in the idle state.
If FALSE, this event will not be fired.
The main use of idle status event that is controlled by this property is to give the
application control when all outstanding asynchronous outputs have been processed.
The event will be fired if the outputs were completed successfully or if they were
cleared by the ClearOutput method or by an ErrorEvent handler.
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
JrnEmpty Property
Syntax BOOL JrnEmpty;
This property is initialized and kept current while the device is enabled.
JrnNearEnd Property
Syntax BOOL JrnNearEnd;
This property is initialized and kept current while the device is enabled.
MessageLength Property
Syntax LONG MessageLength;
Remarks Holds the maximum number of characters that may be passed as a message line in
the method PrintRecMessage. The value may change in different modes of the
fiscal printer. For example in the mode “Fiscal Receipt” the number of characters
may be bigger than in the mode “Fiscal Receipt Total”.
NumHeaderLines Property
Syntax LONG NumHeaderLines;
Remarks Contains the maximum number of header lines that can be printed for each fiscal
receipt. Header lines usually contain information like store address, store name,
store Fiscal ID. Each header line is set using the SetHeaderLine method and
remains set even after the printer is switched off. Header lines are automatically
printed when a fiscal receipt is initiated using the BeginFiscalReceipt method or
when the first line item inside a receipt is sold.
NumTrailerLines Property
Syntax LONG NumTrailerLines;
Remarks Contains the maximum number of trailer lines that can be printed for each fiscal
receipt. Trailer lines are usually promotional messages. Each trailer line is set using
the SetTrailerLine method and remains set even after the printer is switched off.
Trailer lines are automatically printed either after the last PrintRecTotal or when a
fiscal receipt is closed using the EndFiscalReceipt method.
NumVatRates Property
Syntax LONG NumVatRates;
Remarks Contains the maximum number of vat rates that can be entered into the printer’s Vat
table.
PredefinedPaymentLines Property
Syntax BSTR PredefinedPaymentLines;
PrinterState Property
Syntax LONG PrinterState;
Remarks Holds the printer’s current operational state. This property controls which methods
are currently legal.
Values are:
Value Meaning
FPTR_PS_FISCAL_RECEIPT
If TrainingModeActive property is FALSE:
The printer is currently processing a fiscal receipt. In this
state the printer will accept any of the PrintRec…
methods.
FPTR_PS_FISCAL_RECEIPT_TOTAL
If TrainingModeActive property is FALSE:
The printer has already accepted at least one payment, but
the total has not been completely paid. In this state the
printer will accept either the PrintRecTotal or
PrintRecNotPaid methods.
FPTR_PS_FISCAL_RECEIPT_ENDING
If TrainingModeActive property is FALSE:
The printer has completed the receipt up to the total line.
In this state the printer will accept either the
PrintRecMessage or EndFiscalReceipt methods.
FPTR_PS_FISCAL_DOCUMENT
The printer is currently processing a fiscal slip. In this
state the printer will accept either the
PrintFiscalDocumentLine or EndFiscalDocument
methods.
FPTR_PS_FIXED_OUTPUT
The printer is currently processing fixed text output to one
or more stations. In this state the printer will accept either
the PrintFixedOutput or EndFixedOutput methods.
There are a few methods that are accepted in any state except FPTR_PS_LOCKED.
These are BeginInsertion, EndInsertion, BeginRemoval, EndRemoval,
GetDate, GetData, GetTotalizer, GetVatEntry, ResetPrinter and ClearOutput.
For more information, see the discussion of Printer States on page 190.
QuantityDecimalPlaces Property
Syntax LONG QuantityDecimalPlaces;
Remarks Holds the number of decimal digits in the fractional part that should be assumed to
be in any quantity parameter passed to this Service Object.
QuantityLength Property
Syntax LONG QuantityLength;
Remarks Holds the maximum number of digits that may be passed as a quantity parameter,
including both the whole and fractional parts.
RecEmpty Property
Syntax BOOL RecEmpty;
This property is initialized and kept current while the device is enabled.
RecNearEnd Property
Syntax BOOL RecNearEnd;
This property is initialized and kept current while the device is enabled.
RemainingFiscalMemory Property
Syntax LONG RemainingFiscalMemory;
This property is initialized and kept current while the device is enabled and may be
updated by PrintZReport method.
ReservedWord Property
Syntax BSTR ReservedWord;
Remarks Holds the string that is automatically printed with the total when the PrintRecTotal
method is called. This word may not occur in any string that is passed into any
fiscal output methods.
SlpEmpty Property
Syntax BOOL SlpEmpty;
This property is initialized and kept current while the device is enabled.
Note
The “slip empty” sensor should be used primarily to determine whether a form has been
inserted before printing, and can be monitored to determine whether a form is still in place.
This sensor is usually placed one or more print lines above the slip print head.
However, the “slip near end” sensor (when present) should be used to determine when
nearing the end of the slip. This sensor is usually placed one or more print lines below the
slip print head.
SlpNearEnd Property
Syntax BOOL SlpNearEnd;
The “near end” sensor is also sometimes called the “trailing edge” sensor, referring
to the bottom edge of the slip.
This property is initialized and kept current while the device is enabled.
Note
The “slip empty” sensor should be used primarily to determine whether a form has been
inserted before printing, and can be monitored to determine whether a form is still in place.
This sensor is usually placed one or more print lines above the slip print head.
However, the “slip near end” sensor (when present) should be used to determine when
nearing the end of the slip. This sensor is usually placed one or more print lines below the
slip print head.
Values are:
Value Meaning
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
TrainingModeActive Property
Syntax BOOL TrainingModeActive;
Remarks Holds the current printer's operational state concerning the training mode. Training
mode allows all fiscal commands, but each receipt is marked as non-fiscal and no
internal printer registers are updated with any data while in training mode. Some
countries' fiscal rules require that all blank characters on a training mode receipt are
printed as some other character. Italy, for example, requires that all training mode
receipts print a ? instead of a blank.
Values are:
Value Meaning
Methods
BeginFiscalDocument Method
Syntax LONG BeginFiscalDocument (LONG DocumentAmount);
Parameter Description
The slip paper must be inserted into the slip station using Begin/EndInsertion
before calling this method.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer’s current state does not allow this state
transition.
ResultCodeExtended = OPOS_EFPTR_SLP_EMPTY:
There is no paper in the slip station.
ResultCodeExtended = OPOS_EFPTR_BAD_ITEM_AMOUNT:
The DocumentAmount parameter is invalid.
BeginFiscalReceipt Method
Syntax LONG BeginFiscalReceipt (BOOL PrintHeader);
Parameter Description
If PrintHeader and the CapIndependentHeader property are both TRUE all defined
header lines will be printed before control is returned. Otherwise header lines will be
printed when the first item is sold.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer’s current state does not allow this state
transition.
BeginFixedOutput Method
Syntax LONG BeginFixedOutput (LONG Station, LONG DocumentType);
Parameter Description
If the Station parameter is FPTR_S_SLIP, the slip paper must be inserted into the
slip station using Begin/EndInsertion before calling this method.
Each fixed output will be printed using the PrintFixedOutput method. If this
method is successful, the PrinterState property will be changed to
FPTR_PS_FIXED_OUTPUT. The EndFixedOutput method ends fixed output
modality and resets PrinterState.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_SLP_EMPTY:
There is no paper in the slip station.
BeginInsertion Method
Syntax LONG BeginInsertion (LONG Timeout);
The Timeout parameter gives the number of milliseconds before failing the method.
If zero, the method tries to begin insertion mode, then returns the appropriate status
immediately.
If OPOS_FOREVER (-1), the method tries to begin insertion mode, then waits as
long as needed until either the form is inserted or an error occurs.
When called, the slip station is made ready to receive a form by opening the form’s
handling “jaws” or activating a form insertion mode. This method is paired with the
EndInsertion method for controlling form insertion.
If the printer device cannot be placed into insertion mode, an error is returned to the
application. Otherwise, the Control continues to monitor form insertion until either:
• The form is not inserted before Timeout milliseconds have elapsed, or an error is
reported by the printer device. In this case, the Control either returns
OPOS_E_TIMEOUT or another error. The printer device remains in form
insertion mode. This allows an application to perform some user interaction and
reissue the BeginInsertion method without altering the form handling
mechanism.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_ILLEGAL The slip station does not exist (see the CapSlpPresent
property).
OPOS_E_TIMEOUT The specified time has elapsed without the form being
properly inserted.
BeginItemList Method
Syntax LONG BeginItemList (LONG VatID);
Parameter Description
Remarks Called to initiate a validation report of items belonging to a particular VAT class.
After this method only VerifyItem and EndItemList methods may be called.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer’s current state does not allow this state
transition.
ResultCodeExtended = OPOS_EFPTR_BAD_VAT:
The VatID parameter is invalid.
BeginNonFiscal Method
Syntax LONG BeginNonFiscal ();
This method can be successfully called only if the current value of the PrinterState
property is FPTR_PS_MONITOR.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer’s current state does not allow this state
transition.
BeginRemoval Method
Syntax LONG BeginRemoval (LONG Timeout);
The Timeout property gives the number of milliseconds before failing the method.
If zero, the method tries to begin removal mode, then returns the appropriate status
immediately.
If OPOS_FOREVER (-1), the method tries to begin removal mode, then waits as
long as needed until either the form is removed or an error occurs.
When called, the printer is made ready to remove a form by opening the form
handling “jaws” or activating a form ejection mode. This method is paired with the
EndRemoval method for controlling form removal.
If the printer device cannot be placed into removal or ejection mode, an error is
returned to the application. Otherwise, the Control continues to monitor form
removal until either:
• The form is not removed before Timeout milliseconds have elapsed, or an error is
reported by the printer device. In this case, the Control either returns
OPOS_E_TIMEOUT or another error. The printer device remains in form
removal mode. This allows an application to perform some user interaction and
reissue the BeginRemoval method without altering the form handling
mechanism.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_ILLEGAL The printer does not have a slip station (see the
CapSlpPresent property).
OPOS_E_TIMEOUT The specified time has elapsed without the form being
properly removed.
BeginTraining Method
Syntax LONG BeginTraining ();
Output in this mode is accomplished using the PrintRec… methods in order to print
a receipt or other methods to print reports.
This method can be successfully called only if the current value of the PrinterState
property is FPTR_PS_MONITOR.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer’s current state does not allow this state
transition.
ClearError Method
Syntax LONG ClearError ();
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
EndFiscalDocument Method
Syntax LONG EndFiscalDocument ();
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_ILLEGAL The printer does not support fiscal output to the slip station
(see the CapSlpFiscalDocument property).
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer is not currently in the Fiscal Document state.
EndFiscalReceipt Method
Syntax LONG EndFiscalReceipt (BOOL PrintHeader);
Parameter Description
If PrintHeader is FALSE, this method will close the current fiscal receipt, cut it, and
print the trailer lines and fiscal logotype, if they were not already printed after the
total lines. All functions carried out by this method will be completed before this call
returns.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer is not currently in the Fiscal Receipt Ending
state.
EndFixedOutput Method
Syntax LONG EndFixedOutput ();
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_ILLEGAL The printer does not support fixed output (see the
CapFixedOutput property).
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer is not currently in the Fixed Output state.
EndInsertion Method
Syntax LONG EndInsertion ();
When called, the printer is taken out of form insertion mode. If the slip device has
forms “jaws,” they are closed by this method. If a form is detected in the device, a
successful status of OPOS_SUCCESS is returned to the application. If no form is
present, an extended error status OPOS_EFPTR_SLP_EMPTY is returned.
This method is paired with the BeginInsertion method for controlling form
insertion. The application may choose to call this method immediately after a
successful BeginInsertion if it wants to use the printer sensors to determine when
a form is positioned within the slip printer. Alternatively, the application may prompt
the user and wait for a key press before calling this method.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
ResultCodeExtended = OPOS_EFPTR_SLP_EMPTY:
The device was taken out of insertion mode without a
form being inserted.
EndItemList Method
Syntax LONG EndItemList ();
Remarks Called to terminate a validation report of items belonging to a particular VAT class.
This method can be successfully called only if current value of PrinterState property
is equal to FPTR_PS_ITEM_LIST.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer’s current state does not allow this state
transition.
EndNonFiscal Method
Syntax LONG EndNonFiscal ();
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_ILLEGAL The printer does not support non-fiscal output (see the
CapNonFiscalMode property).
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer is not currently in the Non-Fiscal state.
EndRemoval Method
Syntax LONG EndRemoval ();
When called, the printer is taken out of form removal or ejection mode. If no form
is detected in the device, a successful status of OPOS_SUCCESS is returned to the
application. If a form is present, an extended error status
OPOS_EFPTR_SLP_FORM is returned.
This method is paired with the BeginRemoval method for controlling form
removal. The application may choose to call this method immediately after a
successful BeginRemoval if it wants to use the printer sensors to determine when
the form has been removed. Alternatively, the application may prompt the user and
wait for a key press before calling this method.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
EndTraining Method
Syntax LONG EndTraining ();
Remarks Called to terminate training operations on either the receipt or slip station.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_ILLEGAL The printer does not support training mode (see the
CapTrainingMode property).
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer is not currently in the Training state.
GetData Method
Syntax LONG GetData (LONG DataItem, LONG* OptArgs, BSTR* Data);
Parameter Description
Value Meaning
The data is returned in a string because some of the fields, such as the grand total,
might overflow a 4-byte integer.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
GetDate Method
Syntax LONG GetDate (BSTR* Date);
Parameter Description
The date and time are returned as a string in the format “ddmmyyyyhhmm”, where:
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_ILLEGAL Retrieval of the date and time is not valid at this time.
GetTotalizer Method
Syntax LONG GetTotalizer (LONG VatID, LONG OptArgs, BSTR* Data);
Parameter Description
Remarks Called to get the totalizer associated with the given VAT rate.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
GetVatEntry Method
Syntax LONG GetVatEntry (LONG VatID, LONG OptArgs, LONG* VatRate);
Parameter Description
Remarks Called to get the rate associated with a given VAT identifier.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
PrintDuplicateReceipt Method
Syntax LONG PrintDuplicateReceipt ();
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer is not currently in the Monitor state.
ResultCodeExtended = OPOS_EFPTR_JRN_EMPTY:
The journal station is out of paper.
ResultCodeExtended = OPOS_EFPTR_REC_EMPTY:
The receipt station is out of paper.
PrintFiscalDocumentLine Method
Syntax LONG PrintFiscalDocumentLine (BSTR DocumentLine);
Parameter Description
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_ILLEGAL The printer does not support fiscal documents (see the
CapSlpFiscalDocument property).
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer is not currently in the Fiscal Document state.
ResultCodeExtended = OPOS_EFPTR_COVER_OPEN:
The printer cover is open.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_SLP_EMPTY:
The slip station was specified, but a form is not inserted.
(Can only be returned if AsyncMode is FALSE.)
PrintFixedOutput Method
Syntax LONG PrintFixedOutput (LONG DocumentType, LONG LineNumber, BSTR
Data);
Parameter Description
Remarks Called to print a line of a fixed document to the print station specified in the
BeginFixedOutput method. Each call prints a single line from a document by
merging the stored text with the parameter Data. Within a document lines must be
printed sequentially. Some lines are optional and some lines are required, such as the
first and last lines.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer is not currently in the Fixed Output state.
ResultCodeExtended = OPOS_EFPTR_COVER_OPEN:
The printer cover is open.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_JRN_EMPTY:
The journal station is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_REC_EMPTY:
The receipt station was specified but is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_SLP_EMPTY:
The slip station was specified, but a form is not inserted.
(Can only be returned if AsyncMode is FALSE.)
PrintNormal Method
Syntax LONG PrintNormal (LONG Station, BSTR Data);
Parameter Description
This method performs non-fiscal printing. Escape sequences, carriage returns (13
decimal), and line feeds (10 decimal) are available on some printers, but in many
cases these are not supported.
The format of this data depends upon the value of the BinaryConversion property.
Value Meaning
Line Feed (10) Print any data in the line buffer, and feed to the next print
line. (A Carriage Return is not required in order to cause
the line to be printed.)
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_EXTENDED;
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer is not currently in the Non-Fiscal state.
ResultCodeExtended = OPOS_EFPTR_COVER_OPEN:
The printer cover is open.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_JRN_EMPTY:
The journal station was specified but is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_REC_EMPTY:
The receipt station was specified but is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_SLP_EMPTY:
The slip station was specified, but a form is not inserted.
(Can only be returned if AsyncMode is FALSE.)
PrintPeriodicTotalsReport Method
Syntax LONG PrintPeriodicTotalsReport (BSTR Date1, BSTR Date2);
Parameter Description
Remarks Called to print a report of totals for a range of dates on the receipt.
mm month (1 - 12)
hh hour (0-23)
mm minutes (0-59)
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer’s current state does not allow this state
transition.
ResultCodeExtended = OPOS_EFPTR_JRN_EMPTY:
The journal station is out of paper.
ResultCodeExtended = OPOS_EFPTR_REC_EMPTY:
The receipt station is out of paper.
ResultCodeExtended = OPOS_EFPTR_BAD_DATE:
One of the date parameters is invalid.
PrintPowerLossReport Method
Syntax LONG PrintPowerLossReport ();
Remarks Called to print on the receipt a report of a power failure that resulted in a loss of data
stored in the CMOS of the printer.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_ILLEGAL The printer does not support power loss reports (see the
CapPowerLossReport property).
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer’s current state does not allow this state
transition.
ResultCodeExtended = OPOS_EFPTR_COVER_OPEN:
The printer cover is open.
ResultCodeExtended = OPOS_EFPTR_JRN_EMPTY:
The journal station is out of paper.
ResultCodeExtended = OPOS_EFPTR_REC_EMPTY:
The receipt station is out of paper.
PrintRecItem Method
Syntax LONG PrintRecItem (BSTR Description, CURRENCY Price, LONG Quantity,
LONG VatInfo, CURRENCY UnitPrice, BSTR UnitName)
Parameter Description
UnitName Name of the unit i.e. “kg” or “ltr” or “pcs”. If not used an
empty string (““) is to be transferred
Remarks Called to print a receipt item for a sold item. If the Quantity parameter is 0, then a
single item quantity will be assumed.
Minimum parameters are Description and Price or Description, Price, Quantity, and
UnitPrice. Most countries require Quantity and VatInfo and some countries also
require UnitPrice and UnitName.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer is not currently in the Fiscal Receipt state.
ResultCodeExtended = OPOS_EFPTR_COVER_OPEN:
The printer cover is open.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_JRN_EMPTY:
The journal station is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_REC_EMPTY:
The receipt station is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_BAD_ITEM_QUANTITY:
The quantity is invalid.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_BAD_PRICE:
The unit price is invalid.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_BAD_ITEM_DESCRIPTION:
The discount description is too long or contains a reserved
word.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_BAD_VAT:
The VAT parameter is invalid.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_RECEIPT_TOTAL_OVERFLOW:
The receipt total has overflowed.
(Can only be returned if AsyncMode is FALSE.)
PrintRecItemAdjustment Method
Syntax LONG PrintRecItemAdjustment (LONG AdjustmentType, BSTR Description,
CURRENCY Amount, LONG VatInfo);
Parameter Description
Value Meaning
FPTR_AT_AMOUNT_DISCOUNT
Fixed amount discount. The Amount parameter contains a
currency value.
FPTR_AT_AMOUNT_SURCHARGE
Fixed amount surcharge. The Amount parameter contains
a currency value.
FPTR_AT_PERCENTAGE_DISCOUNT
Percentage discount. The Amount parameter contains a
percentage value.
FPTR_AT_PERCENTAGE_SURCHARGE
Percentage surcharge. The Amount parameter contains a
percentage value.
Remarks Called to apply and print a discount or a surcharge to the last receipt item sold. This
discount may be either a fixed currency amount or a percentage amount relating to
the last item.
If the discount amount is greater than the receipt subtotal, an error occurs since the
subtotal can never be negative.
In many countries discount operations cause the printing of a fixed line of text
expressing the kind of operation that has been perform
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer is not currently in the Fiscal Receipt state.
ResultCodeExtended = OPOS_EFPTR_COVER_OPEN:
The printer cover is open.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_JRN_EMPTY:
The journal station is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_REC_EMPTY:
The receipt station is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_BAD_ITEM_AMOUNT:
The discount amount is invalid.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_BAD_ITEM_DESCRIPTION:
The discount description is too long or contains a reserved
word.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_BAD_VAT:
The VAT parameter is invalid.
(Can only be returned if AsyncMode is FALSE.)
PrintRecMessage Method
Syntax LONG PrintRecMessage (BSTR Message);
Parameter Description
Remarks Called to print a message on the fiscal receipt. The length of an individual message
is limited to the number of characters given in the MessageLength property.
This method is only supported when the printer is in the Fiscal Receipt Ending state.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer is not currently in the Fiscal Receipt Ending
state.
ResultCodeExtended = OPOS_EFPTR_COVER_OPEN:
The printer cover is open.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_JRN_EMPTY:
The journal station is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_REC_EMPTY:
The receipt station is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_BAD_ITEM_DESCRIPTION:
The message is too long or contains a reserved word.
(Can only be returned if AsyncMode is FALSE.)
PrintRecNotPaid Method
Syntax LONG PrintRecNotPaid (BSTR Description, CURRENCY Amount);
Parameter Description
Remarks Called to indicate that part of the receipt’s total was not paid.
Some fixed text, along with the Description, will be printed on the receipt and
journal to indicate that part of the receipt total has not been paid.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer is not currently in either the Fiscal Receipt or
Fiscal Receipt Total state.
ResultCodeExtended = OPOS_EFPTR_COVER_OPEN:
The printer cover is open.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_JRN_EMPTY:
The journal station is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_REC_EMPTY:
The receipt station is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_BAD_ITEM_DESCRIPTION:
The description is too long or contains a reserved word.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_BAD_ITEM_AMOUNT:
The amount is invalid.
(Can only be returned if AsyncMode is FALSE.)
PrintRecRefund Method
Syntax LONG PrintRecRefund (BSTR Description, CURRENCY Amount, LONG
VatInfo);
Parameter Description
Remarks Called to process a refund. The Amount is positive, but it is printed as a negative
number and the totals registers are decremented.
Some fixed text, along with the Description, will be printed on the receipt and
journal to indicate that a refund has occurred.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer is not currently in the Fiscal Receipt state.
ResultCodeExtended = OPOS_EFPTR_COVER_OPEN:
The printer cover is open.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_JRN_EMPTY:
The journal station is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_REC_EMPTY:
The receipt station is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_BAD_ITEM_DESCRIPTION:
The description is too long or contains a reserved word.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_BAD_ITEM_AMOUNT:
The amount is invalid.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_BAD_VAT:
The VAT information is invalid.
(Can only be returned if AsyncMode is FALSE.)
PrintRecSubtotal Method
Syntax LONG PrintRecSubtotal (CURRENCY Amount);
Parameter Description
Remarks Called to check and print the current receipt subtotal. If CapCheckTotal is TRUE,
the Amount is compared to the subtotal calculated by the printer. If the subtotals
match, the subtotal is printed on both the receipt and journal. If the results do not
match, the receipt is automatically canceled. If CapCheckTotal is FALSE, then the
subtotal is printed on the receipt and journal and the parameter is never compared to
the subtotal computed by the printer.
If this method compares the application’s subtotal with the printer’s subtotal and
they do not match, the PrinterState property will be changed to
FPTR_PS_FISCAL_RECEIPT_ENDING.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer is not currently in the Fiscal Receipt state.
ResultCodeExtended = OPOS_EFPTR_COVER_OPEN:
The printer cover is open.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_JRN_EMPTY:
The journal station is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_REC_EMPTY:
The receipt station is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_BAD_ITEM_AMOUNT:
The subtotal from the application does not match the
subtotal computed by the printer.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_NEGATIVE_TOTAL:
The total computed by the printer is less than zero.
(Can only be returned if AsyncMode is FALSE.)
PrintRecSubtotalAdjustment Method
Syntax LONG PrintRecSubtotalAdjustment (LONG AdjustmentType, BSTR Description,
CURRENCY Amount);
Parameter Description
Value Meaning
FPTR_AT_AMOUNT_DISCOUNT
Fixed amount discount. The Amount parameter contains a
currency value.
FPTR_AT_AMOUNT_SURCHARGE
Fixed amount surcharge. The Amount parameter contains
a currency value.
FPTR_AT_PERCENTAGE_DISCOUNT
Percentage discount. The Amount parameter contains a
percentage value.
FPTR_AT_PERCENTAGE_SURCHARGE
Percentage surcharge. The Amount parameter contains a
percentage value.
Remarks Called to apply and print a discount/surcharge to the current receipt subtotal. This
discount/surcharge may be either a fixed currency amount or a percentage amount
relating to the current receipt subtotal.
If the discount/surcharge amount is greater than the receipt subtotal, an error occurs
since the subtotal can never be negative.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer is not currently in the Fiscal Receipt state.
ResultCodeExtended = OPOS_EFPTR_COVER_OPEN:
The printer cover is open.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_JRN_EMPTY:
The journal station is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_REC_EMPTY:
The receipt station is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_BAD_ITEM_AMOUNT:
The discount amount is invalid.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_BAD_ITEM_DESCRIPTION:
The discount description is too long or contains a reserved word.
(Can only be returned if AsyncMode is FALSE.)
PrintRecTotal Method
Syntax LONG PrintRecTotal (CURRENCY Total, CURRENCY Payment, BSTR
Description);
Parameter Description
Remarks Called to check and print the current receipt total and to tender a payment. If
CapCheckTotal is TRUE, the Total is compared to the total calculated by the
printer. If the totals match, the total is printed on both the receipt and journal along
with some fixed text. If the results do not match, the receipt is automatically
canceled. If CapCheckTotal is FALSE, then the total is printed on the receipt and
journal and the parameter is never compared to the total computed by the printer.
If Payment = Total, a line containing the Description and Payment is printed. The
PrinterState property will be set to FPTR_PS_FISCAL_RECEIPT_ENDING.
If Payment > Total, a line containing the Description and Payment is printed
followed by a second line containing the change due. The PrinterState property
will be set to FPTR_PS_FISCAL_RECEIPT_ENDING.
If Payment < Total, a line containing the Description and Payment is printed. Since
the entire receipt total has not yet been tendered, the PrinterState property will be
set to FPTR_PS_FISCAL_RECEIPT_TOTAL.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer is not currently in the Fiscal Receipt state.
ResultCodeExtended = OPOS_EFPTR_COVER_OPEN:
The printer cover is open.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_JRN_EMPTY:
The journal station is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_REC_EMPTY:
The receipt station is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_BAD_ITEM_AMOUNT:
One of the following errors occurred:
• The application computed total does not match the
printer computed total.
• The Total parameter is invalid.
• The Payment parameter is invalid
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_BAD_ITEM_DESCRIPTION:
The description is too long or contains a reserved word.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_NEGATIVE_TOTAL:
The total computed by the printer is less than zero.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_WORD_NOT_ALLOWED:
The description contains the reserved word
PrintRecVoid Method
Syntax LONG PrintRecVoid (BSTR Description);
Parameter Description
Remarks Called to cancel the current receipt. The receipt is annulled but it is not physically
canceled from the printer’s fiscal memory since fiscal receipts are printed with an
increasing serial number and totals are accumulated in registers. When a receipt is
canceled, its subtotal is subtracted from the totals registers, but it is added to the
canceled receipt register.
Some fixed text, along with the Description, will be printed on the receipt and
journal to indicate that the receipt has been canceled.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer is not currently in the Fiscal Receipt state.
ResultCodeExtended = OPOS_EFPTR_COVER_OPEN:
The printer cover is open.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_JRN_EMPTY:
The journal station is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_REC_EMPTY:
The receipt station is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_BAD_ITEM_DESCRIPTION:
The description is too long or contains a reserved word.
(Can only be returned if AsyncMode is FALSE.)
PrintRecVoidItem Method
Syntax LONG PrintRecVoidItem (BSTR Description, CURRENCY Amount, LONG
Quantity, LONG AdjustmentType, CURRENCY Adjustment, LONG VatInfo);
Parameter Description
Value Meaning
FPTR_AT_AMOUNT_DISCOUNT
Fixed amount discount. The Adjustment parameter
contains a currency value.
FPTR_AT_AMOUNT_SURCHARGE
Fixed amount surcharge. The Adjustment parameter
contains a currency value.
FPTR_AT_PERCENTAGE_DISCOUNT
Percentage discount. The Adjustment parameter contains a
percentage value.
FPTR_AT_PERCENTAGE_SURCHARGE
Percentage surcharge. The Adjustment parameter contains
a percentage value.
Remarks Called to cancel an item that has been added to the receipt and print a void
description. Amount is a positive number, it will be printed as a negative and will be
decremented from the totals registers.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer is not currently in the Fiscal Receipt state.
ResultCodeExtended = OPOS_EFPTR_COVER_OPEN:
The printer cover is open.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_JRN_EMPTY:
The journal station is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_REC_EMPTY:
The receipt station is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_BAD_ITEM_AMOUNT:
The amount is invalid.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_BAD_ITEM_QUANTITY:
The quantity is invalid.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_BAD_VAT:
The VAT information is invalid.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_BAD_ITEM_DESCRIPTION:
The description is too long or contains a reserved word.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_NEGATIVE_TOTAL:
The total computed by the printer is less than zero.
(Can only be returned if AsyncMode is FALSE.)
PrintReport Method
Syntax LONG PrintReport (LONG ReportType, BSTR StartNum, BSTR EndNum);
Parameter Description
Value Meaning
FPTR_RT_DATE Prints a report between two dates. The dates are strings in
the format “ddmmyyyyhhmm”, where:
dd day of the month (01 - 31)
mm month (01 - 12)
yyyy year (1997- ...)
hh hour (00-23)
mm minutes (00-59)
Remarks Called to print a report of the fiscal EPROM contents on the receipt that occurred
between two end points.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer's current state does not allow this state
transition.
ResultCodeExtended = OPOS_EFPTR_COVER_OPEN:
The printer cover is open.
ResultCodeExtended = OPOS_EFPTR_JRN_EMPTY:
The journal station is out of paper.
ResultCodeExtended = OPOS_EFPTR_REC_EMPTY:
The receipt station is out of paper.
PrintXReport Method
Syntax LONG PrintXReport ();
Remarks Called to print on the receipt a report of all the daily fiscal activities. No data will be
written to the fiscal EPROM as a result of this method invocation.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer’s current state does not allow this state
transition.
ResultCodeExtended = OPOS_EFPTR_COVER_OPEN:
The printer cover is open.
ResultCodeExtended = OPOS_EFPTR_JRN_EMPTY:
The journal station is out of paper.
ResultCodeExtended = OPOS_EFPTR_REC_EMPTY:
The receipt station is out of paper.
PrintZReport Method
Syntax LONG PrintZReport ();
Remarks Called to print on the receipt a report of all the daily fiscal activities. Data will be
written to the fiscal EPROM as a result of this method invocation.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer’s current state does not allow this state
transition.
ResultCodeExtended = OPOS_EFPTR_COVER_OPEN:
The printer cover is open.
ResultCodeExtended = OPOS_EFPTR_JRN_EMPTY:
The journal station is out of paper.
ResultCodeExtended = OPOS_EFPTR_REC_EMPTY:
The receipt station is out of paper.
ResetPrinter Method
Syntax LONG ResetPrinter ();
Remarks Called to force the printer to return to Monitor state. This forces any interrupted
operations to be canceled and closed. This method must be invoked when the
printer is not in a Monitor state after a successful call to the Claim method and
successful setting of the DeviceEnabled property to TRUE. This typically happens
if a power failures occurs during a fiscal operation.
Calling this method does not close the printer, i.e. does not force a Z report to be
printed.
• If the printer was in either Fiscal Receipt, Fiscal Receipt Total or Fiscal Receipt
Ending state, the receipt will be ended without updating any registers.
• If the printer was in a non-fiscal state, the printer will exit that state.
• If the printer was in the training state, the printer will exit the training state.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
SetDate Method
Syntax LONG SetDate (BSTR Date);
Parameter Description
The date and time is passed as a string in the format “ddmmyyyyhhmm”, where:
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_ILLEGAL The printer has already begun the fiscal day (see the
DayOpened property).
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_BAD_DATE:
One of the date parameters is invalid.
SetHeaderLine Method
Syntax LONG SetHeaderLine (LONG LineNumber, BSTR Text, BOOL DoubleWidth);
Parameter Description
Remarks Called to set one of the fiscal receipt header lines. The text set by this method will
be stored by the printer and retained across power losses.
If Text is an empty string (““), then the header line is unset and will not be printed.
DoubleWidth characters will be printed if the printer supports them. See the
CapDoubleWidth property to determine if they are supported.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_BAD_ITEM_DESCRIPTION:
The Text parameter is too long or contains a reserved
word.
(Can only be returned if AsyncMode is FALSE.)
SetPOSID Method
Syntax LONG SetPOSID (BSTR POSID, BSTR CashierID);
Parameter Description
Remarks Called to set the POS and cashier identifiers. These values will be printed when
each fiscal receipt is closed.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
SetStoreFiscalID Method
Syntax LONG SetStoreFiscalID (BSTR ID);
Parameter Description
ID Fiscal identifier.
Remarks Called to set the store fiscal ID. This value is retained by the printer even after
power failures. This ID is automatically printed by the printer after the fiscal receipt
header lines.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
SetTrailerLine Method
Syntax LONG SetTrailerLine (LONG LineNumber, BSTR Text, BOOL DoubleWidth);
Parameter Description
Remarks Called to set one of the fiscal receipt trailer lines. The text set by this method will be
stored by the printer and retained across power losses.
If Text is an empty string (““), then the trailer line is unset and will not be printed.
DoubleWidth characters will be printed if the printer supports them. See the
CapDoubleWidth property to determine if they are supported.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_BAD_ITEM_DESCRIPTION:
The Text parameter is too long or contains a reserved
word.
(Can only be returned if AsyncMode is FALSE.)
SetVatTable Method
Syntax LONG SetVatTable ();
Remarks Called to send the VAT table built inside the Service Object to the printer. The VAT
table is built one entry at a time using the SetVatValue method.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_ILLEGAL The printer has already begun the fiscal day (see the
DayOpened property).
SetVatValue Method
Syntax LONG SetVatValue (LONG VatID, BSTR VatValue);
Parameter Description
Remarks Called to set the value of a specific VAT class in the VAT table. The VAT table is
built one entry at a time in the Service Object using this method. The entire table is
then sent to the printer at one time using the SetVatTable method.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
VerifyItem Method
Syntax LONG VerifyItem (BSTR ItemName, LONG VatID);
Parameter Description
Remarks Called to compare ItemName and its VatID with the values stored in the printer.
This method can only be called while the printer is in the Item List state.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_ILLEGAL The printer does not support VAT tables (see the
CapHasVatTable property).
OPOS_E_EXTENDED:
ResultCodeExtended = OPOS_EFPTR_WRONG_STATE:
The printer is not currently in the Item List state.
ResultCodeExtended = OPOS_EFPTR_BAD_ITEM_DESCRIPTION:
The item name is too long or contains a reserved word.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EFPTR_BAD_VAT:
The VAT parameter is invalid.
(Can only be returned if AsyncMode is FALSE.)
Events
ErrorEvent Event
Syntax void ErrorEvent (LONG ResultCode, LONG ResultCodeExtended,
LONG ErrorLocus, LONG* pErrorResponse);
Parameter Description
ResultCode Result code causing the error event. See ResultCode for
values.
ResultCodeExtended Extended result code causing the error event. See values
below.
Value Meaning
OPOS_EFPTR_COVER_OPEN
The printer cover is open.
OPOS_EFPTR_JRN_EMPTY
The journal station is out of paper.
OPOS_EFPTR_REC_EMPTY
The receipt station is out of paper.
OPOS_EFPTR_SLP_EMPTY
A form is not inserted in the slip station.
OPOS_EFPTR_WRONG_STATE
The requested method could not be executed in the
printer’s current state.
OPOS_EFPTR_TECHNICAL_ASSISTANCE
The printer has encountered a severe error condition.
Calling for printer technical assistance is required.
OPOS_EFPTR_CLOCK_ERROR
The printer’s internal clock has failed.
OPOS_EFPTR_FISCAL_MEMORY_FULL
The printer’s fiscal memory has been exhausted.
OPOS_EFPTR_FISCAL_MEMORY_DISCONNECTED
The printer’s fiscal memory has been disconnected.
OPOS_EFPTR_FISCAL_TOTALS_ERROR
The Grand Total in working memory does not match the
one in the EPROM.
OPOS_EFPTR_BAD_ITEM_QUANTITY
The Quantity parameter is invalid.
OPOS_EFPTR_BAD_ITEM_AMOUNT
The Amount parameter is invalid.
OPOS_EFPTR_BAD_ITEM_DESCRIPTION
The Description parameters is either to long, contains
illegal characters or contains the reserved word.
OPOS_EFPTR_RECEIPT_TOTAL_OVERFLOW
The receipt total has overflowed.
OPOS_EFPTR_BAD_VAT
The Vat parameter is invalid.
OPOS_EFPTR_BAD_PRICE
The Price parameter is invalid.
OPOS_EFPTR_NEGATIVE_TOTAL
The printer’s computed total or subtotal is less than zero.
OPOS_EFPTR_MISSING_DEVICES
Some of the other devices which according to the local
fiscal legislation are to be connected has been
disconnected. In some countries in order to use a fiscal
printer a full set of peripheral devices are to be connected
to the POS (such as cash drawer and customer display).
In case one of these devices is not present sales are not
allowed.
The contents at the location pointed to by the pErrorResponse parameter are preset
to the default value of OPOS_ER_RETRY. The application may set the value to one
of the following:
Value Meaning
Remarks Fired when an error is detected and the control transitions into the error state.
StatusUpdateEvent Event
Syntax void StatusUpdateEvent (LONG Data);
Value Meaning
Hard Totals
Summary
Properties
Common Type Access Initialized After
AutoDisable 1.2 Boolean R/W Not Supported
BinaryConversion 1.2 Long R/W Open
CapPowerReporting 1.3 Long R Open
CheckHealthText 1.0 String R Open
Claimed 1.0 Boolean R Open
DataCount 1.2 Long R Not Supported
DataEventEnabled 1.0 Boolean R/W Not Supported
DeviceEnabled 1.0 Boolean R/W Open
FreezeEvents 1.0 Boolean R/W Open
OutputID 1.0 Long R Not Supported
PowerNotify 1.3 Long R/W Open
PowerState 1.3 Long R Open
ResultCode 1.0 Long R --
ResultCodeExtended 1.0 Long R Open
State 1.0 Long R --
Methods
Common May Use After
Open 1.0 --
Close 1.0 Open
Claim 1.0 Open
Release 1.0 Open & Claim
CheckHealth 1.0 Open & Enable; Note 1
ClearInput 1.0 Not Supported
ClearOutput 1.0 Not Supported
DirectIO 1.0 Open
Specific
ClaimFile 1.0 Open & Enable; Note 2
ReleaseFile 1.0 Open & Enable
Note 1: Also requires that no other application has claimed the hard totals device.
Note 2: Also requires that no other application has claimed the hard totals device or the
file on which this method acts.
Events
Name May Occur After
DataEvent 1.0 Not Supported
DirectIOEvent 1.0 Open, Claim
ErrorEvent 1.0 Not Supported
OutputCompleteEvent 1.0 Not Supported
StatusUpdateEvent 1.3 Open, Claim, & Enable
General Information
The Hard Totals Control’s OLE programmatic ID is “OPOS.Totals”.
Capabilities
The Hard Totals device has the following minimal set of capabilities:
• Supports at least one totals file with the name ““ (the empty string) in an area of
totals memory. Each totals file is read and written as if it were a sequence of
byte data.
• Each totals file is created with a fixed size and may be deleted, initialized, and
claimed for exclusive use.
• Totals memory is frequently a limited but secure resource - perhaps of only
several thousand bytes of storage.
The Hard Totals device may have the following additional capabilities:
• Supports additional named totals files. They share some characteristics of a file
system with only a root directory level. In addition to the minimal capabilities
listed above, each totals file may also be renamed.
• Supports transactions, with begin and commit operations, plus rollback.
• Supports advanced error detection. This detection may be implemented through
hardware or software.
Model
The following is the general model of the Hard Totals:
• A Hard Totals device is logically treated as a sequence of byte data, which the
application subdivides into “totals files.” This is done by the Create method,
which assigns a name, size, and error detection level to the totals file. Totals
files have a fixed-length that is set at Create time.
At a minimum, a single totals file with the name ““ (the empty string) can be
created and manipulated. Optionally, additional totals files with arbitrary names
may be created.
Totals files model many of the characteristics of a traditional file system. The
intent, however, is not to provide a robust file system. Rather, totals files allow
partitioning and ease of access into what is frequently a limited but secure
resource. In order to reduce unnecessary overhead usage of this resource,
directory hierarchies are not supported, file attributes are minimized, and files
may not be dynamically resized.
• The FreeData property holds the current number of unassigned data bytes.
• The NumberOfFiles property holds the number of totals files that exist in the
hard totals device.
Device Sharing
The hard totals device is sharable. Its device sharing rules are:
Properties
CapErrorDetection Property
Syntax BOOL CapErrorDetection;
CapSingleFile Property
Syntax BOOL CapSingleFile;
Remarks If TRUE, then only a single file, identified by the empty string (“”), is supported;
otherwise it is FALSE.
CapTransactions Property
Syntax BOOL CapTransactions;
FreeData Property
Syntax LONG FreeData;
Remarks Holds the number of bytes of unallocated data in the Hard Totals device.
Its value is initialized to an appropriate value when the device is enabled and is
updated as files are Created and Deleted. If creating a file requires some overhead
to support the file information, then FreeData is reduced by this overhead amount.
This guarantees that a new file of size FreeData may be created.
Data writes within a transaction may temporarily reduce FreeData, since some
Hard Totals space may need to be allocated to prepare for the transaction commit.
Therefore, the application should ensure that sufficient FreeData is maintained to
allow its maximally sized transactions to be performed.
NumberOfFiles Property
Syntax LONG NumberOfFiles;
Remarks Holds the number of totals file currently in the Hard Totals device.
This property is initialized and kept current while the device is enabled.
TotalsSize Property
Syntax LONG TotalsSize;
Remarks Holds the size of the Hard Totals area. This size is equal to the largest totals file that
can be created if no other files exist.
TransactionInProgress Property
Syntax BOOL TransactionInProgress;
Methods
BeginTrans Method
Syntax LONG BeginTrans ();
Remarks Marks the beginning of a series of Hard Totals writes that must either be applied as a
group or not at all.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
The Timeout parameter gives the maximum number of milliseconds to wait for
exclusive access to be satisfied.
If zero, the method attempts to claim the device, then returns the appropriate status
immediately.
If OPOS_FOREVER (-1), the method waits as long as needed until exclusive access
is satisfied.
If any other application has claimed exclusive access to any of the hard totals files
by using ClaimFile, then this Claim cannot be satisfied until those files are released
by ReleaseFile.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
See Also “Device Sharing Model”; Release Method; ClaimFile Method; ReleaseFile
Method
ClaimFile Method
Syntax LONG ClaimFile (LONG HTotalsFile, LONG Timeout);
Parameter Description
Remarks Attempts to gain exclusive access to a specific file for use by the claiming
application. Once granted, the application maintains exclusive access until it
explicitly releases access or until the device is closed.
If any other applications have claimed exclusive access to this file by using
ClaimFile, or if an application has claimed exclusive access to the entire totals area
by using Claim, then this ClaimFile cannot be satisfied until those claims have been
released.
All claims are released when the application calls the Close method.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
CommitTrans Method
Syntax LONG CommitTrans ();
Remarks Ends the current transaction. All writes between the previous BeginTrans method
and this method are saved to the Hard Totals areas.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
Create Method
Syntax LONG Create (BSTR FileName, LONG* pHTotalsFile, LONG Size,
BOOL ErrorDetection);
Parameter Description
pHTotalsFile Pointer to the handle of the newly created totals file. Set
by the method.
Size The length of the file in bytes. Once created, the file size
cannot be changed – totals files are fixed-length files.
Remarks Creates a totals file with the specified name, size, and error detection level. The data
area is initialized to binary zeros.
If CapSingleFile is TRUE, then only one file may be created, and its name must be
the empty string (“”). Otherwise, the number of totals files that may be created is
limited only by the free space available in the Hard Totals area.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_CLAIMED Cannot create because the entire totals file area is claimed
by another application.
Delete Method
Syntax LONG Delete (BSTR FileName);
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_CLAIMED Cannot delete because either the totals file or the entire
totals area is claimed by another application.
Find Method
Syntax LONG Find (BSTR FileName, LONG* pHTotalsFile, LONG* pSize);
Parameter Description
pHTotalsFile Pointer to the handle of the totals file. Set by the method.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_CLAIMED Cannot find because the entire totals file area is claimed by
another application.
FindByIndex Method
Syntax LONG FindByIndex (LONG Index, BSTR* pFileName);
Parameter Description
Remarks Returns the totals file name currently associated with the given index.
This method provides a means for enumerating all of the totals files currently
defined. An Index of zero will return the file name at the first file position, with
subsequent indices returning additional file names. The largest valid Index value is
one less than NumberOfFiles.
The creation and deletion of files may change the relationship between indices and
the file names, as the Control may compact or rearrange the data areas used to
manage file names and attributes at these times. Therefore, the application may need
to Claim the device to ensure that all file names are retrieved successfully.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_CLAIMED Cannot find because the entire totals file area is claimed by
another application.
OPOS_E_ILLEGAL The Index is greater than the largest file index that is
currently defined.
Read Method
Syntax LONG Read (LONG HTotalsFile, BSTR* pData, LONG Offset, LONG Count);
Parameter Description
pData Pointer to the data buffer in which the totals data will be
placed.
The format of this data depends upon the value of the
BinaryConversion property. See page 37.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_CLAIMED Cannot read because either the totals file or the entire totals
area is claimed by another application.
RecalculateValidationData Method
Syntax LONG RecalculateValidationData (LONG HTotalsFile);
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_CLAIMED Cannot recalculate because either the totals file or the entire
totals area is claimed by another application.
An application may own claims on both the Hard Totals device through Claim as
well as individual files through ClaimFile. Calling Release only releases the claim
on the Hard Totals device.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
ReleaseFile Method
Syntax LONG ReleaseFile (LONG HTotalsFile);
The HTotalsFile parameter contains the handle of the totals file to be released.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
Rename Method
Syntax LONG Rename (LONG HTotalsFile, BSTR FileName);
Parameter Description
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_CLAIMED Cannot rename because either the totals file or the entire
totals area is claimed by another application.
Rollback Method
Syntax LONG Rollback ();
Remarks Ends the current transaction. All writes between the previous BeginTrans and this
method are discarded; they are not saved to the Hard Totals areas.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
SetAll Method
Syntax LONG SetAll (LONG HTotalsFile, LONG Value);
Parameter Description
Remarks Set all the data in a totals file to the specified value.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_CLAIMED Cannot set because either the totals file or the entire totals
area is claimed by another application.
ValidateData Method
Syntax LONG ValidateData (LONG HTotalsFile);
Remarks Verifies that all data in the specified totals file passes validation checks.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_CLAIMED Cannot validate because either the totals file or the entire
totals area is claimed by another application.
Write Method
Syntax LONG Write (LONG HTotalsFile, BSTR Data, LONG Offset, LONG Count);
Parameter Description
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_CLAIMED Cannot write because either the totals file or the entire
totals area is claimed by another application.
ResultCodeExtended = OPOS_ETOT_VALIDATION:
A validation error has occurred while reading data.
See Also Read Method; BeginTrans Method; CommitTrans Method; Rollback Method;
FreeData Property
Keylock
Summary
Properties
Common Type Access Initialized After
AutoDisable 1.2 Boolean R/W Not Supported
BinaryConversion 1.2 Long R/W Open
CapPowerReporting 1.3 Long R Open
CheckHealthText 1.0 String R Open
Claimed 1.0 Boolean R Open
DataCount 1.2 Long R Not Supported
DataEventEnabled 1.0 Boolean R/W Not Supported
DeviceEnabled 1.0 Boolean R/W Open
FreezeEvents 1.0 Boolean R/W Open
OutputID 1.0 Long R Not Supported
PowerNotify 1.3 Long R/W Open
PowerState 1.3 Long R Open
ResultCode 1.0 Long R --
ResultCodeExtended 1.0 Long R Open
State 1.0 Long R --
Methods
Common May Use After
Open 1.0 --
Close 1.0 Open
Claim 1.0 Open
Release 1.0 Open & Claim
CheckHealth 1.0 Open & Enable
ClearInput 1.0 Not Supported
ClearOutput 1.0 Not Supported
DirectIO 1.0 Open
Specific
WaitForKeylockChange 1.0 Open & Enable
Events
Name May Occur After
DataEvent 1.0 Not Supported
DirectIOEvent 1.0 Open
ErrorEvent 1.0 Not Supported
OutputCompleteEvent 1.0 Not Supported
StatusUpdateEvent 1.0 Open & Enable
General Information
The Keylock Control’s OLE programmatic ID is “OPOS.Keylock”.
Capabilities
The keylock has the following minimal set of capabilities:
Model
The keylock defines three keylock positions as constants. It is assumed that the
keylock supports locked, normal, and supervisor positions. The constants for these
keylock positions and their values are as follows:
• LOCK_KP_LOCK 1
• LOCK_KP_NORM 2
• LOCK_KP_SUPR 3
The KeyPosition property holds the value of the keylock position where the values
range from one (1) to the total number of keylock positions contained in the
PositionCount property.
Device Sharing
The keylock is sharable. Its device sharing rules are:
• After opening and enabling the device, the application may access all properties
and methods and will receive status update events.
• If more than one application has opened and enabled the device, each of these
applications may access its properties and methods. Status update events are
fired to all of these applications.
• The keylock may not be claimed for exclusive access. If an application calls
Claim, the method always return OPOS_E_ILLEGAL.
• See the “Summary” table for precise usage prerequisites.
Properties
KeyPosition Property
Syntax LONG KeyPosition;
This value is set by the Control whenever the keylock position is changed. In
addition to the application receiving the StatusUpdateEvent, this value is changed to
reflect the new keylock position.
Value Meaning
This property is initialized and kept current while the device is enabled.
PositionCount Property
Syntax LONG PositionCount;
Contains the total number of positions that are present on the keylock device.
Methods
WaitForKeylockChange Method
Syntax LONG WaitForKeylockChange (LONG KeyPosition, LONG Timeout);
Parameter Description
Value Meaning
LOCK_KP_ANY Wait for any keylock position change. Value is zero (0).
Other Values Wait for keylock position to be set to one of the auxiliary
positions. This value may range from four (4) up to the
total number of keylock positions indicated by the
PositionCount property.
If the keylock position specified by the KeyPosition parameter is the same as the
current keylock position, then the method returns immediately.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
Events
StatusUpdateEvent Event
Syntax void StatusUpdateEvent (LONG Status);
The Status parameter contains the updated keylock position. The following keylock
position values may be set:
Value Meaning
Line Display
Summary
Properties
Common Type Access Initialized After
AutoDisable 1.2 Boolean R/W Not Supported
BinaryConversion 1.2 Long R/W Open
CapPowerReporting 1.3 Long R Open
CheckHealthText 1.0 String R Open
Claimed 1.0 Boolean R Open
DataCount 1.2 Long R Not Supported
DataEventEnabled 1.0 Boolean R/W Not Supported
DeviceEnabled 1.0 Boolean R/W Open & Claim
FreezeEvents 1.0 Boolean R/W Open
OutputID 1.0 Long R Not Supported
PowerNotify 1.3 Long R/W Open
PowerState 1.3 Long R Open
ResultCode 1.0 Long R --
ResultCodeExtended 1.0 Long R Open
State 1.0 Long R --
Methods
Common May Use After
Open 1.0 --
Close 1.0 Open
Claim 1.0 Open
Release 1.0 Open & Claim
CheckHealth 1.0 Open, Claim, & Enable
ClearInput 1.0 Not Supported
ClearOutput 1.0 Not Supported
DirectIO 1.0 Open
Specific
DisplayText 1.0 Open, Claim, & Enable
DisplayTextAt 1.0 Open, Claim, & Enable
ClearText 1.0 Open, Claim, & Enable
ScrollText 1.0 Open, Claim, & Enable
Events
Name May Occur After
DataEvent 1.0 Not Supported
DirectIOEvent 1.0 Open, Claim
ErrorEvent 1.0 Not Supported
OutputCompleteEvent 1.0 Not Supported
StatusUpdateEvent 1.3 Open, Claim, & Enable
General Information
The Line Display Control’s OLE programmatic ID is “OPOS.LineDisplay”.
Capabilities
The Line Display has the following capability:
• Supports text character display. The default mode (or perhaps only mode) of
the display is character display output.
The line display may also have the following additional capabilities:
The following capability is not addressed in this version of the OPOS specification:
Model
The general model of a line display:
• The rows and columns are numbered beginning with (0, 0) at the upper-left
corner of the window.
Display Modes
• Immediate Mode
In effect when MarqueeType is DISP_MT_NONE and InterCharacterWait
is zero.
If the window is bigger than the viewport, then only those characters which
map into the viewport will be seen.
• Teletype Mode
In effect when MarqueeType is DISP_MT_NONE and InterCharacterWait
is not zero.
DisplayText and DisplayTextAt requests are enqueued and processed in the
order they are received. The InterCharacterWait timer specifies the time to
wait between outputting each character. InterCharacterWait only applies to
those characters within the viewport.
• Marquee Mode
In effect when MarqueeType is not DISP_MT_NONE.
The window must be bigger than the viewport.
A marquee is typically initialized after entering Marquee Init Mode by setting
MarqueeType to DISP_MT_INIT, then calling ClearText, DisplayText, and
DisplayTextAt methods. Then, when MarqueeType is changed to an “on”
value, Marquee On Mode is entered, and the marquee begins to be displayed in
the viewport beginning at the start of the window (or end if the type is right or
down).
When the mode is changed from Marquee On Mode to off, the marquee stops in
place. A subsequent transition from back to Marquee On Mode continues from
the current position.
When the mode is changed from Marquee On Mode to Marquee Init Mode, the
marquee stops. Changes may be made to the window, then the window may be
returned to Marquee On Mode to restart the marquee with the new data.
It is illegal to use DisplayText, DisplayTextAt, ClearText, RefreshWindow,
and ScrollText unless in Marquee Init Mode or marquees are off.
Device Sharing
The line display is an exclusive-use device. Its device sharing rules are:
Properties
CapBlink Property
Syntax LONG CapBlink;
Remarks Holds the character blink capability of the device. It may be one of the following:
Value Meaning
CapBrightness Property
Syntax BOOL CapBrightness;
CapCharacterSet Property
Syntax LONG CapCharacterSet;
Remarks Holds the default character set capability. It may be one of the following:
Value Meaning
DISP_CCS_KANA The default character set supports partial code page 932,
including ASCII characters 20-hex through 7F-hex and the
Japanese Kana characters A1-hex through DF-hex, but
excluding the Japanese Kanji characters.
The default character set may contain a superset of these ranges. The initial
CharacterSet property may be examined for additional information.
CapDescriptors Property
Syntax BOOL CapDescriptors;
CapHMarquee Property
Syntax BOOL CapHMarquee;
CapICharWait Property
Syntax BOOL CapICharWait;
CapVMarquee Property
Syntax BOOL CapVMarquee;
Value Meaning
Range 101 - 199 A device-specific character set that does not match a code
page, nor the ASCII or Windows ANSI character sets.
Range 400 - 990 Code page; matches one of the standard values.
Range 1000 and higher Windows code page; matches one of the standard values.
This property is initialized to an appropriate value when the device is first enabled
following the Open method. This value is guaranteed to support at least the set of
characters specified by the CapCharacterSet capability.
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
CharacterSetList Property
Syntax BSTR CharacterSetList;
This property is initialized by the Open method. The string consists of ASCII
numeric set numbers separated by commas.
For example, if the string is “101,850,999”, then the device supports a device-
specific character set, code page 850, and the Windows ANSI character set.
Columns Property
Syntax LONG Columns;
Several properties are associated with each window: Rows, Columns, CursorRow,
CursorColumn, CursorUpdate, MarqueeType, MarqueeUnitWait,
MarqueeRepeatWait, and InterCharacterWait.
When set, this property changes the current window and sets the associated
properties to their values for this window.
Setting a window does not refresh its viewport. If this window and another
window’s viewports overlap, and the other window has changed the viewport, then
RefreshWindow may be called to restore this window’s viewport contents.
This property is initialized to zero – the device window – by the Open method, and
is updated when CreateWindow or DestroyWindow are called.
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
Remarks Holds the column in the current window to which the next displayed character will
be output.
Legal values range from (zero) through (Columns). (See DisplayText for a note
on the interpretation of CursorColumn = Columns.)
This property is initialized to zero on the by the Open and CreateWindow methods,
and is updated when CurrentWindow is set or ClearText, DisplayTextAt, or
DestroyWindow is called. It is also updated when DisplayText is called if
CursorUpdate is TRUE.
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
Remarks Holds the row in the current window to which the next displayed character will be
output.
This property is initialized to zero by the Open and CreateWindow methods, and is
updated when CurrentWindow is set or ClearText, DisplayTextAt, or
DestroyWindow is called. It is also updated when DisplayText is called if
CursorUpdate is TRUE.
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
If FALSE when characters are displayed, then the cursor properties will not be
updated.
This property is maintained fore each window. It initialized to TRUE by the Open
and CreateWindow methods, and is updated when CurrentWindow is set or
DestroyWindow is called.
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
Remarks Holds the device brightness value, expressed as a percentage between 0 and 100.
Any device can support 0% (blank) and 100% (full intensity). Blanking can, at a
minimum, be supported by sending spaces to the device. If the capability
CapBrightness is TRUE, then the device also supports one or more levels of
dimming.
If a device does not support the specified brightness value, then the Service Object
will choose an appropriate substitute.
This property is initialized to 100 when the device is first enabled following the
Open method.
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
DeviceColumns Property
Syntax LONG DeviceColumns;
DeviceDescriptors Property
Syntax LONG DeviceDescriptors;
DeviceRows Property
Syntax LONG DeviceRows;
DeviceWindows Property
Syntax LONG DeviceWindows;
Remarks Holds the maximum window number supported by this device. A value of zero
indicates that only the device window is supported, and that no windows may be
created.
Remarks Holds the wait time between displaying each character with the DisplayText and
DisplayTextAt methods. This timer gives a “teletype” appearance when displaying
the text.
InterCharacterWait is only used if the window is not in Marquee Mode — that is,
MarqueeType must be DISP_MT_NONE.
When non-zero and the window is not in Marquee Mode, the window is in Teletype
Mode: DisplayText and DisplayTextAt requests are enqueued and processed in the
order they are received. The InterCharacterWait timer specifies the time to wait
between outputting each character into the viewport. The wait time is the specified
number of milliseconds. (Note that the system timer resolution may reduce the
precision of the wait time.) If CursorUpdate is TRUE, CursorRow and
CursorColumn are updated to their final values before DisplayText or
DisplayTextAt returns, even though all of its data may not yet be displayed.
When the timer is zero and the window is not in Marquee Mode, Immediate Mode is
in effect, so that characters are processed as quickly as possible. If some display
requests are enqueued at the time that InterCharacterWait is set to zero, the
requests are completed as quickly as possible.
This property is initialized to zero by the Open and CreateWindow methods, and is
updated when CurrentWindow is set or DestroyWindow is called.
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
Value Meaning
DISP_MF_WALK Begin the marquee by walking data from the opposite side.
For example, if the marquee type is “left”, then the
viewport is filled by bringing characters into the right side
and scrolling them to the left.
2. Display the mapped portion of the window into the viewport, then wait
MarqueeUnitWait milliseconds. Move the window mapping onto the viewport
by one row or column in the marquee direction. Repeat until the viewport is
full.
3. Move the window mapping onto the viewport by one row or column in the
marquee direction, and refresh the viewport, then wait MarqueeUnitWait
milliseconds. Repeat until the last row or column is scrolled into the viewport
(in which case, omit the unit wait).
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
and the display contains (assuming the other windows are all blank):
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 0 1 2
1 5 6 7
and display contains (assuming the other windows are all blank):
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 0 1 2
1 5 6 7
From this point to the end of the window, the marquee action is the same as with
marquee walking…
After MarqueeUnitWait milliseconds, the viewport is changed to:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 1 2 3
1 6 7 8
Remarks Holds the wait time between scrolling the final character or row of the window into
its viewport and restarting the marquee with the first or last character or row.
The wait time is the specified number of milliseconds. (Note that the timer
resolution may reduce the precision of the wait time.)
This property is initialized to zero by the Open and CreateWindow methods, and is
updated when CurrentWindow is set or DestroyWindow is called.
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
Remarks Holds the marquee type for the current window. When not DISP_MT_NONE, the
window is in Marquee Mode.
Value Meaning
DISP_MT_UP Scroll the window up. Illegal unless Rows is greater than
the Height parameter used for the window’s
CreateWindow call, and the capability CapVMarquee is
TRUE.
When the mode is changed from Marquee On Mode to off, the marquee stops in
place. A subsequent transition from back to Marquee On Mode continues from the
current position.
When the mode is changed from Marquee On Mode to Marquee Init Mode, the
marquee stops. Changes may be made to the window, then the window may be
returned to Marquee On Mode to restart the marquee with the new data.
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
Remarks Holds the wait time between marquee scrolling of each column or row in the
window.
The wait time is the specified number of milliseconds. (Note that the timer
resolution may reduce the precision of the wait time.)
This property is initialized to zero by the Open and CreateWindow methods, and is
updated when CurrentWindow is set or DestroyWindow is called.
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
Rows Property
Syntax LONG Rows;
Methods
ClearDescriptors Method
Syntax LONG ClearDescriptors ();
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
ClearText Method
Syntax LONG ClearText ();
Remarks Clears the current window to blanks, sets CursorRow and CursorColumn to zero,
and resynchronizes the beginning of the window with the start of the viewport.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
CreateWindow Method
Syntax LONG CreateWindow (LONG ViewportRow, LONG ViewportColumn,
LONG ViewportHeight, LONG ViewportWidth,
LONG WindowHeight, LONG WindowWidth);
Parameter Description
Remarks Creates a viewport over the portion of the display given by the first four parameters.
The window size is given by the last two parameters. Valid window row values
range from (0) to (WindowHeight-1) and column values range from (0) to
(WindowWidth-1).
The window size may be larger than the viewport size in one direction. Using the
window marquee properties MarqueeType, MarqueeFormat, MarqueeUnitWait,
and MarqueeRepeatWait, such a window may be continuously scrolled in a
marquee fashion.
Property Value
CursorRow Set to 0.
CursorColumn Set to 0.
MarqueeUnitWait Set to 0.
MarqueeRepeatWait Set to 0.
InterCharacterWait Set to 0.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_ILLEGAL One or more parameters are out of their valid ranges, or all
available windows are already in use.
DestroyWindow Method
Syntax LONG DestroyWindow ();
Remarks Destroys the current window. The characters displayed in its viewport are not
changed.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
DisplayText Method
Syntax LONG DisplayText (BSTR Data, LONG Attribute);
Parameter Description
Remarks The characters in Data are processed beginning at the location specified by
CursorRow and CursorColumn, and continue in succeeding columns.
Character processing continues to the next row when the end of a window row is
reached. If the end of the window is reached with additional characters to be
processed, then the window is scrolled upward by one row and the bottom row is
set to blanks. If CursorUpdate is TRUE, then CursorRow and CursorColumn are
updated to point to the character following the last character of Data.
Note
Scrolling will not occur when the last character of Data is placed at the end of a row. In
this case, when CursorUpdate is TRUE, then CursorRow is set to the row containing the
last character, and CursorColumn is set to Columns (that is, to one more than the final
character of the row).
This stipulation ensures that the display does not scroll when a character is written into
its last position. Instead, the Control will wait until another character is written before
scrolling the window.
Value Meaning
New Line (13) Change the next character’s output position to the
beginning of the current row.
Line Feed (10) Change the next character’s output position to the
beginning of the next row. Scroll the window if the
current row is the last row of the window.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
DisplayTextAt Method
Syntax LONG DisplayTextAt (LONG Row, LONG Column,
BSTR Data, LONG Attribute);
Parameter Description
Remarks The characters in Data are processed beginning at the window location specified by
the Row and Column parameters, and continuing in succeeding columns.
This method has the same effect as setting the CursorRow to Row, setting
CursorColumn to Column, and calling the DisplayText method.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
RefreshWindow Method
Syntax LONG RefreshWindow (LONG Window);
Remarks Changes the current window to Window, then redisplays its viewport. Neither the
mapping of the window to its viewport nor the window’s cursor position is
changed.
This function may be used to restore a window after another window has
overwritten some of its viewport.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
ScrollText Method
Syntax LONG ScrollText (LONG Direction, LONG Units);
The Direction parameter indicates the scrolling direction, which may be one of the
following:
Value Meaning
If the window size for the scroll direction matches its viewport size, then the
window data is scrolled, the last Units rows or columns are set to spaces, and the
viewport is updated.
If the window size for the scroll direction is larger than its viewport, then the
window data is not changed. Instead, the mapping of the window into the viewport
is moved in the specified direction. The window data is not altered, but the
viewport is updated. If scrolling by Units would go beyond the beginning of the
window data, then the window is scrolled so that the first viewport row or column
contains the first window row or column. If scrolling by Units would go beyond
the end of the window data, then the window is scrolled so that the last viewport
row or column contains the last window row or column.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
If the method
LD.ScrollText (DISP_ST_LEFT, 2)
is called, the window data becomes:
0 1 2 3
0 c d
1 C D
If the method
LD.ScrollText (DISP_ST_LEFT, 2)
is called, the window data is unchanged, and the viewport becomes:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
0 c d e f
1 C D E F
If the method
LD.ScrollText (DISP_ST_UP, 1)
is called next, the window data becomes:
0 1 2 3 4 5 6 7
0 A B C D E F G H
1
SetDescriptor Method
Syntax LONG SetDescriptor (LONG Descriptor, LONG Attribute);
The Descriptor parameter indicates which descriptor to change. The value may
range between zero and one less than DeviceDescriptors.
The Attribute parameter indicates the attribute for the descriptor. Values are:
Value Meaning
Remarks Sets the state of one of the descriptors, which are small indicators with a fixed label.
The device and its Service Object determine the mapping of Descriptor to its
descriptors.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
Summary
Properties
Common Type Access Initialized After
AutoDisable 1.2 Boolean R/W Open
BinaryConversion 1.2 Long R/W Open
CapPowerReporting 1.3 Long R Open
CheckHealthText 1.0 String R Open
Claimed 1.0 Boolean R Open
DataCount 1.2 Long R Open
DataEventEnabled 1.0 Boolean R/W Open
DeviceEnabled 1.0 Boolean R/W Open & Claim
FreezeEvents 1.0 Boolean R/W Open
OutputID 1.0 Long R Not Supported
PowerNotify 1.3 Long R/W Open
PowerState 1.3 Long R Open
ResultCode 1.0 Long R --
ResultCodeExtended 1.0 Long R Open
State 1.0 Long R --
Methods
Common May Use After
Open 1.0 --
Close 1.0 Open
Claim 1.0 Open
Release 1.0 Open & Claim
CheckHealth 1.0 Open, Claim, & Enable
ClearInput 1.0 Open & Claim
ClearOutput 1.0 Not Supported
DirectIO 1.0 Open
Specific
BeginInsertion 1.0 Open, Claim, & Enable
EndInsertion 1.0 Open, Claim, & Enable
BeginRemoval 1.0 Open, Claim, & Enable
EndRemoval 1.0 Open, Claim, & Enable
Events
Name May Occur After
DataEvent 1.0 Open, Claim, & Enable
DirectIOEvent 1.0 Open, Claim
ErrorEvent 1.0 Open, Claim, & Enable
OutputCompleteEvent 1.0 Not Supported
StatusUpdateEvent 1.3 Open, Claim, & Enable
General Information
The MICR Control’s OLE programmatic ID is “OPOS.MICR”.
Capabilities
The MICR Control has the following minimal set of capabilities:
Some MICR devices support exception tables, which cause non-standard parsing of
the serial number for specific check routing numbers. Exception tables are not
directly supported by this OPOS release. However, a Service Object may choose to
support them, and could assign registry entries under its device name key to define
the exception entries. (See the appendix “APPENDIX B
OPOS Registry Usage”, page 683.)
Model
The MICR Control follows the general “Input Model” (page 24). One point of
difference is that the MICR Control requires the execution of methods to insert and
remove the check for processing. Therefore, this Control requires more than simply
setting the DataEventEnabled property to TRUE in order to receive data. The
basic model is as follows:
Many models of MICR devices do not require any check handling processing from
the application. Such devices may always be capable of receiving a check and
require no commands to actually read and eject the check. For these types of MICR
devices, the BeginInsertion, EndInsertion, BeginRemoval and EndRemoval
methods simply return an OPOS_SUCCESS status, and the Control will enqueue the
data until the DataEventEnabled property is set to TRUE. However, applications
should still use these methods to ensure application portability across different MICR
devices.
Device Sharing
The MICR is an exclusive-use device, as follows:
Transit t
Amount a
On-Us o
Dash -
Properties
AccountNumber Property
Syntax BSTR AccountNumber;
Remarks A string containing the account number parsed from the most recently read MICR
data.
This account number will not include a check serial number if a check serial number
is able to be separately parsed, even if the check serial number is embedded in the
account number portion of the ‘On Us’ field.
If the account number cannot be identified successfully, the string will be empty
(“”).
Amount Property
Syntax BSTR Amount;
Remarks A string containing the amount field parsed from the most recently read MICR data.
The amount field on a check consists of ten digits bordered by Amount symbols.
All non space digits will be represented in the test string including leading 0’s.
BankNumber Property
Syntax BSTR BankNumber;
Remarks A string containing the bank number portion of the transit field parsed from the most
recently read MICR data.
If the bank number or transit field is not present or successfully identified, the string
will be empty (“”).
CapValidationDevice Property
Syntax BOOL CapValidationDevice;
Remarks Indicates if this device also performs validation printing via the POS Printer
Control’s slip station.
If its value is TRUE, a check does not have to be removed from the MICR device
prior to performing validation printing. For devices that are both a MICR device as
well as a POS Printer, the device will automatically position the check for validation
printing after successfully performing a MICR read. Either the MICR Control’s or
the POS Printer Control’s BeginRemoval and EndRemoval methods may be called
to remove the check once processing is complete.
CheckType Property
Syntax LONG CheckType;
Remarks A number that represents the type of check parsed from the most recently read
MICR data.
Values are:
Value Meaning
CountryCode Property
Syntax LONG CountryCode;
Remarks A number that represents the country of origin of the check parsed from the most
recently read MICR data.
Values are:
Value Meaning
EPC Property
Syntax BSTR EPC;
Remarks A string containing the Extended Processing Code (“EPC”) field parsed from the
most recently read MICR data. The string will contain a single character 0 though 9
if the field is present. If not, the string will be empty (“”).
RawData Property
Syntax BSTR RawData;
Remarks A string containing the MICR data from the most recent MICR read.
The string contains any of the 15 MICR characters with appropriate substitution to
represent non-ASCII characters (see “MICR Character Substitution”, page 384).
No parsing or special processing is done to the data returned in this string. A
sample value may look like the following:
“2t123456789t123 4 567890o 123 a0000001957a”
Note that the property value will include spaces to represent spaces in the MICR
data.
SerialNumber Property
Syntax BSTR SerialNumber;
Remarks A string containing the serial number of the check parsed from the most recently
read MICR data.
If the serial number cannot be successfully parsed, the value of this property will be
empty (“”).
TransitNumber Property
Syntax BSTR TransitNumber;
Remarks A string containing the transit field of the check parsed from the most recently read
MICR data.
The transmit number consists of all the characters read between the ‘Transit’
symbols on the check. It is a nine character string.
Methods
BeginInsertion Method
Syntax LONG BeginInsertion (LONG Timeout);
The Timeout parameter gives the number of milliseconds before failing the method.
If zero, the method tries to begin insertion mode, then returns the appropriate status
immediately.
If OPOS_FOREVER (-1), the method tries to begin insertion mode, then waits as
long as needed until either the check is inserted or an error occurs.
When called, the MICR is made ready to receive a check by opening the MICR’s
check handling “jaws” or activating a MICR’s check insertion mode. This method
is paired with the EndInsertion method for controlling check insertion. For MICR
devices that do not require this sort of processing, these methods will always return
OPOS_SUCCESS. However, the application should still use these methods to
ensure application portability across different MICR devices.
If the MICR device cannot be placed into insertion mode, an error is returned to the
application. Otherwise, the Control continues to monitor check insertion until either:
• The check is not inserted before Timeout milliseconds have elapsed, or an error
is reported by the MICR device. In this case, the Control either returns
OPOS_E_TIMEOUT or another error. The MICR device remains in check
insertion mode. This allows an application to perform some user interaction and
reissue the BeginInsertion method without altering the MICR check handling
mechanism.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_TIMEOUT The specified time has elapsed without the check being
properly inserted.
BeginRemoval Method
Syntax LONG BeginRemoval (LONG Timeout);
The Timeout property gives the number of milliseconds before failing the method.
If zero, the method tries to begin removal mode, then returns the appropriate status
immediately.
If OPOS_FOREVER (-1), the method tries to begin removal mode, then waits as
long as needed until either the check is removed or an error occurs.
When called, the MICR is made ready to remove a check, by opening the MICR’s
check handling “jaws” or activating a MICR’s check ejection mode. This method is
paired with the EndRemoval method for controlling check removal. For MICR
devices that do not require this sort of processing, these methods will always return
OPOS_SUCCESS. However, the application should still use these methods to
ensure application portability across different MICR devices.
If the MICR device cannot be placed into removal or ejection mode, an error is
returned to the application. Otherwise, the Control continues to monitor check
removal until either:
• The check is not removed before Timeout milliseconds have elapsed, or an error
is reported by the MICR device. In this case, the Control either returns
OPOS_E_TIMEOUT or another error. The MICR device remains in check
removal mode. This allows an application to perform some user interaction and
reissue the BeginRemoval method without altering the MICR check handling
mechanism.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_TIMEOUT The specified time has elapsed without the check being
properly removed.
EndInsertion Method
Syntax LONG EndInsertion ();
When called, the MICR is taken out of check insertion mode. If a check is detected
in the device, a successful status of OPOS_SUCCESS is returned to the application.
If no check is present, an extended error status OPOS_EMICR_NOCHECK is
returned. Upon completion of this method, the check will be read by the MICR
device, and data will be available as soon as the DataEventEnabled property is set
to TRUE. This allows an application to prompt the user prior to calling this method
to ensure that the form is correctly positioned.
This method is paired with the BeginInsertion method for controlling check
insertion. For MICR devices that do not require this sort of processing, these
methods will always return OPOS_SUCCESS. However, the application should still
use these methods to ensure application portability across different MICR devices.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
EndRemoval Method
Syntax LONG EndRemoval ();
When called, the MICR is taken out of check removal or ejection mode. If no
check is detected in the device, a successful status of OPOS_SUCCESS is returned
to the application. If a check is present, an extended error status
OPOS_EMICR_CHECK is returned.
This method is paired with the BeginRemoval method for controlling check
removal. For MICR devices that do not require this sort of processing, these
methods will always return OPOS_SUCCESS. However, the application should still
use these methods to ensure application portability across different MICR devices.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
Events
DataEvent Event
Syntax void DataEvent (LONG Status);
Before delivering this event, the MICR Control updates the RawData property and
attempts to parse this data into the MICR data fields.
ErrorEvent Event
Syntax void ErrorEvent (LONG ResultCode, LONG ResultCodeExtended,
LONG ErrorLocus, LONG* pErrorResponse);
Parameter Description
ResultCode Result code causing the error event. See ResultCode for
values.
Value Meaning
Value Meaning
OPOS_ER_CLEAR Clear the buffered input data. The error state is exited.
Default when locus is OPOS_EL_INPUT.
OPOS_ER_CONTINUEINPUT
Use only when locus is OPOS_EL_INPUT_DATA.
Acknowledges the error and directs the Control to continue
processing. The Control remains in the error state and will
deliver additional DataEvents as directed by the
DataEventEnabled property. When all input has been
delivered and the DataEventEnabled property is again set
to TRUE, then another ErrorEvent is delivered with locus
OPOS_EL_INPUT.
Default when locus is OPOS_EL_INPUT_DATA.
Remarks Fired when an error is detected while trying to read MICR data.
Input error events are not delivered until the DataEventEnabled property is TRUE,
so that proper application sequencing occurs.
Summary
Properties
Common Type Access Initialized After
AutoDisable 1.2 Boolean R/W Open
BinaryConversion 1.2 Long R/W Open
CapPowerReporting 1.3 Long R Open
CheckHealthText 1.0 String R Open
Claimed 1.0 Boolean R Open
DataCount 1.2 Long R Open
DataEventEnabled 1.0 Boolean R/W Open
DeviceEnabled 1.0 Boolean R/W Open & Claim
FreezeEvents 1.0 Boolean R/W Open
OutputID 1.0 Long R Not Supported
PowerNotify 1.3 Long R/W Open
PowerState 1.3 Long R Open
ResultCode 1.0 Long R --
ResultCodeExtended 1.0 Long R Open
State 1.0 Long R --
Methods
Common May Use After
Open 1.0 --
Close 1.0 Open
Claim 1.0 Open
Release 1.0 Open & Claim
CheckHealth 1.0 Open, Claim, & Enable
ClearInput 1.0 Open & Claim
ClearOutput 1.0 Not Supported
DirectIO 1.0 Open
Events
Name May Occur After
DataEvent 1.0 Open, Claim, & Enable
DirectIOEvent 1.0 Open, Claim
ErrorEvent 1.0 Open, Claim, & Enable
OutputCompleteEvent 1.0 Not Supported
StatusUpdateEvent 1.3 Open, Claim, & Enable
General Information
The MSR Control’s OLE programmatic ID is “OPOS.MSR”.
Capabilities
The MSR Control has the following minimal set of capabilities:
• Reads encoded data from a magnetic stripe. Data is obtainable from any
combination of tracks 1, 2, and 3.
• The alphanumeric data bytes may be decoded into their corresponding
alphanumeric codes. Furthermore, this decoded alphanumeric data may be
divided into specific fields accessed as device properties.
• Support for specific card types: ISO, JIS Type I, and/or JIS Type 2.
Model
Four writable properties control MSR data handling:
The MSR Control follows the general input model for event-driven input:
Device Sharing
The MSR is an exclusive-use device, as follows:
Properties
AccountNumber Property
Syntax BSTR AccountNumber;
Remarks The account number obtained from the most recently swiped card.
• The field was not included in the track data obtained, or,
• The track data format was not one of those listed in the ParseDecodeData
property section of this document, or,
• ParseDecodeData is FALSE.
CapISO Property
Syntax BOOL CapISO;
CapJISOne Property
Syntax BOOL CapJISOne;
JIS-I cards are a superset of ISO cards. Therefore, if CapJISOne is TRUE, then it
is implied that CapISO is also TRUE.
CapJISTwo Property
Syntax BOOL CapJISTwo;
Remarks If FALSE, the Track1Data, Track2Data, and Track3Data properties contain the
original encoded bit sequence, known as “raw format”.
If TRUE, each byte of track data contained within the Track1Data, Track2Data,
and Track3Data properties is mapped from its raw format to its corresponding
decoded ASCII bit sequence. This conversion is mainly of relevance for data that is
NOT of the 7-bit format, since 7-bit data needs no decoding to decipher its
corresponding alphanumeric and/or Katakana characters.
The decoding that takes place is as follows for each card type, track, and track data
format:
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
Remarks An error is reported by an ErrorEvent when a card is swiped, and one or more of
the tracks specified by the TracksToRead property contains data with errors.
When the ErrorEvent is fired to the application, two types of error reporting are
supported:
• Track level: The Control can return an extended status with a separate status
for each of the tracks. Also, for those tracks that contain valid data or no data,
the track’s properties are updated as with a DataEvent. For those tracks that
contain invalid data, the track’s properties are set to empty.
This level should be used when the application may be able to utilize a
successfully read track or tracks when another of the tracks contains errors.
For example, suppose TracksToRead is MSR_TR_1_2_3, and a swiped card
contains good track 1 and 2 data, but track 3 contains “random noise” that is
flagged as an error by the MSR. With track level error reporting, the
ErrorEvent sets the track 1 and 2 properties with the valid data, sets the track 3
properties to empty, and returns an error code indicating the status of each
track.
Value Meaning
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
ExpirationDate Property
Syntax BSTR ExpirationDate;
Remarks The expiration date obtained from the most recently swiped card, as four ASCII
decimal characters in the form YYMM. For example, February 1998 is “9802” and
August 2018 is “1808”.
• The field was not included in the track data obtained, or,
• The track data format was not one of those listed in the ParseDecodeData
property section of this document, or,
• ParseDecodeData is FALSE.
FirstName Property
Syntax BSTR FirstName;
Remarks The first name obtained from the most recently swiped card.
• The field was not included in the track data obtained, or,
• The track data format was not one of those listed in the ParseDecodeData
property section of this document, or,
• ParseDecodeData is FALSE.
MiddleInitial Property
Syntax BSTR MiddleInitial;
Remarks The middle initial obtained from the most recently swiped card.
• The field was not included in the track data obtained, or,
• The track data format was not one of those listed in the ParseDecodeData
property section of this document, or,
• ParseDecodeData is FALSE.
Remarks If TRUE, the decoded data contained within the Track1Data and Track2Data
properties is further separated into fields for access via various other properties.
Track3Data is not parsed because its data content is of an open format defined by
the card issuer. JIS-I Track 1 Format C and ISO Track 1 Format C data are not
parsed for similar reasons.
The parsed data properties are the defined possible fields for cards with data
consisting of the following formats:
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
5
An MSR Control Object must support the property ParseDecodeData. In addition, due to a
documentation error in OPOS APG Releases 1.1 and earlier, it is recommended that the
property ParseDecodedData also be supported, and that it refer to the same property.
ServiceCode Property
Syntax BSTR ServiceCode;
Remarks The service code obtained from the most recently swiped card.
• The field was not included in the track data obtained, or,
• The track data format was not one of those listed in the ParseDecodeData
property section of this document, or,
• ParseDecodeData is FALSE.
Suffix Property
Syntax BSTR Suffix;
Remarks The suffix obtained from the most recently swiped card.
• The field was not included in the track data obtained, or,
• The track data format was not one of those listed in the ParseDecodeData
property section of this document, or,
• ParseDecodeData is FALSE.
Surname Property
Syntax BSTR Surname;
Remarks The surname obtained from the most recently swiped card.
• The field was not included in the track data obtained, or,
• The track data format was not one of those listed in the ParseDecodeData
property section of this document, or,
• ParseDecodeData is FALSE.
Title Property
Syntax BSTR Title;
Remarks The title obtained from the most recently swiped card.
• The field was not included in the track data obtained, or,
• The track data format was not one of those listed in the ParseDecodeData
property section of this document, or,
• ParseDecodeData is FALSE.
Track1Data Property
Syntax BSTR Track1Data;
Remarks Contains either the track 1 data from the previous card swipe or an empty string.
This property contains track data between but not including the start and end
sentinels.
If DecodeData is TRUE, then the data returned by this property has been decoded
from “raw” format. The data may also be parsed into other properties when the
ParseDecodeData property is set.
Track1DiscretionaryData Property
Syntax BSTR Track1DiscretionaryData;
Remarks The track 1 discretionary data obtained from the most recently swiped card.
• The field was not included in the track data obtained, or,
• The track data format was not one of those listed in the ParseDecodeData
property section of this document, or,
• ParseDecodeData is FALSE.
The amount of data contained in this property varies widely depending upon the
format of the track 1 data.
Track2Data Property
Syntax BSTR Track2Data;
Remarks Contains either the track 2 data from the previous card swipe or an empty string.
This property contains track data between but not including the start and end
sentinels.
If DecodeData is TRUE, then the data returned by this property has been decoded
from “raw” format. It may also be parsed into other properties when the
ParseDecodeData property is set.
Track2DiscretionaryData Property
Syntax BSTR Track2DiscretionaryData;
Remarks The track 2 discretionary data obtained from the most recently swiped card.
• The field was not included in the track data obtained, or,
• The track data format was not one of those listed in the ParseDecodeData
property section of this document, or,
• ParseDecodeData is FALSE.
Track3Data Property
Syntax BSTR Track3Data;
Remarks Contains either the track 3 data from the previous card swipe or an empty string.
This property contains track data between but not including the start and end
sentinels.
If DecodeData is TRUE, then the data returned by this property has been decoded
from “raw” format.
Remarks Indicates the track data that the application wishes to have placed into the
Track1Data, Track2Data, and Track3Data properties following a card swipe.
Value Meaning
Decreasing the required number of tracks may provide a greater swipe success rate
and somewhat greater responsiveness by removing the processing for unaccessed
data.
TracksToRead does not indicate a capability of the MSR hardware unit, but instead
is an application configurable property representing which track(s) will have their
data obtained, potentially decoded, and returned if possible. Cases such as an ISO
type card being swiped through a JIS-II read head, cards simply not having data for
particular tracks, and other factors may preclude desired data from being obtained.
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
Events
DataEvent Event
Syntax void DataEvent (LONG Status);
The Status parameter is divided into four bytes with three of the bytes representing
information about the three tracks, while the fourth byte is unused. The diagram
below indicates how the parameter Status is divided:
A value of zero (0) for a track byte means that no data was obtained from the swipe
for that particular track. This might be due to the hardware device simply not
having a read head for the track, or perhaps the application intentionally precluded
incoming data from the track via the TracksToRead property.
A value greater than zero (> 0) indicates the length in bytes of the corresponding
TrackxData property.
Remarks Fired to indicate input data from the device to the application.
Before delivering the event, the swiped data is placed into Track1Data,
Track2Data, and Track3Data. If DecodeData is TRUE, then this track data is
decoded. If ParseDecodeData is TRUE, then the data is parsed into several
additional properties.
ErrorEvent Event
Syntax void ErrorEvent (LONG ResultCode, LONG ResultCodeExtended,
LONG ErrorLocus, LONG* pErrorResponse);
Parameter Description
ResultCode Result code causing the error event. See values below.
ResultCodeExtended Extended result code causing the error event. See values
below.
Value Meaning
ResultCodeExtended = OPOS_EMSR_END:
End sentinel error.
ResultCodeExtended = OPOS_EMSR_PARITY:
Parity error.
ResultCodeExtended = OPOS_EMSR_LRC:
LRC error.
Value Meaning
OPOS_SUCCESS No error.
OPOS_EMSR_START Start sentinel error.
OPOS_EMSR_END End sentinel error.
OPOS_EMSR_PARITY Parity error.
OPOS_EMSR_LRC LRC error.
OPOS_E_FAILURE Other or general error.
Value Meaning
The contents at the location pointed to by the pErrorResponse parameter are preset
to a default value, based on the ErrorLocus. The application may change it to one of
the following:
Value Meaning
OPOS_ER_CLEAR Clear the buffered input data. The error state is exited.
Default when locus is OPOS_EL_INPUT.
OPOS_ER_CONTINUEINPUT
Use only when locus is OPOS_EL_INPUT_DATA.
Acknowledges the error and directs the Control to continue
Remarks Fired when an error is detected while trying to read MSR data.
Input error events are not delivered until the DataEventEnabled property is TRUE,
so that proper application sequencing occurs.
See Also “Status, Result Code, and State Model”; ErrorReportingType Property
PIN Pad
Summary
Properties
Common Type Access Initialized After
AutoDisable 1.3 Boolean R/W Not Supported
BinaryConversion 1.3 Long R/W Not Supported
CapPowerReporting 1.3 Long R Open
CheckHealthText 1.3 String R Open
Claimed 1.3 Boolean R Open
DataCount 1.3 Long R Open
DataEventEnabled 1.3 Boolean R/W Open
DeviceEnabled 1.3 Boolean R/W Open & Claim
FreezeEvents 1.3 Boolean R/W Open
OutputID 1.3 Long R Not Supported
PowerNotify 1.3 Long R/W Open
PowerState 1.3 Long R Open
ResultCode 1.3 Long R --
ResultCodeExtended 1.3 Long R Open
State 1.3 Long R --
Methods
Common May Use After
Open 1.3 --
Close 1.3 Open
Claim 1.3 Open
Release 1.3 Open & Claim
CheckHealth 1.3 Open, Claim, & Enable
ClearInput 1.3 Open, Claim, & Enable
ClearOutput 1.3 Not Supported
DirectIO 1.3 Open
Specific
BeginEFTTransaction 1.3 Open, Claim, & Enable
EndEFTTransaction 1.3 BeginEFTTransaction
EnablePINEntry 1.3 BeginEFTTransaction
ComputeMAC 1.3 BeginEFTTransaction
VerifyMAC 1.3 BeginEFTTransaction
UpdateKey 1.3 BeginEFTTransaction
Events
Name May Occur After
DataEvent 1.3 Open, Claim, & Enable
DirectIOEvent 1.3 Open, Claim
ErrorEvent 1.3 Open, Claim, & Enable
OutputCompleteEvent 1.3 Not Supported
StatusUpdateEvent 1.3 Open, Claim, & Enable
General Information
The Pinpad Control’s OLE programmatic ID is “OPOS.PINPad”.
This device was added in OPOS Release 1.3.
A Pinpad
Capabilities
The Pinpad Control has the following minimal capability:
• Accept a PIN Entry at its keyboard and provide an Encrypted PIN to the
application.
• Initial Key Loading. This operation usually requires downloading at least one key
in the clear and must be done in a secure location (typically either the factory or
at a Financial Institution). Thus, support for initial key loading is outside the
scope of this specification. However, this specification does include support for
updating keys while a Pinpad unit is installed at a retail site.
• Full EFT functionality. This specification addresses the functionality of a
Pinpad that is used solely as a peripheral device by an Electronic Funds Transfer
application. It specifically does not define the functionality of an Electronic
Funds Transfer application that might execute within an intelligent Pinpad. This
specification does not include support for applications in which the Pinpad
Application determines that a message needs to be transmitted to the EFT
Transaction Host. Consequently, this specification will not apply in Canada,
Germany, Netherlands, and possibly other countries. It also does not apply to
Pinpads in which the vendor has chosen to provide EFT Functionality in the
Pinpad.
• Smartcard Reader. Some Pinpad devices will include a Smartcard reader.
Support for this device may be included in a future revision of this specification.
Model
A Pinpad performs encryption functions under control of a Pinpad Management
System. Some Pinpads will support multiple Pinpad Management Systems. Some
Pinpad Management Systems support multiple keys (sets) for different EFT
Transaction Hosts. Thus, for each EFT transaction, the application will need to
select the Pinpad Management System and EFT Transaction Host to be used.
Depending on the Pinpad Management System, one or more EFT transaction
parameters will need to be provided to the Pinpad for use in the encryption
functions. The application should set the value of ALL EFT Transaction parameter
properties to enable easier migration to EFT Transaction Hosts that require a
different Pinpad Management System.
After opening, claiming, and enabling the Pinpad Control, the application should use
the following general scenario for each EFT Transaction.
This specification supports 2 models of how the display on the Pinpad is used. The
CapDisplay property indicates which model the Pinpad device supports.
• In one model, the Application has complete control of the text that is to be
displayed. For this model, there is an associated OPOS Line Display Control
that is used by the Application to interact with the display.
• In the other model, the Application cannot supply the text to be displayed.
Instead, it can only select from a list of pre-defined messages to be displayed.
For this model, there is a set of Pinpad properties that are used to control the
display.
Device Sharing
The Pinpad is an exclusive-use device, as follows:
Properties
AccountNumber Property R/W
Syntax BSTR AccountNumber;
Remarks The account number to be used for the current EFT transaction. The application
must set this property before calling the BeginEFTTransaction method. Any
attempt to change this property after the BeginEFTTransaction method has been
called will result in a value of OPOS_E_ILLEGAL being stored into ResultCode.
AdditionalSecurityInformation Property
Syntax BSTR AdditionalSecurityInformation;
Remarks The amount of the current EFT transaction. The application must set this property
before calling the BeginEFTTransaction method. Any attempt to change this
property after the BeginEFTTransaction method has been called will result in a
value of OPOS_E_ILLEGAL being stored into ResultCode.
AvailableLanguagesList Property
Syntax BSTR AvailableLanguagesList;
Remarks This property is a comma separated string of the languages supported by the pre-
defined prompts in the Pinpad. Languages are numeric values and are Microsoft
Language Ids. If CapLanguage = PPAD_LANG_NONE, then this property will be
the empty string.
AvailablePromptsList Property
Syntax BSTR AvailablePromptsList;
Remarks This property is a comma-separated string of supported values for the Prompt
property.
Value Meaning
PPAD_MSG_ENTERPIN
The user should enter his pin number on the Pinpad.
PPAD_MSG_PLEASEWAIT
The system is processing. The user should wait.
PPAD_MSG_ENTERVALIDPIN
The pin that was entered is not correct. The user should
enter the correct pin number.
PPAD_MSG_RETRIESEXCEEDED
The user has failed to enter the correct pin number and the
maximum number of attempts has been exceeded.
PPAD_MSG_APPROVED
The request has been approved.
PPAD_MSG_DECLINED
The EFT Transaction Host has declined to perform the
requested function.
PPAD_MSG_CANCELED
The request is canceled.
PPAD_MSG_AMOUNTOK
The customer should enter Yes/No to approve the amount.
PPAD_MSG_NOTREADY
Pinpad is not ready for use by customer.
PPAD_MSG_SLIDE_CARD
The user should slide their card through the integrated
MSR.
PPAD_MSG_INSERTCARD
The customer should insert their (smart)card.
PPAD_MSG_SELECTCARDTYPE
The customer should select the card type (typically credit
or debit).
Values 1000 and above are reserved for OEM defined values.
CapDisplay Property
Syntax LONG CapDisplay;
Remarks Defines the operations that the Application may perform on the Pinpad display.
Value Meaning
PPAD_DISP_UNRESTRICTED
The application can use the Pinpad display in an
unrestricted manner to display messages. In this case, an
associated Line Display Control Object is the interface to
the Pinpad display. The Application must call Line Display
methods to manipulate the display.
PPAD_DISP_PINRESTRICTED
The Application can use the Pinpad display in an
unrestricted manner except during PIN Entry. The Pinpad
will display a pre-defined message during PIN Entry. If an
attempt is made to use the associated Line Display Control
Object while PIN Entry is enabled, the Line Display
Control will return a result of OPOS_E_BUSY.
PPAD_DISP_RESTRICTED_LIST
The Application cannot specify the text of messages to
display. It can only select from a list of pre-defined
messages. There is no associated Line Display Control
Object.
PPAD_DISP_RESTRICTED_ORDER
The application cannot specify the text of messages to
display. It can only select from a list of pre-defined
messages. The selections must occur in a pre-defined
acceptable order. There is no associated Line Display
Control object.
CapLanguage Property
Syntax LONG CapLanguage;
Remarks Defines the capabilities that the application has to select the language of pre-defined
messages (e.g. English, French, Arabic).
Value Meaning
PPAD_LANG_PINRESTRICTED
The Pinpad cannot change prompt languages during PIN
Entry. The application must set the desired value into the
PromptLanguage property before calling
EnablePINEntry. Any attempt to set the value of the
PromptLanguage while PINEntryEnabled is TRUE will
cause the ResultCode property to have a value of
OPOS_E_BUSY.
PPAD_LANG_UNRESTRICTED
The application can change the language of pre-defined
prompt messages at anytime. The currently displayed
message will change immediately.
CapMACCalculation Property
Syntax BOOL CapMACCalculation;
CapKeyboard Property
Syntax BOOL CapKeyboard;
Remarks Defines whether the application can obtain input from the Pinpad keyboard.
If TRUE, the application can use the Pinpad to obtain input. The application will use
an associated POS Keyboard Control object as the interface to the Pinpad keyboard.
Note that the associated POS Keyboard Control is effectively disabled while
PINEntryEnabled is TRUE.
If FALSE, the application cannot obtain input directly from the Pinpad keyboard.
CapTone Property
Syntax BOOL CapTone;
Remarks If TRUE, the Pinpad has a Tone Indicator. The Tone Indicator may be accessed by
use of an associated Tone Indicator Control. If FALSE, there is no Tone Indicator.
EncryptedPIN Property
Syntax BSTR EncryptedPIN;
Remarks This property will contain the value of the Encrypted PIN after a DataEvent event.
This property will be formatted as a 16 byte Hex-ASCII string. If the PIN Entry was
canceled, this property will contain the empty string.
Remarks The application should set this property to the maximum acceptable number of digits
in a PIN. This property must be set by the application before the EnablePINEntry
method is executed This property will be set to a default value by the Open method.
Note that in some implementations, this value cannot be changed by the application
Remarks The Merchant ID, as it is known to the EFT Transaction Host. The application
must set this property before calling the BeginEFTTransaction method. Any
attempt to change this property after the BeginEFTTransaction method has been
called will result in a value of OPOS_E_ILLEGAL being stored into ResultCode.
Remarks The application should set this property to the minimum acceptable number of digits
in a PIN. This property must be set by the application before the EnablePINEntry
method is executed. This property will be set to a default value by the Open
method. Note that in some implementations, this value cannot be changed by the
application.
PINEntryEnabled Property
Syntax BOOL PINEntryEnabled;
Remarks The Pinpad Control object sets this property to TRUE when an EnablePINEntry
method is executed. It will be set to FALSE when the user has completed the PIN
Entry operation or an EndEFTTransaction is executed.
Remarks This property identifies a pre-defined message to be displayed on the Pinpad. This
property is used if CapDisplay has a value of PPAD_DISP_RESTRICTED_LIST or
PPAD_DISP_RESTRICTED_ORDER. It is also used during PIN Entry if
CapDisplay has a value of PPAD_DISP_PINRESTRICTED. The
AvailablePromptsList property lists the values for this property that the Service
Object will accept.
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
Remarks This property specifies the language of the message to be displayed (as specified by
the Prompt property). This property is used if the Prompt property is being used.
The exact effect of changing this property depends on the value of the
CapLanguage property.
The values for this property are MS Windows Language IDs. The property is
initialized to a default value by the Open method.
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
Remarks The terminal ID, as it is known to the EFT Transaction Host. The application must
set this property before calling the BeginEFTTransaction method. Any attempt to
change this property after the BeginEFTTransaction method has been called will
result in a value of OPOS_E_ILLEGAL being stored into ResultCode.
Remarks Contains either the track 1 data from the previous card swipe or an empty string.
An empty string indicates that the track was not physically read. The application
must set this property before calling the BeginEFTTransaction method Any attempt
to change this property after the BeginEFTTransaction method has been called will
result in a value of OPOS_E_ILLEGAL being stored into ResultCode.
Remarks Contains either the track 2 data from the previous card swipe or an empty string.
An empty string indicates that the track was not physically read. The application
must set this property before calling the BeginEFTTransaction method Any attempt
to change this property after the BeginEFTTransaction method has been called will
result in a value of OPOS_E_ILLEGAL being stored into ResultCode.
Remarks Contains either the track 3 data from the previous card swipe or an empty string.
An empty string indicates that the track was not physically read. The application
must set this property before calling the BeginEFTTransaction method Any attempt
to change this property after the BeginEFTTransaction method has been called will
result in a value of OPOS_E_ILLEGAL being stored into ResultCode.
Remarks The type of the current EFT transaction. The application must set this property
before calling the BeginEFTTransaction method. Any attempt to change this
property after the BeginEFTTransaction method has been called will result in a
value of OPOS_E_ILLEGAL being stored into ResultCode.
Value Meaning
PPAD_TRANS_DEBIT
Debit (decrease) the specified account
PPAD_TRANS_CREDIT
Credit (increase) the specified account.
PPAD_TRANS_RECONCILE
Reconciliation/Settlement
PPAD_TRANS_ADMIN
Administrative Transaction
Methods
BeginEFTTransaction Method
Syntax LONG BeginEFTTransaction (BSTR PINPadSystem,
LONG TransactionHost);
Parameter Description
Value Meaning
“HGEPOS” (Italian)
Remarks This method must be called by the application to inform the Pinpad Control of the
beginning of an EFT Transaction. The Pinpad Control will perform initialization
functions (such as computing session keys). No other Pinpad functions can be
performed until this method is called.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
ComputeMAC Method
Syntax LONG ComputeMAC (BSTR InMsg, BSTR* pOutMsg);
Parameter Description
Remarks This method is called by the application to have the Pinpad compute a MAC value
and append it to the designated message. Depending on the selected Pinpad
Management System, the Pinpad may also insert other fields into the message. Note
that the ComputeMAC method cannot be used while Pinpad input (PIN Entry) is
enabled.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
EnablePINEntry Method
Syntax LONG EnablePINEntry ();
Remarks This method is called by the application to enable PIN Entry at the Pinpad device.
When this method is called, the PINEntryEnabled property will be changed to
TRUE. If the Pinpad uses pre-defined prompts for PIN Entry, then the value of the
Prompt property will be changed to PPAD_MSG_ENTERPIN.
When the user has completed the PIN entry operation (either by entering their PIN
or by hitting Cancel), the PINEntryEnabled property will be changed to FALSE. A
DataEvent event will be fired to provide the encrypted PIN to the application when
DataEventEnabled is set to TRUE. Note that any data entered at the Pinpad while
PINEntryEnabled is TRUE will be supplied in encrypted form to this Control Object
and will NOT be provided to any associated Keyboard Control Object.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
EndEFTTransaction Method
Syntax LONG EndEFTTransaction (LONG CompletionCode);
Value Meaning
PPAD_EFT_ABNORMAL
The proper sequence of messages was not transmitted &
received.
Remarks This method must be called by the application to inform the Pinpad Control of the
end of an EFT Transaction. The Pinpad Control will perform termination functions
(such as computing next transaction keys).
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
UpdateKey Method
Syntax LONG UpdateKey (LONG KeyNum, BSTR Key);
Parameter Description
Remarks This method is used to provide a new encryption key to the Pinpad. It is used only
for those Pinpad Management Systems in which new key values are sent to the
terminal as a field in standard messages from the EFT Transaction Host.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
VerifyMAC Method
Syntax BOOL VerifyMAC (BSTR Message);
Remarks This method is called by the application to have the Pinpad verify the MAC value in a
message received from an EFT Transaction Host. This method returns TRUE if it
can verify the message; otherwise, it returns FALSE. Note that the VerifyMAC
method cannot be used while PIN Entry is enabled.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
Events
DataEvent Event
Syntax void DataEvent (LONG Status);
Value Meaning
PPAD_SUCCESS PIN Entry has occurred and values have been stored into
the EncryptedPIN and AdditionalSecurityInformation
properties.
ErrorEvent Event
Syntax void ErrorEvent (LONG ResultCode, LONG ResultCodeExtended,
LONG ErrorLocus, LONG* pErrorResponse);
Parameter Description
ResultCode Result code causing the error event. See values below.
ResultCodeExtended Extended result code causing the error event. See values
below.
Value Meaning
Value Meaning
The contents at the location pointed to by the pErrorResponse parameter are preset
to a default value, based on the ErrorLocus:
Value Meaning
OPOS_ER_CLEAR Clear the buffered input data. The error state is exited.
Default when locus is OPOS_EL_INPUT.
Remarks Fired when an error is detected while trying to perform a PIN encryption function.
The Pinpad service object may optionally provide more detailed diagnostic
information via a CheckHealth or DirectIO mechanism.
POS Keyboard
Summary
Properties
Common Type Access Initialized After
AutoDisable 1.2 Boolean R/W Open
BinaryConversion 1.2 Long R/W Open
CapPowerReporting 1.3 Long R Open
CheckHealthText 1.1 String R Open
Claimed 1.1 Boolean R Open
DataCount 1.2 Long R Open
DataEventEnabled 1.1 Boolean R/W Open
DeviceEnabled 1.1 Boolean R/W Open & Claim
FreezeEvents 1.1 Boolean R/W Open
OutputID 1.1 Long R Not Supported
PowerNotify 1.3 Long R/W Open
PowerState 1.3 Long R Open
ResultCode 1.1 Long R --
ResultCodeExtended 1.1 Long R Open
State 1.1 Long R --
Methods
Common May Use After
Open 1.1 --
Close 1.1 Open
Claim 1.1 Open
Release 1.1 Open & Claim
CheckHealth 1.1 Open, Claim, & Enable
ClearInput 1.1 Open & Claim
ClearOutput 1.1 Not Supported
DirectIO 1.1 Open
Events
Name May Occur After
DataEvent 1.1 Open, Claim, & Enable
DirectIOEvent 1.1 Open, Claim
ErrorEvent 1.1 Open, Claim, & Enable
OutputCompleteEvent 1.1 Not Supported
StatusUpdateEvent 1.3 Open, Claim, & Enable
General Information
The POS Keyboard Control’s OLE programmatic ID is “OPOS.POSKeyboard”.
This device was added in OPOS Release 1.1.
Capabilities
The POS Keyboard Control has the following capability:
6
OPOS 1.1 defined a POS Keyboard as a secondary key entry device, separate from the primary
keyboard. OPOS 1.2 expanded this definition.
Model
The POS Keyboard Control follows the general “Input Model” for event-driven
input:
Keyboard Translation
The POS Keyboard Control must supply a method for translating its internal key
codes into user-defined codes which are returned by the data events. Note that this
translation must be end-user configurable.
Device Sharing
The POS keyboard is an exclusive-use device, as follows:
Properties
CapKeyUp Property Added in Release 1.2
Syntax LONG CapKeyUp;
Remarks If TRUE, then the Control is able to generate both key down and key up events,
depending upon the setting of the EventTypes.
If FALSE, then the Control is only able to generate the key down event.
Remarks Select the type of events that the application wants to receive.
Values are:
Value Meaning
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
POSKeyData Property
Syntax LONG POSKeyData;
The Application may treat this value as device independent, assuming that the
system installer has configured the POSKeyboard Service Object to translate internal
key codes to the codes expected by the Application. Such configuration is inherently
Service Object-specific.
Release 1.1: POSKeyData was defined as a logical key code in the upper 16
bits and a scan code in the lower 16 bits, where the values need not match a
standard PC keyboard's values.
Release 1.2 and later: Added the requirement for an end-user configurable
translation into arbitrary keycodes.
This property is set by the Control just before delivering the DataEvent.
Remarks This property holds the type of the last keyboard event: Is the key being pressed or
released?
Values are:
Value Meaning
KBD_KET_KEYDOWN
The key in POSKeyData was pressed.
This property is set by the Control just before delivering the DataEvent.
Events
DataEvent Event
Syntax void DataEvent (LONG Status);
Remarks Fired to present input data from the device to the application. The logical key
number is placed in the POSKeyData property and the event type is placed in the
POSKeyEventType property before this event is delivered.
ErrorEvent Event
Syntax void ErrorEvent (LONG ResultCode, LONG ResultCodeExtended,
LONG ErrorLocus, LONG* pErrorResponse);
Parameter Description
ResultCode Result code causing the error event. See ResultCode for
values.
Value Meaning
Value Meaning
OPOS_ER_CLEAR Clear the buffered input data. The error state is exited.
Default when locus is OPOS_EL_INPUT.
OPOS_ER_CONTINUEINPUT
Use only when locus is OPOS_EL_INPUT_DATA.
Acknowledges the error and directs the Control to continue
processing. The Control remains in the error state and will
deliver additional DataEvents as directed by the
DataEventEnabled property. When all input has been
delivered and the DataEventEnabled property is again set
to TRUE, then another ErrorEvent is delivered with locus
OPOS_EL_INPUT.
Default when locus is OPOS_EL_INPUT_DATA.
Remarks Fired when an error is detected while trying to read POS Keyboard data.
Input error events are not delivered until the DataEventEnabled property is TRUE,
so that proper application sequencing occurs.
POS Printer
Summary
Properties
Common Type Access Initialized After
AutoDisable 1.2 Boolean R/W Not Supported
BinaryConversion 1.2 Long R/W Open
CapPowerReporting 1.3 Long R Open
CheckHealthText 1.0 String R Open
Claimed 1.0 Boolean R Open
DataCount 1.2 Long R Not Supported
DataEventEnabled 1.0 Boolean R/W Not Supported
DeviceEnabled 1.0 Boolean R/W Open & Claim
FreezeEvents 1.0 Boolean R/W Open
OutputID 1.0 Long R Open
PowerNotify 1.3 Long R/W Open
PowerState 1.3 Long R Open
ResultCode 1.0 Long R --
ResultCodeExtended 1.0 Long R Open
State 1.0 Long R --
Methods
Common May Use After
Open 1.0 --
Close 1.0 Open
Claim 1.0 Open
Release 1.0 Open & Claim
CheckHealth 1.0 Open, Claim, & Enable
ClearInput 1.0 Not Supported
ClearOutput 1.0 Open & Claim
DirectIO 1.0 Open
Specific
PrintNormal 1.0 Open, Claim, & Enable
PrintTwoNormal 1.0 Open, Claim, & Enable
PrintImmediate 1.0 Open, Claim, & Enable
Events
Name May Occur After
DataEvent 1.0 Not Supported
DirectIOEvent 1.0 Open, Claim
ErrorEvent 1.0 Open, Claim, & Enable
OutputCompleteEvent 1.0 Open, Claim, & Enable
StatusUpdateEvent 1.0 Open, Claim, & Enable
General Information
The POS Printer Control’s OLE programmatic ID is “OPOS.POSPrinter”.
The printer OLE Control does not attempt to encapsulate the generic Windows
graphics printer. Rather, for performance and ease of use considerations, the
interfaces are defined to directly control a printer. Usually, an application will print
one line to one station per method, for ease of use and accuracy in recovering from
errors.
The printer model defines three stations with the following general uses:
• Journal Used for simple text to log transaction and activity information. Kept
by the store for audit and other purposes.
• Receipt Used to print transaction information. Usually given to the customer.
Also often used for store reports. Contains either a knife to cut the paper
between transactions, or a tear bar to manually cut the paper.
• Slip Used to print information on a form. Usually given to the customer.
Also used to print “validation” information on a form. The form type is typically
a check or credit card slip.
Sometimes, limited forms-handling capability is integrated with the receipt or
journal station to permit validation printing. Often this limits the number of print
lines, due to the station’s forms-handling throat depth. The Printer Control
nevertheless addresses this printer functionality as a slip station.
Capabilities
The POS printer has the following capability:
• The default character set can print the ASCII characters 0x20 through 0x7F,
which includes space, digits, uppercase, lowercase, and some special
characters. (If the printer does not support all of these, then it should translate
them to close approximations – such as lowercase to uppercase.)
The POS printer may have several additional capabilities. See the capabilities
properties for specific information.
The following capabilities are not addressed in this version of the OPOS
specification. A Service Object may choose to support them through the DirectIO
mechanism.
Model
The POS Printer follows the general output model, with some enhancements:
• Printer out-of-paper and cover open conditions are reported by setting the
ResultCode to OPOS_E_EXTENDED and then setting ResultCodeExtended
to one of the following error conditions:
OPOS_EPTR_JRN_EMPTY,
OPOS_EPTR_REC_EMPTY,
OPOS_EPTR_SLP_EMPTY, or
OPOS_EPTR_COVER_OPEN.
• Other printer errors are reported by setting the ResultCode to
OPOS_E_FAILURE or another standard error status. These failures are
typically due to a printer fault or jam, or to a more serious error.
Device Sharing
The POS Printer is an exclusive-use device, as follows:
Every escape sequence begins with the escape character ESC, whose value is 27
decimal, followed by a vertical bar (‘|’). This is followed by zero or more digits
and/or lowercase alphabetic characters. The escape sequence is terminated by an
uppercase alphabetic character. Sequences that do not begin with ESC “|” are
passed through to the printer. Also, sequences that begin with ESC “|” but which
are not valid OPOS escape sequences are passed through to the printer.
Print Line Characteristics that are reset at the end of each print method or by a
“Normal” sequence.
Properties
AsyncMode Property R/W
Syntax BOOL AsyncMode;
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
Remarks Holds the default character set capability. It may be one of the following:
Value Meaning
PTR_CCS_KANA The default character set supports partial code page 932,
including ASCII characters 20-hex through 7F-hex and the
Japanese Kana characters A1-hex through DF-hex, but
excluding the Japanese Kanji characters.
The default character set may contain a superset of these ranges. The initial
CharacterSet property may be examined for additional information.
CapConcurrentJrnRec Property
Syntax BOOL CapConcurrentJrnRec;
Remarks If TRUE, then the Journal and Receipt stations can print at the same time. The
PrintTwoNormal method may be used with the PTR_TWO_RECEIPT_JOURNAL
and PTR_S_JOURNAL_RECEIPT station parameters.
If FALSE, the application should print to only one of the stations at a time, and
minimize transitions between the stations. Non-concurrent printing may be required
for reasons such as:
• Higher likelihood of error, such as greater chance of paper jams when moving
between the stations.
CapConcurrentJrnSlp Property
Syntax BOOL CapConcurrentJrnSlp;
Remarks If TRUE, then the Journal and Slip stations can print at the same time. The
PrintTwoNormal method may be used with the PTR_TWO_SLIP_JOURNAL and
PTR_S_JOURNAL_SLIP station parameters.
• Physical constraints, such as the Slip form being placed in front of the Journal
station.
• Higher likelihood of error, such as greater chance of paper jams when moving
between the stations.
CapConcurrentRecSlp Property
Syntax BOOL CapConcurrentRecSlp;
Remarks If TRUE, then the Receipt and Slip stations can print at the same time. The
PrintTwoNormal method may be used with the PTR_TWO_SLIP_RECEIPT and
PTR_S_RECEIPT_SLIP station parameters.
• Physical constraints, such as the Slip form being placed in front of the Receipt
station.
• Higher likelihood of error, such as greater chance of paper jams when moving
between the stations.
CapCoverSensor Property
Syntax BOOL CapCoverSensor;
CapJrn2Color Property
Syntax BOOL CapJrn2Color;
Remarks If TRUE, then the journal can print dark plus an alternate color;
otherwise it is FALSE.
CapJrnBold Property
Syntax BOOL CapJrnBold;
CapJrnDhigh Property
Syntax BOOL CapJrnDhigh;
Remarks If TRUE, then the journal can print double high characters;
otherwise it is FALSE.
CapJrnDwide Property
Syntax BOOL CapJrnDwide;
Remarks If TRUE, then the journal can print double wide characters;
otherwise it is FALSE.
CapJrnDwideDhigh Property
Syntax BOOL CapJrnDwideDhigh;
Remarks If TRUE, then the journal can print double high / double wide characters;
otherwise it is FALSE.
CapJrnEmptySensor Property
Syntax BOOL CapJrnEmptySensor;
CapJrnItalic Property
Syntax BOOL CapJrnItalic;
CapJrnNearEndSensor Property
Syntax BOOL CapJrnNearEndSensor;
CapJrnPresent Property
Syntax BOOL CapJrnPresent;
CapJrnUnderline Property
Syntax BOOL CapJrnUnderline;
CapRec2Color Property
Syntax BOOL CapRec2Color;
Remarks If TRUE, then the receipt can print dark plus an alternate color;
otherwise it is FALSE.
CapRecBarCode Property
Syntax BOOL CapRecBarCode;
Remarks If TRUE, then the receipt has bar code printing capability;
otherwise it is FALSE.
CapRecBitmap Property
Syntax BOOL CapRecBitmap;
CapRecBold Property
Syntax BOOL CapRecBold;
CapRecDhigh Property
Syntax BOOL CapRecDhigh;
Remarks If TRUE, then the receipt can print double high characters;
otherwise it is FALSE.
CapRecDwide Property
Syntax BOOL CapRecDwide;
Remarks If TRUE, then the receipt can print double wide characters;
otherwise it is FALSE.
CapRecDwideDhigh Property
Syntax BOOL CapRecDwideDhigh;
Remarks If TRUE, then the receipt can print double high / double wide characters;
otherwise it is FALSE.
CapRecEmptySensor Property
Syntax BOOL CapRecEmptySensor;
CapRecItalic Property
Syntax BOOL CapRecItalic;
CapRecLeft90 Property
Syntax BOOL CapRecLeft90;
Remarks If TRUE, then the receipt can print in rotated 90°left mode;
otherwise it is FALSE.
CapRecNearEndSensor Property
Syntax BOOL CapRecNearEndSensor;
CapRecPapercut Property
Syntax BOOL CapRecPapercut;
CapRecPresent Property
Syntax BOOL CapRecPresent;
CapRecRight90 Property
Syntax BOOL CapRecRight90;
Remarks If TRUE, then the receipt can print in a rotated 90°right mode;
otherwise it is FALSE.
CapRecRotate180 Property
Syntax BOOL CapRecRotate180;
Remarks If TRUE, then the receipt can print in a rotated upside down mode;
otherwise it is FALSE.
CapRecStamp Property
Syntax BOOL CapRecStamp;
CapRecUnderline Property
Syntax BOOL CapRecUnderline;
CapSlp2Color Property
Syntax BOOL CapSlp2Color;
Remarks If TRUE, then the slip can print dark plus an alternate color;
otherwise it is FALSE.
CapSlpBarCode Property
Syntax BOOL CapSlpBarCode;
Remarks If TRUE, then the slip has bar code printing capability;
otherwise it is FALSE.
CapSlpBitmap Property
Syntax BOOL CapSlpBitmap;
CapSlpBold Property
Syntax BOOL CapSlpBold;
CapSlpDhigh Property
Syntax BOOL CapSlpDhigh;
Remarks If TRUE, then the slip can print double high characters;
otherwise it is FALSE.
CapSlpDwide Property
Syntax BOOL CapSlpDwide;
Remarks If TRUE, then the slip can print double wide characters;
otherwise it is FALSE.
CapSlpDwideDhigh Property
Syntax BOOL CapSlpDwideDhigh;
Remarks If TRUE, then the slip can print double high / double wide characters;
otherwise it is FALSE.
CapSlpEmptySensor Property
Syntax BOOL CapSlpEmptySensor;
CapSlpFullslip Property
Syntax BOOL CapSlpFullslip;
Remarks If TRUE, then the slip is a full slip station. It can print full-length forms..
If FALSE, then the slip is a “validation” type station. This usually limits the number
of print lines, and disables access to the receipt and/or journal stations while the
validation slip is being used.
CapSlpItalic Property
Syntax BOOL CapSlpItalic;
CapSlpLeft90 Property
Syntax BOOL CapSlpLeft90;
Remarks If TRUE, then the slip can print in a rotated 90°left mode;
otherwise it is FALSE.
CapSlpNearEndSensor Property
Syntax BOOL CapSlpNearEndSensor;
Remarks If TRUE, then the slip has a “slip near end” sensor;
otherwise it is FALSE.
CapSlpPresent Property
Syntax BOOL CapSlpPresent;
CapSlpRight90 Property
Syntax BOOL CapSlpRight90;
Remarks If TRUE, then the slip can print in a rotated 90°right mode;
otherwise it is FALSE.
CapSlpRotate180 Property
Syntax BOOL CapSlpRotate180;
Remarks If TRUE, then the slip can print in a rotated upside down mode;
otherwise it is FALSE.
CapSlpUnderline Property
Syntax BOOL CapSlpUnderline;
This property is initialized when the device is first enabled following the Open
method.
Values are:
Value Meaning
Range 101 - 199 Device-specific character sets that do not match a code
page or the ASCII or Windows ANSI character sets.
Range 400 - 990 Code page; matches one of the standard values.
Range 1000 and higher Windows code page; matches one of the standard values.
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
CharacterSetList Property
Syntax BSTR CharacterSetList;
This property is initialized by the Open method. The string consists of ASCII
numeric set numbers separated by commas.
For example, if the string is “101,850,999”, then the device supports a device-
specific character set, code page 850, and the Windows ANSI character set.
CoverOpen Property
Syntax BOOL CoverOpen;
If the CapCoverSensor property is FALSE, then the printer does not have a cover
open sensor, and this property always returns FALSE.
This property is initialized and kept current while the device is enabled.
Values are:
Value Meaning
This property is set by the Control just before delivering an ErrorEvent. When the
error is cleared, then the property is changed to PTR_EL_NONE.
ErrorStation Property
Syntax LONG ErrorStation;
Remarks Holds the station or stations that were printing when an error was detected.
Remarks If TRUE, the Control will fire a StatusUpdateEvent if it is in the idle state.
If FALSE, this event will not be fired.
The main use of idle status event that is controlled by this property is to give the
application control when all outstanding asynchronous outputs have been processed.
The event will be fired if the outputs were completed successfully or if they were
cleared by the ClearOutput method or by an ErrorEvent handler.
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
Remarks A string that specifies the fonts and/or typefaces that are supported by the printer.
This property is initialized by the Open method. The string consists of font or
typeface names separated by commas. The application selects a font or typeface
for a printer station by using the font typeface selection escape sequence
(ESC |#fT). The “#” character is replaced by the number of the font or typeface
within the list: 1, 2, and so on.
In Japan, this property will frequently include the fonts “Mincho” and “Gothic”.
Other fonts or typefaces may be commonly supported in other countries.
JrnEmpty Property
Syntax BOOL JrnEmpty;
This property is initialized and kept current while the device is enabled.
This property advises the Service Object that either high quality or high speed
printing is desired. For example, printers with bi-directional print capability may be
placed in unidirectional mode for high quality, so that column alignment is more
precise.
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
If changed to a line character width that can be supported, then the width is set to
the specified value. If the exact width cannot be supported, then subsequent lines
will be printed with a character size that most closely supports the specified
characters per line. (For example, if set to 36 and the printer can print either 30 or
40 characters per line, then the Service Object should select the character size “40”
and print up to 36 characters on each line.)
If the character width cannot be supported, then an error is returned. (For example,
if set to 42 and the printer can print either 30 or 40 characters per line, then the
Service Object cannot support the request.)
The value of JrnLineChars is initialized to the printer’s default line character width
when the device is first enabled following the Open method.
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
JrnLineCharsList Property
Syntax BSTR JrnLineCharsList;
Remarks A string containing the line character widths supported by the journal station.
This property is initialized by the Open method. The string consists of ASCII
numeric set numbers separated by commas.
For example, if the string is “32,36,40”, then the station supports line widths of 32,
36, and 40 characters.
Remarks The journal print line height. Expressed in the unit of measure given by MapMode.
If changed to a height that can be supported with the current character width, then
the line height is set to this value. If the exact height cannot be supported, then the
height is set to the closest supported value.
The value of JrnLineHeight is initialized to the printer’s default line height when the
device is first enabled following the Open method.
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
Remarks The spacing of each single-high print line, including both the printed line height plus
the whitespace between each pair of lines. Depending upon the printer and the
current line spacing, a multi-high print line might exceed this value. Line spacing is
expressed in the unit of measure given by MapMode.
If changed to a spacing that can be supported by the printer, then the line spacing is
set to this value. If the spacing cannot be supported, then the spacing is set to the
closest supported value.
The value of JrnLineSpacing is initialized to the printer’s default line spacing when
the device is first enabled following the Open method.
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
JrnLineWidth Property
Syntax LONG JrnLineWidth;
Remarks The width of a line of JrnLineChars characters. Expressed in the unit of measure
given by MapMode.
The value of JrnLineWidth is initialized to the printer’s default line width when the
device is first enabled following the Open method.
JrnNearEnd Property
Syntax BOOL JrnNearEnd;
This property is initialized and kept current while the device is enabled.
Remarks Contains the mapping mode of the printer. The mapping mode defines the unit of
measure used for other properties, such as line heights and line spacings.
Value Meaning
PTR_MM_DOTS The printer’s dot width. This width may be different for
each printer station.7
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
7
From the OPOS POS Printer perspective, the exact definition of a “dot” is not significant. It is
a Printer/Service Object unit used to express various metrics. For example, some printers define
a “half-dot” that is used in high-density graphics printing, and perhaps in text printing. An
OPOS POS Printer Service Object may handle this case in one of these ways:
(a) Consistently define a “dot” as the printer’s smallest physical size, that is, a half-dot.
(b) If the Service Object changes bitmap graphics printing density based on the
XxxLetterQuality setting, then alter the size of a dot to match the bitmap density (that is,
a physical printer dot when FALSE and a half-dot when TRUE). Note that this choice
should not be used if the printer’s text metrics are based on half-dot sizes, since accurate
values for the metrics may not then be possible.
Remarks A string that specifies the directions in which a receipt barcode may be rotated.
This property is initialized by the Open method. The string consists of rotation
strings separated by commas. An empty string indicates that bar code printing is
not supported. The legal rotation strings are:
Value Meaning
For example, if the string is “0,180”, then the printer can print normal bar codes and
upside down bar codes.
RecEmpty Property
Syntax BOOL RecEmpty;
This property is initialized and kept current while the device is enabled.
This property advises the Service Object that either high quality or high speed
printing is desired.
For example:
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
If changed to a line character width that can be supported, then the width is set to
the specified value. If the exact width cannot be supported, then subsequent lines
will be printed with a character size that most closely supports the specified
characters per line. (For example, if set to 36 and the printer can print either 30 or
40 characters per line, then the Service Object should select the character size “40”
and print up to 36 characters on each line.)
If the character width cannot be supported, then an error is returned. (For example,
if set to 42 and the printer can print either 30 or 40 characters per line, then the
Service Object cannot support the request.)
The value of RecLineChars is initialized to the printer’s default line character width
when the device is first enabled following the Open method.
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
RecLineCharsList Property
Syntax BSTR RecLineCharsList;
Remarks A string containing the line character widths supported by the receipt station.
This property is initialized by the Open method. The string consists of ASCII
numeric set numbers, separated by commas.
For example, if the string is “32,36,40”, then the station supports line widths of 32,
36, and 40 characters.
Remarks The receipt print line height. Expressed in the unit of measure given by MapMode.
If changed to a height that can be supported with the current character width, then
the line height is set to this value. If the exact height cannot be supported, then the
height is set to the closest supported value.
The value of RecLineHeight is initialized to the printer’s default line height when
the device is first enabled following the Open method.
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
Remarks The spacing of each single-high print line, including both the printed line height plus
the whitespace between each pair of lines. Depending upon the printer and the
current line spacing, a multi-high print line might exceed this value. Line spacing is
expressed in the unit of measure given by MapMode.
If changed to a spacing that can be supported by the printer, then the line spacing is
set to this value. If the spacing cannot be supported, then the spacing is set to the
closest supported value.
The value of RecLineSpacing is initialized to the printer’s default line spacing when
the device is first enabled following the Open method.
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
RecLinesToPaperCut Property
Syntax LONG RecLinesToPaperCut;
Remarks Holds the number of lines that must be advanced before the receipt paper is cut.
If the capability CapRecPapercut is TRUE, then this is the line count before
reaching the paper cut mechanism. Otherwise, this is the line count before the
manual tear-off bar.
This property is initialized when the device is first enabled following the Open
method.
RecLineWidth Property
Syntax LONG RecLineChars;
Remarks The width of a line of RecLineChars characters. Expressed in the unit of measure
given by MapMode.
The value of RecLineWidth is initialized to the printer’s default line width when the
device is first enabled following the Open method.
RecNearEnd Property
Syntax BOOL RecNearEnd;
This property is initialized and kept current while the device is enabled.
RecSidewaysMaxChars Property
Syntax LONG RecSidewaysMaxChars;
Remarks Holds the maximum number of characters that may be printed on each line in
sideways mode.
This property is initialized when the device is first enabled following the Open
method.
RecSidewaysMaxLines Property
Syntax LONG RecSidewaysMaxLines;
Remarks Holds the maximum number of lines that may be printed in sideways mode.
This property is initialized when the device is first enabled following the Open
method.
Values are:
Value Meaning
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
Remarks A string that specifies the directions in which a slip barcode may be rotated.
This property is initialized by the Open method. The string consists of rotation
strings separated by commas. An empty string indicates that bar code printing is
not supported. The legal rotation strings are:
Value Meaning
For example, if the string is “0,180”, then the printer can print normal bar codes and
upside down bar codes.
SlpEmpty Property
Syntax BOOL SlpEmpty;
This property is initialized and kept current while the device is enabled.
Note
The “slip empty” sensor should be used primarily to determine whether a form has been
inserted before printing, and can be monitored to determine whether a form is still in place.
This sensor is usually placed one or more print lines above the slip print head.
However, the “slip near end” sensor (when present) should be used to determine when
nearing the end of the slip. This sensor is usually placed one or more print lines below the
slip print head.
This property advises the Service Object that either high quality or high speed
printing is desired.
For example:
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
If changed to a line character width that can be supported, then the width is set to
the specified value. If the exact width cannot be supported, then subsequent lines
will be printed with a character size that most closely supports the specified
characters per line. (The Service Object should print the requested characters in the
column positions closest to the side of the slip table at which the slip is aligned. For
example, if the operator inserts the slip with the right edge against the table side, and
if SlpLineChars is set to 36 and the printer prints 60 characters per line, then the
Service Object should add 24 spaces at the left margin, and print the characters in
columns 25 through 60.)
If the character width cannot be supported, then an error is returned. (For example,
if set to 65 and the printer can print 60 characters per line, then the Service Object
cannot support the request.)
The value of SlpLineChars is initialized to the printer’s default line character width
when the device is first enabled following the Open method.
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
SlpLineCharsList Property
Syntax BSTR SlpLineCharsList;
Remarks A string containing the line character widths supported by the slip station.
This property is initialized by the Open method. The string consists of ASCII
numeric set numbers, separated by commas.
For example, if the string is “32,36,40”, then the station supports line widths of 32,
36, and 40 characters.
Remarks The slip print-line height. Expressed in the unit of measure given by MapMode.
If changed to a height that can be supported with the current character width, then
the line height is set to this value. If the exact height cannot be supported, then the
height is set to the closest supported value.
The value of SlpLineHeight is initialized to the printer’s default line height when the
device is first enabled following the Open method.
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
SlpLinesNearEndToEnd Property
Syntax LONG SlpLinesNearEndToEnd;
Remarks Holds the number of lines that may be printed after the “slip near end” sensor is
TRUE but before the printer reaches the end of the slip.
This property may be used to optimize the use of the slip, so that the maximum
number of lines may be printed.
This property is initialized when the device is first enabled following the Open
method.
Remarks The spacing of each single-high print line, including both the printed line height plus
the whitespace between each pair of lines. Depending upon the printer and the
current line spacing, a multi-high print line might exceed this value. Line spacing is
expressed in the unit of measure given by MapMode.
If changed to a spacing that can be supported by the printer, then the line spacing is
set to this value. If the spacing cannot be supported, then the spacing is set to the
closest supported value.
The value of SlpLineSpacing is initialized to the printer’s default line spacing when
the device is first enabled following the Open method. Also, when SlpLineChars
or SlpLineHeight are changed, SlpLineSpacing is updated to the default line
spacing for the selected width or height.
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
SlpLineWidth Property
Syntax LONG SlpLineWidth;
Remarks The width of a line of SlpLineChars characters. Expressed in the unit of measure
given by MapMode.
The value of SlpLineWidth is initialized to the printer’s default line width when the
device is first enabled following the Open method.
SlpMaxLines Property
Syntax LONG SlpMaxLines;
Remarks Holds the maximum number of lines that can be printed on a form.
When the capability CapSlpFullslip is TRUE, then this value will be zero, indicating
an unlimited maximum slip length.
The value of SlpMaxLines is initialized when the device is first enabled following
the Open method.
SlpNearEnd Property
Syntax BOOL SlpNearEnd;
The “near end” sensor is also sometimes called the “trailing edge” sensor, referring
to the bottom edge of the slip.
This property is initialized and kept current while the device is enabled.
Note
The “slip empty” sensor should be used primarily to determine whether a form has been
inserted before printing, and can be monitored to determine whether a form is still in place.
This sensor is usually placed one or more print lines above the slip print head.
However, the “slip near end” sensor (when present) should be used to determine when
nearing the end of the slip. This sensor is usually placed one or more print lines below the
slip print head.
SlpSidewaysMaxChars Property
Syntax LONG SlpSidewaysMaxChars;
Remarks Holds the maximum number of characters that may be printed on each line in
sideways mode.
This property is initialized when the device is first enabled following the Open
method.
SlpSidewaysMaxLines Property
Syntax LONG SlpSidewaysMaxLines;
Remarks Holds the maximum number of lines that may be printed in sideways mode.
This property is initialized when the device is first enabled following the Open
method.
Methods
BeginInsertion Method
Syntax LONG BeginInsertion (LONG Timeout);
The Timeout parameter gives the number of milliseconds before failing the method.
If zero, the method tries to begin insertion mode, then returns the appropriate status
immediately.
If OPOS_FOREVER (-1), the method tries to begin insertion mode, then waits as
long as needed until either the form is inserted or an error occurs.
When called, the slip station is made ready to receive a form by opening the form’s
handling “jaws” or activating a form insertion mode. This method is paired with the
EndInsertion method for controlling form insertion.
If the printer device cannot be placed into insertion mode, an error is returned to the
application. Otherwise, the Control continues to monitor form insertion until either:
• The form is not inserted before Timeout milliseconds have elapsed, or an error
is reported by the printer device. In this case, the Control either returns
OPOS_E_TIMEOUT or another error. The printer device remains in form
insertion mode. This allows an application to perform some user interaction and
reissue the BeginInsertion method without altering the form handling
mechanism.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_ILLEGAL The slip station does not exist (see the CapSlpPresent
property) or an invalid Timeout parameter was specified..
OPOS_E_TIMEOUT The specified time has elapsed without the form being
properly inserted.
BeginRemoval Method
Syntax LONG BeginRemoval (LONG Timeout);
The Timeout property gives the number of milliseconds before failing the method.
If zero, the method tries to begin removal mode, then returns the appropriate status
immediately.
If OPOS_FOREVER (-1), the method tries to begin removal mode, then waits as
long as needed until either the form is removed or an error occurs.
When called, the printer is made ready to remove a form by opening the form
handling “jaws” or activating a form ejection mode. This method is paired with the
EndRemoval method for controlling form removal.
If the printer device cannot be placed into removal or ejection mode, an error is
returned to the application. Otherwise, the Control continues to monitor form
removal until either:
• The form is not removed before Timeout milliseconds have elapsed, or an error
is reported by the printer device. In this case, the Control either returns
OPOS_E_TIMEOUT or another error. The printer device remains in form
removal mode. This allows an application to perform some user interaction and
reissue the BeginRemoval method without altering the form handling
mechanism.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_ILLEGAL The printer does not have a slip station (see the
CapSlpPresent property) or an invalid Timeout parameter
was specified..
OPOS_E_TIMEOUT The specified time has elapsed without the form being
properly removed.
CutPaper Method
Syntax LONG CutPaper (LONG Percentage);
The Percentage parameter indicates the percentage of paper to cut. The constant
identifier PTR_CP_FULLCUT or the value 100 causes a full paper cut. Other values
request a partial cut percentage.
Many printers with paper cut capability can perform both full and partial cuts.
Some offer gradations of partial cuts, such as a perforated cut and an almost-full
cut. Although the exact type of cut will vary by printer capabilities, the following
general guide may be used:
Value Meaning
The Service Object will select an appropriate type of cut based on the capabilities of
its device and these general guidelines.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
ResultCodeExtended = OPOS_EPTR_REC_EMPTY:
The receipt station is out of paper.
(Can only be returned if AsyncMode is FALSE.)
EndInsertion Method
Syntax LONG EndInsertion ();
When called, the printer is taken out of form insertion mode. If the slip device has
forms “jaws,” they are closed by this method. If a form is detected in the device, a
successful status of OPOS_SUCCESS is returned to the application. If no form is
present, an extended error status OPOS_EPTR_SLP_EMPTY is returned.
This method is paired with the BeginInsertion method for controlling form
insertion. The application may choose to call this method immediately after a
successful BeginInsertion if it wants to use the printer sensors to determine when
a form is positioned within the slip printer. Alternatively, the application may prompt
the user and wait for a key press before calling this method.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
ResultCodeExtended = OPOS_EPTR_SLP_EMPTY:
The device was taken out of insertion mode without a
form being inserted.
EndRemoval Method
Syntax LONG EndRemoval ();
When called, the printer is taken out of form removal or ejection mode. If no form
is detected in the device, a successful status of OPOS_SUCCESS is returned to the
application. If a form is present, an extended error status
OPOS_EPTR_SLP_FORM is returned.
This method is paired with the BeginRemoval method for controlling form
removal. The application may choose to call this method immediately after a
successful BeginRemoval if it wants to use the printer sensors to determine when
the form has been removed. Alternatively, the application may prompt the user and
wait for a key press before calling this method.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
PrintBarCode Method
Syntax LONG PrintBarCode (LONG Station, BSTR Data,
LONG Symbology, LONG Height, LONG Width,
LONG Alignment, LONG TextPosition);
Parameter Description
Value Meaning
Other Values Distance from the left-most print column to the start of the
bar code. Expressed in the unit of measure given by
MapMode.
Value Meaning
Value Meaning
PTR_BCS_UPCA UPC-A
PTR_BCS_UPCE UPC-E
PTR_BCS_UPCD1 UPC-D1
PTR_BCS_UPCD2 UPC-D2
PTR_BCS_UPCD3 UPC-D3
PTR_BCS_UPCD4 UPC-D4
PTR_BCS_UPCD5 UPC-D5
PTR_BCS_EAN128 EAN-128
PTR_BCS_ITF Interleaved 2 of 5
PTR_BCS_Codabar Codabar
PTR_BCS_Code39 Code 39
PTR_BCS_Code93 Code 93
PTR_BCS_MAXICODE MAXICODE
Special Cases
If the property RotateSpecial indicates that the bar code is to be rotated, then
perform the rotation. The Height, Width, and TextPosition parameters are applied to
the bar code before the rotation. For example, if PTR_BC_TEXT_BELOW is
specified and the bar code is rotated left, then the text will appear on the paper to the
right of the bar code.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
ResultCodeExtended = OPOS_EPTR_REC_EMPTY:
The receipt station was specified but is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EPTR_SLP_EMPTY:
The slip station was specified, but a form is not inserted.
(Can only be returned if AsyncMode is FALSE.)
PrintBitmap Method
Syntax LONG PrintBitmap (LONG Station, BSTR FileName,
LONG Width, LONG Alignment);
Parameter Description
Value Meaning
PTR_BM_ASIS Print the bitmap with one bitmap pixel per printer dot.
Value Meaning
Other Values Distance from the left-most print column to the start of the
bitmap. Expressed in the unit of measure given by
MapMode.
• Works well for bitmaps tuned for a specific printer’s aspect ratio between
horizontal dots and vertical dots.
Disadvantages are:
• Some lines and images that are “smooth” in the original bitmap may show some
“ratcheting.”
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
ResultCodeExtended = OPOS_EPTR_COVER_OPEN:
The printer cover is open.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EPTR_BADFORMAT:
The specified file is either not a bitmap file, or it is in an
unsupported format.
ResultCodeExtended = OPOS_EPTR_REC_EMPTY:
The receipt station was specified but is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EPTR_SLP_EMPTY:
The slip station was specified, but a form is not inserted.
(Can only be returned if AsyncMode is FALSE.)
PrintImmediate Method
Syntax LONG PrintImmediate (LONG Station, BSTR Data);
This method tries to print its data immediately – that is, as the very next printer
operation. It may be called when asynchronous output is outstanding.
PrintImmediate is primarily intended for use in exception conditions when
asynchronous output is outstanding, such as within an error event handler.
Value Meaning
Line Feed (10) Print any data in the line buffer, and feed to the next print
line. (A Carriage Return is not required in order to cause
the line to be printed.)
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
ResultCodeExtended = OPOS_EPTR_JRN_EMPTY:
The journal station was specified but is out of paper.
ResultCodeExtended = OPOS_EPTR_REC_EMPTY:
The receipt station was specified but is out of paper.
ResultCodeExtended = OPOS_EPTR_SLP_EMPTY:
The slip station was specified, but a form is not inserted.
PrintNormal Method
Syntax LONG PrintNormal (LONG Station, BSTR Data);
Value Meaning
Line Feed (10) Print any data in the line buffer, and feed to the next print
line. (A Carriage Return is not required in order to cause
the line to be printed.)
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
ResultCodeExtended = OPOS_EPTR_JRN_EMPTY:
The journal station was specified but is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EPTR_REC_EMPTY:
The receipt station was specified but is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EPTR_SLP_EMPTY:
The slip station was specified, but a form is not inserted.
(Can only be returned if AsyncMode is FALSE.)
PrintTwoNormal Method
Syntax LONG PrintTwoNormal (LONG Stations, BSTR Data1, BSTR Data2);
Parameter Description
PTR_S_JOURNAL_RECEIPT,
PTR_S_JOURNAL_SLIP, or
PTR_S_RECEIPT_SLIP.
Remarks Call to print two strings on two print stations simultaneously. When supported, this
may give increased print performance.
Documentation releases prior to 1.3 were not sufficiently clear as to the meaning of
“first” and “second” station, so implementations varied between the following:
Due to this inconsistency, the application should use the new constants if the
Control Object and Service Object versions indicate Release 1.3 or later.
Release 1.3 and later
Service Objects for Release 1.3 or later should support both sets of constants. The
vendor should define and document the behavior of the obsolete constants.
The sequence of stations in the constants does not imply the physical printing
sequence on the stations. The physical sequence depends on the printer, and may
be different based on bi-directional printing, multiple print heads, and so on.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
ResultCodeExtended = OPOS_EPTR_JRN_EMPTY:
The journal station was specified but is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EPTR_REC_EMPTY:
The receipt station was specified but is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EPTR_SLP_EMPTY:
The slip station was specified, but a form is not inserted.
(Can only be returned if AsyncMode is FALSE.)
RotatePrint Method
Syntax LONG RotatePrint (LONG Station, LONG Rotation);
Parameter Description
Value Meaning
Changing the rotation mode may also change the station’s line height, line spacing,
line width, and other metrics.
Calling the ClearOutput method cancels rotated print mode. Any buffered
sideways rotated print lines are also cleared.
Return One of the values in the following table is returned by the method and placed in the
ResultCode property:
Value Meaning
ResultCodeExtended = OPOS_EPTR_REC_EMPTY:
The receipt station was specified but is out of paper.
(Can only be returned if AsyncMode is FALSE.)
ResultCodeExtended = OPOS_EPTR_SLP_EMPTY:
The slip station was specified, but a form is not inserted.
(Can only be returned if AsyncMode is FALSE.)
SetBitmap Method
Syntax LONG SetBitmap (LONG BitmapNumber, LONG Station, BSTR FileName,
LONG Width, LONG Alignment);
Parameter Description
A Service Object may choose to cache the bitmap for later use to provide better
performance. Regardless, the bitmap file and parameters are validated for
correctness by this method.
The application must ensure that the printer station metrics, such as character
width, line height, and line spacing are set for the Station before calling this method.
The Service Object may perform transformations on the bitmap in preparation for
later printing based upon the current values.
Release 1.0 – 1.1
Only 2 bitmaps may be set, and each bitmap number may only be used for one
station at a time.
Release 1.2 and later
The application may set bitmaps numbered 1 and 2 for each of the two valid
Stations. If desired, the same bitmap FileName may be set to the same
BitmapNumber for each station, so that the same print bitmap escape sequence may
be used for either station.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
ResultCodeExtended = OPOS_EPTR_BADFORMAT:
The specified file is either not a bitmap file, or it is in an
unsupported format.
SetLogo Method
Syntax LONG SetLogo (LONG Location, BSTR Data);
Parameter Description
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
Parameter Description
Value Meaning
Calling the ClearOutput method cancels transaction mode. Any buffered print lines
are also cleared.
Return One of the values in the following table is returned by the method and placed in the
ResultCode property:
Value Meaning
ResultCodeExtended = OPOS_EPTR_JRN_EMPTY:
The journal station was specified but is out of paper.
(Can only be returned if AsyncMode is FALSE and
Control is PTR_TP_NORMAL.)
ResultCodeExtended = OPOS_EPTR_REC_EMPTY:
The receipt station was specified but is out of paper.
(Can only be returned if AsyncMode is FALSE and
Control is PTR_TP_NORMAL.)
ResultCodeExtended = OPOS_EPTR_SLP_EMPTY:
The slip station was specified, but a form is not inserted.
(Can only be returned if AsyncMode is FALSE and
Control is PTR_TP_NORMAL.)
Parameter Description
Remarks Call to determine whether a data sequence, possibly including one or more escape
sequences, is valid for the specified station, before calling the PrintImmediate,
PrintNormal, or PrintTwoNormal methods.
This method does not cause any printing, but is used to determine the capabilities of
the station.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
Paper cut The percentage ‘#’ is not precisely supported: Control will
select the closest supported value.
Feed and Paper cut The percentage ‘#’ is not precisely supported: Control will
select the closest supported value.
Feed, Paper cut, and Stamp The percentage ‘#’ is not precisely supported: Control
will select the closest supported value.
Feed units The unit count ‘#’ is not precisely supported: Control will
select the closest supported value.
Feed reverse The line count ‘#’ is too large: Control will select the
maximum supported value.
Scale horizontally The scaling factor ‘#’ is not supported: Control will select
the closest supported value.
Scale vertically The scaling factor ‘#’ is not supported: Control will select
the closest supported value.
Data Condition
Print bitmap Bitmap printing is not supported, or the bitmap number ‘#’
is out of range.
Data Condition
Events
ErrorEvent Event
Syntax void ErrorEvent (LONG ResultCode, LONG ResultCodeExtended,
LONG ErrorLocus, LONG* pErrorResponse);
Parameter Description
ResultCode Result code causing the error event. See ResultCode for
values.
ResultCodeExtended Extended result code causing the error event. See values
below.
Value Meaning
The contents at the location pointed to by the pErrorResponse parameter are preset
to the default value of OPOS_ER_RETRY. The application may set the value to one
of the following:
Value Meaning
Remarks Fired when an error is detected and the Control’s State transitions into the error
state.
StatusUpdateEvent Event
Syntax void StatusUpdateEvent (LONG Status);
Value Meaning
Summary
Properties
Common Type Access Initialized After
AutoDisable 1.3 Boolean R/W Not Supported
BinaryConversion 1.3 Long R/W Open
CapPowerReporting 1.3 Long R Open
CheckHealthText 1.3 String R Open
Claimed 1.3 Boolean R Open
DataCount 1.3 Long R Open
DataEventEnabled 1.3 Boolean R/W Open
DeviceEnabled 1.3 Boolean R/W Open; Claim
FreezeEvents 1.3 Boolean R/W Open
OutputID 1.3 Long R Open
PowerNotify 1.3 Long R/W Open
PowerState 1.3 Long R Open
ResultCode 1.3 Long R --
ResultCodeExtended 1.3 Long R Open
State 1.3 Long R --
Properties (continued)
Specific Type Access Initialized After
CapTransaction 1.3 Boolean R Open
AsyncMode 1.3 Boolean R/W Open, Claim, & Enable
EventType 1.3 Long R/W Open
SystemClocks 1.3 Long R Open. Claim, Enable
SystemVideoSaveBuffers 1.3 Long R Open, Claim, & Enable
Timeout 1.3 Long R/W Open
UnitsOnline 1.3 Long R Open, Claim, & Enable
Methods
Common Prerequisites
Open 1.3 None
Close 1.3 Open
Claim 1.3 Open
Release 1.3 Open, Claim
CheckHealth 1.3 Open, Claim, & Enable
ClearInput 1.3 Open, Claim
ClearOutput 1.3 Open, Claim
DirectIO 1.3 Open
Specific
ControlClock 1.3 Open, Claim, & Enable
ControlCursor 1.3 Open, Claim, & Enable
FreeVideoRegion 1.3 Open, Claim, & Enable
ResetVideo 1.3 Open, Claim, & Enable
SelectChararacterSet 1.3 Open, Claim, & Enable
SetCursor 1.3 Open, Claim, & Enable
Events
Name May Occur After
DataEvent 1.3 Open, Claim, & Enable
DirectIOEvent 1.3 Open, Claim
ErrorEvent 1.3 Open, Claim, & Enable
OutputCompleteEvent 1.3 Open, Claim, & Enable
StatusUpdateEvent 1.3 Open, Claim, & Enable
General Information
The Remote Order Display Control’s OLE Programmatic ID is
“OPOS.RemoteOrderDisplay”.
This device was added in OPOS Release 1.3.
Capabilities
The Remote Order Display Control has the following minimal set of capabilities:
The Remote Order Display Control may also have the following additional
capabilities:
• Supports multiple video displays each with possibly different video modes.
• Supports touch video input for a touch screen display unit.
• Supports video enunciator output with frequency and duration.
• Supports tactile feedback via an automatic tone when a video display unit is
touched (for touch screen only).
• Supports downloading alternate character sets to one or many video units.
• Support transaction mode display output to one or many video units.
The following capability is not addressed in this version of the OPOS specification:
Model
The general model of a remote order display:
• The remote order display device class is a subsystem of video units. The initial
targeted environment is food service, to display order preparation and fulfillment
information. Remote order displays are often used in conjunction with bump
bars.
The subsystem can support up to 32 video units.
One Application on one PC or POS Terminal will typically manage and control
the entire subsystem of video units. If Applications on the same or other PCs
and POS Terminals will need to access the subsystem, then this Application
must act as a subsystem server and expose interfaces to other Applications.
• All specific methods are broadcast methods. This means that the method can
apply to one unit, a selection of units or all online units. The Units parameter is
a Long, with each bit identifying an individual video unit. (One or more of the
constants ROD_UID_1 through ROD_UID_32 are bitwise ORed to form the
bitmask.) The service object will attempt to satisfy the method for all units
specified by the Units parameter. If an error is received from one or more
units, the ErrorUnits property is updated with the appropriate units in error.
The ErrorString property is updated with a description of the error or errors
received. The method will then return with the corresponding OPOS error. In
the case where two or more units encounter different errors, the service object
should determine the most severe OPOS error to return.
• The common methods CheckHealth, ClearInput, and ClearOutput are not
broadcast methods and use the unit ID specified by the CurrentUnitID
property. (One of the constants ROD_UID_1 through ROD_UID_32 are
selected.) See the description of these common methods to understand how the
current unit ID property is used.
• When the current unit ID property is set by the application, all the
corresponding properties are updated to reflect the settings for that unit.
If the current unit ID property is set to a unit ID that is not online, the
dependent properties will contain non-initialized values.
The CurrentUnitID uniquely represents a single video unit. The definitions
range from ROD_UID_1 to ROD_UID_32. These definitions are also used to
create the bitwise parameter, Units, used in the broadcast methods. See the
Examples section below for usage.
• The rows and columns are numbered beginning with (0,0) at the top-left corner
of the video display. The dimensions are defined by the height and width
parameters. The region depicted below would have the parameters Row = 1,
Column = 2, Height = 3, and Width = 4.
0 1 2 3 4 5 6
0
1
2
3
4
All position parameters are expressed in text characters.
♦ All unit output buffered by the Control may be deleted by setting the
CurrentUnitID property and calling the ClearOutput method.
OutputCompleteEvents will not be fired for cleared output. This
method also stops any output that may be in progress (when possible).
• The Remote Order Display Control device may support transaction mode. A
transaction is a sequence of display operations that are sent to a video unit as a
single unit. Display operations which may be included in a transaction are
ClearVideo, ClearVideoRegion, CopyVideoRegion, DisplayData, DrawBox,
RestoreVideoRegion, SaveVideoRegion, and UpdateVideoRegionAttribute.
During a transaction, the display operations are first validated. If valid, they are
added to the transaction but not displayed yet. Once the application has added
as many operations as required, then the transaction display method is called.
If the transaction is displayed synchronously, then the returned status indicates
either that the entire transaction displayed successfully or that an error occurred
during the display. If the transaction is displayed asynchronously, then the
asynchronous display rules listed above are followed. If an error occurs and the
Error Event handler causes a retry, the entire transaction is retried.
Examples
Set up an attribute variable and initializes it for various uses.
’Standard white foreground on black background
lAttribute = ROD_ATTR_BG_BLACK | ROD_ATTR_FG_GRAY
’Turn Blinking on
lAttribute = lAttribute | ROD_ATTR_BLINK
Draws a box with a solid border on unit ID 1 and unit ID 4. The box is located at
the top left corner (0,0) with a height of 80 and a width of 25.
ROD.DrawBox( ROD_UID_1 | ROD_UID_4, 0, 0, 80, 25, lAttribute,
ROD_BDR_SOLID )
Device Sharing
The remote order display is an exclusive-use device. Its device sharing rules are:
• The application must claim the device before enabling it.
• The application must claim and enable the device before accessing many remote
order display specific properties.
• The application must claim and enable the device before calling methods that
manipulate the device.
• When a Claim method is called again, settable device characteristics are
restored to their condition at Release. Examples of restored characteristics are
character set, video mode, and tone frequency. Region memory buffers, clock
and cursor settings are considered state characteristics and are not restored.
• See the “Summary” table for precise usage prerequisites.
Properties
AsyncMode Property R/W
Syntax BOOL AsyncMode;
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
Remarks Sets the duration (in milliseconds) of the automatic tone for the video unit specified
by the CurrentUnitID property.
This property is initialized to the default value for each online video unit when the
device is first enabled following the Open method.
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
Remarks Sets the frequency (in Hertz) of the automatic tone for the video unit specified by
the CurrentUnitID property.
This property is initialized to the default value for each online video unit when the
device is first enabled following the Open method.
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
CapSelectCharacterSet Property
Syntax BOOL CapSelectCharacterSet;
Remarks If TRUE, the video unit specified by the CurrentUnitID property may be loaded
with an alternate, user supplied character set; otherwise it is FALSE.
This property is initialized for each video unit online when the device is first enabled
following the Open method.
CapTone Property
Remarks If TRUE, the video unit specified by the CurrentUnitID property supports an
enunciator; otherwise it is FALSE
This property is initialized for each video unit online when the device is first enabled
following the Open method.
CapTouch Property
Syntax BOOL CapTouch;
Remarks If TRUE, the video unit specified by the CurrentUnitID property supports the
ROD_DE_TOUCH_UP, ROD_DE_TOUCH_DOWN, and
ROD_DE_TOUCH_MOVE event types; otherwise it is FALSE.
This property is initialized for each video unit online when the device is first enabled
following the Open method.
CapTransaction Property
Syntax BOOL CapTransaction;
CharacterSet Property
Syntax LONG CharacterSet;
Remarks Contains the character set for displaying characters for the video unit specified by
the CurrentUnitID property. When CapSelectCharacterSet is TRUE, this
property can be set with one of the character set numbers found in the
CharacterSetList property.
This property is initialized to the default video character set used by each video unit
online when the device is first enabled following the Open method.
CharacterSetList Property
Syntax BSTR CharacterSetList;
Remarks A string of character set numbers for the video unit specified by the
CurrentUnitID property.
The character set number string consists of an ASCII numeric set of numbers,
separated by commas.
For example, if the string is “101, 850, 999”, the video unit supports a device-
specific character set, code page 850, and the Windows ANSI character set.
Value Meaning
Range 101 - 199 A device-specific character set that does not match a code
page, nor the ASCII or Windows ANSI character sets.
Range 400 - 990 Code page; matches one of the standard values.
Range 1000 and higher Windows code page; matches one of the standard values.
Clocks Property
Syntax LONG Clocks;
Remarks Indicates the number of clocks the video unit, specified by the CurrentUnitID
property, can support.
This property is initialized for each online video unit when the device is first enabled
following the Open method.
Remarks Selects the current video unit ID. Up to 32 units are allowed on one remote order
display device. The unit ID definitions range from ROD_UID_1 to ROD_UID_32.
The following properties and methods apply only to the selected video unit ID:
Setting CurrentUnitID will update these properties to the current values for the
specified unit.
• Methods: CheckHealth, ClearInput, ClearOutput.
This property is initialized to ROD_UID_1 when the device is first enabled following
the Open method.
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
Remarks Indicates the total number of DataEvents enqueued at the control. All units online
are included in this value. The number of enqueued events for a specific unit ID is
stored in the VideoDataCount property.
ErrorString Property
Syntax BSTR ErrorString;
Remarks When an error occurs for any method that acts on a bitwise set of video units, the
ErrorString is set to a description of the error which occurred to the unit(s)
specified by the ErrorUnits property.
ErrorUnits Property
Syntax LONG ErrorUnits;
Remarks When an error occurs for any method that acts on a bitwise set of video units, the
ErrorUnits will contain a bitwise mask of the unit(s) that encountered an error.
EventString Property
Syntax BSTR EventString;
Remarks When an ErrorEvent is delivered, this property is set to a description of the error
which occurred to the unit(s) specified by the EventUnits property.
Remarks A bitwise mask that is used to selectively indicate which event types are to be fired
by the DataEvent, for all video units online. See the DataEvent description for
event type definitions.
This property is initialized to all defined event types by the Open method.
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
EventUnitID Property
Syntax LONG EventUnitID;
Remarks Just before the Control delivers a DataEvent to the Application, it sets this property
to the video unit ID causing the event. The unit ID definitions range from
ROD_UID_1 to ROD_UID_32.
EventUnits Property
Syntax LONG EventUnits;
SystemClocks Property
Syntax LONG SystemClocks;
Remarks Indicates the total number of clocks the remote order display device can support at
one time.
This property is initialized when the device is first enabled following the Open
method.
SystemVideoSaveBuffers Property
Syntax LONG SystemVideoSaveBuffers;
Remarks Indicates the total number of video save buffers the remote order display device can
support at one time.
This property is initialized when the device is first enabled following the Open
method.
Remarks Timeout value in milliseconds used by the remote order display device to complete
all output methods supported. If the device cannot successfully complete an output
method within the timeout value, then the method returns a failure status if
AsyncMode is FALSE, or enqueues an ErrorEvent if AsyncMode is TRUE.
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
UnitsOnline Property
Syntax LONG UnitsOnline;
Remarks Bitwise mask indicating the video units online, where zero or more of the unit
constants ROD_UID_1 (bit 0 on) through ROD_UID_32 (bit 31 on) are bitwise
ORed.
This property is initialized when the device is first enabled following the Open
method. This property is updated as changes are detected, such as before a
StatusUpdateEvent is fired and during the CheckHealth method.
VideoDataCount Property
Syntax LONG VideoDataCount;
Remarks Indicates the number of DataEvents enqueued for the video unit specified by the
CurrentUnitID property.
Remarks Indicates the video ModeId selected for the video unit specified by the
CurrentUnitID property. The ModeId represents one of the selections in the
VideoModesList property.
This property is initialized to the Service Object dependent default video ModeId
used by each video unit online when the device is first enabled following the Open
method.
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
VideoModesList Property
Syntax BSTR VideoModesList;
Remarks The video modes supported for the video unit specified by the CurrentUnitID
property. The video modes are listed in a comma delineated string with the
following format:
<ModeId>:<Height>x<Width>x<NumberOfColors><M|C>.
The ModeId values are determined by the remote order display system.
M = Monochrome (and gray scales) and C = Color.
The ModeId is used to initialize the VideoMode property for each video unit online.
This property is initialized to the video modes list supported by each video unit online
when the device is first enabled following the Open method.
VideoSaveBuffers Property
Syntax LONG VideoSaveBuffers;
Remarks Indicates the number of save buffers for the video unit specified by the
CurrentUnitID property. This property should be consulted when using the
SaveVideoRegion, RestoreVideoRegion and FreeVideoRegion methods. When
set to 0, this indicates that buffering for the selected unit is not supported. When
VideoSaveBuffers is greater than 0, the remote order display device can save at
minimum one entire video screen for the selected video unit.
This property is initialized for each video unit online when the device is first enabled
following the Open method.
Methods
CheckHealth Method (Common)
Syntax LONG CheckHealth (LONG Level);
The Level parameter indicates the type of health check to be performed on the
device. The following values may be specified:
Value Meaning
OPOS_CH_INTERNAL Perform a health check that does not physically change the
device. The device is tested by internal tests to the extent
possible.
OPOS_CH_EXTERNAL Perform a more thorough test that may change the device.
For example, a pattern may be displayed on the video.
The UnitsOnline property will be updated with any changes before returning to the
application.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
Remarks Called to clear the device input that has been buffered for the unit specified by the
CurrentUnitID property.
Any data events that are enqueued – usually waiting for DataEventEnabled to be
set to TRUE and FreezeEvents to be set to FALSE – are also cleared.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_NOTCLAIMED
The device must be claimed before this method can be
used.
Remarks Called to clear all outputs that have been buffered for the unit specified by the
CurrentUnitID property, including video and tone outputs.
Any output complete and output error events that are enqueued – usually waiting for
DataEventEnabled to be set to TRUE and FreezeEvents to be set to FALSE – are
also cleared.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_E_NOTCLAIMED
The device must be claimed before this method can be
used.
ClearVideo Method
Syntax LONG ClearVideo (LONG Units, LONG Attribute);
Parameter Description
Remarks This method will clear the entire display area for the video unit(s) specified by the
Units parameter. The display area will be cleared using the attribute placed in the
Attribute parameter.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
ClearVideoRegion Method
Syntax LONG ClearVideoRegion (LONG Units, LONG Row, LONG Column, LONG
Height, LONG Width, LONG Attribute);
Parameter Description
Remarks This method will clear the specified video region for the video unit(s) specified by
the Units parameter. The display area will be cleared using the attribute placed in the
Attribute parameter.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
ControlClock Method
Syntax LONG ControlClock (LONG Units, LONG Function, LONG ClockId,
LONG Hour, LONG Min, LONG Sec, LONG Row, LONG Column,
LONG Attribute, LONG Mode);
Parameter Description
Value Meaning
ROD_CLK_STOP Permanently stops the clock from updating the display and
the ClockId becomes free.
Value Meaning
Remarks This method will carryout the clock command requested in the Function parameter
on the video unit(s) specified by the Units parameter. The clock will be displayed in
the requested Mode format at the location found in the Row and Column parameters.
The clock will start at the specified Hour, Min, and Sec, time values and will be
updated every second until a ROD_CLK_PAUSE or ROD_CLK_STOP is requested
for this ClockId.
Generally a video unit can support the number of clocks specified by the Clocks
property. However, the ROD_CLK_START command will return
OPOS_EROD_NOCLOCKS if it exceeds the number of SystemClocks even though
the Clocks property may indicated the unit can support more clocks than allocated
for that unit.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
See Also Clocks Property; ErrorString Property; ErrorUnits Property; “Model” discussion
ControlCursor Method
Syntax LONG ControlCursor (LONG Units, LONG Function);
Parameter Description
Value Meaning
ROD_CRS_LINE_BLINK
Enable a blinking solid underscore cursor.
ROD_CRS_BLOCK_BLINK
Enable a blinking solid block cursor.
Remarks This method will enable or disable the cursor depending on the Function parameter,
for the video unit(s) specified by the Units parameter.
When the Function is ROD_CRS_OFF, the cursor is disabled, otherwise the cursor
is enabled as the requested cursor type. If the video unit cannot support the
requested cursor type, the service object will use the next closest cursor type.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
CopyVideoRegion Method
Syntax LONG CopyVideoRegion (LONG Units, LONG Row, LONG Column, LONG
Height, LONG Width, LONG TargetRow, LONG TargetColumn);
Parameter Description
Remarks This method will copy a region of the display area to a new location on the display
area for the video unit(s) specified by the Units parameter. The source area is
defined by the Row, Column, Height, and Width parameters. The top-left corner of
the target location is defined by the TargetRow and TargetColumn parameters. If
the ranges overlap the copy is done such that all original data is preserved.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
DisplayData Method
Syntax LONG DisplayData (LONG Units, LONG Row, LONG Column,
LONG Attribute, BSTR Data);
Parameter Description
Remarks The characters in Data are processed beginning at the location specified by Row and
Column, and continue in succeeding columns on the video unit(s) specified by the
Units parameter. Any characters that extend beyond the last column will be
discarded.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
DrawBox Method
Syntax LONG DrawBox (LONG Units, LONG Row, LONG Column, LONG Height,
LONG Width, LONG Attribute, LONG BorderType);
Parameter Description
Value Meaning
Remarks This method will draw a box on the video units(s) specified by the Units parameter.
The remote order display will attempt to draw a box with the border type specified.
If the character set does not support the chosen border type, the service object will
choose the best fit from the given character set.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
FreeVideoRegion Method
Syntax LONG FreeVideoRegion (LONG Units, LONG BufferId);
Parameter Description
Remarks This method will free any buffer memory allocated for the video unit(s) specified by
the Units parameter. The number of video buffers supported is stored in the
VideoSaveBuffers property for each video unit online. If the BufferId was never
used in a previous SaveVideoRegion method, no action is take and
OPOS_SUCCESS is returned.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
ResetVideo Method
Syntax LONG ResetVideo (LONG Units);
Remarks Sets the video unit(s) specified by the Units parameter to a power on state. All
internal service object buffers and clocks associated with the unit(s) are released.
All settable characteristics are set to default values.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
RestoreVideoRegion Method
Syntax LONG RestoreVideoRegion (LONG Units, LONG TargetRow,
LONG TargetColumn, LONG BufferId);
Parameter Description
Remarks This method will restore a previously saved video region of the display area from the
requested BufferId for the video unit(s) specified by the Units parameter. A region
can be saved using the SaveVideoRegion method. The number of video buffers
supported is stored in the VideoSaveBuffers property for each video unit online.
The target location is defined by the TargetRow and TargetColumn parameters.
This method doesn’t free the memory after restoring, therefore, this method can be
used to copy a video region to multiple locations on the display. Use the
FreeVideoRegion method to free any memory allocated for a video buffer.
If the BufferId does not contain a previously saved video region for the Units
selected, an OPOS_EROD_NOREGION error is returned.
Video regions cannot be restored between video units. For example, the
SaveVideoRegion method is called with Units = 0000 1000 and BufferId = 1. This
will save a video region for the Unit Id 4, in to Buffer 1 for that unit. If
RestoreVideoRegion is called with Units = 0000 0100 and BufferId = 1 with the
intention of restoring the previously saved buffer to Unit Id 3, the return status could
either be OPOS_EROD_NOREGION or an unwanted region is restored.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
SaveVideoRegion Method
Syntax LONG SaveVideoRegion (LONG Units, LONG Row, LONG Column,
LONG Height, LONG Width, LONG BufferId);
Parameter Description
Remarks This method will save the specified video region of the display area to one of the
provided video buffers for the video unit(s) specified by the Units parameter. The
number of video buffers supported is stored in the VideoSaveBuffers property for
each video unit online. However, an OPOS_EROD_NOBUFFERS error will be
returned if the requested buffer exceeds the number of SystemVideoSaveBuffers
even though the VideoSaveBuffers property may indicated the unit can support
more save buffers than currently allocated for that unit.
The source area is defined by the Row, Column, Height, and Width parameters. The
video region can be restored to the screen by calling the RestoreVideoRegion
method. If SaveVideoRegion is called twice with the same BufferId, the previous
video data is lost, and any allocated memory is returned to the system.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
ResultCodeExtended = OPOS_EROD_NOROOM:
All the buffer memory has been allocated for a specific
unit. The ErrorUnits and ErrorString properties are
updated before return.
SelectChararacterSet Method
Syntax LONG SelectChararacterSet (LONG Units, LONG CharacterSet);
Parameter Description
Value Meaning
Range 101-199 A device-specific character set that does not match a code
page, nor the ASCII or Widows ANSI character sets.
Ranges 1000 or higher Windows code page; matches one of the standard values.
Remarks Selects a compatible character set for the video unit(s) specified by the Units
parameter.
The CharacterSet property is updated for each video unit id for which a new
character set is is successfully.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
SetCursor Method
Syntax LONG SetCursor (LONG Units, LONG Row, LONG Column);
Parameter Description
Remarks This method will update the cursor position on the video unit(s) specified by the
Units parameter.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
TransactionDisplay Method
Syntax LONG TransactionDisplay (LONG Units, LONG Function);
Parameter Description
Value Meaning
ROD_TD_TRANSACTION
Begin a transaction.
Remarks Enters or exits transaction mode for the video unit(s) specified by the Units
parameter.
Calling the ClearOutput method cancels transaction mode for the unit specified by
the CurrentUnitID property. Any buffered print lines are also cleared.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
UpdateVideoRegionAttribute Method
Syntax LONG UpdateVideoRegionAttribute (LONG Units, LONG Function,
LONG Row, LONG Column, LONG Height, LONG Width, LONG Attribute);
Parameter Description
Value Meaning
ROD_UA_INTENSITY_ON
Turn on foreground intensity in the region.
ROD_UA_INTENSITY_OFF
Turn off foreground intensity in the region.
ROD_UA_REVERSE_ON
Reverse video the region.
ROD_UA_REVERSE_OFF
Remove reverse video from the region.
ROD_UA_BLINK_ON
Turn on blinking in the region.
ROD_UA_BLINK_OFF
Turn off blinking in the region.
Remarks This method will modify the attribute on the video unit(s) specified by the Units
parameter in the region defined by the Row, Column, Height, and Width parameters.
When the Function parameter is ROD_UA_SET, the region’s attributes will be
replaced with the new value in the Attribute parameter; otherwise the Attribute
parameter is ignored and the region’s attributes will be modified.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
VideoSound Method
Syntax LONG VideoSound (LONG Units, LONG Frequency, LONG Duration, LONG
NumberOfCycles, LONG InterSoundWait);
Parameter Description
Remarks Sound the video enunciator for the video(s) specified by the Units parameter.
Duration parameter +
InterSoundWait parameter (except on the last tone cycle)
After the video has started an asynchronous sound, then the ClearOutput method
will stop the sound. (When an InterSoundWait value of OPOS_FOREVER was used
to start the sound, then the application must use ClearOutput to stop the
continuous sounding of tones.)
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
Events
DataEvent Event
Syntax void DataEvent (LONG Status);
The Status parameter is divided into four bytes. The diagram below indicates how
the parameter Status is divided:
Remarks Fired to indicate input data from a video touch unit to the application. The low word
contains the Event Type. The high word contains additional data depending on the
Event Type. When the Event Type is ROD_DE_TOUCH_UP,
ROD_DE_TOUCH_DOWN, or ROD_DE_TOUCH_MOVE, the high word indicates
where the touch occurred. The low byte contains the Column position and the high
byte contains the Row position, with valid values ranging from 0-255.
Data events can be filtered at the remote order display device by setting the
EventTypes property.
OutputCompleteEvent Event
Syntax void OutputCompleteEvent (LONG OutputID);
StatusUpdateEvent Event
Syntax void StatusUpdateEvent (LONG Status);
The Status parameter reports a change in the power state of a video unit.
Remarks Fired when the remote order display device detects a power state change.
• Before delivering the event, the EventUnits property is set to the units for
which the new power state applies.
• When the remote order display device is enabled, then the Control will fire a
StatusUpdateEvent to specify the bitmask of online units.
ErrorEvent Event
Syntax void ErrorEvent (LONG ResultCode, LONG ResultCodeExtended,
LONG ErrorLocus, LONG* pErrorResponse);
Parameter Description
ResultCode Result code causing the error event. See ResultCode for
values.
Value Meaning
The contents at the location pointed to by the pErrorResponse parameter are preset
to a default value, based on the ErrorLocus. The application may change the value
to one of the following:
Value Meaning
OPOS_ER_CLEAR Clear the buffered input data. The error state is exited.
Default when locus is OPOS_EL_INPUT.
OPOS_ER_CONTINUEINPUT
Use only when locus is OPOS_EL_INPUT_DATA.
Acknowledges the error and directs the Control to continue
processing. The Control remains in the error state, and
Remarks Fired when an error is detected while trying to read remote order display data.
Input error events are not delivered until the DataEventEnabled property is TRUE,
so that proper application sequencing occurs.
See Also “Status, Result Code, and State Model”; DataEventEnabled Property; EventUnits
Property; EventString Property
Scale
Summary
Properties
Common Type Access Initialized After
AutoDisable 1.3 Boolean R/W Open
BinaryConversion 1.2 Long R/W Open
CapPowerReporting 1.3 Long R Open
CheckHealthText 1.0 String R Open
Claimed 1.0 Boolean R Open
DataCount 1.3 Long R Open
DataEventEnabled 1.3 Boolean R/W Open
DeviceEnabled 1.0 Boolean R/W Open & Claim
FreezeEvents 1.0 Boolean R/W Open
OutputID 1.0 Long R Not Supported
PowerNotify 1.3 Long R/W Open
PowerState 1.3 Long R Open
ResultCode 1.0 Long R --
ResultCodeExtended 1.0 Long R Open
State 1.0 Long R --
Methods
Common May Use After
Open 1.0 --
Close 1.0 Open
Claim 1.0 Open
Release 1.0 Open & Claim
CheckHealth 1.0 Open, Claim, & Enable
ClearInput 1.3 Open & Claim
ClearOutput 1.0 Not Supported
DirectIO 1.0 Open
Specific
DisplayText 1.3 Open, Claim, & Enable
ReadWeight 1.0 Open, Claim, & Enable
ZeroScale 1.3 Open, Claim, & Enable
Events
Name May Occur After
DataEvent 1.3 Open, Claim, & Enable
DirectIOEvent 1.0 Open, Claim
ErrorEvent 1.3 Open, Claim, & Enable
OutputCompleteEvent 1.0 Not Supported
StatusUpdateEvent 1.3 Open, Claim, & Enable
General Information
The Scale Control’s OLE programmatic ID is “OPOS.Scale”.
Capabilities
The scale has the following capability:
• Includes an integrated display with the current weight, or with the current
weight plus Application-specified text.
• Performs price calculations (weight X unit price) and returns the sale price.
(This feature is mostly used in Europe at this time.)
• Supports Application setting of tare weight.
• Supports Application zeroing of the scale.
Model
The general model of a scale is:
For price-calculating scales, the Application must set the property UnitPrice before
calling ReadWeight. After a weight is read (and just before the DataEvent is
delivered to the Application, for asynchronous mode), the Control sets the property
SalesPrice to the calculated price of the item.
Device Sharing
The scale is an exclusive-use device, as follows:
Properties
AsyncMode Property R/W Added in Release 1.3
Syntax BOOL AsyncMode;
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
Remarks Set to TRUE if the scale includes an integrated display that shows the current
weight;
otherwise it is FALSE, indicating that the application may need to show the current
weight on another display.
Remarks Set to TRUE if the scale includes an integrated display that shows the current weight
and can also show a text that describes the item being weighed. Otherwise FALSE,
indicating that extra text cannot be shown on the display.
Remarks Set to TRUE if the scale can calculate prices. Otherwise FALSE, indicating that the
scale only returns a weight.
For price calculating scales the calculation unit is in the scale rather than in the data-
receiving terminal. For price-calculating scales the UnitPrice property is to be set
before calling the ReadWeight method
Remarks Set to TRUE if the scale includes setting a tare value. Otherwise FALSE, indicating
that the scale does not support tare values.
Remarks Set to TRUE if the Application can set the scale weight to zero. Otherwise FALSE,
indicating that the scale does not support programmatic zeroing.
Remarks The number of characters that may be displayed on an integrated display for the text
which describes an article.
If the capability CapDisplayText is FALSE, then the device does not support text
displaying and MaxDisplayTextChars is always zero.
MaximumWeight Property
Syntax LONG MaximumWeight;
Remarks Holds the maximum weight measurement possible from the scale. The measurement
unit is available via the WeightUnit property.
MaximumWeight has an assumed decimal place located after the “thousands” digit
position. For example, an actual value of 12345 represents 12.345, and an actual
value of 5 represents 0.005.
Remarks The sales price read from the scale for price calculating scales. For price-calculating
scales the scale calculates this value during the process of weighing by multiplying
the UnitPrice property by the acquired weight.
This property is set by the control before the ReadWeight method returns (in
synchronous use) or the DataEvent is delivered by the control (in asynchronous
use).
Remarks Holds the tare weight of scale data. The weight in TareWeight property has an
assumed fractional part of three digits. For example, an actual value of 12345
represents 12.345, and an actual value of 5 represents 0.005. The measured unit
is specified in the WeightUnit property. If the capability CapTareWeight is
FALSE then the device does not support setting of a tare value and TareWeight is
always zero.
Tare weight is not included in the item weight returned by the ReadWeight method.
This property is initialized by the Open method to the scale’s default tare weight
(usually zero)
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
Remarks Holds the unit price of the article to be weighed. For price calculating scales this
property is to be set before starting the process of weighing. The scale itself
calculates during weighing the property SalesPrice by multiplying the UnitPrice
with the pWeightData parameter of the ReadWeight method. So, this property
contains only a factor.
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
WeightUnit Property
Syntax LONG WeightUnit;
LONG WeightUnits; (Synonym for WeightUnit. 8)
Value Meaning
SCAL_WU_KILOGRAM
Unit is a kilogram (= 1000 grams).
This property is initialized to the scale’s weight unit by the Open method.
8
A Scale Control Object must support the property WeightUnit. In addition, due to a
documentation error in OPOS APG Releases 1.1 and earlier, it is recommended that the
property WeightUnits also be supported, and that it refer to the same property.
Methods
DisplayText Method Added in Release 1.3
Syntax LONG DisplayText (BSTR Data);
Parameter Description
Remarks Call this method to update the text shown on the integrated display. Calling this
method with an empty string (“”) will clear the display.
If the capability CapDisplayText is FALSE, then the device does not support text
displaying and DisplayText will fail.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
ReadWeight Method
Syntax LONG ReadWeight (LONG* pWeightData, LONG Timeout);
Parameter Description
The weighing process is performed synchronously and the method will return after
finishing the weighing process. The weight is returned at pWeightData,
Release 1.3 and later
The weight has an assumed decimal place located after the “thousands” digit
position. For example, an actual value of 12345 represents 12.345, and an actual
value of 5 represents 0.005.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
OPOS_SUCCESS A valid weight was read and placed into the specified
location.
Remarks Call to set the current scale weight to zero. It may be used for initial calibration, or
to account for tare weight on the scale.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
Events
DataEvent Event
Syntax void DataEvent (LONG Status);
Remarks Fired to present input data from the device to the application after an asynchronous
ReadWeight was initiated.
If the scale is a price-calculating scale, the unit price is placed in the UnitPrice
property and the calculated sales price is placed in the SalesPrice property before
this event is delivered.
ErrorEvent Event
Syntax void ErrorEvent (LONG ResultCode, LONG ResultCodeExtended,
LONG ErrorLocus, LONG* pErrorResponse);
Parameter Description
ResultCode Result code causing the error event. See ResultCode for
values.
Value Meaning
The contents at the location pointed to by the pErrorResponse parameter are preset
to a default value, based on the ErrorLocus. The application may change the value
to one of the following:
Value Meaning
OPOS_ER_CLEAR Clear the buffered input data. The error state is exited.
Default when locus is OPOS_EL_INPUT.
OPOS_ER_CONTINUEINPUT
Use only when locus is OPOS_EL_INPUT_DATA.
Acknowledges the error and directs the Control to continue
processing. The Control remains in the error state, and
will deliver additional DataEvents as directed by the
DataEventEnabled property. When all input has been
delivered and the DataEventEnabled property is again set
to TRUE, then another ErrorEvent is delivered with locus
OPOS_EL_INPUT.
Default when locus is OPOS_EL_INPUT_DATA.
Remarks Fired when an error is detected while trying to read scale data.
Input error events are not delivered until the DataEventEnabled property is TRUE,
so that proper application sequencing occurs.
Summary
Properties
Common Type Access Initialized After
AutoDisable 1.2 Boolean R/W Open
BinaryConversion 1.2 Long R/W Open
CapPowerReporting 1.3 Long R Open
CheckHealthText 1.0 String R Open
Claimed 1.0 Boolean R Open
DataCount 1.2 Long R Open
DataEventEnabled 1.0 Boolean R/W Open
DeviceEnabled 1.0 Boolean R/W Open & Claim
FreezeEvents 1.0 Boolean R/W Open
OutputID 1.0 Long R Not Supported
PowerNotify 1.3 Long R/W Open
PowerState 1.3 Long R Open
ResultCode 1.0 Long R --
ResultCodeExtended 1.0 Long R Open
State 1.0 Long R --
Methods
Common May Use After
Open 1.0 --
Close 1.0 Open
Claim 1.0 Open
Release 1.0 Open & Claim
CheckHealth 1.0 Open, Claim, & Enable
ClearInput 1.0 Open & Claim
ClearOutput 1.0 Not Supported
DirectIO 1.0 Open
Events
Name May Occur After
DataEvent 1.0 Open, Claim, & Enable
DirectIOEvent 1.0 Open, Claim
ErrorEvent 1.0 Open, Claim, & Enable
OutputCompleteEvent 1.0 Not Supported
StatusUpdateEvent 1.3 Open, Claim, & Enable
General Information
The Scanner Control’s OLE programmatic ID is “OPOS.Scanner”.
Capabilities
The Scanner Control has the following capability:
Model
The Scanner Control follows the general “Input Model” for event-driven input:
Scanned data is placed into the property ScanData. If the application sets the
property DecodeData to TRUE, then the data is decoded into ScanDataLabel and
ScanDataType.
Device Sharing
The scanner is an exclusive-use device, as follows:
Properties
DecodeData Property R/W Added in Release 1.2
Syntax BOOL DecodeData;
Remarks If TRUE, then the Control will decode ScanData into the properties ScanDataLabel
and ScanDataType.
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
ScanData Property
Syntax BSTR ScanData;
Scan data is, in general, in the format as delivered from the scanner. Message
header and trailer information should be removed, however, since they do not
contain useful information for an application and are likely to be scanner-specific.
Some merchandise may be marked with multiple labels, sometimes called multi-
symbol labels or tiered labels. These barcodes are typically arranged vertically, and
may be of the same or different symbology. If the scanner reads merchandise that
contains multiple labels, each barcode is delivered to the application as a separate
label. This is necessary due to the current lack of standardization of these barcode
types. One is not able to determine all variations based upon the individual barcode
data. Therefore, the application will need to determine when a multiple label barcode
has been read based upon the data returned. (Note that a scanner may or may not
support reading of multiple labels.)
This property is set by the Control just before delivering the DataEvent.
When the property DecodeData is TRUE, the Control decodes ScanData into
ScanDataLabel as follows:
• If the label type contains a readable check digit (such as with UPC-A and EAN-
13), then it must be present in ScanDataLabel. If the scanner does not return
the check digit to the Service Object, then it is to be calculated and included.
• For variable length bar codes, the length identification is removed, if present.
For example, the EAN-13 barcode which appears printed as "5 018374 827715" on a
label may be received from the scanner and placed into ScanData as the following:
For each of these cases (and any other variations), ScanDataLabel must always be
set to the string "5018374827715", and ScanDataType must be set to
SCAN_SDT_EAN13.
This property is set by the Control just before delivering the DataEvent.
When the property DecodeData is TRUE, the Control tries to determine the scan
label type. The Scanner Control header file (OposScan.h) defines several
symbologies with constant names beginning with SCAN_SDT.
SCAN_SDT_UPCA UPC-A
SCAN_SDT_UPCE UPC-E
SCAN_SDT_UPCD1 UPC-D1
SCAN_SDT_UPCD2 UPC-D2
SCAN_SDT_UPCD3 UPC-D3
SCAN_SDT_UPCD4 UPC-D4
SCAN_SDT_UPCD5 UPC-D5
SCAN_SDT_EAN128 EAN-128
SCAN_SDT_ITF Interleaved 2 of 5
SCAN_SDT_Codabar Codabar
SCAN_SDT_Code39 Code 39
SCAN_SDT_Code93 Code 93
SCAN_SDT_MAXICODE MAXICODE
Special Cases
This property is set by the Control just before delivering the DataEvent.
Events
DataEvent Event
Syntax void DataEvent (LONG Status);
Remarks Fired to present input data from the device to the application. The scanner data is
placed in the ScanData, ScanDataLabel, and ScanDataType properties before this
event is delivered.
ErrorEvent Event
Syntax void ErrorEvent (LONG ResultCode, LONG ResultCodeExtended,
LONG ErrorLocus, LONG* pErrorResponse);
Parameter Description
ResultCode Result code causing the error event. See ResultCode for
values.
Value Meaning
The contents at the location pointed to by the pErrorResponse parameter are preset
to a default value, based on the ErrorLocus. The application may change the value
to one of the following:
Value Meaning
OPOS_ER_CLEAR Clear the buffered input data. The error state is exited.
Default when locus is OPOS_EL_INPUT.
OPOS_ER_CONTINUEINPUT
Use only when locus is OPOS_EL_INPUT_DATA.
Acknowledges the error and directs the Control to continue
processing. The Control remains in the error state, and
will deliver additional DataEvents as directed by the
DataEventEnabled property. When all input has been
delivered and the DataEventEnabled property is again set
to TRUE, then another ErrorEvent is delivered with locus
OPOS_EL_INPUT.
Default when locus is OPOS_EL_INPUT_DATA.
Remarks Fired when an error is detected while trying to read scanner data.
Input error events are not delivered until the DataEventEnabled property is TRUE,
so that proper application sequencing occurs.
Signature Capture
Summary
Properties
Common Type Access Initialized After
AutoDisable 1.2 Boolean R/W Open
BinaryConversion 1.2 Long R/W Open
CapPowerReporting 1.3 Long R Open
CheckHealthText 1.0 String R Open
Claimed 1.0 Boolean R Open
DataCount 1.2 Long R Open
DataEventEnabled 1.0 Boolean R/W Open
DeviceEnabled 1.0 Boolean R/W Open & Claim
FreezeEvents 1.0 Boolean R/W Open
OutputID 1.0 Long R Not Supported
PowerNotify 1.3 Long R/W Open
PowerState 1.3 Long R Open
ResultCode 1.0 Long R --
ResultCodeExtended 1.0 Long R Open
State 1.0 Long R --
Methods
Common May Use After
Open 1.0 --
Close 1.0 Open
Claim 1.0 Open
Release 1.0 Open & Claim
CheckHealth 1.0 Open, Claim, & Enable
ClearInput 1.0 Open & Claim
ClearOutput 1.0 Not Supported
DirectIO 1.0 Open
Specific
BeginCapture 1.0 Open, Claim, & Enable
EndCapture 1.0 Open, Claim, & Enable
Events
Name May Occur After
DataEvent 1.0 Open, Claim, & Enable
DirectIOEvent 1.0 Open, Claim
ErrorEvent 1.0 Open, Claim, & Enable
OutputCompleteEvent 1.0 Not Supported
StatusUpdateEvent 1.3 Open, Claim, & Enable
General Information
The Signature Capture Control’s OLE programmatic ID is “OPOS.SigCap”.
Capabilities
The Signature Capture Control has the following capability:
The Signature Capture Control may have the following additional capabilities:
• Provides a way for the user to terminate signature capture – that is, to tell the
device that she or he has completed the signature.
• Displays form/data on the signature capture device.
• Returns the signature in “real time” as it is entered on the device. If this
capability is true and has been enabled by application by setting the
RealTimeDataEnabled property to TRUE, then a series of DataEvents are
generated, each with an array of one or more line points representing a partial
signature.
Model
The signature capture device usage model is:
The Signature Capture Control follows the general “Input Model” for event-driven
input:
• The capture of signature data begins when the BeginCapture method is called.
• If signature capture is terminated by calling EndCapture, then no DataEvent is
fired.
Device Sharing
The signature capture device is an exclusive-use device, as follows:
Properties
CapDisplay Property
Syntax BOOL CapDisplay;
Remarks Set to TRUE if the device is able to display a form or data entry screen;
otherwise it is FALSE.
Remarks Set to TRUE if the device is able to supply signature data as the signature is being
captured (“real time”);
otherwise it is FALSE.
CapUserTerminated Property
Syntax BOOL CapUserTerminated;
Remarks Set to TRUE if the user is able to terminate signature capture by checking a
completion box, pressing a completion button, or performing some other interaction
with the device.
Contains FALSE if the application must end signature capture by calling the
EndCapture method.
Set to FALSE to disable the device. If CapDisplay is TRUE, then the display screen
of the device is cleared.
MaximumX Property
Syntax LONG MaximumX;
Remarks Contains the maximum horizontal coordinate of the signature capture device. It
must be less than 65,536.
MaximumY Property
Syntax LONG MaximumY;
Remarks Contains the maximum vertical coordinate of the signature capture device. It must
be less than 65,536.
PointArray Property
Syntax BSTR PointArray;
Remarks Contains the signature captured from the device. It consists of an array of (x, y)
coordinate points with the number of array entries specified in TotalPoints. Each
point is represented by four characters: x (low 8 bits), x (high 8 bits), y (low 8
bits), y (high 8 bits).
The format of this data depends upon the value of the BinaryConversion property.
See page 37.
A special point value is (0xFFFF, 0xFFFF) which indicates the end of a line (that is,
a pen lift). Almost all signatures are comprised of more than one line.
The point representation definition is the same regardless of whether the signature is
presented as a single PointArray, or as a series of real time PointArrays.
This property is set by the Control just before delivering the DataEvent or by the
EndCapture method.
RawData Property
Syntax BSTR RawData;
Remarks Contains the signature captured from the device in a device-specific format.
The format of this data depends upon the value of the BinaryConversion property.
See page 37.
This property is set by the Control just before delivering the DataEvent or by the
EndCapture method.
Remarks When CapRealTimeData is TRUE and this property is set to TRUE, a series of
partial signature data events is fired as the signature is captured until signature
capture is terminated.
Else, the captured signature is fired as a single data event when signature capture is
terminated.
Return When this property is set, one of the following values is placed in the ResultCode
property:
Value Meaning
TotalPoints Property
Syntax LONG TotalPoints;
This property is set by the Control just before delivering the DataEvent or by the
EndCapture method. It includes the line drawing terminators (see PointArray).
Methods
BeginCapture Method
Syntax LONG BeginCapture (BSTR FormName);
The FormName parameter contains the registry subkey name for obtaining form or
data screen information for display on the device screen.
If CapDisplay is TRUE, then FormName is used to find information about the form
or data screen to be displayed. The operating system registry key
\HKEY_LOCAL_MACHINE\SOFTWARE\OLEforRetail\ServiceOPOS\
SignatureCapture\DeviceName\FormName
The format and features of each signature capture device’s form/data screen varies
widely and is often built with proprietary tools. Therefore, this key’s data and
additional values and data under this key contain information that varies by Service
Object. Typically, the registry key’s data is set to a form/data screen file name, and
extra registry values and data are set as needed to control its display. (See the
appendix “APPENDIX B
OPOS Registry Usage”, page 683.)
After displaying the form or data screen, when applicable, the signature capture
stylus is enabled.
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
EndCapture Method
Syntax LONG EndCapture ();
Return One of the following values is returned by the method and placed in the ResultCode
property:
Value Meaning
Events
DataEvent Event
Syntax void DataEvent (LONG Status);
Remarks Fired to signal input data from the device to the application.
This event can only be fired if the user can terminate signature capture – that is, if
CapUserTerminated is TRUE.
The Status parameter contains TRUE if the user has entered a signature before
terminating capture. It contains FALSE if the user terminated capture with no
signature.
Before firing the event, the properties TotalPoints, PointArray, and RawData are
set to appropriate values.
ErrorEvent Event
Syntax void ErrorEvent (LONG ResultCode, LONG ResultCodeExtended,
LONG ErrorLocus, LONG* pErrorResponse);
Parameter Description
ResultCode Result code causing the error event. See ResultCode for
values.
Value Meaning
The contents at the location pointed to by the pErrorResponse parameter are preset
to a default value, based on the ErrorLocus. The application may change the value
to one of the following:
Value Meaning
OPOS_ER_CLEAR Clear the buffered input data. The error state is exited.
Default when locus is OPOS_EL_INPUT.
OPOS_ER_CONTINUEINPUT
Use only when locus is OPOS_EL_INPUT_DATA.
Acknowledges the error and directs the Control to continue
processing. The Control remains in the error state, and
will deliver additional DataEvents as directed by the
DataEventEnabled property. When all input has been
delivered and the DataEventEnabled property is again set
to TRUE, then another ErrorEvent is delivered with locus
OPOS_EL_INPUT.
Default when locus is OPOS_EL_INPUT_DATA.
Remarks Fired when an error is detected while trying to read signature capture data.
Input error events are not delivered until the DataEventEnabled property is TRUE,
so that proper application sequencing occurs.
Tone Indicator
Summary
Properties
Common Type Access Initialized After
AutoDisable 1.2 Boolean R/W Not Supported
BinaryConversion 1.2 Long R/W Open
CapPowerReporting 1.3 Long R Open
CheckHealthText 1.2 String R Open
Claimed 1.2 Boolean R Open
DataCount 1.2 Long R Not Supported
DataEventEnabled 1.2 Boolean R/W Not Supported
DeviceEnabled 1.2 Boolean R/W Open
FreezeEvents 1.2 Boolean R/W Open
OutputID 1.2 Long R Open
PowerNotify 1.3 Long R/W Open
PowerState 1.3 Long R Open
ResultCode 1.2 Long R --
ResultCodeExtended 1.2 Long R Open
State 1.2 Long R --
Methods
Common May Use After
Open 1.2 --
Close 1.2 Open
Claim 1.2 Open
Release 1.2 Open & Claim
CheckHealth 1.2 Open & Enable; Note
ClearInput 1.2 Not Supported
ClearOutput 1.2 Open
DirectIO 1.2 Open
Specific
Sound 1.2 Open & Enable; Note
SoundImmediate 1.2 Open & Enable; Note
Note: Also requires that no other application has claimed the tone indicator.
Events
Name May Occur After
DataEvent 1.2 Not Supported
DirectIOEvent 1.2 Open
ErrorEvent 1.2 Open & Enable
OutputCompleteEvent 1.2 Open & Enable
StatusUpdateEvent 1.3 Open & Enable
General Information
The Tone Indicator Control’s OLE programmatic ID is “OPOS.ToneIndicator”.
Capabilities
The Tone Indicator Control has the following capabilities:
• Sound a tone device, which may be the PC system speaker or another hardware
device. In many cases the PC speaker will not be available or will be in a
position that is inaudible to the operator.
• Sound a two-tone indicator, providing simple pitch and volume control.
• Provide a synchronous one-shot (play once while waiting) indicator, similar to
the Win32 Beep function.
Model
The Tone Indicator device is for use when the POS hardware platform provides
such capabilities external to the PC standard speaker. Many POS systems have
such devices, for example the ICL 92R keyboard, so that an indicator is always
present at the point of sale.
This device supports a two-tone sound so that “siren” tones can be produced. The
indicator is in general also started asynchronously so applications may perform other
functions while waiting for the user to acknowledge the tone. There are also
options to start the tone asynchronously with no count, so it runs forever, and be
stopped when running.
The Tone Indicator follows the general output model. Asynchronous output is
handled as follows:
• The Control buffers the request, sets the OutputID property to an identifier for
this request, and returns as soon as possible. When the device completes the
request successfully, then the Control fires an OutputCompleteEvent. A
parameter of this event contains the OutputID of the completed request.
The Sound method will not return an error status due to a hardware problem.
These errors will only be reported by an ErrorEvent. An error status is
returned only if the Control is claimed by another application, is not enabled, a
parameter is invalid, or the request cannot be enqueued. The first three error
cases are due to an application error, while the last is a serious system resource
exception.
Examples
Set up an asynchronous two-tone indicator and sounds it 100 times. Each tone is
sounded for 750 milliseconds at 50% volume, with no pause between each tone.
Indicator.Tone1Pitch = 500
Indicator.Tone1Volume = 50
Indicator.Tone1Duration = 750
Indicator.Tone2Pitch = 800
Indicator.Tone2Volume = 50
Indicator.Tone2Duration = 750
Indicator.InterToneWait = 0
Indicator.AsyncMode = True
Indicator.Sound 100, 0
Start a synchronous indicator. This has a simple alternating beep, 500 milliseconds
on and 500 milliseconds off.
Indicator.Tone1Pitch = 500
Indicator.Tone1Volume = 50
Indicator.Tone1Duration = 500
Indicator.Tone2Pitch = 0 ' turn off second tone
Indicator.InterToneWait = 0 ' no wait after tone-1
Indicator.AsyncMode = False
Indicator.Sound 100, 500
The following example will cause an error, as it defines both tones to be zero.
Indicator.Tone1Pitch = 0 ' turn off first tone
Indicator.Tone2Pitch = 0 ' turn off second tone
Indicator.Sound 100, 0
The indicator Sound method can also be used to start an indefinite duration tone. If
the NumberOfCycles parameter is specified to be OPOS_FOREVER then the tone is
started and must be stopped explicitly.
Indicator.Tone1Pitch = 500
Indicator.Tone1Volume = 50
Indicator.Tone1Duration = 500
Indicator.Tone2Pitch = 0 ' turn off second tone
Indicator.InterToneWait = 0 ' no wait after tone-1
Indicator.AsyncMode = True
Indicator.Sound OPOS_FOREVER, 500
Indicator.AsyncMode = True
Indicator.Sound 1, 0 ' asynchronous beep
Indicator.SoundImmediate ' synchronous beep
Device Sharing
The Tone Indicator is a sharable device. Its device sharing rules are:
• After opening and enabling the device, the application may access all properties
and methods and will receive status update events.
• If more than one application has opened and enabled the device, all applications
may access its properties and methods. Status update events are fired to all of
the applications.
• If one application claims the tone indicator, then only that application may call
the Sound and SoundImmediate methods. Use of this feature will effectively
restrict the tone indicator to the main POS application if that application claims
the device at startup.
• The application that initiates asynchronous sounds is the only one that receives
the corresponding OutputCompleteEvents or ErrorEvents.
• See the “Summary” table for precise usage prerequisites.
Properties
AsyncMode Property R/W
Syntax BOOL AsyncMode;
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
CapPitch Property
Syntax BOOL CapPitch;
Remarks If TRUE, then the hardware tone generator has the ability to vary the pitch of the
tone;
otherwise it is FALSE.
CapVolume Property
Syntax BOOL CapVolume;
Remarks If TRUE, then the hardware tone generator has the ability to vary the volume of the
tone;
otherwise it is FALSE.
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
Remarks The duration of the first tone in milliseconds. A value of zero or less will cause this
tone not to sound.
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
Remarks The pitch or frequency of the first tone in hertz. A value of zero or less will cause
this tone not to sound.
If the device does not support user-defined pitch (CapPitch is FALSE), then any
value greater than zero indicates that the tone indicator uses its default value.
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
Remarks The volume of the first tone in percent of the device's capability, where 0 (or less) is
silent and 100 (or more) is maximum.
If the device does not support user-defined volume (CapVolume is FALSE), then
any value greater than zero indicates that the tone indicator uses its default value.
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
Remarks The duration of the second tone in milliseconds. A value of zero or less will cause
this tone not to sound.
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
Remarks The pitch or frequency of the second tone in hertz. A value of zero or less will
cause this tone not to sound.
If the device does not support user-defined pitch (CapPitch is FALSE), then any
value greater than zero indicates that the tone indicator uses its default value.
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
Remarks The volume of the second tone in percent of the device's capability, where 0 (or
less) is silent and 100 (or more) is maximum.
If the device does not support user-defined volume (CapVolume is FALSE), then
any value greater than zero indicates that the tone indicator uses its default value.
Return When this property is set, the following value is placed in the ResultCode property:
Value Meaning
Methods
Sound Method
Syntax LONG Sound (LONG NumberOfCycles, LONG InterSoundWait);
Parameter Description
Tone1Duration property +
InterToneWait property +
Tone2Duration property +
InterSoundWait parameter (except on the last tone cycle)
After the tone indicator has started an asynchronous sound, then the sound may be
stopped by using one of the following methods. (When an InterSoundWait value of
OPOS_FOREVER was used to start the sound, then the application must use one of
these to stop the continuous sounding of the tones.)
• ClearOutput
• SoundImmediate
Return One of the following values are returned by the method, and also placed in the
ResultCode property.
Value Meaning
SoundImmediate Method
Syntax LONG SoundImmediate ();
Remarks Sounds the hardware tone generator once, synchronously. Both tone-1 and tone-2
are sounded, with their InterToneWait.
Return One of the following values are returned by the method, and also placed in the
ResultCode property.
Value Meaning
A P P E N D I X A
Change History
Release 1.01
Release 1.01 mostly adds clarifications and corrections, but the Line Display and
Signature Capture chapters received substantive changes to correct deficiencies in
their definition.
Section Change
Second Page Add name of Microsoft Web site for OPOS information.
Release 1.1
Release 1.1 adds APIs based on requirements from OPOS-J, the Japanese OPOS
consortium.
Section Change
Release 1.2
Release 1.2 adds additional device classes, plus additional APIs based on
requirements from various OPOS-US, OPOS-Japan, and OPOS-Europe members.
Section Change
Common Open method Correct return value information: ResultCode may not
match method return value.
MSR ErrorReportingType
Add this new property.
MSR ParseDecodeData
Clarify inconsistency: Both ParseDecodeData and
ParseDecodedData were used for this property.
POS Printer SetBitmap Extend the bitmap number usage to allow the same bitmap
to be used for both receipt and slip.
Scale Model Correct to state the weight unit is defined by the device,
and not settable by the application.
Release 1.3
Release 1.3 adds additional device classes, a few additional APIs, and some
corrections.
Section Change
General Modify the use of the term event “firing.” Use “enqueue”
and “deliver” appropriately to describe event firing.
Remote Order Display New device: Add information in several locations, plus
Remote Order Display chapter and header file.
Several places Relax ErrorEvent “retry” response to allow its use with
some input devices.
Common StatusUpdateEvent
Add power state reporting information.
MSR DecodeData Add “raw format” description and column to track data
table.
MSR TrackxData Specify that data excludes the sentinels and LRC.
Add that decoding occurs when DecodeData is TRUE.
MSR ErrorEvent Clarify that DataCount and AutoDisable are not relevant
for MSR error events.
POSPrinter XxxLineChars
Add implementation recommendations.
POSPrinter PrintTwoNormal
Clarify the meaning of the Stations parameter, including the
addition of new constants.
Release 1.4
Release 1.4 adds one additional device class.
Section Change
A P P E N D I X B
OPOS Controls require some data in the system registry in order for the Control
Objects to locate the proper Service Object and initialize it for the device.
HKEY_LOCAL_MACHINE\SOFTWARE\OLEforRetail\ServiceOPOS
BumpBar
CashChanger
CashDrawer
CAT
CoinDispenser
FiscalPrinter
HardTotals
Keylock
LineDisplay
MICR
MSR
PINPad
POSKeyboard
POSPrinter
RemoteOrderDisplay
Scale
Scanner
SignatureCapture
ToneIndicator
The default value of the Device Name key is the programmatic ID9 of the Service
Object. This string is needed by the Control Object, so that the Service Object may
be loaded and the OLE Automation interfaces established between the CO and the
SO.
Value – Required Data
(Default) Service Object’s OLE Programmatic ID.
The device unit key’s values and their data describe the characteristics of the actual
device on the terminal or PC. The following values are strongly recommended for
use by installation and support personnel:
Value – Recommended Data
Service Filename of the Service Object.
9
A Programmatic ID, or “Prog ID”, is the name of a key that must appear in the
“HKEY_CLASSES_ROOT” section of the registry. This key must have a subkey named
“CLSID”, which is the Class ID associated with the Prog ID. The Class ID must be a key
within the “HKEY_CLASSES_ROOT\CLSID” registry section. This key contains subkeys
that specify the OLE Automation Server type and that instruct OLE how to start the Server.
Other values may be defined as needed by the Service Object. Values might contain
information such as:
Communications Port
Baud Rate
Serial Line Characteristics
Interrupt Request (IRQ) Values
Input/Output (I/O) Ports
A Logical Device Name is added to the registry as a value contained in the Device
Class key. The value name is set to the Logical Device Name, and its data must
match a Device Name key contained in the same Device Class.
The application integrator is responsible for adding Logical Device Names to the
registry. (They are not added by the Service Object install procedure.)
HKEY_LOCAL_MACHINE\SOFTWARE\OLEforRetail\ServiceInfo
The subkeys under this key should be the names of service provider companies.
Subkeys and values within each service provider company subkey are provider-
dependent.
Example
In this example, keys are listed in italics. Comments appear as comment.
The POSPrinter class contains two Device Names. Also, two Logical Device
Names are present, which point to the Device Names.
The CashDrawer class contains one Device Name and one Logical Device Name.
The Service Object has a unique Prog ID but uses the same executable as one of the
printers. This Service Object could use the example value “Uses” to point to some
registry values of the printer device that can be used for the cash drawer
parameters.
\HKEY_LOCAL_MACHINE
→ \SOFTWARE
→ \OLEforRetail
↓
→ \ServiceOPOS
↓
→ \POSPrinter Device Class Key
→ \NCR7156=NCR.Ptr7156.1 Device Name Key
Service=C:\OPOS\NCR\PTR7156.DLL
Description=NCR 7156 Serial Printer
Version=1.0.12
...Service Object-specific values. Might include:
Port=COM3
BaudRate=9600
→ \Epson950=Epson.PtrTMU950.1 Device Name Key
Service=TMU950.EXE
Description=Epson TM-U950 Printer
Version=1.0.7
...Service Object-specific values could go here.
→ PSI.Ptr.1=NCR7156 Logical Device Name
→ PSI.Ptr.2=Epson950 Logical Device Name
→ \CashDrawer Device Class Key
→ \EpsonCash=Epson.CD.1 Device Name Key
Service=TMU950.EXE
Description=Epson Cash Drawer Kickout on TM-U950
Version=1.0.7
...Service Object-specific values. Might include:
Uses=POSPrinter\Epson950
→ PSI.CD.1=EpsonCash Logical Device Name
→ \ServiceInfo
→ \EPSON
InstallDir=C:\OPOS\EPSON
InstallDate=1995/11/13
↓
A P P E N D I X C
The header files are listed in alphabetical order. The mapping of device class name
to header file name is as follows:
– General – Opos.h
Bump Bar OposBb.h
Cash Changer OposChan.h
Cash Drawer OposCash.h
CAT OposCat.h
Coin Dispenser OposCoin.h
Fiscal Printer OposFptr.h
Hard Totals OposTot.h
Keylock OposLock.h
Line Display OposDisp.h
MICR OposMicr.h
MSR OposMsr.h
PIN Pad OposPpad.h
POS Keyboard OposKbd.h
POS Printer OposPtr.h
Remote Order Display OposRod.h
Scale OposScal.h
Scanner OposScan.h
Signature Capture OposSig.h
Tone Indicator OposTone.h
#if !defined(OPOS_H)
#define OPOS_H
/////////////////////////////////////////////////////////////////////
// OPOS "State" Property Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// OPOS "ResultCode" Property Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// OPOS "BinaryConversion" Property Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "CheckHealth" Method: "Level" Parameter Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// OPOS "CapPowerReporting", "PowerState", "PowerNotify”Property
// Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "ErrorEvent" Event: "ErrorLocus" Parameter Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "ErrorEvent" Event: "ErrorResponse" Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "StatusUpdateEvent" Event: Common "Status" Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// General Constants
/////////////////////////////////////////////////////////////////////
#endif // !defined(OPOS_H)
#if !defined(OPOSBB_H)
#define OPOSBB_H
#include "Opos.h"
/////////////////////////////////////////////////////////////////////
// "CurrentUnitID" and "UnitsOnline" Properties
// and "Units" Parameter Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "DataEvent" Event: "Status" Parameter Constants
/////////////////////////////////////////////////////////////////////
#endif // !defined(OPOSBB_H)
#if !defined(OPOSCASH_H)
#define OPOSCASH_H
#include "Opos.h"
/////////////////////////////////////////////////////////////////////
// "StatusUpdateEvent" Event Constants
/////////////////////////////////////////////////////////////////////
#endif // !defined(OPOSCASH_H)
#if !defined(OPOSCAT_H)
#define OPOSCAT_H
#include "Opos.h"
/////////////////////////////////////////////////////////////////////
// Payment Condition Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// Transaction Type Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// ResultCodeExtended Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "Daily Log" Property & Argument Constants
/////////////////////////////////////////////////////////////////////
#endif // !defined(OPOSCAT_H)
#if !defined(OPOSCHAN_H)
#define OPOSCHAN_H
#include "Opos.h"
/////////////////////////////////////////////////////////////////////
// "DeviceStatus" and "FullStatus" Property Constants
// "StatusUpdateEvent" Event Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "ResultCodeExtended" Property Constants for Cash Changer
/////////////////////////////////////////////////////////////////////
#endif // !defined(OPOSCHAN_H)
#if !defined(OPOSCOIN_H)
#define OPOSCOIN_H
#include "Opos.h"
/////////////////////////////////////////////////////////////////////
// "DispenserStatus" Property Constants
// "StatusUpdateEvent" Event: "Data" Parameter Constants
/////////////////////////////////////////////////////////////////////
#endif // !defined(OPOSCOIN_H)
#if !defined(OPOSDISP_H)
#define OPOSDISP_H
#include "Opos.h"
/////////////////////////////////////////////////////////////////////
// "CapBlink" Property Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "CapCharacterSet" Property Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "CharacterSet" Property Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "MarqueeType" Property Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "MarqueeFormat" Property Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "DisplayText" Method: "Attribute" Property Constants
// "DisplayTextAt" Method: "Attribute" Property Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "ScrollText" Method: "Direction" Parameter Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "SetDescriptor" Method: "Attribute" Parameter Constants
/////////////////////////////////////////////////////////////////////
#endif // !defined(OPOSDISP_H)
#if !defined(OPOSFPTR_H)
#define OPOSFPTR_H
#include "Opos.h"
/////////////////////////////////////////////////////////////////////
// Fiscal Printer Station Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "CountryCode" Property Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "ErrorLevel" Property Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "SlipSelection" Property Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "GetData" Method Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "AdjustmentType" arguments in diverse methods
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "ReportType" argument in "PrintReport" method
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "StatusUpdateEvent" Event: "Data" Parameter Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "ResultCodeExtended" Property Constants for Fiscal Printer
/////////////////////////////////////////////////////////////////////
18 + OPOSERREXT; // (Several)
const LONG OPOS_EFPTR_BAD_DATE =
19 + OPOSERREXT; // (Several)
const LONG OPOS_EFPTR_NEGATIVE_TOTAL =
20 + OPOSERREXT; // (Several)
const LONG OPOS_EFPTR_WORD_NOT_ALLOWED =
21 + OPOSERREXT; // (Several)
#endif // !defined(OPOSFPTR_H)
#if !defined(OPOSKBD_H)
#define OPOSKBD_H
#include "Opos.h"
/////////////////////////////////////////////////////////////////////
// "EventTypes" Property Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "POSKeyEventType" Property Constants
/////////////////////////////////////////////////////////////////////
#endif // !defined(OPOSKBD_H)
#if !defined(OPOSLOCK_H)
#define OPOSLOCK_H
#include "Opos.h"
/////////////////////////////////////////////////////////////////////
// "KeyPosition" Property Constants
// "WaitForKeylockChange" Method: "KeyPosition" Parameter
// "StatusUpdateEvent" Event: "Data" Parameter
/////////////////////////////////////////////////////////////////////
#endif // !defined(OPOSLOCK_H)
#if !defined(OPOSMICR_H)
#define OPOSMICR_H
#include "Opos.h"
/////////////////////////////////////////////////////////////////////
// "CheckType" Property Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "CountryCode" Property Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "ResultCodeExtended" Property Constants for MICR
/////////////////////////////////////////////////////////////////////
#endif // !defined(OPOSMICR_H)
#if !defined(OPOSMSR_H)
#define OPOSMSR_H
#include "Opos.h"
/////////////////////////////////////////////////////////////////////
// "TracksToRead" Property Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "ErrorReportingType" Property Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "ErrorEvent" Event: "ResultCodeExtended" Parameter Constants
/////////////////////////////////////////////////////////////////////
#endif // !defined(OPOSMSR_H)
#if !defined(OPOSPPAD_H)
#define OPOSPPAD_H
#include "Opos.h"
/////////////////////////////////////////////////////////////////////
// "CapDisplay" Property Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "AvailablePromptsList" and "Prompt" Property Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "CapLanguage" Property Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "TransactionType" Property Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "EndEFTTransaction" Method Completion Code Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "DataEvent" Event Status Constants
/////////////////////////////////////////////////////////////////////
const LONG PPAD_SUCCESS = 1;
const LONG PPAD_CANCEL = 2;
#endif // !defined(OPOSPPAD_H)
#if !defined(OPOSPTR_H)
#define OPOSPTR_H
#include "Opos.h"
/////////////////////////////////////////////////////////////////////
// Printer Station Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "CapCharacterSet" Property Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "CharacterSet" Property Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "ErrorLevel" Property Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "MapMode" Property Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "CutPaper" Method Constant
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "PrintBarCode" Method Constants:
/////////////////////////////////////////////////////////////////////
// "Alignment" Parameter
// Either the distance from the left-most print column to the start
// of the bar code, or one of the following:
// "TextPosition" Parameter
// "Symbology" Parameter:
/////////////////////////////////////////////////////////////////////
// "PrintBitmap" Method Constants:
/////////////////////////////////////////////////////////////////////
// "Width" Parameter
// Either bitmap width or:
// "Alignment" Parameter
// Either the distance from the left-most print column to the start
// of the bitmap, or one of the following:
/////////////////////////////////////////////////////////////////////
// "RotatePrint" Method: "Rotation" Parameter Constants
// "RotateSpecial" Property Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "SetLogo" Method: "Location" Parameter Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "TransactionPrint" Method: "Control" Parameter Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "StatusUpdateEvent" Event: "Data" Parameter Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "ResultCodeExtended" Property Constants for Printer
/////////////////////////////////////////////////////////////////////
#endif // !defined(OPOSPTR_H)
#if !defined(OPOSROD_H)
#define OPOSROD_H
#include "Opos.h"
/////////////////////////////////////////////////////////////////////
// "CurrentUnitID" and "UnitsOnline" Properties
// and "Units" Parameter Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// Broadcast Methods: "Attribute" Parameter Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "DrawBox" Method: "BorderType" Parameter Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "ControlClock" Method: "Function" Parameter Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "ControlCursor" Method: "Function" Parameter Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "SelectChararacterSet" Method: "CharacterSet" Parameter Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "TransactionDisplay" Method: "Function" Parameter Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "UpdateVideoRegionAttribute" Method: "Function" Parameter Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "EventTypes" Property and "DataEvent" Event: "Status" Parameter Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "ResultCodeExtended" Property Constants for Remote Order Display
/////////////////////////////////////////////////////////////////////
#endif // !defined(OPOSROD_H)
#if !defined(OPOSSCAL_H)
#define OPOSSCAL_H
#include "Opos.h"
/////////////////////////////////////////////////////////////////////
// "WeightUnit" Property Constants
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// "ResultCodeExtended" Property Constants for Scale
/////////////////////////////////////////////////////////////////////
#endif // !defined(OPOSSCAL_H)
#if !defined(OPOSSCAN_H)
#define OPOSSCAN_H
#include "Opos.h"
/////////////////////////////////////////////////////////////////////
// "ScanDataType" Property Constants
/////////////////////////////////////////////////////////////////////
// barcode
const LONG SCAN_SDT_EAN13_S = 119; // EAN 13 with supplemental
// barcode
const LONG SCAN_SDT_EAN128 = 120; // EAN 128
const LONG SCAN_SDT_OCRA = 121; // OCR "A"
const LONG SCAN_SDT_OCRB = 122; // OCR "B"
// Special cases
const LONG SCAN_SDT_OTHER = 501; // Start of Scanner-Specific bar
// code symbologies
const LONG SCAN_SDT_UNKNOWN = 0; // Cannot determine the barcode
// symbology.
#endif // !defined(OPOSSCAN_H)
#if !defined(OPOSSIG_H)
#define OPOSSIG_H
#include "Opos.h"
#endif // !defined(OPOSSIG_H)
#if !defined(OPOSTONE_H)
#define OPOSTONE_H
#include "Opos.h"
#endif // !defined(OPOSTONE_H)
#if !defined(OPOSTOT_H)
#define OPOSTOT_H
#include "Opos.h"
/////////////////////////////////////////////////////////////////////
// "ResultCodeExtended" Property Constants for Hard Totals
/////////////////////////////////////////////////////////////////////
#endif // !defined(OPOSTOT_H)
A P P E N D I X D
Technical Details
A system string consists of a sequence of Unicode characters, which are each 16-
bits wide. Thus, they are also referred to as “wide” characters. The string is
followed by a NUL, or zero, character. The string is preceded by an unsigned long
count of the bytes in the string, not including the NUL. Divide this count by two to
obtain the number of characters in the string.
Most of the time, OPOS uses system strings to pass character data back and forth
among the Application, Control Object, and System Object. A system string
(BSTR) is used to pass string parameters by methods and to return string properties.
A pointer to a system string (BSTR*) is used as a method parameter when the
method must return string data.
BSTR* can be a little more difficult to use in ANSI mode, since the string remains in
Unicode format.
• To get the string, it must be converted from Unicode to MBCS. Some macros
are available that make this conversion easier, such as T2OLE and OLE2T.
(These do no handle NUL characters embedded in the string, however.)
• To set the string, place the data into an MFC CString object, and use CString's
“SetSysString” member function.
These cases may return byte data in the range 00-hex to FF-hex. Each 16-bit
character of the system string contains one byte of binary data in the lower 8 bits.
The upper 8 bits are zero. This ensures that translations between ANSI and Unicode
formats maintain one byte per string character.
The troublesome character within binary data is the NUL character, or zero. This is
because although system strings have a length component, some software still relies
upon the NUL character to determine the end of the string.
• To get the string, it must be converted from Unicode to MBCS. The conversion
macros, such as T2OLE and OLE2T, stop on the first NUL character.
Therefore, the function “WideCharToMultiByte” must be used.
• To set the string, place the data into an MFC CString object, and use CString's
“SetSysString” member function.
The generated member functions for calling a method with a BSTR parameter or for
setting a BSTR property use LPCTSTR as the input parameter, and convert this
NUL-terminated string into a system string. Thus, this member function may not be
used for passing binary data with NULs.
The solution involves manually overloading the generated method to accept a “const
CString&”. Then, the application may set a CString to the binary data and call the
new function.
For example, if the control has a method “long SendBstring(BSTR String)”, the
generated wrapper class will have a function similar to the following:
long xxx::SendBstring(LPCTSTR String)
{
long result;
static BYTE parms[] = VTS_BSTR;
InvokeHelper(???, // ??? is the dispatch ID for the method.
DISPATCH_METHOD,
VT_I4, (void*)&result, // Returns a 4-byte integer.
parms, String); // Sends one BSTR parameter.
return result;
}
Add the following overloaded function to the class declaration header file:
long SendBstring(const CString& String);
and add the following definition to the class definition source file:
long xxx::SendBstring(const CString& String);
{
long result;
static BYTE parms[] = VTS_VARIANT;
VARIANT VarString;
VariantInit(&VarString);
VarString.vt = VT_BSTR;
VarString.bstrVal = String.AllocSysString();
InvokeHelper(???, // ??? is the dispatch ID for the method.
DISPATCH_METHOD,
VT_I4, (void*)&result, // Returns a 4-byte integer.
parms, &VarString); // Sends one VARIANT parameter.
VariantClear(&VarString);
return result;
}
To call the method with binary data, use a sequence such as:
CString s;
.... Put string (which may contain NULs) into “s” ....
.... Then, assuming that bs is an instance of the class “xxx”:
long r = bs.SendBstring(s);