NCR Direct Connect (NDC)
NCR Direct Connect (NDC)
B006-5102-D000
Issue 3
July 2007
Copyright and Trademark Information
The products described in this document are copyrighted works of NCR Corporation.
This publication supports the NCR Direct Connect (NDC) compatible software APTRA Advance NDC for Windows
XP/NT, and NDC+ for OS/2.
Disclaimer:
It is the policy of NCR Corporation to improve products as new technology, components, software, and firmware become
available. NCR therefore reserves the right to change specifications without prior notice.
All features, functions, and operations described herein may not be marketed by NCR in all parts of the world. In some
instances, photographs are of equipment prototypes. Therefore, before using this document, consult with your NCR
representative or NCR office for information that is applicable and current.
To maintain the quality of our publications, we need your comments on the accuracy, clarity, organization, and value
of this document.
© 1997 - 2007
By NCR Corporation
Dayton, Ohio USA
All Rights Reserved
Federal Communications
Commission (FCC) Radio Frequency
Interference Statement
Note: This equipment has been tested and found to comply with
the limits for a Class A digital device, pursuant to Part 15 of the
FCC Rules. These limits are designed to provide reasonable
protection against harmful interference when the equipment is
operated in a commercial environment. This equipment
generates, uses, and can radiate radio frequency energy and, if not
installed and used in accordance with the instruction manual,
may cause harmful interference to radio communications.
Operation of this equipment in a residential area is likely to cause
harmful interference in which case the user will be required to
correct the interference at his own expense.
This digital apparatus does not exceed the Class A limits for radio
Canadian Class A Device noise emissions from digital apparatus set out in the Radio
Declaration Interference Regulations of the Canadian Department of
Communications.
Le présent appareil numérique n’émet pas de bruits
radioélectriques dépassant les limites applicables aux appareils
numériques de la classe A prescrites dans le Réglement sur le
brouillage radioélectrique édicté par le ministère des
Communications du Canada.
Revision Record
Contents
Preface
Chapter 1
Background
Chapter 2
The Structure Of The Terminal Application
S4 and ADI-2....................................................................................2-2
NDC+ and NDC-ADI .....................................................................2-3
High Order Comms ........................................................................2-3
Host ...................................................................................................2-4
Chapter 3
Communications Between the Host, Exits and NDC
Overview ................................................................................................3-1
Communication Between the Host, Exits and NDC ........................3-2
Restrictions on Messages ...............................................................3-2
New Message Classes ...........................................................................3-3
Exit to Host Message ......................................................................3-3
Host to Exit Message ......................................................................3-4
Expanded Transaction Request and Transaction Reply Messages 3-6
Additional Fields in the Transaction Request Message ............3-6
Additional Fields in the Transaction Reply Message ................3-7
Message Security.............................................................................3-8
Status Messages .....................................................................................3-9
Free Form Messages ............................................................................3-11
SNA Translation, IBM Loop/SNA ETX Character.........................3-12
Chapter 4
Message Security
Overview ................................................................................................4-1
Logical Unit Number and MAC Machine Number .........................4-2
Logical Unit Number......................................................................4-2
MAC Machine Number .................................................................4-2
Message Co-ordination Number.........................................................4-3
Selective MAC........................................................................................4-4
Time Variant Number...........................................................................4-5
Top Of Receipt Flag...............................................................................4-6
Transaction Status .................................................................................4-7
Last Transaction Serial Number ...................................................4-7
Last Message Status ........................................................................4-7
Last Dispensed Cash Amount.......................................................4-8
Last Dispensed Coin Amount .......................................................4-8
Trace ........................................................................................................4-9
Chapter 5
Exits
Chapter 6
Devices
Overview ................................................................................................6-1
Device Sharing .......................................................................................6-2
Restrictions on the Use of Devices................................................6-2
Adding New Devices .....................................................................6-3
Error Control....................................................................................6-3
Device Monitoring and Reporting ......................................................6-4
Native Mode ....................................................................................6-4
Diebold Mode ..................................................................................6-4
Chapter 7
Access To NDC
Overview ................................................................................................7-1
Shared Data ............................................................................................7-2
Data Groups ...........................................................................................7-3
Card and Buffer Data .....................................................................7-3
Financial Institution Table Data....................................................7-3
Document Processing Module Data.............................................7-3
Printer Data ......................................................................................7-3
State Control Data ...........................................................................7-3
Communications Data....................................................................7-3
Screen Data ......................................................................................7-3
Timer Data .......................................................................................7-3
Message Mode Options Data ........................................................7-3
MAC Number..................................................................................7-4
Downloaded Configuration Options ...........................................7-4
Counters ...........................................................................................7-4
Miscellaneous Data.........................................................................7-6
Data Accessors .......................................................................................7-7
Read Numerical Item .....................................................................7-7
Read String Item..............................................................................7-7
Write String Item.............................................................................7-8
Dump Data.......................................................................................7-8
NDC+ Screens ......................................................................................7-10
Displaying a Screen and Activating the
Associated Keyboard..................................................................7-10
Chapter 8
Forward Compatibility Considerations
Chapter 9
Reference Information
Chapter 10
Programmer’s Tips
Overview ..............................................................................................10-1
Some Rules For Using Virtual Controllers ......................................10-2
Communications Response Time-out ........................................10-2
Fast Replies to ‘Print Statement and Wait’...............................10-2
ADI-2 Call Restrictions .......................................................................10-3
Multi-tasking .................................................................................10-3
Attaching to and Detaching from S4 Services .................................10-4
Memory Allocation and De-allocation .............................................10-5
Using File Management Interface .....................................................10-6
Linking Exit DLLs................................................................................10-7
Appendix A
Examples of Exits
Overview ...............................................................................................A-1
Example 1 - State Exit...........................................................................A-2
The Code .........................................................................................A-2
The Definition File .......................................................................A-22
The Header File ............................................................................A-22
The Make File ...............................................................................A-24
The Link File .................................................................................A-24
Example 2 - Virtual Controller Exit .................................................A-25
The Code .......................................................................................A-25
The Definition File .......................................................................A-39
The Header File ............................................................................A-39
The Make File ...............................................................................A-40
The Link File .................................................................................A-41
Example 3 - Supervisor Exit ..............................................................A-42
The Code .......................................................................................A-42
The Definition File .......................................................................A-49
The Header File ............................................................................A-50
The Make File ...............................................................................A-50
The Link File .................................................................................A-50
Example 4 - Miscellaneous Exit ........................................................A-51
The Code .......................................................................................A-51
The Definition File .......................................................................A-59
The Header File ............................................................................A-59
The Make File ...............................................................................A-60
Glossary
Glossary .................................................................................... Glossary-1
Index
Index................................................................................................Index-1
List of Figures
Chapter 1
Background
Chapter 2
The Structure Of The Terminal Application
Chapter 5
Exits
List of Tables
Preface
Chapter 3
Communications Between the Host, Exits and NDC
Chapter 5
Exits
Chapter 7
Access To NDC
Chapter 9
Reference Information
This chapter tells you why Exits have been introduced, what
changes to the NDC environment have been made to allow you to
write Exits, and what types of Exit you can write. It also introduces
the NDC shared data mechanism.
This chapter tells you about the structure and principal components
of the software that runs on the terminal.
This chapter tells you about the new messages which have been
introduced to allow Exits to communicate with the host computer. It
also tells you about any changes which have been made to message
types.
This chapter tells you about how you can use NDC security features
to authenticate messages.
Chapter 5, “Exits” 0
This chapter tells you how to write the different types of Exit and
how they are invoked from NDC.
Chapter 6, “Devices” 0
This chapter tells you about the devices NDC allows Exits to share,
how to share devices and any restrictions that apply. It also tells you
how NDC monitors devices.
This chapter tells you about the NDC shared data and about the use
of NDC screens, keyboards and NVRAM.
This chapter tells you how to avoid problems with subsequent NDC
versions, and with migration to APTRA Advance NDC.
Advance NDC
For Advance NDC 3.x, the following table shows what is relevant
and if appropriate, where to find more information.
The overviews are not included in the table as they provide only a
summary of the content in each chapter or appendix.
Advance NDC uses C signatures, so wherever Pascal signatures are
mentioned, substitute a C signature of the following format:
extern "C" <function return value type> <user-defined routine name>
(<parameters>)
Table Pref-1
Relevance of Using NDC Exits to
Advance NDC
“Previous Environment” Does not apply as Advance NDC uses the CEN-XFS
on page 1-3 interface ([Link]
“Exits” on page 1-7 Applies; for more information, refer to the APTRA
Advance NDC, Developer’s Guide, Appendix A, “Using
Exits in Advance NDC”. and the CEN-XFS Exits in
Advance NDC white paper
Chapter 2, “The Does not apply as Advance NDC uses the CEN-XFS
Structure Of The interface with APTRA XFS on NCR SSTs or an
Terminal equivalent on other vendors’ SSTs
Application”
Chapter 4, “Message “Logical Unit Number Applies; refer to the Advance NDC Reference Manual,
Security” and MAC Machine Chapter 7, “Configuration Parameters”
Number” on page 4-2
“Selective MAC” on page Applies; refer to the Advance NDC Reference Manual,
4-4 Chapter 11, “Security Features”
“Time Variant Number” Applies; refer to the Advance NDC Reference Manual,
on page 4-5 Chapter 11, “Security Features”
“Top Of Receipt Flag” on Applies; refer to the Advance NDC Reference Manual,
page 4-6 Chapter 5, “Printer Data” and Advance NDC,
Developer’s Guide, Chapter 7, “Enhancing the
Customisation Layer” and Appendix C, “Common
Data Interface Stores”
“Trace” on page 4-9 Does not apply; refer to Advance NDC, Developer’s
Guide, Chapter 3, Migrating Existing NDC+
Applications to Advance NDC
“Exits” on page 5-2 Applies except for section headed “Error Actions” as
Advance NDC does not journal the listed messages
“Exits - Start of Day Applies to Advance NDC even though only NDC+ is
Initialisation” on page 5-3 referenced in the text
“Exit States” on page 5-4 Applies except for references to Diskbuild and FM; for
more information about STCONT, refer to the Advance
NDC Developer’s Guide
“Hooks” on page 5-23 Applies, but refer to the Advance NDC Developer’s
Guide where indicated; and also the Advance NDC
Display and Keyboard Hooks white paper
“Debugging” on page 5-29 Does not apply; refer to the CEN-XFS Exits in Advance
NDC white paper and the Advance NDC Developer’s
Guide, Chapter 11. “Troubleshooting”
Chapter 6, “Devices” Does not apply; refer to the CEN-XFS Exits in Advance
NDC white paper
“NDC+ Keyboards” on Does not apply as Advance NDC does not support
page 7-15 downloadable keyboard definitions. If different
keyboard layouts are required, they must be specified
through the PIN service provider.
“NVRAM” on page 7-17 Does not apply; Advance NDC uses persistent
memory (pmdata) instead of NVRAM.
Chapter 8, “Forward “Forward Compatibility Applies except no ADI-2 calls are used in Advance
Compatibility Considerations” on page NDC; refer to the Advance NDC, Developer’s Guide,
Considerations” 8-2 chapter 3, “Migrating Existing NDC+ Applications to
Advance NDC” and chapter 4, “Upgrading from
Earlier Releases of Advance NDC”
“Rule Files” on page 9-2 Applies except for the file location, and references to
Diskbuild. Advance NDC uses the Aggregate Builder;
refer to the Advance NDC Developer’s Guide
“Signatures and Synopses Applies, except the following are not implemented in
of the Routines” on page Advance NDC:
9-10 SetDigitalAudioPath
ClearDeviceName
ClearFitnessName
DumpData
ProcessHoCommMsg
For more information about the Supervisor Exit
executor and the Generic Exit executor, refer to the
Advance NDC Developer’s Guide
“Data Available In NDC Applies, but refer to the Advance NDC Developer’s
Structures” on page 9-20 Guide where indicated
“New Screen Definitions” Does not apply; refer to the Advance NDC Supervisor’s
on page 9-46 Guide and the Advance NDC Reference Manual
Chapter 10, “Some Rules For Using Response time-out information applies, but Advance
“Programmer’s Tips” Virtual Controllers” on NDC does not support Fast Ready 9’s
page 10-2
“ADI-2 Call Restrictions” Does not apply; refer to the CEN-XFS Exits in Advance
on page 10-3 NDC white paper and the Advance NDC Developer’s
Guide.
“Attaching to and Does not apply; refer to the CEN-XFS Exits in Advance
Detaching from S4 NDC white paper and the Advance NDC Developer’s
Services” on page 10-4 Guide
“Linking Exit DLLs” on Does not apply as Microsoft Visual Studio is required
page 10-7 for Advance NDC.
Appendix A, “Examples All Do not apply; refer to the CEN-XFS Exits in Advance
of Exits” NDC white paper.
NDC+ 0
If you are using NDC+, you should also refer to the following
NDC+ related publications:
● Self Service Platform Software, Building a Load Disk (B006-1797)
● NCR Self Service Terminals, Band 1 Comms Manual (D1-2197)
NCR provide EMV smart card exits in separate products for NDC+
or APTRA Advance NDC; these are entitled the ‘EMV/CAM2 Exits
for NDC+’ or the ‘EMV/CAM2 Exits for APTRA Advance NDC’
product.
Both these products are supported by the same NDC+ and APTRA
Advance NDC, EMV Integrated Circuit Card (ICC) Reference Manual
(B006-6297).
Other routines must be written by you and loaded onto the terminal
in DLLs. You will supply the names of these routines. Where we
refer to a routine of this kind by name, it appears in this typeface:
ProcessHoCommMsg
Chapter 1
Background
Overview 1-1
Exits 1-7
Exit States 1-7
Exit Supervisors 1-7
Virtual Controllers 1-8
Hooks 1-9
Overview
Overview 1
Purpose of Exits 1
Previous Environment 1
Figure 1-1
Previous NDC+ Environment
1
NDC Host Software
Mgt.
HO
COMMS Devices
NDCADI
Indicators
NDC+
TM-Alert
T.I.
S4
Key
Diags
Permament Communications
Device Sharing CSOH
New Environment 1
HO Shared
COMMS Data Devices
NDCADI
Indicators
NDC+
TM-Alert
T.I.
S4
Key Diags
Data Device Permament Secondary HO
Transfer Sharing Communications Comms Link
CSOH
NDC makes some of its data available to Exits. Data can only be
NDC and Data Sharing 1
following times:
● An Exit is processing its Start of Day initialisation
● An Exit State is in progress
● An Exit Supervisor feature is active
● A Virtual Controller is processing a Transaction
Request/Transaction Reply session or a solicited error response
to a Transaction Reply
● An Exit is processing its device clearing actions
● An Exit is processing its suspend request actions
● An Exit is processing its Supervisor Mode Entry actions
● An Exit is processing its Supervisor Mode Exit actions.
If an Exit is using a device, it must detach from the device before:
● Returning control to NDC
● Requesting NDC to display a screen
● Performing an NDC standard state.
NDC will immediately reattach to a device when the Exit detaches.
For details, see “Device Sharing” in Chapter 6, “Devices”.
Exits 1
state flow in the same way as a standard NDC state. An Exit State
might provide completely new functionality or replace one of the
existing standard NDC states.
But for two very significant exceptions there are no restrictions on
where in the state flow an Exit State can be located. An Exit State can
have a standard NDC state as a next state, and a standard NDC state
can have an Exit State as a next state.
The first exception is State 0 in the state flow and any of its
mandatory followers. You must not replace these with Exit States.
The second exception is the Time-out state, which is hard coded and
cannot be replaced.
Figure 1-3
Virtual Controllers Operate in Outbound
1
HO Comms
VC 4 VC 3
VC 5 VC 2
VC 6 VC 1
NDC+
Hooks are user written routines which NDC calls, at certain points
Hooks 1
Shared Data 1
NDC makes some of its data available to Exits; we call this exposed
data. Exits and NDC can share this exposed data.
NDC+ provides a facility to allow you to dump the shared data for
Debugging 1
debugging.
For details, see “Dump Data” function in Chapter 7, “Access To
NDC”.
Chapter 2
The Structure Of The Terminal
Application
Overview 2-1
Overview
Overview 2
When developing Exits you need to know about and consider the
key elements of the overall application structure. To give you an
understanding of these, this chapter discusses these NDC+
elements:
● S4 and ADI-2
● NDC+
● High Order Comms
● The host application.
For Advance NDC, see the APTRA Advance NDC, Developer’s Guide.
This section tells you briefly about the components which make up
the terminal processing application.
Figure 2-1
Exits Within the NDC+ Environment
2
NDC+ EXITS
NDCADI ADI2
S4
HO Comms
Figure 2-2
NDC+ Communicates With High Order
2
NDC+
Comms via S4
NDCADI
S4
HO Comms
NDC+ does not use ADI-2. Instead it communicates with S4, and
hence with its own devices, through its own Application Device
Interface, NDC-ADI.
Figure 2-3
NDC+ Communicates With the Host via
2
NDC+
High Order Comms
NDCADI
S4
computer.
The host provides the transaction decision making; for example, the
NDC+ application gathers the necessary information from the
cardholder and sends this in a transaction request to the host. The
host decides what should happen and sends commands back to
NDC+ to tell it what to do.
The host driver will already be designed to receive and interpret
messages from the terminal and to encode messages in NDC+
format.
Chapter 3
Communications Between the Host,
Exits and NDC
Overview 3-1
Overview
Overview 3
When you develop Exits, you may want these to communicate with
the host. There are three different ways to do this, these are:
● Using two new NDC+ messages classes - Exit to Host and Host
to Exit messages
● Using new additional fields within the Transaction Request and
Transaction Reply messages
● Using another logical communications connection to send free
form messages.
In addition, NDC+ also provides routines that allow Exits to send
status messages to the host.
can be received from the host, if Exits are used. The message size
must be less than 4 KB. This is because the pipes used to pass
messages between Advance NDC and AANDCIA have a buffer size
of 4 KB. If a message of 4 KB or more is sent, the system will hang.
If you wish to develop CEN-XFS Exits with Advance NDC to extend
your application, see the CEN-XFS Exits in Advance NDC, White
Paper.
Some other restrictions apply to all messages:
● The maximum length of a message to the host is 1622 bytes
● There may be a maximum length for messages to the terminal.
This maximum will depend on the communications protocol
being used
● Hardware restrictions may impose further limits on maximum
message lengths
● Where NDC+ is to transmit a message type that it knows of, the
Exit must obey the format and rules for that type of message
● NDC+ does not perform any MACing or security tagging on
non standard message types.
Note: The MAC Field Selection Load message has been modified to
provide security for expanded Transaction Request and Transaction
Reply messages.
where:
Note Calling this routine does not free any memory allocation
associated with the string parameter.
NDC+ adds fields b, c, d and the FS and transmits the specified data
as field f, in the following message format.
FS Field Separator M 1
e Field Separator M 1
c Response Flag O 1
FS Field Separator M 1
FS Field Separator M 1
FS Field Separator M 1
where:
Note: NDC+ will release the memory allocated for the string after
the DLL call terminates.
Note The data in the additional fields must not contain Field
Separator, FS, (01C hex) Group Separator, GS, (01D hex) characters,
as NDC+ uses these to interpret the message.
FS 1 O
FS 1 O
FS 1 O
FS 1 O
FS 1 O
FS 1 O
FS 1 O
FS 1 O
FS 1 O
FS 1 O
Status Messages 3
where:
3 Illegal message
Exits can communicate with the host by sending and receiving free
form messages, via NDC+ acting as a communications gateway,
using the new Exit to Host and Host to Exit messages.
If the communications protocol supports multiple logical
connections, then the Exit can establish its own connection.
If the protocol supports multiple logical connections, you can if you
wish establish connection with more than one host.
If you are sending free form messages to the host using NDC+ as a
communications gateway, the NDC+ host will need to be updated
in order to interpret the messages.
Chapter 4
Message Security
Overview 4-1
Trace 4-9
Overview
Overview 4
This chapter tells you about the data and the features that NDC uses
to make its messages secure.
Certain fields in the standard message formats are used for
authentication and verification. We call these security fields. The
processes of authentication and verification ensure that messages
have not been interfered with in transmission and that they come
from where they purport to have come from. The use of some fields
are optional and controlled by setting security flags during terminal
configuration.
For the use of these fields and flags, see the APTRA Advance NDC,
Reference Manual or the NDC+ Programmer’s Reference Manual. In the
sections that follow in this chapter, we discuss each field as it
operates when the security flags controlling its inclusion are on.
All the security fields are set by NDC on outbound messages and
tested by NDC on inbound messages. Messages which fail
authentication are not processed.
Some of the security fields can be accessed as NDC shared data.
Different security fields are used to authenticate different types of
message. This chapter discusses the various techniques available
within NDC to protect messages passing between the host and the
terminal. The chapter covers:
● Logical Unit Number and MAC Machine Number
● Message Co-ordination Number
● Selective MAC
● Time Variant Number
● Top of Receipt Flag
● Transaction Status
● Trace.
The Logical Unit Number and MAC Machine Number can be used
to uniquely identify the terminal from which a message was
transmitted.
The Logical Unit Number (LUNO) is a three digit number. Its initial
Logical Unit Number 4
Exit Impact 4
Exit Impact
The MAC Machine Number field will be added and checked at a
point between the last outbound Virtual Controller, or first inbound
Virtual Controller and the High Order Comms. Like the LUNO, the
Exit application does not need to add the MAC MAchine Number,
but simply ensure that the field separators that delimit the LUNO
and MAC Machine Number are supplied.
Selective MAC 4
Exit Impact 4
For Solicited Status messages, NDC will add the Time Variant
Number and the following field separator before passing the
message to High Order Comms. The Exit application does not have
to do anything.
For Transaction Request Messages, the Exit application should add
delimiting field separators to the message before it is passed to High
Order Comms.
The Top Of Receipt Flag is used to indicate to the host the present
state of the receipt printer. It is a mandatory one-byte field which is
transmitted in Transaction Request messages.
This flag is not returned to NDC in any message.
The meaning of the flag is:
● TRUE - the paper in the receipt printer has been cut and no more
printing performed
● FALSE - Any other state.
Exit Impact 4
You must allocate one byte to this flag when a Virtual Controller
passes a Transaction Request message on to the ‘real’ host. The
present value of the flag will be copied into the message by NDC at
a point between the last outbound Virtual Controller and the High
Order Comms.
Transaction Status 4
This subfield takes one of four values, representing the last status
Last Message Status 4
sent by NDC:
0 No status sent
1 Ready sent
2 Status sent
3 Reject sent
NDC normally sets this subfield. It allows the host to verify the
Last Dispensed Cash number of notes dispensed by the last dispenser operation. This
Amount 4
subfield is present when the Counters Status is queried and also,
under option control, in the Transaction Request message.
Treat this subfield with caution.
If an Exit performs hidden note dispense operations, it will have to
manipulate this field so as to provide a valid total to the host.
Trace 4
Chapter 5
Exits
Overview 5-1
Exits 5-2
Error Actions 5-2
Hooks 5-23
Understanding MISCONT 5-23
Start Of Day - Hook 5-24
Clearing Fitness - Hook 5-24
Physically Clearing Devices - Hook 5-25
Suspend Mechanism - Hook 5-25
High Order Comms Message for an Exit - Hook 5-26
Close State Processing - Hook 5-26
Miscellaneous Support File Control (MISCONT) Error Handling
5-27
Using MISCMULT 5-27
NDC+ 5-27
Advance NDC 5-27
Debugging 5-29
Overview
Overview 5
Exits 5
Error Actions 5
NDC+ will also print the following details along with the error
message: the Exit DLL name, the routine name and an error value
from the operating system. The error messages are tagged with a
standard NDC+ security header.
For more information on these error messages see Appendix C,
“Error Messages” of the NDC+ Supervisor’s Reference Manual.
At the Start of Day NDC+ will attempt to load the Exit support files
Errors at Start of Day listed above. The following table details what happens if an error
Initialisation 5
occurs.
MISCONT Table not present, NDC+ will not be able to call any of
Load error the Hooks DLLs.
Exit States 5
of all the states being used, both NDC+ standard states and Exit
states. When NDC+ is processing the state flow it looks in the rule
file STCONT for the details it needs to validate the state table
entries. After successful validation, if a state is marked as an Exit
state, NDC+ loads the DLL and calls the routine specified to
implement that state.
A default version of STCONT containing entries for the standard
NDC+ state types is supplied. If you create Exit states, you will need
to edit STCONT with the details. You will also need to include the
edited STCONT with the DLLs in an FM object for input to
Diskbuild/2. See Appendix K of the NCR publication NDC+
Programmer’s Reference Manual for details.
The file STCONT holds one entry per state type. Each entry is as
follows:
Group separator
Group separator
Group separator
Group separator
Primary state table, The Primary state table max. limits specify
max. limits the maximum value for each entry in the
runtime state table for this state type. The
limits are specified as four ASCII digits. A
fifth digit indicates an extension state
associated with this field. The entries are
specified as eight groups of five ASCII
digits. See Note 2.
Group separator
Field Description
1st extension state table, The 1st extension state table max. limits
max. limits specify the maximum value for each entry
in the runtime state table for the 1st
extension state of the primary state. The
limits are specified as eight groups of four
ASCII digits.
Group separator
Nth extension state table, This and the preceding Group separator
max. limits repeat for each extension state for this
primary state.
The Nth extension state table max. limits
specify the maximum value for each entry
in the runtime state table for the Nth
extension state of the primary state. The
limits are specified as eight groups of four
ASCII digits. Up to 8 extension states are
permitted for each primary state.
Field separator
Next Entry
in the STCONT rule file. After successful validation, if the state type
has a Support Flag value of ‘E’, indicating an Exit state, it loads the
DLL and calls the specified routine.
The routine must comply with the following signature:
where:
The Exit routine must return the number of its successor state.
When this call is made, the Exit state will be regarded as having
temporarily completed its actions. Before making the call, the Exit
must detach from all devices so NDC+ can reattach to all known
devices.
The signature of this routine is:
where:
TableExitId
Meaning
Value
TableExitId
Meaning
Value
In the table, first, second, third, and so on refer to the first, second,
third occurrence of an extension entry in the main state definition.
Values Returned 5
Value Meaning
NDC+ will cause the terminal to go into the Default Close State, if
State Table (STCONT) any of the following conditions occur:
Error Handling 5
● Support flag indicates an Exit state, but the DLL and/or routine
name are not specified fully
● An error occurs in either loading the DLL or calling the specified
routine
● State table data downloaded by host outside the specified
maximum limits
● Illegal values in State Table entries; for example, hex or
alphabetic values.
Exit Supervisors 5
The supplied default SUPCTR file already has entries for the
Understanding SUPCTR 5
Group Separator
Group Separator
Group Separator
Field Description
Group Separator
Group Separator
Group Separator
Field Separator
Next Entry
To replace the initial NDC+ Supervisor menu with your own Exit
How to Replace the Initial Supervisor menu:
NDC+ Menu with an Exit
Supervisor Menu 5
The entries in SUPCTR establish the link between the menu, the
Signature of Exit function number and the Exit DLL name and routine name.
Supervisor Routines 5
where:
0 Select
1 Replenish
2 Configure
3 Access
4 Reserved
5 Reserved
6 Reserved
0 Cardholder interface
1 Rear interface
0 Cardholder interface
1 Rear interface
where:
2 Out of service
4 In service
5 Offline
If the Auto Exit option is set (option 5 on the Access menu) the
Stop Supervisor Hook 5
INIT ENTRY option has been set to NDC+ will default to the Select
2, but no initial menu of FF (hex) has menu.
been specified in the SUPCTR file.
Virtual Controllers 5
Figure 5-1
Virtual Controllers Operate in Outbound
5
HO Comms
VC 4 VC 3
VC 5 VC 2
VC 6 VC 1
NDC+
NCR does not supply the file VCCONT. You must create it if you
Understanding VCCONT 5
Group separator
Field separator
Next Entry
You will also need to create the DLL and routine that provides the
functionality for the Virtual Controller.
In addition to creating the VCCONT file, you will also have to create
DLLs 5
the Virtual Controller DLLs. The DLL routines must have one of the
following signatures:
where:
Value Meaning
Structure of Messages 5
Reserved 1 Byte
Reserved 1 Byte
Reserved 30 Bytes
Reserved 1 Byte
Reserved 1 Byte 0
Reserved 1 Byte 0
Reserved Var
VCCONT File Missing at Start of The link between NDC+ and High
Day Order Comms is maintained.
Hooks 5
If you use Exits, you may need to make use of some or all of the
Understanding MISCONT 5
For the differences with Advance NDC, see the APTRA Advance
NDC, Developer’s Guide.
MISCONT has an entry for each Hook required and has the
following structure.
Group separator
DLL name The name of the DLL that includes the Hook routine,
which must be at least four characters in length.
Group separator
Field separator
Next Entry
At start of day, NDC+ calls the Start of Day hook to allow the Exit
Start Of Day - Hook 5
system to perform any start of day activity it needs to. The routine
must have the following signature:
The DLL and routine name are specified in the MISCONT file with a
point-of-use value of 8.
where:
For a full description of DIGs, see the section called “Solicited Status
Messages“ in the NDC+ Programmer’s Reference Manual.
Device sharing and data sharing are not available while the
ClearFitnessName Exit is running.
There is no limit set on the time for this Exit to complete, however,
you must make sure that it completes within any other prevailing
time limit.
The DLL and routine name are specified in the MISCONT file with
point-of-use value of 4.
where:
There is no limit set on the time for this Exit to complete, however,
you must make sure that it completes within any other prevailing
time limit.
The DLL and routine name are specified in the MISCONT file with
point-of-use value of 5.
1 Suspend needed
There is no limit set on the time for this Exit to complete, however,
you must make sure that it completes within any other prevailing
time limit.
The DLL and the routine name are specified in the MISCONT file
with point-of-use value of 6.
where:
where:
The DLL and routine name(s) are specified in the MISCONT file
with point-of-use value of 9.
These routines can be used to access shared data, and to access
NDC+ devices.
DLL or routine name not fully The hook will not be called.
specified or an error is detected on
loading or calling the specified routine
NDC+ 5
Advance NDC 5
If you do not wish to use multiple Exit libraries (for example, if you
are not using EMV Exits) then you do not need to use MISCMULT.
However, to use multiple Exit libraries with Advance NDC,
MISCMULT must be used.
When using multiple Exit libraries with MISCMULT in Advance
NDC, the names which can be used in the MISCONT file are as
follows:
1 miscmult SuperEntryHooks
2 miscmult SuperExitHooks
3 miscmult StopSuperHooks
8 miscmult StartOfDayHooks
9 miscmult CloseStateHooks
For further details of using multiple exit hooks with Advance NDC,
see Appendix A ‘Using Exits in Advance NDC’ in the APTRA
Advance NDC, Developer’s Guide.
Debugging 5
This section provides you with tips on what is required at the SST
before you can begin debugging NDC+ Exits. General Advance
NDC debugging tips are included in the APTRA Advance NDC,
Developer’s Guide.
Firstly you will need to create a DLL with debug information, and
with the switches and options appropriate to the Exit. For details,
see your Microsoft C publications.
Presentation Manager must be present on the SST to perform
debugging, and [Link] must be commented out in the RUN
file, by adding a semicolon at the start of the line:
C:\NDCADI\[Link]
cvp /l \s4dll\[Link]\ndcadi\ndcia
Chapter 6
Devices
Overview 6-1
Overview
Overview 6
If you develop Exits, you will probably want to make use of some of
the terminal devices. You may also want to add new devices, not
currently supported by NDC+.
This chapter discusses:
● Device Sharing - which devices you can share, which ones
NDC+ does not allow you to share, what you need to do to
share a device, and restrictions that apply when you share
certain devices
● Device Monitoring and Reporting - how NDC+ monitors
devices in Native and Diebold mode.
Device Sharing 6
terminal by adding new devices to it. You cannot add any device
unless there is S4 support for it. An example of a new device which
might be added to an SST under Exit control would be a Smart Card
Reader.
If control passes back from an EXIT to NDC+ and the Exit fails to
Error Control 6
relinquish a device, NDC+ will stop and after two minutes will
system escape with a file ID of 3D hex and a caller ID of A9 hex.
Ready message.
Chapter 7
Access To NDC
Overview 7-1
NVRAM 7-17
Overview
Overview 7
Shared Data 7
NDC+ makes some of its data available as exposed data for use by
Exits. A summary of the exposed data is given in the rest of this
chapter and full details are given in “Data Available In NDC
Structures” on page 9-20.
During the periods that NDC+ has relinquished control of the
terminal to Exits, the Exits can read and write the shared data.
When NDC+ is about to invoke an Exit, it copies the shared data
from storage locations in NDC+ to a shared data area. When the Exit
operation is complete, NDC+ copies the shared data back to its
original locations.
More information on data sharing restrictions when using Virtual
Controllers is given in “Data and Device Sharing” on page 5-16.
NDC+ shared data are grouped into groups of similar function. A
numeric identifier and a mnemonic are associated with each data
item. The mnemonics are held in the C header file NDCDATA.H. As
this file contains a number of optimisations you should always use
it when you are accessing the shared data.
In order to read or write shared data items, you must use the
accessor routines held in the DLL [Link].
Care must be taken when modifying shared data. NDC+ offers very
little protection against misuse.
Note The Exit must update any data elements which are affected by
its operations; for instance, if the Exit ejects the card, it is responsible
for setting the card state variable appropriately.
Data Groups 7
The shared data are grouped as follows. There is a full table of all
the data items in “Data Available In NDC Structures” on page 9-20.
The data in this group cover the state of the card, whether the card is
Card and Buffer Data 7
This group covers whether a match has been found for the financial
Financial Institution Table institution referred to on the card, and the values from the financial
Data 7
institution table.
printers. Note that DPM and Envelope Dispenser first use flags are
also included here.
This group includes current state number, next state number and
State Control Data 7
state table data for the primary and any extension states.
This gives the screen offset for language partitions, and the override
Screen Data 7
This gives the type of status messages currently in use and the
Message Mode Options values of entered option strings.
Data 7
The six byte MAC number is available in this group together with
MAC Number 7
Table 7-1
Counters
Count
Device Description Data Accessor ID Backup Accessor ID
Method
Count
Device Description Data Accessor ID Backup Accessor ID
Method
Note 4: If the value of this variable is 65535, then leave alone during
device response processing. If the value is less than the
corresponding Coin Dispenser response Replenishment Count field,
set the variable to 65535. If the value is greater or equal to, reduce
the value of this variable by the Replenishment Count field value.
Standard Counts 7
The coin and cash dispensers may have standard amounts added
during replenishment. These values are specified in IdStdCoin1.. 4,
and IdStdNotes1 .. 4 respectively.
Data Accessors 7
You can use the supplied data accessor routines to read and write
the shared data items when an Exit is in control of the system. The
accessors are supplied in [Link]. When using them, you
should #include the header file NDCDATA.H.
To aid in debugging, there is a dump data function. This copies the
shared data to a file when an Exit starts and finishes, so that you can
inspect it.
This function returns the value of a numeric data item. Its signature
Read Numerical Item 7
is:
extern unsigned long pascal far _loadds
GetIntVal(long ID);
where:
where:
This function copies a numerical value into the exposed data area.
Write Numerical Item The value will be truncated to ensure that it can be stored in the
target NDC+ variable, if necessary. When NDC+ resumes control, it
will copy the value from the shared data area into its internal
storage.
The signature of this routine is:
extern void pascal far _loadds PutIntVal(long ID,
long NewValue);
where:
the routine system escapes with file ID 47 hex and caller ID A2 hex.
This function copies a string into the exposed data area. The first
Write String Item 7
where:
the routine system escapes with file ID 47 hex and caller ID A3 hex.
where:
NDC+ Screens 7
where:
where:
ScreenData may point to more than one set of screen data. Multiple
sets of screen data must be delimited by field separators (1C hex). If
the screen is associated with a custom keyboard, you must delimit
the keyboard information with group separator characters (1D hex).
Each set of screen data is in the format
Group Separator
Group separator
Touch data
32 ASCII digits giving a valid IEEE value
2 characters for return code: any two ASCII
digits
Group separator
Nest data
3 character ASCII decimal value that refers to a
keyboard number
Group separator
Return Value 7
from the NDC+ screen pool. The routine is supplied in the DLL
[Link]. Its signature is:
where:
Return Value 7
The screen data is displayed at the current cursor position and uses
the current text attributes, such as font and colour. Adding screen
control characters allows you to change the display, for example the
cursor position, text colour, or the displayed picture.
DisplayString is supplied in the DLL [Link],
included from NDCCUSTS.H and linked with [Link]. Its
signature is:
extern void far_loadds DisplayString ( const char* screenData,
unsigned long ScreenDataLength, unsigned long bFocusWindow,
unsigned long inSupv );
where:
NDC+ Keyboards 7
where:
Keyboard Number
3 characters for each keyboard number followed
by possible multiples of:
Group separator
Touch data
32 ASCII digits giving a valid IEEE value
2 characters for return code: any two ASCII digits
Group separator
Nest data
3 character ASCII decimal value that refers to a
keyboard number
Group separator
Return Value 7
NVRAM 7
Chapter 8
Forward Compatibility
Considerations
Overview 8-1
Overview
Overview 8
This chapter tells you how to avoid possible conflicts with future
versions of NDC. It discusses forward compatibility considerations
and sets out conditions that you as an Exit programmer must follow
to ensure that your Exits will run under future versions of NDC.
In the chapter you will find information on:
● State Letters Available For Exits Use
● Supervisor Menus And Menu Numbers Available For Exits Use
● Migration To Advance NDC considerations
● Screen Numbers
● Timers.
Forward Compatibility
Considerations 8
The state letters d, e, f and g (lower case: 64, 65, 66 and 67 ASCII
State Letters Available for hex) are available for use as Exit state types.
Exits Use 8
If you want to write more than four Exit state types, we recommend
you to use the second field in the State Table to define extension
states. If you do this, the Exit must validate that second field of the
State Table entry.
The SUPCTR rule file defines the functions and menu numbers
Supervisor Menus and available for Exits:
Menu Numbers Available ● To add Exit Supervisor functions to existing NDC+ Supervisor
for Exits Use 8
Exit use. This is because screens and keyboards can be loaded onto
the terminal by host download. You must ensure that the host
application will not overwrite any screens or keyboards that you
define.
Chapter 9
Reference Information
Overview 9-1
Overview
Overview 9
Rule Files 9
If you create Exit states, you will need to add details of these to
STCONT. You will also have to update STCONT along with the
DLLs in an FM object for input to Diskbuild/2. See the NCR
publication NDC+ Programmer’s Reference Manual, Appendix K, for
details.
For each valid state type, the table specifies the following
information:
● Whether the state type is NDC+ standard or an Exit state
● The number of associated state table entries and the maximum
value of each of the entries
● Which state table entries are references to extension states.
STCONT consists of a number of entries, one for each state type. The
structure of each entry is:
1st extension state table, max. limits Var, max 8 sets of 4 bytes
2nd extension state table, max. limits Var, max 8 sets of 4 bytes
3rd extension state table, max. limits Var, max 8 sets of 4 bytes
4th extension state table, max. limits Var, max 8 sets of 4 bytes
Number of
Field Description Value
Bytes
5th extension state table, max. limits Var, max 8 sets of 4 bytes
6th extension state table, max. limits Var, max 8 sets of 4 bytes
7th extension state table, max. limits Var, max 8 sets of 4 bytes
8th extension state table, max. limits Var, max 8 sets of 4 bytes
The State Type Character specifies the State Letter. The state
letters d to g (lower case) are available for use as Exit state types.
● Support flag
Note: Any Support Flag entry other than ‘E’ or ‘N’ will be
regarded as ‘N’.
‘State Table Max Limits’ specify the maximum value for each entry
in the run-time state table. The limits are specified as eight groups of
four ASCII digits.
The primary state table max. limits each include an additional byte.
This byte indicates whether the entry refers to an extension state
associated with the primary state. A value of ‘0’ indicates that this is
not such a reference. Values of ‘1’ to ‘8’ indicate that this is a
reference to the first, second, etc., extension state. An entry with the
value ‘1’ to ‘8’ will result in the matching limit being replaced by the
maximum state number supported by the current release of NDC.
Number of
Field Description Value
Bytes
Note: You must include a field separator after the last entry in the
table.
For information on error conditions, see “Supervisor Table Control
(SUPCTR) Error Handling” on page 5-14.
Note: You must include a field separator after the last entry in the
table.
Each hook has a point-of-use of use value, which links the hook
with its corresponding entry in the table.
Note: You must include a field separator after the last entry in the
table.
The following call back routines are held in the file [Link]:
Call Backs Held In
[Link] 9 PerformNDCState 9
where:
StateLetter is the state letter of the required state
RetrieveKeyboard 9
where:
KeyboardNumber Number of the keyboard
RetrieveScreen 9
where:
SendStatus 9
where:
SendUnformatedData 9
where:
StoreScreen 9
where:
PrintToJournal 9
where:
SetDigitalAudioPath 9
where:
where:
ScreenGroup is NDC+ screen group to use.
DisplayString 9
where:
screenData is the string to display from the current cursor position.
where:
GetStringVal 9
where:
PutIntVal 9
where:
PutStringVal 9
where:
malloc 9
where:
_fmalloc 9
where:
free 9
where:
_ffree 9
where:
DumpData 9
Control File 9
where:
where:
OutboundMessageIntercept, InboundMessageIntercept 9
where:
Miscellaneous Support
File 9
Invoked when NDC+ is physically clearing any device.
where:
ClearFitnessName 9
where:
InitialiseExitRoutine 9
NDCSuspendName 9
ProcessHoCommMsg 9
where:
SupEntryName 9
where:
SupExitName 9
where:
SupStopName 9
SetDigitalAudioPath 9
where:
The DLL and routine name are specified in the MISCONT file with
point-of-use value of 5.
EnteredCloseStateRoutine 9
where:
The DLL and routine name(s) are specified in the MISCONT file
with point-of-use value of 9.
These routines can be used to access shared data, and to access
NDC+ devices.
In this section we list the NDC+ shared data. The shared data items
are listed in groups, so that related data items are shown together.
Note: The data type which NDC+ uses internally for a particular
data item is not necessarily the data type which GetIntVal or
GetStringVal will return, nor the type which PutIntVal and
PutStringVal accept. For example, the card state is held internally
as a byte, but the accessors return and accept an unsigned long. All
shared data is accepted and returned as either an unsigned long or
a NULL terminated string. The tables show both the internal data
type and the data type used by the accessors.
NDC+ performs the data conversion between internal and external
data types. Where a value is too long to fit into the internal storage,
it is truncated.
Table 9-5
Card And Buffer Data
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
Track 1 data 78 string IdT1Data Track data from the magnetic card.
Bytes 20H - 5FH including sentinels.
Track 2 data 39 string IdT2Data Track data from the magnetic card.
Bytes 30H - 3FH including sentinels.
Track 3 data 106 string IdT3Data Track data from the magnetic card.
Bytes 30H - 3FH including sentinels.
Track 1 data length Byte unsigned IdT1DataLen Length of data in IdT1data buffer.
long This must be updated if the length
of data in the buffer is updated by a
C-Exit state.
Track 2 data length Byte unsigned IdT2DataLen Length of data in IdT2data buffer.
long This must be updated if the length
of data in the buffer is updated by a
C-Exit state.
Track 3 data length Byte unsigned IdT3DataLen Length of data in IdT3 data buffer.
long This must be updated if the length
of data in the buffer is updated by a
C-Exit state.
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
Buffer B digits after Byte unsigned IdBufBPoint 0..12. Indicates decimal point
decimal point long position of the next buffer.
Buffer C digits after Byte unsigned IdBufCPoint 0..12. Indicates decimal point
decimal point long position of the next buffer.
Op code buffer 8 Bytes string IdOpBuffer ‘A’..’D’, ‘F’.. ‘I’ and 20H
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
Table 9-6
Financial Institution Table Data
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
Table 9-7
Document Processing Module Data
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
DPM Read Zone 0 Byte unsigned IdRdZo0Sta The status will be decimal zero
Status long when reset by NDC+. Otherwise it
will contain the ASCII equivalent of
the status returned by the DPM.
DPM Read Zone 0 100 string IdRdZo0Data Data read from the DPM
Data Bytes
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
DPM transaction in Byte unsigned IdDPMTrans Set to TRUE when a function S reply
progress long has gone beyond the point of being
specifically rejected.
Candidate 1 used Byte unsigned IdCan1Used Set to TRUE when the first of a
long number (max 3) of candidates has
been selected.
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
Table 9-8
Printer Data
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
Table 9-9
State Control Data
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
Next state number word unsigned IdNextStateNumber 000-750. The state to go to next.
long Used by NDC+ after Exit State
operation completes.
Current state type byte unsigned IdCurrStateType For state types, see “State Tables” in
long the NDC+ Programmer’s Reference
Manual, or any Exit state types.
State table data 8 8 unsigned IdStateData0 The state table data for the current
words longs . state, without the current state type
. (provided above).
IdStateData7
Primary extension 8 8 unsigned IdPrimExStateData0 The state table data for the current
state table words longs . state first level extension state,
. without the state type (Z).
.
IdPrimExStateData7
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
Table 9-10
Communications Data
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
MCN range option Byte unsigned IdmCNRngOpt Identifies the MCN range :
long 0 - MCN is from 31H to 3FH
1 - MCN is from 31H to 7EH.
Available in Native mode only.
Transaction Serial 4 bytes string IdTSN Serial number for last transaction
Number
Table 9-11
Screen Data
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
Screen offset for word unsigned IdScreenOffset 0...999. Decimal value of the offset
language long to the first screen number for
partitioning current language partition.
Table 9-12
Timer Data
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
Timer 82 - Camera Byte unsigned IdTimer82 For Timer descriptions, see the
Delay Timer (Not long “Configuration Parameters Load”
supported by section in Chapter 4 of theNDC+
Advance NDC) Programmer’s Reference Manual.
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
Table 9-13
Message Mode Options Data
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
Table 9-14
MAC Number
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
MAC Number 6 bytes string IdMACNo The first 6 characters of MAC entry
in the Access menu. See the
“Security Features” section in the
NDC+ Programmer’s Reference
Manual, and the “Access Menu”
section in the NDC+ Supervisor’s
Reference Manual.
Table 9-15
Downloaded Configuration Options
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
Limit Repeated Use byte unsigned IdLimitTimeoutState 000 - Do not enter Timeout state
Of Timeout State long 00x - Enter Timeout state up to x
Option times (x = 1 to 9)
255 - No limit on number of times
the Timeout state is entered
Cash Dispenser byte unsigned IdPurgeAfterPresent 000 - Do not perform purge after a
Purge After Present long good present
Option 001 - Perform purge after a good
present
Table 9-16
Counters
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
Cards Last Cleared 6 bytes string IdCardClrDate Year, month, day, hour, minute,
Date second
Cash Last Cleared 6 bytes string IdCashClrDate Year, month, day, hour, minute,
Date second
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
Notes Purged From word unsigned IdNotesPurgedType1 Cumulative count of purged notes
Cassette Type 1 long
Notes Purged From word unsigned IdNotesPurgedType2 Cumulative count of purged notes
Cassette Type 2 long
Notes Purged From word unsigned IdNotesPurgedType3 Cumulative count of purged notes
Cassette Type 3 long
Notes Purged From word unsigned IdNotesPurgedType4 Cumulative count of purged notes
Cassette Type 4 long
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
Backup Notes In word unsigned IdBackNotes1 Backup copy of count set at start of
Cassette Type 1 long dispense processing
Backup Notes In word unsigned IdBackNotes2 Backup copy of count set at start of
Cassette Type 2 long dispense processing
Backup Notes In word unsigned IdBackNotes3 Backup copy of count set at start of
Cassette Type 3 long dispense processing
Backup Notes In word unsigned IdBackNotes4 Backup copy of count set at start of
Cassette Type 4 long dispense processing
Backup Notes word unsigned IdBackPurge1 Backup copy of count set at start of
Purged From long dispense processing
Cassette Type 1
Backup Notes word unsigned IdBackPurge2 Backup copy of count set at start of
Purged From long dispense processing
Cassette Type 2
Backup Notes word unsigned IdBackPurge3 Backup copy of count set at start of
Purged From long dispense processing
Cassette Type 3
Backup Notes word unsigned IdBackPurge4 Backup copy of count set at start of
Purged From long dispense processing
Cassette Type 4
Backup Notes word unsigned IdBackDisp1 Backup copy of count set at start of
Dispensed From long dispense processing
Cassette Type 1
Backup Notes word unsigned IdBackDisp2 Backup copy of count set at start of
Dispensed From long dispense processing
Cassette Type 2
Backup Notes word unsigned IdBackDisp3 Backup copy of count set at start of
Dispensed From long dispense processing
Cassette Type 3
Backup Notes word unsigned IdBackDisp4 Backup copy of count set at start of
Dispensed From long dispense processing
Cassette Type 4
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
Envelope Last 6 bytes string IdEnvClrDate Year, month, day, hour, minute,
Cleared Date second
Coins Last Cleared 6 bytes string IdCoinClrDate Year, month, day, hour, minute,
Date second
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
Table 9-17
Miscellaneous Data
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
Current version 6 bytes string IdCurrVersion Identifies the version of NDC, for
example ‘020600’ for Advance NDC
release 02.06.00
Enable transaction byte unsigned IdPlsWaitEnableNext 0FFH - NDC+ will display the
request ‘please long ‘please wait’ screen.
wait’ screen when 0 - NDC+ will not display the
next request or screen.
OAR sent.
Enable transaction byte unsigned IdPlsWaitEnableRep 0FFH - NDC+ will display the
request ‘please long ‘please wait’ screen.
wait’ message if 0 - NDC+ will not display the
current transaction screen.
reply processing is
successful
Machine Number 6 bytes string IdMachineNo ASCII set of digits entered in the
Machine Number function in the
Configure menu.
NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type
Current State Of byte unsigned IdTMADispActive Not currently used by NDC+ / TM-
TM-Alert Display long Alert
For the latest screens defined in Advance NDC, see the APTRA
Advance NDC, Supervisor’s Guide and the APTRA Advance NDC,
Reference Manual.
Chapter 10
Programmer’s Tips
Overview 10-1
Overview
Overview 10
When using ADI-2 with Exits, certain ADI-2 calls may either be not
recommended or have restrictions placed upon their use. Any
ADI-2 functions that are not described below have no restrictions
placed upon their use, and can be used as described in the NCR
Publication Self Service Platform Software C Programmer’s Reference
Manual.
The routines within the Exit DLLs will be called from an NDC+
Multi-tasking 10
Appendix A
Examples of Exits
Overview A-1
Overview
Overview A
This appendix gives four examples of Exits which you may find useful
when you start to create your own Exits.
Each example contains:
● code
● a definition file
● a header file
● a make file
● a link file
The Code A
/****************************************************************************/
/* */
/* MODULE NAME : exstates.c */
/* */
/* DESCRIPTION : Exits state code */
/* */
/* */
/****************************************************************************/
#include <malloc.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include “s4dundee.h”
#include “s4adi2.h”
#include “\pj015\code\600\ndcdata.h”
#include “exconst.h”
#include “exgener.h”
#include “exstates.h”
/****************************************************************************/
/* */
/* PROCEDURE NAME : PutValues */
/* */
/* DESCRIPTION : Places values into primary state table positions. */
/* */
/****************************************************************************/
void PutValues(long val_0, long val_1, long val_2, long val_3, long val_4, long
val_5, long val_6, long val_7)
{
PutIntVal(IdStateData0, val_0); PutIntVal(IdStateData1, val_1);
PutIntVal(IdStateData2, val_2); PutIntVal(IdStateData3, val_3);
PutIntVal(IdStateData4, val_4); PutIntVal(IdStateData5, val_5);
PutIntVal(IdStateData6, val_6); PutIntVal(IdStateData7, val_7);
}
/****************************************************************************/
/* */
/* PROCEDURE NAME : State_1 */
/* */
/* DESCRIPTION : Allows testing of DumpData when shared data is */
/* transferred from NDC to Exits (OPDATA) and Exits to */
/* NDC (INDATA). */
/* */
/****************************************************************************/
unsigned short pascal far _loadds State_1(unsigned char StateType)
{
BYTE tdata[200];
BYTE detachable = FALSE;
WORD cardholder_keyboard_dev;
send_msg_type send_msg;
enable_rsp_type *response;
BYTE ActiveFDKs = 0;
int Cancel_NextStateNum = 0;
unsigned short ScreenGroup = ‘0’;
unsigned short ScreenNumber = 0;
unsigned short UpdateKeyboard = 0;
unsigned short Idle = 0;
StateType;
ScreenNumber = (unsigned short) GetIntVal(IdStateData0);
Cancel_NextStateNum = (unsigned short) GetIntVal(IdStateData1);
ActiveFDKs = (BYTE) 0xF; /* Only FDK_A to FDK_D */
DisplayScreen(ScreenGroup, ScreenNumber, UpdateKeyboard, Idle);
LookUpDev(“CARDHOLDER_KEYBOARD”, &cardholder_keyboard_dev);
AttachDev(cardholder_keyboard_dev, &detachable);
initialise_keys(cardholder_keyboard_dev, &send_msg);
enable_cancel_key(&send_msg); enable_FDK_keys(ActiveFDKs, &send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);
/* Wait for keypress */
get_keys(cardholder_keyboard_dev, &detachable, tdata);
DetachDev(cardholder_keyboard_dev, detachable);
response = (enable_rsp_type *) &tdata[0];
switch (response->tdata[0])
{
case FDK_A:
DumpData(1L, 1L); /* Activates dumping to OPDATA and INDATA files */
break;
case FDK_B:
DumpData(0L, 0L); /* Deactivates dumping to OPDATA and INDATA files
*/
break;
case FDK_C:
DumpData(1L, 0L); /* Activates dumping to OPDATA file only */
break;
case FDK_D:
DumpData(0L, 1L); /* Activates dumping to INDATA file only */
break;
case CANCEL:
/* Do Nothing */
break;
}
return (Cancel_NextStateNum);
/****************************************************************************/
/* */
/* PROCEDURE NAME : State_2 */
/* */
/* DESCRIPTION : Allows screen idling on an Exit state */
/* */
/* */
/****************************************************************************/
unsigned short pascal far _loadds State_2(unsigned char StateType)
{
BYTE tdata[200];
BYTE detachable = FALSE;
WORD cardholder_keyboard_dev;
send_msg_type send_msg;
int Cancel_NextStateNum = 0;
unsigned short ScreenGroup = ‘0’;
unsigned short ScreenNumber = 0;
unsigned short UpdateKeyboard = 0; u
nsigned short Idle = 255;
StateType;
ScreenNumber = (unsigned short) GetIntVal(IdStateData0);
Cancel_NextStateNum = (unsigned short) GetIntVal(IdStateData1);
DisplayScreen(ScreenGroup, ScreenNumber, UpdateKeyboard, Idle);
LookUpDev(“CARDHOLDER_KEYBOARD”, &cardholder_keyboard_dev);
AttachDev(cardholder_keyboard_dev, &detachable);
initialise_keys(cardholder_keyboard_dev, &send_msg);
enable_cancel_key(&send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);
/* Wait for keypress */
get_keys(cardholder_keyboard_dev, &detachable, tdata);
DetachDev(cardholder_keyboard_dev, detachable);
return (Cancel_NextStateNum);
}
/****************************************************************************/
/* */
/* PROCEDURE NAME : State_3 */
/* */
/* DESCRIPTION : Does not detach from cardholder keypad at end */
/* of routine to check that NDC+ will system escape if */
/* all devices are not returned by Exits upon completion */
/* */
/****************************************************************************/
unsigned short pascal far _loadds State_3(unsigned char StateType)
{
BYTE tdata[200];
BYTE detachable = FALSE;
WORD cardholder_keyboard_dev;
send_msg_type send_msg;
int Cancel_NextStateNum = 0;
unsigned short ScreenGroup = ‘0’;
unsigned short ScreenNumber = 0;
unsigned short UpdateKeyboard = 0;
unsigned short Idle = 0;
StateType;
ScreenNumber = (unsigned short) GetIntVal(IdStateData0);
Cancel_NextStateNum = (unsigned short) GetIntVal(IdStateData1);
DisplayScreen(ScreenGroup, ScreenNumber, UpdateKeyboard, Idle);
LookUpDev(“CARDHOLDER_KEYBOARD”, &cardholder_keyboard_dev);
AttachDev(cardholder_keyboard_dev, &detachable);
initialise_keys(cardholder_keyboard_dev, &send_msg);
enable_cancel_key(&send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);
/* Wait for keypress */
get_keys(cardholder_keyboard_dev, &detachable, tdata);
return (Cancel_NextStateNum);
}
/****************************************************************************/
/* */
/* PROCEDURE NAME : State_XXX */
/* */
/* DESCRIPTION : Displays a screen and the StateType letter */
/* parameter passed in then waits for <CNL> to be */
/* pressed */
/* */
/****************************************************************************/
{
BYTE tdata[200];
BYTE detachable = FALSE;
WORD cardholder_keyboard_dev;
send_msg_type send_msg;
enable_rsp_type *response;
BYTE ActiveFDKs = 0;
int Cancel_NextStateNum = 0;
unsigned short ScreenGroup = ‘0’;
unsigned short ScreenNumber = 0;
unsigned short UpdateKeyboard = 0;
unsigned short Idle = 0;
int length = 0;
char message[2000];
int i;
unsigned char temp;
char str[100];
StateType;
ScreenNumber = (unsigned short) GetIntVal(IdStateData0);
length = UTS20_TXMAX;
break;
case TC500_SYNC:
length = TC500_SYNC_TXMAX;
break;
case RS232:
length = RS232_TXMAX;
break;
case SNA_X25:
length = SNA_X25_TXMAX;
break;
case FBSS_SNA:
length = FBSS_SNA_TXMAX;
break;
case LUA_SNA:
length = LUA_SNA_TXMAX;
break;
}
/* If FDK_A want the message to be over protocol limit to cause system*/
/*escape*/
*/
if (response->tdata[0] == FDK_A)
length++;
else
length = length - 34;
my_StoreScreen(SCREEN_TO_USE, str);
DisplayScreen(ScreenGroup, SCREEN_TO_USE, UpdateKeyboard, Idle);
ELAPSE_TIME(50);
break;
case CANCEL:
/* Do Nothing */
break;
}
return (Cancel_NextStateNum);
}
/****************************************************************************/
/* */
/* PROCEDURE NAME : State_k */
/* */
/* DESCRIPTION : Displays a screen then waits for one of eight FDKs to be */
/* pressed to show what type of NDC state is to be done by */
/* PerformNDCState (pressing <CNL> ends the routine). */
/* */
/****************************************************************************/
unsigned short pascal far _loadds State_k(unsigned char StateType)
{
BYTE tdata[200];
BYTE detachable = FALSE;
WORD cardholder_keyboard_dev;
send_msg_type send_msg;
enable_rsp_type *response;
BYTE ActiveFDKs = 0;
int Cancel_NextStateNum = 0;
unsigned short ScreenGroup = '0';
unsigned short ScreenNumber = 0;
unsigned short UpdateKeyboard = 255;
unsigned short Idle = 0;
unsigned long NextStateNumber = 0;
unsigned long TableExitId = 0;
int error = 0;
int terminate = FALSE;
char str[500];
StateType;
ScreenNumber = (unsigned short) GetIntVal(IdStateData0);
Cancel_NextStateNum = (unsigned short) GetIntVal(IdStateData1);
ActiveFDKs = 0xFF;
LookUpDev("CARDHOLDER_KEYBOARD", &cardholder_keyboard_dev);
while (terminate == FALSE)
{
DisplayScreen(ScreenGroup, ScreenNumber, UpdateKeyboard, Idle);
AttachDev(cardholder_keyboard_dev, &detachable);
send_msg.clen = 0;
enable_numeric_keys(&send_msg);
enable_cancel_key(&send_msg);
enable_FDK_keys(ActiveFDKs, &send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);
/* Wait for keypress */
get_keys(cardholder_keyboard_dev, &detachable, tdata);
DetachDev(cardholder_keyboard_dev, detachable);
response = (enable_rsp_type *) &tdata[0];
switch (response->tdata[0])
{
case FDK_A:
case 1:
sprintf(str, "%c1-STATE TYPE ILLEGAL%c"
"PRESS CANCEL TO CONTINUE\0", 0x0c, 0x0d);
break;
case 2:
sprintf(str, "%c2-STATE TABLE FAILED VALIDATION%c"
"PRESS CANCEL TO CONTINUE\0", 0x0c, 0x0d);
break;
case 3:
sprintf(str, "%c3-STATE SUPPORTED BY EXIT APP%c"
"PRESS CANCEL TO CONTINUE\0", 0x0c, 0x0d);
break;
case 4:
sprintf(str, "%c4-CARD READ TYPE STATE REQUESTED%c"
"PRESS CANCEL TO CONTINUE\0", 0x0c, 0x0d);
break;
default:
sprintf(str, "%cINVALID VALUE %d OUTSIDE RANGE 0-5 RETURNED%c"
"PRESS CANCEL TO CONTINUE\0", 0x0c, error, 0x0d);
break;
}
if (error != 0)
Cancel_NextStateNum = 255;
my_StoreScreen(SCREEN_TO_USE, str);
DisplayScreen(ScreenGroup, SCREEN_TO_USE, UpdateKeyboard, Idle);
AttachDev(cardholder_keyboard_dev, &detachable);
initialise_keys(cardholder_keyboard_dev, &send_msg);
enable_cancel_key(&send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);
/* Wait for keypress */
get_keys(cardholder_keyboard_dev, &detachable, tdata);
DetachDev(cardholder_keyboard_dev, detachable);
}
}
return (Cancel_NextStateNum);
}
/****************************************************************************/
/* */
/* PROCEDURE NAME : State_l */
/* */
/* DESCRIPTION : Displays a screen and waits for a key (pressing FDK A-D */
/* results in a device being used corresponding to the state */
/* data fields 2-5, FDK F results in PerformNDCState doing a */
/* transaction request state, and <CNL> ends the routine. */
/* */
/****************************************************************************/
unsigned short pascal far _loadds State_l(unsigned char StateType)
{
BYTE tdata[200];
BYTE detachable[6];
WORD cardholder_keyboard_dev;
WORD journal_printer_dev;
WORD cash_handler_dev;
WORD coin_dispenser_dev;
WORD dpm_dev;
WORD cardreader_dev;
send_msg_type send_msg;
enable_rsp_type tran_msg;
enable_rsp_type *response;
BYTE ActiveFDKs = 0;
int Cancel_NextStateNum = 0;
unsigned short ScreenGroup = '0';
unsigned short ScreenNumber = 0;
unsigned short UpdateKeyboard = 0;
unsigned short Idle = 0;
StateType;
ScreenNumber = (unsigned short) GetIntVal(IdStateData0);
Cancel_NextStateNum = (unsigned short) GetIntVal(IdStateData1);
ActiveFDKs = 0x1F; /* Only FDK_A to FDK_F */
DeviceUsage[0] = (int) GetIntVal(IdStateData2); /* FDK_A */
DeviceUsage[1] = (int) GetIntVal(IdStateData3); /* FDK_B */
DeviceUsage[2] = (int) GetIntVal(IdStateData4); /* FDK_C */
DeviceUsage[3] = (int) GetIntVal(IdStateData5); /* FDK_D */
LookUpDev("CARDHOLDER_KEYBOARD", &cardholder_keyboard_dev);
LookUpDev("JOURNAL_PRINTER", &journal_printer_dev);
}
if ((terminate == FALSE) && (i != 999))
{
/* The journal printer can be used to report any errors in */
/* attaching to devices. */
if (journal_printer_dev != 0)
AttachDev(journal_printer_dev, &detachable[1]);
switch (DeviceUsage[i])
{
case 0:
/* Do Nothing */
break;
case 1:
if (journal_printer_dev != 0)
{
send_msg.clen = 3;
send_msg.cdata[0] = 'A';
send_msg.cdata[1] = 'B';
send_msg.cdata[2] = 'C';
ADI_SEND_AND_RECEIVE(journal_printer_dev,
ACTION_PRINT_STREAM, (BYTE far *) &send_msg,
temp_buf, temp_buf, temp_buf, temp_buf, temp_buf);
}
/* If JOURNAL_PRINTER device not present then can't log error */
break;
case 2:
LookUpDev("CASH_HANDLER", &cash_handler_dev);
if (cash_handler_dev != 0)
{
AttachDev(cash_handler_dev, &detachable[2]);
send_msg.clen = 0;
send_msg.cdata[0] = NULL;
ADI_SEND_AND_RECEIVE(cash_handler_dev, CURRENCY_CLEAR,
(BYTE far *) &send_msg,
temp_buf, temp_buf, temp_buf, temp_buf, temp_buf);
DetachDev(cash_handler_dev, detachable[2]);
}
else
if (journal_printer_dev != 0)
{
strcpy(&send_msg.cdata[0], "CASH_HANDLER DEVICE NOT
ATTACHED\0");
send_msg.clen = strlen(&send_msg.cdata[0]);
ADI_SEND_AND_RECEIVE(journal_printer_dev,
ACTION_PRINT_STREAM, (BYTE far *) &send_msg,
temp_buf, temp_buf, temp_buf, temp_buf, temp_buf);
}
break;
case 3:
LookUpDev("COIN_DISPENSER", &coin_dispenser_dev);
if (coin_dispenser_dev != 0)
{
AttachDev(coin_dispenser_dev, &detachable[3]);
send_msg.clen = 4;
send_msg.cdata[0] = 1;
send_msg.cdata[1] = 1;
send_msg.cdata[2] = 1;
send_msg.cdata[3] = 1;
ADI_SEND_AND_RECEIVE(coin_dispenser_dev,
DISPENSE_BY_POSITION, (BYTE far *) &send_msg,
temp_buf); (BYTE far *) &tran_msg, temp_buf, temp_buf, temp_buf,
DetachDev(coin_dispenser_dev, detachable[3]);
}
else
if (journal_printer_dev != 0)
{
strcpy(&send_msg.cdata[0], "COIN_DISPENSER DEVICE NOT
ATTACHED\0");
send_msg.clen = strlen(&send_msg.cdata[0]);
ADI_SEND_AND_RECEIVE(journal_printer_dev,
ACTION_PRINT_STREAM, (BYTE far *) &send_msg,
temp_buf, temp_buf, temp_buf, temp_buf, temp_buf);
}
break;
case 4:
LookUpDev("DPM_SERVICE", &dpm_dev);
if (dpm_dev != 0)
{
AttachDev(dpm_dev, &detachable[4]);
send_msg.clen = 0;
send_msg.cdata[0] = NULL;
ADI_SEND_AND_RECEIVE(dpm_dev, DPM_CLEAR, (BYTE far *)
&send_msg,
temp_buf, temp_buf, temp_buf, temp_buf, temp_buf);
DetachDev(dpm_dev, detachable[4]);
}
else
if (journal_printer_dev != 0)
{
strcpy(&send_msg.cdata[0], "DPM_SERVICE DEVICE NOT
ATTACHED\0");
send_msg.clen = strlen(&send_msg.cdata[0]);
ADI_SEND_AND_RECEIVE(journal_printer_dev,
ACTION_PRINT_STREAM, (BYTE far *) &send_msg,
temp_buf, temp_buf, temp_buf, temp_buf, temp_buf);
}
break;
case 5:
LookUpDev("MCRW", &cardreader_dev);
if (cardreader_dev != 0)
{
AttachDev(cardreader_dev, &detachable[5]);
send_msg.clen = 0;
send_msg.cdata[0] = NULL;
ADI_SEND_AND_RECEIVE(cardreader_dev, CARD_READ, (BYTE far *)
&send_msg,
tdata, temp_buf, temp_buf, temp_buf, temp_buf);
sprintf(str, "%cCONTENTS OF TRACK 2 FOLLOW%c"
"PRESS CANCEL TO CONTINUE:%c%c\0",
0x0c, 0x0d, 0x0d, 0x0d);
/* Remember WORD HI, LOW BYTES wrong way around */
tlength = tdata[5];
tlength = ((tlength << 8) + (tdata[4]));
strncpy(&str[strlen(str)], &tdata[6], tlength);
my_StoreScreen(SCREEN_TO_USE, str);
DisplayScreen(ScreenGroup, SCREEN_TO_USE, UpdateKeyboard, Idle);
AttachDev(cardholder_keyboard_dev, &detachable[0]);
initialise_keys(cardholder_keyboard_dev, &send_msg);
enable_cancel_key(&send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);
/* Wait for keypress */
get_keys(cardholder_keyboard_dev, &detachable[0], tdata);
DetachDev(cardholder_keyboard_dev, detachable[0]);
DetachDev(cardreader_dev, detachable[5]);
exception = 0;
saddr_list[0] = 1;
saddr_list[1] = cash_handler_dev;
while (exception != 1)
{
temp_buf,ADI_RECEIVE_EVENT(saddr_list, &wait_time, temp_buf, temp_buf,
temp_buf, temp_buf, &exception);
if (exception == 1)
detachable[2] = TRUE;
}
if (tran_msg.tcode == 5)
temp_buf,ADI_RECEIVE_EVENT(saddr_list, &wait_time, temp_buf, temp_buf,
temp_buf, temp_buf, &exception);
ADI_DETACH(cash_handler_dev);
}
else
if (journal_printer_dev != 0)
{
strcpy(&send_msg.cdata[0], "CASH_HANDLER DEVICE NOT
ATTACHED\0");
send_msg.clen = strlen(&send_msg.cdata[0]);
ADI_SEND_AND_RECEIVE(journal_printer_dev,
ACTION_PRINT_STREAM, (BYTE far *) &send_msg,
temp_buf, temp_buf, temp_buf, temp_buf, temp_buf);
}
break;
}
if (journal_printer_dev != 0)
DetachDev(journal_printer_dev, detachable[1]);
}
}
return (Cancel_NextStateNum);
}
/****************************************************************************/
/* */
/* PROCEDURE NAME : State_m */
/* */
/* DESCRIPTION : Used to read/change shared data items specified by the data */
/* in the state and which corresponding FDK is pressed (press */
/* <CNL> to end routine). */
/* */
/****************************************************************************/
LookUpDev("CARDHOLDER_KEYBOARD", &cardholder_keyboard_dev);
switch ((int) GetIntVal(IdStateData2))
{
case 1:
ID_Int = IdStateData7;
break;
case 2:
ID_Int = IdAmtBuffer;
break;
case 3:
ID_Int = IdLUNO;
break;
case 4:
ID_Int = -999;
break;
}
switch ((int) GetIntVal(IdStateData4))
{
case 1:
ID_String = IdStateData7;
break;
case 2:
ID_String = IdAmtBuffer;
break;
case 3:
ID_String = IdLUNO;
break;
case 4:
ID_String = -999;
break;
case 5:
ID_String = IdProductId;
break;
}
while (terminate == FALSE)
{
DisplayScreen(ScreenGroup, ScreenNumber, UpdateKeyboard, Idle);
AttachDev(cardholder_keyboard_dev, &detachable);
initialise_keys(cardholder_keyboard_dev, &send_msg);
enable_cancel_key(&send_msg);
enable_FDK_keys(ActiveFDKs, &send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);
/* Wait for keypress */
get_keys(cardholder_keyboard_dev, &detachable, tdata);
DetachDev(cardholder_keyboard_dev, detachable);
response = (enable_rsp_type *) &tdata[0];
switch (response->tdata[0])
{
case FDK_A:
sprintf(str, "%cPRESS CANCEL TO CONTINUE%c"
"GETINTVAL: %d\0",
0x0c, 0x0d,(char) GetIntVal(ID_Int));
my_StoreScreen(SCREEN_TO_USE, str);
DisplayScreen(ScreenGroup, SCREEN_TO_USE, UpdateKeyboard, Idle);
/* Wait for CANCEL key to continue */
AttachDev(cardholder_keyboard_dev, &detachable);
initialise_keys(cardholder_keyboard_dev, &send_msg);
enable_cancel_key(&send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);
/* Wait for keypress */
get_keys(cardholder_keyboard_dev, &detachable, tdata);
DetachDev(cardholder_keyboard_dev, detachable);
break;
case FDK_B:
switch (NumIntBytes)
{
case 1:
NewValue = 0x7F;
break;
case 2:
NewValue = 0x7FFF;
break;
case 3:
NewValue = 0x7FFFFF;
break;
case 4:
NewValue = 0x7FFFFFFF;
break;
}
PutIntVal(ID_Int, NewValue);
break;
case FDK_C:
sprintf(str, "%cPRESS CANCEL TO CONTINUE%c"
"GETSTRINGVAL: %s\0",
0x0c, 0x0d, GetStringVal(ID_String));
my_StoreScreen(SCREEN_TO_USE, str);
DisplayScreen(ScreenGroup, SCREEN_TO_USE, UpdateKeyboard, Idle);
/* Wait for CANCEL key to continue */
AttachDev(cardholder_keyboard_dev, &detachable);
initialise_keys(cardholder_keyboard_dev, &send_msg);
enable_cancel_key(&send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);
/* Wait for keypress */
get_keys(cardholder_keyboard_dev, &detachable, tdata);
DetachDev(cardholder_keyboard_dev, detachable);
break;
case FDK_D:
if ((NumStringBytes > 0) && (NumStringBytes < 15))
{
strncpy(str, "12345678901234", NumStringBytes);
for (;((NumStringBytes > 0) && (NumStringBytes < 13)); NumStringBytes++)
{
str[NumStringBytes] = '0';
}
str[NumStringBytes] = '\0';
PutStringVal(ID_String, str);
}
break;
case FDK_F:
PutValues(110L, 255L, 100L, 100L, 255L, 255L, 255L, 101L);
PerformNDCState('F', &NextStateNumber, &TableExitId);
break;
case FDK_G:
PutValues(100L, 255L, 5L, 2L, 0L, 0L, 0L, 0L);
PerformNDCState('D', &NextStateNumber, &TableExitId);
break;
case FDK_H:
PutValues(112L, 100L, 0L, 0L, 1L, 1L, 0L, 0L);
PerformNDCState('I', &NextStateNumber, &TableExitId);
break;
case CANCEL:
terminate = TRUE;
break;
}
}
return (Cancel_NextStateNum);
}
/****************************************************************************/
/* */
/* PROCEDURE NAME : State_n */
/* DESCRIPTION : Displays a screen and then waits for a keypress (FDK A will */
/* take a screen then store it under a new number; both are */
/* specified in the state data). */
/* */
/****************************************************************************/
unsigned short pascal far _loadds State_n(unsigned char StateType)
{
BYTE tdata[200];
BYTE detachable = FALSE;
WORD cardholder_keyboard_dev;
BYTE ActiveFDKs = 0;
int Cancel_NextStateNum = 0;
unsigned short ScreenGroup = '0';
unsigned short ScreenNumber = 0;
unsigned short UpdateKeyboard = 255;
unsigned short Idle = 0;
send_msg_type send_msg;
enable_rsp_type *response;
unsigned short ScreenToRetrieve = 0;
unsigned short ScreenToStore = 0;
char *Data;
unsigned long DataSize = 0;
char str[500];
char rep[200];
int i;
unsigned char outcome;
unsigned short kbno;
char *kbdata;
unsigned long kbsize;
StateType;
ScreenNumber = (unsigned short) GetIntVal(IdStateData0);
Cancel_NextStateNum = (unsigned short) GetIntVal(IdStateData1);
ActiveFDKs = (BYTE) 0x1; /* Only FDK_A */
/* Retrieve screen to be displayed */
outcome = RetrieveScreen (ScreenGroup, ScreenNumber, &Data, &DataSize);
/* If using a screen that requires a non-existent keyboard number (SANDKNK) */
/* or a keyboard number with invalid keycodes (SANDKIK) */
if (strstr(Data, "SANDKNK") || strstr(Data, "SANDKIK") || strstr(Data,
"SCRVAL"))
{
/* Copy original screen to be displayed and find the group separator in the
screen */
memcpy(str, Data, (int) DataSize);
for (i = 0; str[i] != 0x1d; i++);
/* Find the associated keyboard number */
kbno = ((unsigned short) str[i + 1] - 48) * 100;
kbno = kbno + (((unsigned short) str[i + 2] - 48) * 10);
kbno = kbno + ((unsigned short) str[i + 3] - 48);
my_StoreScreen(890, rep);
}
}
my_StoreScreen(ScreenToStore, str);
}
else
Cancel_NextStateNum = 10; /* If not FDK_A must be CANCEL */
return (Cancel_NextStateNum);
}
/****************************************************************************/
/* */
/* PROCEDURE NAME : State_o */
/* */
/* DESCRIPTION : Displays a screen then waits for a keypress (pressing FDKs */
/* A-D result in a specified solicited status message being */
/* sent and FDKs F-H result in a specified unsolicited status */
/* using SendStatus). */
/* */
/****************************************************************************/
unsigned short pascal far _loadds State_o(unsigned char StateType)
{
BYTE tdata[200];
BYTE detachable = FALSE;
WORD cardholder_keyboard_dev;
BYTE ActiveFDKs = 0;
int Cancel_NextStateNum = 0;
unsigned short ScreenGroup = '0';
unsigned short ScreenNumber = 0;
unsigned short UpdateKeyboard = 0;
unsigned short Idle = 0;
send_msg_type send_msg;
enable_rsp_type *response;
StateType;
ScreenNumber = (unsigned short) GetIntVal(IdStateData0);
Cancel_NextStateNum = (unsigned short) GetIntVal(IdStateData1);
ActiveFDKs = (BYTE) 0xFF; /* FDK_A to FDK_I */
DisplayScreen(ScreenGroup, ScreenNumber, UpdateKeyboard, Idle);
LookUpDev("CARDHOLDER_KEYBOARD", &cardholder_keyboard_dev);
AttachDev(cardholder_keyboard_dev, &detachable);
initialise_keys(cardholder_keyboard_dev, &send_msg);
enable_cancel_key(&send_msg);
enable_FDK_keys(ActiveFDKs, &send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);
/* Wait for keypress */
get_keys(cardholder_keyboard_dev, &detachable, tdata);
DetachDev(cardholder_keyboard_dev, detachable);
response = (enable_rsp_type *) &tdata[0];
switch (response->tdata[0])
{
case FDK_A:
SendStatus("G\0", TRUE, TRUE);
break;
case FDK_B:
SendStatus("g\0", TRUE, TRUE);
break;
case FDK_C:
SendStatus("ZZZZ\0", TRUE, TRUE);
break;
case FDK_D:
SendStatus("9F\0", TRUE, TRUE);
break;
case FDK_F:
SendStatus("G\0", FALSE, TRUE);
break;
case FDK_G:
SendStatus("ZZZ\0", FALSE, TRUE);
break;
case FDK_H:
SendStatus("F\0", FALSE, TRUE);
break;
case FDK_I:
SendStatus("9\0",TRUE,TRUE);
break;
case CANCEL:
/* Do Nothing */
break;
}
return (Cancel_NextStateNum);
}
/****************************************************************************/
/* */
/* PROCEDURE NAME : State_y */
/* */
/* DESCRIPTION : Displays a screen and waits for <CNL> to be pressed (it */
/* will access all 8 extension values in all 8 extensions). */
/* */
/* */
/****************************************************************************/
unsigned short pascal far _loadds State_y(unsigned char StateType)
{
BYTE tdata[200];
BYTE detachable = FALSE;
WORD cardholder_keyboard_dev;
int Cancel_NextStateNum = 0;
unsigned short ScreenGroup = '0';
unsigned short ScreenNumber = 0;
unsigned short UpdateKeyboard = 0;
unsigned short Idle = 0;
send_msg_type send_msg;
unsigned long IgnoreValue[62];
int i;
StateType;
LIBRARY exstates
The Definition File A PROTMODE
CODE LOADONCALL
DATA PRELOAD SINGLE
EXPORTS
STATE_1
STATE_2
STATE_3
STATE_XXX
STATE_J
STATE_K
STATE_L
STATE_M
STATE_N
STATE_O
STATE_Y
#define INCL_DOSSEMAPHORES
The Header File A
/************************************************************************/
#define IO_COMMAND 0
#define DIAG_COMMAND 1
#define CURRENCY_CLEAR 1
#define DPM_CLEAR 10
#define RESET 0
#define ACCEPT_CARD 1
#define CARD_READ 2
#define EJECT 5
#define CURRENCY_SELFTEST 5
#define CURRENCY_DISPENSE 2
#define COIN_RESET 0
#define SET_THRESHOLDS 5
#define DISPENSE_BY_POSITION 1
#define BISYNC_3275 1
#define TC500_ASYNC 2
#define NCRISO_ASYNC 3
#define IBM_2265_ASYNC 4
#define HDLC_NRM 5
#define NCR_DLC 6
#define SNA_3624 8
#define SNA_LU0 9
#define X25_LAPB 10
#define IBM_3600 12
#define ASYNC_3270 13
#define UTS20 16
#define TC500_SYNC 18
#define RS232 20
#define SNA_X25 25
#define FBSS_SNA 31
#define LUA_SNA 34
/************************************************************************/
# File: [Link]
The Make File A
INCPATH = C:\s4header
DEPENDS = [Link] [Link] [Link] exgener.c
INCS = exstates.h exconst.h exgener.h
COPT = /Zip /Os /Gs2 /Lp /Fc /Fm /AL /c /W3
exstates+dllstart+exgener
The Link File A [Link] /M/NOD,
exstates /LI,
/NOD:LLIBCE D:\MSC51\LIB\[Link] [Link] +
\pj015\code\ndcia\[Link] \pj015\code\600\[Link]
[Link],
The Code A
/***************************************************************************/
/* */
/* MODULE NAME : exvc.c */
/* */
/* DESCRIPTION : Exits virtual controller interceptor code */
/* */
/* */
/****************************************************************************/
#include <malloc.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include “s4dundee.h”
#include “s4adi2.h”
#include “\pj015\code\600\ndcdata.h”
#include “exconst.h”
#include “exgener.h”
#include “exvc.h”
#include <fcntl.h>
/****************************************************************************/
/* */
/* PROCEDURE NAME : FDK_B */
/* */
/* DESCRIPTION : Called by Incoming to display any VC buffers */
/* (IDs ‘M’-’R’) into a transaction reply then delete */
/* them from the reply. */
/* */
/* */
/****************************************************************************/
void process_FDK_B(char far **Message)
{
unsigned short ScreenGroup = ‘0’;
unsigned short ScreenNumber = 0;
unsigned short UpdateKeyboard = 0;
unsigned short Idle = 0;
if (*TempPtr == FS)
{
CurrentPos++;
vc_present[CurrentPos] = TRUE; /* Highlighting Buffer ID positon */
TempPtr++;
CurrentPos++;
/* Copies the contents of the VC buffer found and highlights the position */
datapos = 0;
while ((CurrentPos < MesCheck) && (*TempPtr != FS))
{
data[datapos] = *TempPtr;
vc_present[CurrentPos] = TRUE;
PrevPtr = TempPtr;
TempPtr++;
CurrentPos++;
datapos++;
}
data[datapos] = ‘\0’;
TempPtr = PrevPtr;
CurrentPos--;
}
}
TempPtr++;
CurrentPos++;
}
NewLength = TotalLength;
/* Begin to create new reply without the VC Buffers by finding the new length */
for (CurrentPos = 0; CurrentPos < TotalLength; CurrentPos++)
if (vc_present[CurrentPos] == TRUE)
NewLength--;
TempNewPtr = NewMessage;
TempPtr = *Message;
TempNewPtr = NewMessage;
TempNewPtr += 2;
*TempNewPtr = (char) (incoming_msg->messagelen - (TotalLength -
NewLength));
TempNewPtr ++;
*TempNewPtr = 0x0;
free(*Message);
free(vc_present);
*Message = NewMessage;
/****************************************************************************/
/* */
/* PROCEDURE NAME : Incoming */
/* */
/* DESCRIPTION : Called when a message is received. If it is a */
/* transaction reply, it displays a screen then */
/* waits for a keypress (pressing FDK A results */
/* in the ContinueProcessing value being */
/* returned and FDK B results in the routine */
/* process_FDK_B being called then returning */
/* the same value as for FDK A or the message */
/* not being a reply). */
/* */
/****************************************************************************/
LookUpDev(“CARDHOLDER_KEYBOARD”, &cardholder_keyboard_dev);
AttachDev(cardholder_keyboard_dev, &detachable);
ActiveFDKs = 0x3; /* FDK_A and FDK_B only */
initialise_keys(cardholder_keyboard_dev, &send_msg);
enable_cancel_key(&send_msg);
enable_FDK_keys(ActiveFDKs, &send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);
switch (response->tdata[0])
{
case FDK_A:
/* Do Nothing */
break;
case FDK_B:
process_FDK_B(Message);
case CANCEL:
/* Do Nothing */
break;
}
DetachDev(cardholder_keyboard_dev, detachable);
}
return (2);
}
/***************************************************************************/
/* */
/* PROCEDURE NAME : AddVCBuffers */
/* */
/* DESCRIPTION : Called by Outgoing when keys 1-7 have been */
/* pressed. It adds a number of VC buffers to a */
/* transaction request depending upon */
/* NumberVCBuffers (1-6 is the number of valid */
/* VC buffers ‘W’ - ‘\’ and 7 adds an illegal buffer */
/* of ‘]’). */
/* */
/* */
/***************************************************************************/
if (NumberVCBuffers != 7)
{
memcpy(NewMessage, outgoing_msg,
(sizeof(BYTE) * 3 + sizeof(WORD) + outgoing_msg->messagelen));
if (i==0)
Offset = NewMessage->messagelen - 30;
else
/* Adds a legal buffer of ‘W’, ‘X’, ‘Y’, ‘Z’, ‘[‘, ‘\’ depending on i */
NewMessage->tdata[Offset] = FS;
NewMessage->tdata[Offset + 1] = (char) i + 0x57;
NewMessage->tdata[Offset + 2] = ‘E’;
NewMessage->tdata[Offset + 3] = ‘X’;
NewMessage->tdata[Offset + 4] = ‘T’;
NewMessage->tdata[Offset + 5] = ‘R’;
NewMessage->tdata[Offset + 6] = ‘A’;
NewMessage->tdata[Offset + 7] = (char) i + 0x31;
}
}
else
{
ExtraMemory = 5;
memcpy(NewMessage, outgoing_msg,
(sizeof(BYTE) * 3 + sizeof(WORD) + outgoing_msg->messagelen));
free(Message);
*Message = (char *) NewMessage;
}
/**************************************************************************/
/* */
/* PROCEDURE NAME : process_KEY_8 */
/* */
/* DESCRIPTION : Called by Outgoing when key 8 has been pressed */
/* and causes the opcode buffer in a transaction */
/* request to be extracted and displayed on the */
/* screen. */
/**************************************************************************/
my_StoreScreen(SCREEN_TO_USE, str);
DisplayScreen(ScreenGroup, SCREEN_TO_USE, UpdateKeyboard, Idle);
/****************************************************************************/
/* */
/* PROCEDURE NAME : process_KEY_9 */
/* */
/* DESCRIPTION : Called by Outgoing when key 9 has been pressed. */
/* It changes the message class and subclass of the */
/* transaction request to illegal values. */
/* */
/* */
/****************************************************************************/
void process_KEY_9(char far **Message)
{
NDC_type *outgoing_msg = (NDC_type *) *Message;
}
/****************************************************************************/
/* */
/* PROCEDURE NAME : Outgoing */
/* */
/* DESCRIPTION : Called when a message is to be sent. If the message is a */
/* transaction request it will display a screen then wait for */
/* a key response. If the key is 1-7 it will call AddVCBuffers */
/* If it is key 8, it will call process_KEY_8. If it is key 9, */
/* it will call process_KEY_9. At the end it will return a */
/* ContinueProcessing value of 2. */
/* */
/****************************************************************************/
extern unsigned char pascal far _loadds Outgoing(char far**Message)
{
BYTE tdata[200];
NDC_type far*out_msg = (NDC_type far*) *Message;
BYTE detachable = FALSE;
WORD cardholder_keyboard_dev;
send_msg_type send_msg;
enable_rsp_type *response;
unsigned short ScreenGroup = ‘0’;
unsigned short ScreenNumber = 0;
unsigned short UpdateKeyboard = 0;
unsigned short Idle = 0;
int terminate = FALSE;
LookUpDev(“CARDHOLDER_KEYBOARD”, &cardholder_keyboard_dev);
AttachDev(cardholder_keyboard_dev, &detachable);
initialise_keys(cardholder_keyboard_dev, &send_msg);
enable_cancel_key(&send_msg);
enable_numeric_keys(&send_msg);
enable_enter_key(&send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);
switch (response->tdata[0])
{
case KEY_0:
/* Do Nothing */
break;
case KEY_1:
AddVCBuffers(Message, 1);
break;
case KEY_2:
AddVCBuffers(Message, 2);
break;
case KEY_3:
AddVCBuffers(Message, 3);
break;
case KEY_4:
AddVCBuffers(Message, 4);
break;
case KEY_5:
AddVCBuffers(Message, 5);
break;
case KEY_6:
AddVCBuffers(Message, 6);
break;
case KEY_7:
AddVCBuffers(Message, 7);
break;
case KEY_8:
process_KEY_8(Message);
case KEY_9:
process_KEY_9(Message);
break;
case CANCEL:
/* Do Nothing */
break;
}
DetachDev(cardholder_keyboard_dev, detachable);
}
return(2);
}
/****************************************************************************/
/* */
/* PROCEDURE NAME : VCIn2 */
/* */
/* DESCRIPTION : Called when a message is received. If it is a transaction */
/* reply, it displays a screen then waits for a keypress */
/* (pressing FDK A results in the ContinueProcessing value 2 */
/* being returned so other interceptors can operate on the */
/* reply, FDK B results in the StopAndDelte value of 1 being */
/* returned so the reply is deleted, FDK C returns an invalid */
/* value of 3 and <CNL> results in the continue value of 0 */
/* being returned allowing no other to be interceptors, if */
/* any, to be called for this reply. */
/* */
/* */
/****************************************************************************/
extern unsigned char pascal far _loadds VCIn2(char far**Message)
{
BYTE tdata[200];
HOCOMMS_type far*in_msg = (HOCOMMS_type far*) *Message;
BYTE detachable = FALSE;
WORD cardholder_keyboard_dev;
send_msg_type send_msg;
enable_rsp_type *response;
BYTE ActiveFDKs = 0;
unsigned short ScreenGroup = ‘0’;
unsigned short ScreenNumber = 0;
unsigned short UpdateKeyboard = 0;
unsigned short Idle = 0;
LookUpDev(“CARDHOLDER_KEYBOARD”, &cardholder_keyboard_dev);
AttachDev(cardholder_keyboard_dev, &detachable);
ActiveFDKs = 0x7; /* FDK_A, FDK_B and FDK_C only */
initialise_keys(cardholder_keyboard_dev, &send_msg);
enable_cancel_key(&send_msg);
enable_FDK_keys(ActiveFDKs, &send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);
switch (response->tdata[0])
{
case FDK_A:
DetachDev(cardholder_keyboard_dev, detachable);
*/ return(0); /* Allows other incoming interceptors, if any, to operate on request
break;
case FDK_B:
DetachDev(cardholder_keyboard_dev, detachable);
return(1); /* Deletes reply and stops any further incoming interceptors*/
/*beingcalled */
break;
case FDK_C:
DetachDev(cardholder_keyboard_dev, detachable);
return(3); /* Invalid value causes the reply to be deleted and stops any*/
/*further incoming interceptors being called */
break;
default:
DetachDev(cardholder_keyboard_dev, detachable);
return(2); /* Stops any further incoming interceptors being called for reply */
break;
}
return(2);
}
/****************************************************************************/
/* */
/* PROCEDURE NAME : VCOut2 */
/* */
/* DESCRIPTION : Called when a message is sent. If it is a transaction */
/* request it displays a screen then waits for a keypress */
/* (pressing FDK A results in the ContinueProcessing value 2 */
/* being returned so other interceptors can operate on the */
/* request, FDK B results in the StopAndDelte value of 1 being */
/* returned so the request is deleted, FDK C returns an */
/* invalid value of 3 and <CNL> results in the continue value */
/* of 0 being returned allowing no other intereptor, if any, */
/* to be called for this request. */
/* */
/****************************************************************************/
extern unsigned char pascal far _loadds VCOut2(char far**Message)
{
BYTE tdata[200];
NDC_type far*out_msg = (NDC_type far*) *Message;
BYTE detachable = FALSE;
WORD cardholder_keyboard_dev;
send_msg_type send_msg;
enable_rsp_type *response;
BYTE ActiveFDKs = 0;
unsigned short ScreenGroup = ‘0’;
unsigned short ScreenNumber = 0;
unsigned short UpdateKeyboard = 0;
unsigned short Idle = 0;
LookUpDev(“CARDHOLDER_KEYBOARD”, &cardholder_keyboard_dev);
AttachDev(cardholder_keyboard_dev, &detachable);
ActiveFDKs = 0x7; /* FDK_A, FDK_B and FDK_C only */
initialise_keys(cardholder_keyboard_dev, &send_msg);
enable_cancel_key(&send_msg);
enable_FDK_keys(ActiveFDKs, &send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);
switch (response->tdata[0])
{
case FDK_A:
DetachDev(cardholder_keyboard_dev, detachable);
return(0); /* Allows other outgoing interceptors, if any, to operate on*/
/*request */
break;
case FDK_B:
DetachDev(cardholder_keyboard_dev, detachable);
return(1); /* Deletes request and stops any other outgoing interceptors*/
/*being called */
break;
case FDK_C:
DetachDev(cardholder_keyboard_dev, detachable);
return(3); /* Invalid value causes request to be deleted and stops any*/
/*other outgoing interceptors being called */
break;
default:
DetachDev(cardholder_keyboard_dev, detachable);
return(2); /* Stops any other outgoing interceptors, if any, being called f*/
/*or this request */
break;
}
return(2);
}
/****************************************************************************/
/* */
/* PROCEDURE NAME : HOOut1 */
/* */
/* DESCRIPTION : Called when a message is received. If it is a outgoing HO */
/* comms message, data will be replaced by other characters */
/* and the routine will return a continue processing value. */
/* */
/* */
/****************************************************************************/
extern unsigned char pascal far _loadds HOOut1(char far**Message)
{
NDC_type far*out_msg = (NDC_type far*) *Message;
char *initmes1 = “VC ROUTINE 1”;
/* Pblock of 30, class byte, subclass byte, two field separators and data */
out_msg->messagelen = sizeof(BYTE) * 46;
/****************************************************************************/
/* */
/* PROCEDURE NAME : HOOut2 */
/* */
/* DESCRIPTION : Called when a message is received. If it is a outgoing HO */
/* comms message, data will be replaced by other characters */
/* and the routine will return a no further processing value. */
/* */
/* */
/* */
/****************************************************************************/
extern unsigned char pascal far _loadds HOOut2(char far**Message)
{
NDC_type far*out_msg = (NDC_type far*) *Message;
char *addmes2 = “, VC ROUTINE 2”;
char *initmes2 = “VC ROUTINE 2”;
if (out_msg->tdata[3] != ‘A’)
{
memcpy(&out_msg->tdata[15], (BYTE*) addmes2, 14);
out_msg->messagelen = (out_msg->messagelen + (sizeof(BYTE) * 14));
}
else
{
/* Position of 3 is after the subclass and 2 field separators */
memcpy(&out_msg->tdata[3], (BYTE*) initmes2, 12);
/* Pblock of 30, class byte, subclass byte, two field separators and data */
out_msg->messagelen = sizeof(BYTE) * 46;
/****************************************************************************/
/* */
/* PROCEDURE NAME : HOOut3 */
/* */
/* DESCRIPTION : Called when a message is received. If it is a outgoing HO */
/* comms message, data will be replaced by other characters */
/* and the routine will return a no further processing value. */
/* */
/* */
/****************************************************************************/
extern unsigned char pascal far _loadds HOOut3(char far**Message)
{
NDC_type far*out_msg = (NDC_type far*) *Message;
char *addmes3 = “, VC ROUTINE 3”;
char *initmes3 = “VC ROUTINE 3”;
if (out_msg->tdata[3] != ‘A’)
{
memcpy(&out_msg->tdata[15], (BYTE*) addmes3, 14);
out_msg->messagelen = (out_msg->messagelen + (sizeof(BYTE) * 14));
}
else
{
/* Position of 3 is after the subclass and 2 field separators */
memcpy(&out_msg->tdata[3], (BYTE*) initmes3, 12);
/* Pblock of 30, class byte, subclass byte, two field separators and data */
out_msg->messagelen = sizeof(BYTE) * 46;
}
/****************************************************************************/
/* */
/* PROCEDURE NAME : HOIll */
/* */
/* DESCRIPTION : Called when a message is received. If it is a outgoing HO */
/* comms message, the sender class will be changed to an */
/* illegal value of 1 and the routine will return a no further */
/* processing value. */
/* */
/* */
/****************************************************************************/
extern unsigned char pascal far _loadds HOIll(char far**Message)
{
NDC_type far*out_msg = (NDC_type far*) *Message;
LIBRARY exvc
The Definition File A PROTMODE
CODE LOADONCALL
DATA PRELOAD SINGLE
EXPORTS
INCOMING
OUTGOING
VCOUT2
VCIN2
HOOUT1
HOOUT2
HOOUT3
HOILL
typedef struct
The Header File A {
BYTE sender;
BYTE reserved_1;
WORD messagelen;
BYTE reserved_2[4];
BYTE tcode;
BYTE offset;
BYTE tdata[1]; /* + Message Data, ..... */
} HOCOMMS_type;
typedef struct
{
BYTE sender;
BYTE reserved_1;
BYTE reserved_2;
WORD messagelen;
BYTE reserved_3[30];
BYTE category;
BYTE tdata[1];
} NDC_type;
/************************************************************************/
#define FS 0x1c
/************************************************************************/
# File: [Link]
The Make File A
#
# Run this by typing ‘MAKE [Link]’ on a PC with C6.0 installed.
#
INCPATH = C:\s4header
DEPENDS = [Link] [Link] [Link] exgener.c
INCS = exvc.h exconst.h exgener.h
COPT = /Zip /Os /Gs2 /Lp /Fc /Fm /AL /c /W3
link @[Link]
implib [Link] [Link]
exvc+dllstart+exgener
The Link File A [Link] /M/NOD,
exvc /LI,
/NOD:LLIBCE C:\C600\LIB\[Link] +
[Link] \pj015\code\ndcia\[Link]
[Link],
/****************************************************************************/
The Code A
/*
/* MODULE NAME : exsup.c
*/
*/
/* */
/* DESCRIPTION : Exits supervisor code */
/* */
/* */
/****************************************************************************/
#include <malloc.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include “s4dundee.h”
#include “s4adi2.h”
#include “exconst.h”
#include “exgener.h”
#include “exsup.h”
/****************************************************************************/
/* */
/* PROCEDURE NAME : Screen */
/* */
/* DESCRIPTION : Displays a screen with the passed in parameters of MenuId, */
/* FunctionNo and Interface present on it, then waits for */
/* <CNL> to be pressed. */
/* */
/* */
/****************************************************************************/
void pascal far _loadds Screen(unsigned short far *MenuId,
unsigned short FunctionNo,
unsigned char far *Interface)
{
BYTE tdata[200];
BYTE detachable = FALSE;
WORD cardholder_keyboard_dev;
send_msg_type send_msg;
unsigned short ScreenGroup = ‘0’;
unsigned short ScreenNumber = 0;
unsigned short UpdateKeyboard = 0;
unsigned short Idle = 0;
char str[500];
my_StoreScreen(SCREEN_TO_USE, str);
LookUpDev(“CARDHOLDER_KEYBOARD”, &cardholder_keyboard_dev);
AttachDev(cardholder_keyboard_dev, &detachable);
initialise_keys(cardholder_keyboard_dev, &send_msg);
enable_cancel_key(&send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);
DetachDev(cardholder_keyboard_dev, detachable);
/****************************************************************************/
/* */
/* PROCEDURE NAME : Menu */
/* */
/* DESCRIPTION : Displays a screen then waits for any one of keys 1-0 to be */
/* pressed. */
/* */
/* */
/* */
/****************************************************************************/
void pascal far _loadds Menu(unsigned short far *MenuId,
unsigned short FunctionNo,
unsigned char far *Interface)
{
BYTE tdata[200];
BYTE detachable = FALSE;
WORD cardholder_keyboard_dev;
send_msg_type send_msg;
enable_rsp_type *response;
unsigned short ScreenGroup = ‘0’;
unsigned short ScreenNumber = 0;
unsigned short UpdateKeyboard = 0;
unsigned short Idle = 0;
int option = 0;
char str[500];
FunctionNo = 0;
LookUpDev(“CARDHOLDER_KEYBOARD”, &cardholder_keyboard_dev);
AttachDev(cardholder_keyboard_dev, &detachable);
initialise_keys(cardholder_keyboard_dev, &send_msg);
enable_cancel_key(&send_msg);
enable_numeric_keys(&send_msg);
enable_enter_key(&send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);
switch (response->tdata[0])
{
case KEY_1:
*MenuId = ‘/’;
break;
case KEY_2:
/* Display submenu for valid existing menu numbers */
sprintf(str, “%c%c KEY 1 - 0 KEY 2 - 1%c”
“ KEY 3 - 2 KEY 4 - 3%c%c%c”
0x0d); “ INPUT REQUIRED CHOICE\0”, 0x0c, 0x0d, 0x0d, 0x0d, 0x0d,
my_StoreScreen(SCREEN_TO_USE, str);
DisplayScreen(ScreenGroup, SCREEN_TO_USE, UpdateKeyboard, Idle);
AttachDev(cardholder_keyboard_dev, &detachable);
initialise_keys(cardholder_keyboard_dev, &send_msg);
enable_cancel_key(&send_msg);
enable_numeric_keys(&send_msg);
enable_enter_key(&send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);
case KEY_3:
/* Display submenu for invalid menu numbers */
sprintf(str, “%c%c KEY 1 - 5 KEY 2 - 6%c%c%c”
“ INPUT REQUIRED CHOICE\0”, 0x0c, 0x0d, 0x0d, 0x0d, 0x0d);
my_StoreScreen(SCREEN_TO_USE, str);
DisplayScreen(ScreenGroup, SCREEN_TO_USE, UpdateKeyboard, Idle);
AttachDev(cardholder_keyboard_dev, &detachable);
initialise_keys(cardholder_keyboard_dev, &send_msg);
enable_cancel_key(&send_msg);
enable_numeric_keys(&send_msg);
enable_enter_key(&send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);
if (response->tdata[0] = KEY_1)
*MenuId = 5;
else
if (response->tdata[0] = KEY_2)
*MenuId = 6;
else
*MenuId = 0;
break;
case KEY_4:
*MenuId = 7;
break;
case KEY_5:
*MenuId = 8;
break;
case KEY_6:
*MenuId = 9;
break;
break;
case KEY_7:
*Interface = 0;
LookUpDev(“CARDHOLDER_KEYBOARD”,
&cardholder_keyboard_dev);
AttachDev(cardholder_keyboard_dev, &detachable);
initialise_keys(cardholder_keyboard_dev, &send_msg);
enable_cancel_key(&send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);
*MenuId = 0;
break;
case KEY_8:
*Interface = 1;
my_StoreScreen(SCREEN_TO_USE, str);
LookUpDev(“CARDHOLDER_KEYBOARD”,
&cardholder_keyboard_dev);
AttachDev(cardholder_keyboard_dev, &detachable);
initialise_keys(cardholder_keyboard_dev, &send_msg);
enable_cancel_key(&send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);
DetachDev(cardholder_keyboard_dev, detachable);
*MenuId = 0;
break;
case KEY_9:
*MenuId = 7;
FunctionNo = 5;
break;
case KEY_0:
*Interface = 2;
my_StoreScreen(SCREEN_TO_USE, str);
DisplayScreen(ScreenGroup, SCREEN_TO_USE, UpdateKeyboard, Idle);
LookUpDev(“CARDHOLDER_KEYBOARD”,
&cardholder_keyboard_dev);
AttachDev(cardholder_keyboard_dev, &detachable);
initialise_keys(cardholder_keyboard_dev, &send_msg);
enable_cancel_key(&send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);
DetachDev(cardholder_keyboard_dev, detachable);
*MenuId = 0;
break;
default :
*MenuId = 0;
break;
/****************************************************************************/
/* */
/* PROCEDURE NAME : Rear */
/* */
/* DESCRIPTION : Displays a screen on the EOP or BOP if it detects one is */
/* present, else it will use the front CRT then wait for CNL */
/* to be pressed. */
/* */
/* */
/****************************************************************************/
void pascal far _loadds Rear(unsigned short far *MenuId,
unsigned short FunctionNo,
unsigned char far *Interface)
{
BYTE tdata[200];
BYTE detachable[2];
WORD keyboard_dev;
send_msg_type send_msg;
unsigned short ScreenGroup = ‘0’;
unsigned short ScreenNumber = 0;
unsigned short UpdateKeyboard = 0;
unsigned short Idle = 0;
int screen;
WORD display_dev;
BYTE temp_buf[800];
MenuId;
FunctionNo;
Interface;
if (*Interface == 0)
screen = 0; /* CRT */
else
screen = DetermineDisplay();
if (screen == EOP)
{
send_msg.clen = 16;
sprintf(send_msg.cdata, “%cEOP - PRESS CNL\0”, 0x0c);
}
else
if (screen == BOP)
{
send_msg.clen = 16;
sprintf(send_msg.cdata, “%cBOP - PRESS CNL\0”, 0x0c);
}
else
{
send_msg.clen = 19;
sprintf(send_msg.cdata, “%cCRT - PRESS CANCEL\0”, 0x0c);
}
AttachDev(display_dev, &detachable[0]);
DetachDev(display_dev, detachable[0]);
send_msg.clen = 1;
send_msg.cdata[send_msg.clen - 1] = 0xF3;
AttachDev(keyboard_dev, &detachable[1]);
ADI_SEND_AND_RECEIVE(keyboard_dev, ENABLE_KEYBOARD_MODE,
(BYTE *) &send_msg,
temp_buf, temp_buf, temp_buf, temp_buf, temp_buf);
DetachDev(keyboard_dev, detachable[1]);
/****************************************************************************/
/* */
/* PROCEDURE NAME : DetermineDisplay */
/* */
/* DESCRIPTION : Determines if any kind of rear display device is connected */
/* to the SST, and returns a value to show this. */
/* */
/* */
/****************************************************************************/
int DetermineDisplay()
{
int displayID = UNKNOWN;
WORD system_display_dev;
WORD system_monitor_dev;
BYTE temp_buf[200];
BYTE tdata[800];
WORD saddr;
send_msg_type send_msg;
enable_rsp_type *data;
int i;
LookUpDev(“SYSTEM_MONITOR”, &system_monitor_dev);
if (system_monitor_dev != 0)
{
send_msg.clen = 0;
LookUpDev(“SYSTEM_DISPLAY”, &system_display_dev);
if (system_display_dev != 0)
{
displayID = NO_EOP_OR_BOP;
if (saddr == system_display_dev)
if (data->tdata[i + (sizeof(BYTE) * 2)] == 0)
displayID = BOP;
else
if (data->tdata[i + (sizeof(BYTE) * 2)] == 1)
displayID = EOP;
else
displayID = UNKNOWN;
}
}
}
return (displayID);
}
LIBRARY exsup
PROTMODE
The Definition File A
CODE LOADONCALL
DATA PRELOAD SINGLE
EXPORTS
MENU
SCREEN
REAR
/************************************************************************/
The Header File A
/************************************************************************/
int DetermineDisplay(void);
# File: [Link]
The Make File A #
# Run this by typing ‘MAKE [Link]’ on a PC with C6.0 installed.
#
INCPATH = C:\s4header
DEPENDS = [Link] [Link] [Link] exgener.c
INCS = exsup.h exconst.h exgener.h
COPT = /Zip /Os /Gs2 /Lp /Fc /Fm /AL /c /W3
exsup+dllstart+exgener
The Link File A [Link] /M/NOD,
exsup /LI,
/NOD:LLIBCE D:\MSC51\LIB\[Link] [Link] +
\pj015\code\ndcia\[Link]
[Link],
/****************************************************************************/
The Code A
/*
/* MODULE NAME : exmisc.c
*/
*/
/* */
/* DESCRIPTION : Exits miscellaneous call point code */
/* */
/* */
/****************************************************************************/
#include <malloc.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include “s4dundee.h”
#include “s4adi2.h”
#include “\pj015\code\600\ndcdata.h”
#include “exconst.h”
#include “exgener.h”
#include “exmisc.h”
/****************************************************************************/
/* */
/* PROCEDURE NAME : Point_1 */
/* */
/* DESCRIPTION : Displays a screen with the passed in parameter of Interface */
/* when the function switch is set to Supervisor and waits for */
/* an FDK to be pressed. */
/* */
/****************************************************************************/
void pascal far _loadds Point_1(unsigned char Interface)
{
BYTE tdata[200];
BYTE detachable = FALSE;
WORD cardholder_keyboard_dev;
send_msg_type send_msg;
BYTE ActiveFDKs = 0;
unsigned short ScreenGroup = ‘0’;
unsigned short ScreenNumber = 0;
unsigned short UpdateKeyboard = 0;
unsigned short Idle = 0;
char str[500];
LookUpDev(“CARDHOLDER_KEYBOARD”, &cardholder_keyboard_dev);
AttachDev(cardholder_keyboard_dev, &detachable);
ActiveFDKs = 0xFF;
initialise_keys(cardholder_keyboard_dev, &send_msg);
enable_FDK_keys(ActiveFDKs, &send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);
DetachDev(cardholder_keyboard_dev, detachable);
}
/****************************************************************************/
/* */
/* PROCEDURE NAME : Point_2 */
/* */
/* DESCRIPTION : Displays a screen when auto exit is set and the mode switch */
/* is set to normal during an Exits supervisor function. */
/* */
/* */
/****************************************************************************/
void pascal far _loadds Point_2(void)
{
unsigned short ScreenGroup = ‘0’;
unsigned short ScreenNumber = 0;
unsigned short UpdateKeyboard = 0;
unsigned short Idle = 0;
/****************************************************************************/
/* */
/* PROCEDURE NAME : Point_3 */
/* */
/* DESCRIPTION : Displays a screen with the passed in parameter of */
/* DestinationMode when Supervisor mode is exited then wait */
/* for an FDK to be pressed. */
/* */
/* */
/****************************************************************************/
void pascal far _loadds Point_3(unsigned char DestinationMode)
{
BYTE tdata[200];
BYTE detachable = FALSE;
WORD cardholder_keyboard_dev;
send_msg_type send_msg;
BYTE ActiveFDKs = 0;
unsigned short ScreenGroup = ‘0’;
unsigned short ScreenNumber = 0;
unsigned short UpdateKeyboard = 0;
unsigned short Idle = 0;
char str[500];
/* Display DestinationMode */
sprintf(str, “%c%c DESTINATION: %d\0”, 0x0d, 0x0d, DestinationMode);
my_StoreScreen(SCREEN_TO_USE, str);
DisplayScreen(ScreenGroup, SCREEN_TO_USE, UpdateKeyboard, Idle);
LookUpDev(“CARDHOLDER_KEYBOARD”, &cardholder_keyboard_dev);
AttachDev(cardholder_keyboard_dev, &detachable);
ActiveFDKs = 0xFF;
initialise_keys(cardholder_keyboard_dev, &send_msg);
enable_FDK_keys(ActiveFDKs, &send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);
DetachDev(cardholder_keyboard_dev, detachable);
}
/****************************************************************************/
/* */
/* PROCEDURE NAME : Point_4 */
/* */
/* DESCRIPTION : Displays a screen with the passed in parameter of DeviceId */
/* when NDC+ clears the fitness of devices, then wait for 5 */
/* seconds before finishing. */
/* */
/* */
/****************************************************************************/
void pascal far _loadds Point_4(unsigned char DeviceId)
{
unsigned short ScreenGroup = ‘0’;
unsigned short ScreenNumber = 0;
unsigned short UpdateKeyboard = 0;
unsigned short Idle = 0;
char str[500];
my_StoreScreen(SCREEN_TO_USE, str);
DisplayScreen(ScreenGroup, SCREEN_TO_USE, UpdateKeyboard, Idle);
ELAPSE_TIME(50);
/****************************************************************************/
/* */
/* PROCEDURE NAME : Point_5 */
/* */
/* DESCRIPTION : Displays a screen with the passed in parameter of DeviceId */
/* when NDC+ physically clears the fitness of devices then it */
/* waits for an FDK to be pressed. */
/* */
/* */
/****************************************************************************/
void pascal far _loadds Point_5(unsigned char DeviceId)
{
BYTE tdata[200];
BYTE detachable;
WORD cardholder_keyboard_dev;
send_msg_type send_msg;
BYTE ActiveFDKs = 0;
unsigned short ScreenGroup = ‘0’;
unsigned short ScreenNumber = 0;
unsigned short UpdateKeyboard = 0;
unsigned short Idle = 0;
char str[500];
my_StoreScreen(SCREEN_TO_USE, str);
DisplayScreen(ScreenGroup, SCREEN_TO_USE, UpdateKeyboard, Idle);
ActiveFDKs = 0xFF;
LookUpDev(“CARDHOLDER_KEYBOARD”, &cardholder_keyboard_dev);
AttachDev(cardholder_keyboard_dev, &detachable);
initialise_keys(cardholder_keyboard_dev, &send_msg);
enable_FDK_keys(ActiveFDKs, &send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);
DetachDev(cardholder_keyboard_dev, detachable);
}
/****************************************************************************/
/* */
/* PROCEDURE NAME : Point_6 */
/* */
/* DESCRIPTION: Displays a screen when NDC+ checks for a suspend condition */
/* then if FDK A is pressed, it will request no suspension, */
/* and if FDK B is pressed it will request a suspend. */
/* */
/****************************************************************************/
unsigned char pascal far _loadds Point_6(void)
{
BYTE tdata[200];
BYTE detachable = FALSE;
WORD cardholder_keyboard_dev;
send_msg_type send_msg;
enable_rsp_type *response;
BYTE ActiveFDKs = 0;
unsigned short ScreenGroup = ‘0’;
unsigned short ScreenNumber = 0;
unsigned short UpdateKeyboard = 0;
unsigned short Idle = 0;
unsigned char suspend = 0;
LookUpDev(“CARDHOLDER_KEYBOARD”, &cardholder_keyboard_dev);
AttachDev(cardholder_keyboard_dev, &detachable);
ActiveFDKs = 0x3; /* Only FDK_A and FDK_B */
initialise_keys(cardholder_keyboard_dev, &send_msg);
enable_FDK_keys(ActiveFDKs, &send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);
DetachDev(cardholder_keyboard_dev, detachable);
switch (response->tdata[0])
{
case FDK_A:
suspend = 1;
break;
case FDK_B:
suspend = 0;
break;
}
return(suspend);
}
/****************************************************************************/
/* */
/* PROCEDURE NAME : Point_7 */
/* */
/* DESCRIPTION : Displays a screen with the first 25 bytes obtained from the */
/* passed in DataPtr pointing to the received HO comm message. */
/* */
/* */
/****************************************************************************/
void pascal far _loadds Point_7(char far *DataPtr)
{
unsigned short ScreenGroup = ‘0’;
unsigned short ScreenNumber = 0;
unsigned short UpdateKeyboard = 0;
unsigned short Idle = 0;
char str[500];
char data[25];
/****************************************************************************/
/* */
/* PROCEDURE NAME : Point_8 */
/* */
/* DESCRIPTION : Displays a screen then waits for an FDK to be pressed. */
/* */
/* */
/****************************************************************************/
void pascal far _loadds Point_8(void)
{
BYTE tdata[200];
BYTE detachable = FALSE;
WORD cardholder_keyboard_dev;
send_msg_type send_msg;
BYTE ActiveFDKs = 0;
unsigned short ScreenGroup = ‘0’;
unsigned short ScreenNumber = 0;
unsigned short UpdateKeyboard = 0;
unsigned short Idle = 0;
LookUpDev(“CARDHOLDER_KEYBOARD”, &cardholder_keyboard_dev);
AttachDev(cardholder_keyboard_dev, &detachable);
ActiveFDKs = 0xFF;
initialise_keys(cardholder_keyboard_dev, &send_msg);
enable_FDK_keys(ActiveFDKs, &send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);
DetachDev(cardholder_keyboard_dev, detachable);
}
/****************************************************************************/
/* */
/* PROCEDURE NAME : Nodet_8 */
/* */
/* DESCRIPTION : Displays a screen then waits for an FDK to be pressed (the */
/* routine does not detach from the cardholder keypad so as to */
/* test that NDC+ system escapes if all devices are not handed */
/* back after Exits finishes. */
/* */
/* */
/****************************************************************************/
void pascal far _loadds Nodet_8(void)
{
BYTE tdata[200];
BYTE detachable = FALSE;
WORD cardholder_keyboard_dev;
send_msg_type send_msg;
BYTE ActiveFDKs = 0;
unsigned short ScreenGroup = ‘0’;
unsigned short ScreenNumber = 0;
unsigned short UpdateKeyboard = 0;
unsigned short Idle = 0;
LookUpDev(“CARDHOLDER_KEYBOARD”, &cardholder_keyboard_dev);
AttachDev(cardholder_keyboard_dev, &detachable);
ActiveFDKs = 0xFF;
initialise_keys(cardholder_keyboard_dev, &send_msg);
enable_FDK_keys(ActiveFDKs, &send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);
/* Doesn’t detach from keyboard to test Exits not handing over all devices */
/****************************************************************************/
/* */
/* PROCEDURE NAME : Illbyte_4 */
/* */
/* DESCRIPTION : Displays a screen with the passed in parameter of DeviceId */
/* when NDC+ clears the fitness of devices, tries to write the */
/* value 222 to the shared data byte item of IdLUNO (this will */
/* cause a system escape). */
/* */
/* */
/****************************************************************************/
void pascal far _loadds Illbyte_4(unsigned char DeviceId)
{
unsigned short ScreenGroup = ‘0’;
unsigned short ScreenNumber = 0;
unsigned short UpdateKeyboard = 0;
unsigned short Idle = 0;
char str[500];
long value;
long id;
my_StoreScreen(SCREEN_TO_USE, str);
DisplayScreen(ScreenGroup, SCREEN_TO_USE, UpdateKeyboard, Idle);
value = 222;
id = IdLUNO;
PutIntVal(id, value);
ELAPSE_TIME(50);
/****************************************************************************/
/* */
/* PROCEDURE NAME : Illstring_4 */
/* */
/* DESCRIPTION : Displays a screen with the passed in parameter of DeviceId */
/* when NDC+ clears the fitness of devices, then tries to */
/* write the shared data item IdAmtBuffer (which should */
/* result in a system escape). */
/* */
/****************************************************************************/
void pascal far _loadds Illstring_4(unsigned char DeviceId)
{
unsigned short ScreenGroup = ‘0’;
unsigned short ScreenNumber = 0;
unsigned short UpdateKeyboard = 0;
unsigned short Idle = 0;
char str[500];
char amount[10];
long id;
my_StoreScreen(SCREEN_TO_USE, str);
DisplayScreen(ScreenGroup, SCREEN_TO_USE, UpdateKeyboard, Idle);
strncpy(amount, “12345678\0”, 9);
id = IdAmtBuffer;
PutStringVal(id, amount);
ELAPSE_TIME(50);
LIBRARY exmisc
The Definition File A PROTMODE
CODE LOADONCALL
DATA PRELOAD SINGLE
EXPORTS
POINT_1
POINT_2
POINT_3
POINT_4
POINT_5
POINT_6
POINT_7
POINT_8
NODET_8
ILLBYTE_4
ILLSTRING_4
/************************************************************************/
The Header File A
#define CURRENCY_CLEAR 1
/************************************************************************/
# File: [Link]
The Make File A
#
# Run this by typing ‘MAKE [Link]’ on a PC with C6.0 installed.
#
INCPATH = C:\s4header
DEPENDS = [Link] [Link] [Link] exgener.c
INCS = exmisc.h exconst.h exgener.h
COPT = /Zip /Os /Gs2 /Lp /Fc /Fm /AL /c /W3
exmisc+dllstart+exgener
The Link File A [Link] /M/NOD,
exmisc /LI,
/NOD:LLIBCE C:\C600\LIB\[Link] [Link] +
\pj015\code\ndcia\[Link] \pj015\code\600\[Link]
[Link],
Glossary 0
Financial Institution Table (FIT) This contains details of where and how
F information is stored on the magnetic strip of the card and how a
transaction should be processed.
FIT See Financial Institution Table.
FS ASCII character denoting Field Separator.
Index 0
Accessor id 9-20
A Adding functions to an exit supervisor menu 5-11
Adding new exit supervisor menus 5-11
ADI2 2-2
ADI2 calls
ADI_CREATE_TASK 10-3
ADI_EXIT_TASK 10-3
ADI_INITIALISE_TASK 10-3
ADI_TERMINATE 10-3
ADI_TERMINATE _PROCESS 10-3
ALLOCATE_MEMORY 10-3
FREE_MEMORY 10-3
restrictions 10-3
Advance NDC 8-1–8-2
relevance of Using NDC Exits xxiii
suspend 5-25
usage restrictions 6-2
using combined devices 6-3
using EPP 6-3
using the system disk 6-3
DisplayScreen 9-10
DisplayString
routine 9-13
DLLs 5-18
Document processing module (DPM) shared data 7-3, 9-25
Documentation, relevance to Advance NDC xxiii
Downloaded configuration options shared data 7-4, 9-36
Dump data 7-8
DumpData call back 9-15
InboundMessageIntercept 9-17
I InitialiseExitRoutine callout 9-18
PerformNDCState 9-10
P Physically clearing devices 5-25
Print statement and wait 10-2
Printer data 7-3, 9-28
PrintToJournal 9-12
ProcessHoCommMsg callout 9-18
Purpose of Exits 1-2
PutIntVal call back 9-14
PutStringVal call back 9-14
NCR welcomes your feedback on this publication. Your comments can be of great value in helping us
improve our information products.
Cut
You may send your comments to us electronically. See over for details.
Circle the numbers below that best represent your opinion of this publication.
Cut
Web: [Link]
Fold
If we may contact you concerning your comments, please fill in the information below:
Name:
Organization:
Company:
Address:
Phone: Fax:
Thank you for your evaluation of this publication. Fold the form where indicated, tape (please do not staple),
and drop in the mail.
F 8763-0695
Fold
Affix
Postage
Stamp
Here