0% found this document useful (0 votes)
214 views272 pages

NCR Direct Connect (NDC)

The document provides detailed information on NCR Direct Connect (NDC) and its compatible software, including APTRA Advance NDC and NDC+ for various operating systems. It covers topics such as the structure of terminal applications, communication protocols, message security, and the use of exits in the NDC environment. Additionally, it includes a revision record and copyright information, emphasizing the proprietary nature of the content.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
214 views272 pages

NCR Direct Connect (NDC)

The document provides detailed information on NCR Direct Connect (NDC) and its compatible software, including APTRA Advance NDC and NDC+ for various operating systems. It covers topics such as the structure of terminal applications, communication protocols, message security, and the use of exits in the NDC environment. Additionally, it includes a revision record and copyright information, emphasizing the proprietary nature of the content.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

NCR Direct Connect (NDC)

Using NDC Exits

B006-5102-D000
Issue 3
July 2007
Copyright and Trademark Information

The products described in this document are copyrighted works of NCR Corporation.

NCR and APTRA are trademarks of NCR Corporation.


IBM and OS/2 are registered trademarks of International Business Machines Corporation.
Microsoft, Windows, Windows NT, Windows XP and ActiveX are registered trademarks of Microsoft Corporation in
the United States and/or other countries.

All other trademarks are the property of their respective owners.

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.

Address any correspondence to:

NCR Financial Solutions Group Ltd


Information Solutions Feedback
Software and Services
Kingsway West
Dundee
Scotland
DD2 3XX

© 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.

This equipment must be installed and used in strict accordance with


Information to User the manufacturer’s instructions. However, there is no guarantee
that interference to radio communications will not occur in a
particular commercial installation. If this equipment does cause
interference, which can be determined by turning the equipment off
and on, the user is encouraged to consult an NCR service
representative immediately.

Caution NCR Corporation is not responsible for any radio or television


interference caused by unauthorised modifications of this
equipment or the substitution or attachment of connecting cables
and equipment other than those specified by NCR. Such
unauthorized modifications, substitutions, or attachments may void
the user’s authority to operate the equipment. The correction of
interference caused by such unauthorized modifications,
substitutions, or attachments will be the responsibility of the user.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits iii


Confidential and proprietary information of NCR.
Unauthorised use, reproduction and/or distribution is strictly prohibited.

iv Using NDC Exits


Revision Record

Revision Record

Date Page Description of Change

July 07 Update for Advance NDC 3.02

xxi Updated references to CEN-XFS and Advance NDC

xxiii Added section explaining what text in the publication


is relevant to Advance NDC

xxvii Updated the list of publications for Advance NDC

Dec 05 Service pack update for APTRA Advance NDC 3.00.02

7-13 Added detail of DisplayString routine

9-12 Added the signature of the DisplayString routine

Oct. 04 - Updated to support APTRA Advance NDC 2.06.

All Added that Camera and Door Access are not


supported by Advance NDC.

xxi In ‘About This Publication’ section, added reference to


CEN-XFS Exits in Advance NDC, White Paper.

xxvii In ‘What Else Should I Read? section, added ‘NDC+’


and ‘APTRA Advance NDC’ headings.

xxviii Added ‘EMV Smart Card Exits’ section specifying


required publication.

3-2 In ‘Restrictions On Messages’ section, added that if


Exits are used in Advance NDC, the size of messages
received from the host must be less than 4 KB.

5-15 Added note that LUNO is not contained in message


processed by a Virtual Controller, but added
afterwards.

6-3 Stated EKC not supported by Advance NDC.

7-11 Verified ‘Storing a Screen’ information.

8-2 In ‘Forward Compatibility Considerations’ section,


changed NDC+ to Advance NDC, and added reference
to CEN-XFS Exits in Advance NDC, White Paper.

A-25 In Virtual Controller example, changed


‘char **Message’ to ‘char far **Message’.
Changed ‘unsigned char’ to ‘extern unsigned char’.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits v


Date Page Description of Change

Glossary Added CEN and XFS definitions. Stated EKC not


supported by Advance NDC.

June 03 Updated to support NDC+ 7.01.

5-2, Moved/updated note that function names are


5-24 upper/lower case sensitive.

5-23 Updated ‘Understanding MISCONT’ section.

5-27 In MISCONT Error Handling table, removed duplicate


point-of-use values as not an error condition.

5-27 Updated ‘Using MISCMULT’ section.

9-15 Moved DumpData to [Link] section.

9-20 In ‘Data Available in NDC Structures’ section,


onwards checked/updated shared data items and accessor IDs.

Glossary Added MEI definition.

Mar. 03 Updated to support APTRA Advance NDC 2.05 and


NDC+ 7.00.01.
Changed NDC+ to NDC, where represents APTRA
Advance NDC or NDC+.

xvii Changed ‘Preface’ heading to ‘About This Publication’.

xviii Added link to Appendix.

xix Updated related publications.


Added APTRA Advance NDC publications.

1-10 Added that exits using shared data should be


recompiled with any changed libraries.

5-2 Added note that Advance NDC function names are


case sensitive.

5-23 From NDC+ 7.00.01 or APTRA Advance NDC 2.05


onwards, more than one Exit library can define the
hook points, using the MISCONT rule file and
[Link] file.

5-27 Added brief ‘Using MISCMULT’ section and reference


to APTRA Advance NDC, Developer’s Guide for further
details.

6-3 Added ‘Using the EPP’ section.

8-2 Added paragraph referencing the APTRA Advance


NDC, Developer’s Guide for differences in migration.

9-8 In table, changed point of use range to 1 - 9.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

vi Using NDC Exits


Date Page Description of Change

9-18 to Updated tables in ‘Data Available In NDC Structures’


9-43 section.

A-24, In example Make files, removed following lines


A-40, referencing obsolete TASM:
A-50,
[Link]: $*.asm $(DEPENDS)
A-60 tasm $*;

Glos-2 Added Encrypting PIN Pad definition.

Mar. 01 xiii Updated NDC+ release number to 6.05.


xiv Updated related publications.
xiv Changed SSDS NDC to Advance NDC.

5-5, Added that DLL name must be at least four characters


5-10, in length.
5-17,
5-24

5-23 Added close state processing to list of Exits.

5-26 Added ‘Close State Processing - Hook’ section

8-1, 8-2 Changed SSDS NDC to Advance NDC, and SSDS to


Advance ADE

9-8 Added ‘9’ - Close state entered

9-12 Added ‘SetDigitalAudioPath’ [Link] call back

9-17 Added ‘SetDigitalAudioPath’ and


‘EnteredCloseStateRoutine’ callouts

9-35 Added Disable ICC Manipulation option


Glossary Changed SSDS NDC to Advance NDC

Apr. 99 1-7 Addition of C6 as compiler.

5-27 Addition of instructions for de-bugging Exits.

9-19 Addition of smart card shared data.

Mar. 98 Title Addition of Year 2000 information.

4-3 Optional extension of Message Coordination Number.

5-16 Additional explanation of StopAndDelete code.

6-2 Recommendations for using PrintToJournal routine


instead of device sharing.

7-3 Additional information on DPM reserved screens

9-4 to Corrected information on use of field separator at the


9-8 end entries for control files STCONT, SUPCTR,
VCCONT and MISCONT.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits vii


Date Page Description of Change

9-12 Add PrintToJournal routine to [Link]

9-13 Add malloc, free, _fmalloc and _ffree to


[Link].

9-27 Add accessor id for journal printer to NDCDATA.H

9-29 Add accessor ids for DPM screens and MCN to


NDCDATA.H

9-35 Add accessor id for Enhanced EJ Backup to


NDCDATA.H.

10-7 Advice on linking [Link].

App A Provide examples of Exits.

Mar. 97 All New publication.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

viii Using NDC Exits


Table of Contents

Contents

Preface

About This Publication ......................................................................... xxi


Who Should Use This Publication? .............................................. xxi
What This Publication Contains ................................................... xxi
How To Use This Publication .....................................................xxiii
What Else Should I Read?......................................................... xxviii
Typography ................................................................................... xxix

Chapter 1
Background

Overview ................................................................................................ 1-1


Purpose of Exits ..................................................................................... 1-2
Previous Environment.......................................................................... 1-3
NDC+................................................................................................ 1-3
NDC-ADI ......................................................................................... 1-3
New Environment .................................................................................1-5
NDC and Data Sharing .................................................................. 1-5
NDC and Device Sharing...............................................................1-6
Exits ......................................................................................................... 1-7
Exit States ......................................................................................... 1-7
Exit Supervisors .............................................................................. 1-7
Virtual Controllers .......................................................................... 1-8
Hooks................................................................................................ 1-9
Shared Data .......................................................................................... 1-10
Exposed Data................................................................................. 1-10
Debugging......................................................................................1-10

Chapter 2
The Structure Of The Terminal Application

Overview ................................................................................................ 2-1


The Structure of the Terminal Application........................................ 2-2

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited

Using NDC Exits ix


Table of Contents

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

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

x Using NDC Exits


Table of Contents

Chapter 5
Exits

Overview ................................................................................................ 5-1


Exits ......................................................................................................... 5-2
Exits - Start of Day Initialisation ......................................................... 5-3
Errors at Start of Day Initialisation............................................... 5-3
Exit States................................................................................................ 5-4
Understanding STCONT ...............................................................5-4
Invocation of Exit State .................................................................. 5-6
Invocation of NDC+ Standard State from an Exit...................... 5-7
Time Out ..........................................................................................5-8
State Table (STCONT) Error Handling........................................ 5-8
Exit Supervisors ................................................................................... 5-10
Understanding SUPCTR .............................................................. 5-10
How to Add an Exit Supervisor Function to an Existing NDC+
Menu............................................................................................. 5-11
How to Add New Exit Supervisor Menus ................................5-11
How to Replace the Initial NDC+ Menu with an Exit Supervisor
Menu............................................................................................. 5-11
Signature of Exit Supervisor Routines ....................................... 5-12
Transition Into Supervisor Mode Hook .................................... 5-13
Transition Out Of Supervisor Mode Hook ............................... 5-13
Stop Supervisor Hook .................................................................. 5-14
Supervisor Table Control (SUPCTR) Error Handling ............. 5-14
Virtual Controllers .............................................................................. 5-15
Data and Device Sharing .............................................................5-16
Example Showing How Virtual Controllers Work .................. 5-17
Understanding VCCONT ............................................................ 5-17
DLLs................................................................................................ 5-18
Virtual Controller Control (VCCONT) Error Handling.......... 5-22
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

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits xi


Table of Contents

Using MISCMULT ........................................................................5-27


Debugging ............................................................................................5-29

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

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

xii Using NDC Exits


Table of Contents

Storing a Screen .............................................................................7-11


Retrieving Screen Data ................................................................. 7-12
Adding Screen Data......................................................................7-13
NDC+ Keyboards ................................................................................ 7-15
NVRAM ................................................................................................ 7-17

Chapter 8
Forward Compatibility Considerations

Overview ................................................................................................ 8-1


Forward Compatibility Considerations .............................................8-2
State Letters Available for Exits Use ............................................ 8-2
Supervisor Menus and Menu Numbers Available for
Exits Use......................................................................................... 8-2
Migration to Advance NDC .......................................................... 8-2
Screen Numbers .............................................................................. 8-3
Timers ............................................................................................... 8-3

Chapter 9
Reference Information

Overview ................................................................................................ 9-1


Rule Files.................................................................................................9-2
State Table Control - \SYSTEM\STCONT ................................. 9-2
Supervisor Table Control - \SYSTEM\SUPCTR ....................... 9-5
Virtual Controller Control - \SYSTEM\VCCONT.................... 9-7
Miscellaneous Support File - \SYSTEM\MISCONT................. 9-7
Signatures and Synopses of the Routines ........................................ 9-10
Call Backs Held In [Link]................................................. 9-10
Call Backs Held In [Link] ................................... 9-12
Call Backs Held In [Link] ...........................................9-13
Callout From State Table Control File ....................................... 9-16
Callout From Supervisor Table Control File............................. 9-17
Callouts From Virtual Controller Control File .........................9-17
Callouts From Miscellaneous Support File ............................... 9-17
Data Available In NDC Structures....................................................9-20
New Screen Definitions ......................................................................9-46

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits xiii


Table of Contents

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

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

xiv Using NDC Exits


Table of Contents

The Link File .................................................................................A-60

Glossary
Glossary .................................................................................... Glossary-1

Index
Index................................................................................................Index-1

User Feedback Form

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits xv


Table of Contents

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

xvi Using NDC Exits


List of Figures

List of Figures

Chapter 1
Background

Figure 1-1 Previous NDC+ Environment ...................................... 1-3


Figure 1-2 New NDC+ Environment .............................................1-5
Figure 1-3 Virtual Controllers Operate in Outbound and Inbound
Chains ............................................................................ 1-8

Chapter 2
The Structure Of The Terminal Application

Figure 2-1 Exits Within the NDC+ Environment .........................2-2


Figure 2-2 NDC+ Communicates With High Order Comms
via S4 .............................................................................. 2-3
Figure 2-3 NDC+ Communicates With the Host via High Order
Comms........................................................................... 2-4

Chapter 5
Exits

Figure 5-1 Virtual Controllers Operate in Outbound and Inbound


Chain Sequences ........................................................ 5-16

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits xvii


List of Figures

Confidential and proprietary information of NCR.

Unauthorised use, reproduction and/or distribution is strictly prohibited

xviii Using NDC Exits


List of Tables

List of Tables

Preface

Table Pref-1 Relevance of Using NDC Exits to Advance NDC..... xxv

Chapter 3
Communications Between the Host, Exits and NDC

Table 3-1 Exit to Host Message Format........................................ 3-4


Table 3-2 Host toExit Message Format......................................... 3-5
Table 3-3 Transaction Request Message:
Additional Fields.......................................................... 3-6
Table 3-4 Transaction Reply Message:
Additional Fields.......................................................... 3-7

Chapter 5
Exits

Table 5-1 Start-of-Day Errors......................................................... 5-3


Table 5-2 STCONT File: Field Descriptions................................. 5-5
Table 5-3 SUPCTR File: Field Descriptions ............................... 5-10
Table 5-4 SUPCTR File: Error Conditions..................................5-14
Table 5-5 VCCONT File: Field Descriptions ............................. 5-18
Table 5-6 NDC to High Order Comms:
Message Structure...................................................... 5-20
Table 5-7 High Order Comms to NDC+:
Message Structure...................................................... 5-20
Table 5-8 SUPCTR File: Error Conditions..................................5-22
Table 5-9 MISCONT File: Field Descriptions ............................ 5-24
Table 5-10 MISCONT File: Error Conditions .............................. 5-27

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits xix


List of Tables

Chapter 7
Access To NDC

Table 7-1 Counters ..........................................................................7-4


Table 7-2 Screen Data Format......................................................7-11
Table 7-3 Keyboard Data..............................................................7-15

Chapter 9
Reference Information

Table 9-1 STCONT File: Field Descriptions.................................9-3


Table 9-2 SUPCTR File: Field Descriptions .................................9-5
Table 9-3 VCCONT File: Field Descriptions................................9-7
Table 9-4 MISCONT File: Field Descriptions ..............................9-8
Table 9-5 Card And Buffer Data..................................................9-21
Table 9-6 Financial Institution Table Data.................................9-23
Table 9-7 Document Processing Module Data..........................9-25
Table 9-8 Printer Data ...................................................................9-28
Table 9-9 State Control Data ........................................................9-29
Table 9-10 Communications Data.................................................9-31
Table 9-11 Screen Data....................................................................9-32
Table 9-12 Timer Data.....................................................................9-33
Table 9-13 Message Mode Options Data......................................9-35
Table 9-14 MAC Number ...............................................................9-36
Table 9-15 Downloaded Configuration Options ........................9-36
Table 9-16 Counters ........................................................................9-38
Table 9-17 Miscellaneous Data ......................................................9-44

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

xx Using NDC Exits


Preface
About This Publication

About This Publication

This publication provides guidelines on how to add your own


special purpose routines to APTRA Advance NDC or NDC+,
referred to collectively in this publication as ‘NDC’.
We refer to user-written routines as Exits. This publication describes
only the interfaces between Exits and NDC; it is not a
comprehensive guide to customising the terminal software.
NDC Exits can be used with APTRA Advance NDC or NDC+.
However, with APTRA Advance NDC you can enhance your
application using a combination of methods. For information about
the available methods, refer to the APTRA Advance NDC, Developer’s
Guide (B006-6046), Appendix A, “Using Exits in Advance NDC”.
If you want to develop CEN-XFS Exits to extend your Advance
NDC application, refer to the white paper, CEN-XFS Exits in
Advance NDC, provided with Advance NDC.
For introductory NDC Exit and specific NDC+ Exit information, use
this publication. For Advance NDC Exit information, see Table
Pref-1 on page xxiii, which describes what is relevant to Advance
NDC in this publication and where to find more information.

This publication is designed for experienced programmers who


Who Should Use This intend to develop customised terminal applications on NCR SSTs
Publication? (Self Service Terminals). In order to write Exits, you will need to
understand the C programming language, and be familiar with
NDC+, S4 and OS/2, or APTRA Advance NDC and Windows XP/
Windows NT.

The information in this publication is organised in the following


What This Publication sections:
Contains
Chapter 1, “Background” 0

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.

Chapter 2, “The Structure Of The Terminal Application” 0

This chapter tells you about the structure and principal components
of the software that runs on the terminal.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits xxi


Preface
About This Publication

Chapter 3, “Communications Between the Host, Exits and


NDC” 0

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.

Chapter 4, “Message Security” 0

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.

Chapter 7, “Access To NDC” 0

This chapter tells you about the NDC shared data and about the use
of NDC screens, keyboards and NVRAM.

Chapter 8, “Forward Compatibility Considerations” 0

This chapter tells you how to avoid problems with subsequent NDC
versions, and with migration to APTRA Advance NDC.

Chapter 9, “Reference Information” 0

This section brings together information about rule files, routines


and shared data for quick reference.

Chapter 10, “Programmer’s Tips” 0

This section contains notes which have been provided by


programmers developing Exits.

Appendix A, “Examples of Exits” 0

This appendix provides examples of Exits to use as a guide when


creating your own.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

xxii Using NDC Exits


Preface
About This Publication

For NDC+, we recommend that before beginning to design and


How To Use This implement Exits you read chapters one to eight of this publication to
Publication gain an understanding of the NDC Exits interface and what is
involved. After that, you should use the publication as a reference to
specific information and instruction as required.

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>)

Note: In this manual, references are made to NDC+ manuals and


Advance NDC manuals. References to the NDC+ manuals can be
ignored. For a list of Advance NDC manuals, see “What Else Should
I Read?” on page xxvii.

Table Pref-1
Relevance of Using NDC Exits to
Advance NDC

Chapter Section Relevance to Advance NDC

Chapter 1, “Purpose of Exits” on Applies


“Background” page 1-2

“Previous Environment” Does not apply as Advance NDC uses the CEN-XFS
on page 1-3 interface ([Link]

“New Environment” on The diagram and references to ADI-2 do not apply.


page 1-5

“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

“Shared Data” on page Applies


1-10

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”

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits xxiii


Preface
About This Publication

Chapter Section Relevance to Advance NDC

Chapter 3, “Communication Between Applies with the exception of the 4 KB message


“Communications the Host, Exits and NDC” restriction; in Advance NDC, maximum message
Between the Host, Exits on page 3-2 length is determined by the communications protocol;
and NDC” refer to the Advance NDC Reference Manual, Chapter
10, “Central to Terminal Messages”

“New Message Classes” Applies with the exception of ProcessComms as it


on page 3-3 has not been implemented in Advance NDC

“Expanded Transaction Applies


Request and Transaction
Reply Messages” on page
3-6

“Status Messages” on Applies


page 3-9

“Free Form Messages” on Applies


page 3-11

“SNA Translation, IBM Applies only to communications protocols supported


Loop/SNA ETX in Advance NDC; refer to the Advance NDC
Character” on page 3-12 Developer’s Guide

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

“Message Co-ordination Applies; refer to the Advance NDC Reference Manual,


Number” on page 4-3 Chapter 7, “Configuration Parameters”

“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”

“Transaction Status” on Applies; refer to the Advance NDC Reference Manual,


page 4-7 Chapter 7, “Configuration Data”

“Trace” on page 4-9 Does not apply; refer to Advance NDC, Developer’s
Guide, Chapter 3, Migrating Existing NDC+
Applications to Advance NDC

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

xxiv Using NDC Exits


Preface
About This Publication

Chapter Section Relevance to Advance NDC

Chapter 5, “Exits” All Instead of Pascal signatures, Advance NDC uses C


signatures of the format described in “How To Use
This Publication” on page xxiii; for more information
about C signatures, refer to the Advance NDC
Developer’s Guide and the CEN-XFS Exits in Advance
NDC white paper

“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

“Exit Supervisors” on Applies except for references to Diskbuild , FM and


page 5-10 Diebold; also refer to the CEN-XFS Exits in Advance
NDC white paper. From release 3.02, Advance NDC
supports alphanumeric state numbers; refer to the
Advance NDC, Developer’s Guide, Chapter 4,
“Upgrading from earlier releases of Advance NDC”

“Virtual Controllers” on Applies; from release 3.02, Advance NDC fully


page 5-15 supports message reflection

“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

Chapter 7, “Access To All Instead of Pascal signatures, Advance NDC uses C


NDC” signatures of the format described in “How To Use
This Publication” on page xxiii; for more information
about C signatures, refer to the Advance NDC
Developer’s Guide and the CEN-XFS Exits in Advance
NDC white paper

“Shared Data” on page 7-2 Applies

“Data Groups” on page Applies, except Advance NDC supports up to 7


7-3 cassettes and up to 8 coin hopper types, but does not
support the Document Processing Module (DPM) or
camera

“Data Accessors” on page Applies except Dump Data


7-7

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits xxv


Preface
About This Publication

Chapter Section Relevance to Advance NDC

“NDC+ Screens” on page Applies except for associated keyboards, which


7-10 Advance NDC ignores as keyboard layouts are now
defined at the PIN SP and platform level.

“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”

Chapter 9, “Reference All Instead of Pascal signatures, Advance NDC uses C


Information” signatures of the format described in “How To Use
This Publication” on page xxiii; for more information
about C signatures, refer to the Advance NDC
Developer’s Guide and the CEN-XFS Exits in Advance
NDC white paper

“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.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

xxvi Using NDC Exits


Preface
About This Publication

Chapter Section Relevance to Advance NDC

“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

“Memory Allocation and Does not apply


De-allocation” on page
10-5

“Using File Management Does not apply


Interface” on page 10-6

“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.

The additional publications you should read depend on whether


What Else Should I Read? you are using APTRA Advance NDC or NDC+.

APTRA Advance NDC 0

For APTRA Advance NDC, refer to the following publications:


● APTRA Advance NDC, Overview (B006-6597)
● APTRA Advance NDC, Developer’s Guide (B006-6046)
● APTRA Advance NDC, Supervisor’s Guide (B006-6062)
● APTRA Advance NDC, Reference Manual (B006-6180)
● APTRA Advance NDC, Multi-Vendor Support Reference Manual
(B6006-6344)
● CEN-XFS Exits in Advance NDC, White Paper
● APTRA Advance NDC Display and Keyboard Hooks, White Paper
The following documents are available from the CEN site,
[Link]
● Extensions for Financial Services (XFS) interface specification
(CWA 14050)
● ActiveXFS Interface Specification
(CWA 13849)

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)

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits xxvii


Preface
About This Publication

● NCR Self Service Terminals, Band 2 Comms Manual (B006-0000-


2198)
● NCR Self Service Terminals, Band 3 Comms Manual (D1-2199)
● Template Generator User’s Guide (D1-4808)
● NDC+ Programmer’s Reference Manual (B006-2486)
● NDC Message Formats for Host Application Developers (B006-4201)
● Troubleshooting on a Development Terminal (B006-2561)
● NCR Font Editor User Guide (B006-0000-4169)
● D-Scribe User Guide (D1-4205)
● 56xx Document Processing Application Development Guidelines
(D1-4206)
● EGA/VGA Configuration Toolset Guide (B006-0000-4548)
● NDC+ Keyboard Tool, User’s Guide (D1-4804)
● S4I Documentation CD-ROM (B006-6088)*.
* The latest S4I manuals can only be ordered as Acrobat Portable
Document Format (PDF) files on this bookset CD-ROM, not as
paper manuals.

EMV Smart Card Exits 0

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).

Within this manual we describe two types of routine.


Typography
NCR supplies some routines in DLLs. You use the names of these
routine names exactly as they are shown in this manual. Names of
this kind appear in this typeface:
SendUnformatedData

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

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

xxviii Using NDC Exits


Table of Contents
Background

Chapter 1
Background

Overview 1-1

Purpose of Exits 1-2

Previous Environment 1-3


NDC+ 1-3
NDC-ADI 1-3

New Environment 1-5


NDC and Data Sharing 1-5
NDC and Device Sharing 1-6

Exits 1-7
Exit States 1-7
Exit Supervisors 1-7
Virtual Controllers 1-8
Hooks 1-9

Shared Data 1-10


Exposed Data 1-10
Debugging 1-10

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits


Table of Contents
Background

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits


Background 1

Overview

Overview 1

Exits are a powerful new addition to NDC (NCR Direct Connect)


capability. This chapter introduces you to Exits and provides the
necessary background information that you will need. It will set the
scene for understanding Exits and doing your own Exit
development, by telling you what an Exit is and the types of Exit
you can use.
The chapter covers the following topics:
● Purpose of Exits
● The Previous Environment - prior to the introduction of Exits
● The New Environment - including the introduction of Exits
● Exits - the different types of Exits that exist
● Shared Data - the data that NDC will share with Exits.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 1-1


Background
Purpose of Exits

Purpose of Exits 1

Exits allow you to extend the functionality of the NDC transaction


processing application, by incorporating your own routines. These
can be executed at various points within the NDC operation.
Here are the types of changes you can make to the NDC application
if you use Exits:
● Create and add your own new states to introduce new
functionality or replace existing states
● Create new supervisor functions which can be accessed from the
present NDC Supervisor Menus
● Create new Supervisor menus to sit alongside the present
Supervisor menus
● Create your own Supervisor functionality to replace the present
NDC Supervisor altogether
● Create and add Virtual Controllers, for example to provide
decision making which is beyond the scope of NDC and which
the Host would normally need to provide
● Provide support for devices or services not currently supported
by NDC.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

1-2 Using NDC Exits


Background
Previous Environment

Previous Environment 1

To help you understand the nature of the changes to the NDC


system with the introduction of Exits, it is helpful to illustrate the
NDC+ system as it was before. To understand the Advance NDC
environment, see the APTRA Advance NDC, Developer’s Guide.
Previously with NDC+, the terminal software consisted of the
following components:

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

NDC+ is the transaction processing application software. This deals


NDC+ 1

with processing cardholder transactions, Supervisor functions, etc.

NDC-ADI (Application Device Interface), provides an interface


NDC-ADI 1

between NDC+ and the S4 platform. NDC-ADI is a migrated ADI


application that supports S4 migrated components.
NDC+ is normally attached to the terminal’s devices. The only time
it is not is when one of the following programs is running:
● Terminal Diagnostics
● Clear State of Health
● TM-Alert.
NDC+ instructs these programs to run by sending a message to
them via NDC-ADI. When they are running, these programs may

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 1-3


Background
Previous Environment

make a request to attach to the terminal devices. When NDC+


receives a request, it will surrender control of the device to the
requesting program (when it can - i.e. not in the middle of a
transaction). Immediately after surrendering control, NDC+ will try
to reattach to the surrendered device, so that it regains control as
soon as the other program has finished with it.
NDC+ will not surrender control of the following:
● Alarms
● Tamper Indicating devices
● Door access (Not supported by Advance NDC)
● NDC+ Primary High Order Comms channel
● Rear panel indicator
● Remote status indicator
● In Service LED
● Supervisor LED
● Error LED
● Status Panel
● Beeper.
When TM-Alert is running, it can send messages to, and receive
messages from, the host through NDC+ which acts as a
communications gateway.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

1-4 Using NDC Exits


Background
New Environment

New Environment 1

The following changes were made to the NDC+ environment to


allow the introduction of Exits.

Figure 1-2 ADI 2


New NDC+ Environment
1
NDC Host Software
Exits
Mgt.

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+ continues to operate on top of NDC-ADI. Exits operate on


top of ADI-2.
NDC initiates Exit operations at the following points:
● When an Exit State (a user defined state) is called during normal
transaction flow
● When an Exit Supervisor feature (a user defined menu function,
a user defined menu, or an entirely user defined Supervisor set
of functions) is selected
● At various miscellaneous points during terminal operation in
order to allow NDC and the Exit system to remain in
synchronisation with each other. These miscellaneous points are
referred to as Hooks.
● When an Exit sitting between NDC and High Order Comms
intercepts a message. These Exits are called Virtual Controllers.

NDC makes some of its data available to Exits. Data can only be
NDC and Data Sharing 1

shared through a defined data sharing mechanism. See “Shared


Data” at the end of this chapter.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 1-5


Background
New Environment

NDC allows Exits to use the devices it normally controls at the


NDC and Device 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”.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

1-6 Using NDC Exits


Background
Exits

Exits 1

It is important to remember that Exit functionality is not provided


by NDC. NDC has been modified to provide an environment which
supports Exits. The Exit functionality is user defined and provided
by user written routines which are stored in DLLs, so they can be
called as required. Microsoft C6.00 compiler should be used to
create the DLLs.
There are four different types of Exit. These are:
● Exit States
● Exit Supervisors
● Virtual Controllers
● Hooks.
Each of these is outlined below and discussed in more detail in
Chapter 5.

An Exit State is a user written state, which can be included in the


Exit States 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.

Exit Supervisors are user written Supervisor routines. Exit


Exit Supervisors 1

Supervisors can be implemented in the following three distinct


ways:
● Adding a user written Supervisor function to one of the existing
Supervisor menus
● Adding a completely new menu of user written Supervisor
functions
● Replacing entirely the standard NDC Supervisor application
with a user written Supervisor application.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 1-7


Background
Exits

To understand Virtual Controllers it will be helpful to understand a


Virtual Controllers 1

little background to NDC.


NDC gathers cardholder transaction data which it sends to the host
for authorisation, and acts on commands sent back by the host. It
has no functionality to make transaction decisions: that is, it is a
dumb terminal.
Virtual Controllers allow you to introduce decision making
functionality. Why you should want to do this is entirely up to you,
but here are a couple of possible reasons:
● To be able to make transaction decisions and so remain in
service when the Comms link with the host is down
● To provide decision making for new transactions without
having to make modifications to the host driver.
A Virtual Controller is a user written routine that sits between NDC
and HO Comms and can intercept messages passing between them.

Figure 1-3
Virtual Controllers Operate in Outbound
1

and Inbound Chains

HO Comms

VC 4 VC 3

VC 5 VC 2

VC 6 VC 1

NDC+

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

1-8 Using NDC Exits


Background
Exits

Virtual Controllers can receive messages coming from either NDC


or the Host and can decide to:
● Allow the message to pass through
● Deal with the message itself and send a response back; for
example, the Virtual Controller may make the transaction
decision.
● Modify the message and send it on; for example it may add
additional data gathered by an Exit State, or it could split a
message, providing custom actions before sending a standard
transaction reply to NDC.
● Pass the message on to another Virtual Controller for further
processing.
Virtual Controllers can be chained, so one Virtual Controller might
receive a message and using the return code pass it via NDC on to
another Virtual Controller for further processing. This allows a
modular approach to the use of Virtual Controllers.

Hooks are user written routines which NDC calls, at certain points
Hooks 1

during its operation, in order to maintain a dialogue with the Exit


system. If you implement Exits, you may need to develop hooks to
deal with these.
NDC makes these callouts at the following points:
● When NDC is clearing fitness of devices
● When an incoming Host to Exit message arrives at HO Comms
● When NDC is physically clearing devices
● At Start of Day
● When NDC polls for suspend requirement
● When the operator makes the transition into Supervisor mode
● When the operator makes the transition out of Supervisor mode
● When the operator leaves Supervisor mode by throwing the
mode switch when Supervisor has Auto Exit mode enabled.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 1-9


Background
Shared Data

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.

Note: If an Exit uses shared data, it should be recompiled with any


changed libraries, including any which have changed in the current
NDC release. Any NDC libraries which have changed are listed in
the relevant Release Bulletin.
NDC also provides data accessors. These are routines that allow
Exits to read and write numeric values and strings.

NDC makes the following classes of data available as exposed data:


Exposed Data 1

● Card and Buffer data


● Communications data
● Counters
● Document Processing Module (DPM) data (NDC+ only)
● Downloaded Configuration Options
● Financial Institution Table (FIT) data
● Message Authentication Code (MAC) machine number
● Message Mode Options data
● Printer data
● Screen data
● State Control data
● Timer data
● Miscellaneous data.
Details of data name, data type, Accessor ID, Accessor type, and a
description of each data element are given in “Data Available In
NDC Structures” on page 9-20.
For the differences with Advance NDC, refer to the APTRA Advance
NDC, Developer’s Guide.

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”.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

1-10 Using NDC Exits


Table of Contents
The Structure Of The Terminal Application

Chapter 2
The Structure Of The Terminal
Application

Overview 2-1

The Structure of the Terminal Application 2-2


S4 and ADI-2 2-2
NDC+ and NDC-ADI 2-3
High Order Comms 2-3
Host 2-4

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits


Table of Contents
The Structure Of The Terminal Application

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits


The Structure Of The Terminal Application
2

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.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 2-1


The Structure Of The Terminal Application
The Structure of the Terminal Application

The Structure of the Terminal


Application 2

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

S4 is the platform that runs on NCR’s 4th generation terminals. S4 is


S4 and ADI-2 2

based around the OS/2 operating system.


S4 provides a set of functionality that can be used to support
applications. S4 is an intermediate layer between OS/2 and the
application and thus provides the application with some measure of
operating system independence.
ADI-2, the Application Device Interface, is the interface through
which an application communicates with any of the S4 operating
system services.
When you write Exits, you must use the ADI-2 routines provided to
communicate with S4’s devices and services. ADI-2 provides a
library of routines which an Exit must call when, for example, it
wants to attach to or detach from a device. Using ADI-2 routines
will help protect you from any compatibility problems that could
occur if the base operating system should ever change in the future.
For more information on S4 and the ADI-2, see the NCR publication
Self Service Platform Software Programmer’s Guide.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

2-2 Using NDC Exits


The Structure Of The Terminal Application
The Structure of the Terminal Application

NDC+ is the transaction processing application. The following


NDC+ and NDC-ADI 2

diagram shows the communications path from NDC+ to devices


and High Order 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.

High Order Comms is the S4 service which handles the transfer of


High Order Comms 2

messages between the terminal and the host.


NDC+ communicates with the host on the primary high order
communications channel. A variety of communications protocols
are possible.
The following diagram shows the relationship between NDC+,
High Order Comms and the host.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 2-3


The Structure Of The Terminal Application
The Structure of the Terminal Application

Figure 2-3
NDC+ Communicates With the Host via
2

NDC+
High Order Comms
NDCADI

S4

S4 SERVICES H.O. Comms


HO Comms

A standard NDC+ system must always be connected to a host


Host 2

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.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

2-4 Using NDC Exits


Table of Contents
Communications Between the Host, Exits and NDC

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
Additions To MAC Field Selection Load 3-8

Status Messages 3-9


Solicited Status Message 3-10
Unsolicited Status Message 3-10

Free Form Messages 3-11

SNA Translation, IBM Loop/SNA ETX Character 3-12

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits


Table of Contents
Communications Between the Host, Exits and NDC

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits


Communications Between the Host, Exits and NDC
3

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.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 3-1


Communications Between the Host, Exits and NDC
Communication Between the Host, Exits and NDC

Communication Between the Host,


Exits and NDC 3

There are a number of different ways available for Exits to


communicate with the host, these are:
● Exit to Host messages
● Host to Exit messages
● Expanded Transaction Request and Transaction Reply messages
● Free Form Messages on a different connection may be available,
if the protocol being used supports multiple logical connections
or the terminal has an additional physical channel
● Status messages.

In Advance NDC, there is a restriction on the size of messages that


Restrictions on Messages 3

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.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

3-2 Using NDC Exits


Communications Between the Host, Exits and NDC
New Message Classes

New Message Classes 3

Two new messages have been added to allow Exits to communicate


with the host using the standard NDC+ primary communications
channel. These are:
● Exit to Host - Class 5, subclass 1
● Host to Exit - Class 7, subclass 1
When these messages are used NDC+ acts as a simple pass through
transport layer, adding or stripping the NDC+ message headers
used to identify the message, but not altering the data in any way.
No MACing (Message Authentication Coding), Selective MACing,
or encryption is performed on these messages by NDC+.
The message length is determined by the communications protocol
being used.
These messages are free format 7-bit ASCII and are subject to a
maximum length which depends on the protocol being used.
(Please refer to the Comms. manual for the particular protocol that
you are using.)

To send an Exit to Host message the Exit must use the


Exit to Host Message 3

SendUnformatedData routine. This is located in the DLL


[Link]. The routine signature is:

extern unsigned char pascal far _loadds


SendUnformatedData(char far *DataPtr, unsigned char
ViaInterceptor);

where:

DataPtr is a pointer to a null terminated string. The characters


must be 7 bit transmittable ASCII. The length of the message is
governed by the protocol used, but message lengths greater than
1622 bytes will not be supported. NDC+ will take care of any
protocol dependent ASCII/EBCDIC conversion or
addition/subtraction of ETX characters.

ViaInterceptor is a boolean parameter that defines the


transmission path to be used for the message. If TRUE, the
message will pass through any outgoing Virtual Controller
interceptors that are present. If FALSE, the message will be sent
directly to High Order Comms avoiding any Virtual Controller
interceptors.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 3-3


Communications Between the Host, Exits and NDC
New Message Classes

The routine returns the following values:

0 Good, Message transmitted

1 Failed to transmit message. Link up

2 Failed to transmit message. Link down

3 Message too long to transmit

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.

Table 3-1 Field Mandatory / Number of


Description
Exit to Host Message Format Name Optional Characters

b Message Class (‘5’) M 1

c Message Subclass (‘1’) M 1

FS Field Separator M 1

d Logical Unit Number M 3 or 9

e Field Separator M 1

f Exit Supplied Data M Var

Host to Exit message (class 7, subclass 1) allows the host to send


Host to Exit Message 3

messages to an Exit on the primary communications channel using


NDC+ as a communications gateway.
NDC+ will pass the message to the DLL and routine named in the
MISCONT file corresponding to a Point of Use value of 7. For more
details on the MISCONT file, see “Rule Files” on page 9-2. If there is
no entry specified in MISCONT, then NDC+ will reject the message.
When a Host to Exit message arrives, NDC+ strips the header, fields
b, c, d, f and the FS, from it and passes it to the routine specified.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

3-4 Using NDC Exits


Communications Between the Host, Exits and NDC
New Message Classes

The format of the message received at High Order Comms is:

Table 3-2 Field Mandatory / Number of


Description
Host toExit Message Format Name Optional Characters

b Message Class (‘7’) M 1

c Response Flag O 1

FS Field Separator M 1

d Logical Unit Number O 3 or 9

FS Field Separator M 1

f Message Subclass (‘1’) M 1

FS Field Separator M 1

g Data intended for Exit M Var

The Exit routine must comply with the following signature:

extern void pascal far _loadds ProcessHoCommMsg(char


far *DataPtr);

where:

DataPtr is a pointer to a buffer containing field g of the message


terminated by a NULL.

Note: NDC+ will release the memory allocated for the string after
the DLL call terminates.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 3-5


Communications Between the Host, Exits and NDC
Expanded Transaction Request and Transaction Reply Messages

Expanded Transaction Request and


Transaction Reply Messages 3

The existing NDC+ Transaction Request and Transaction Reply


messages have both been expanded by six additional fields which
can be used by Exits. The new fields will be added to the message or
extracted from the message using Virtual Controller Exits.
If the host is to be involved in receiving or sending messages
containing these additional fields, then the host driver will need to
be modified.

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.

For full information about the format and content of Transaction


Request and Transaction Reply messages, see the NCR publication
NDC+, Programmer’s Reference Manual.

The following additional fields have been added to the Transaction


Additional Fields in the Request message.
Transaction Request
Message 3

Table 3-3 Number of Mandatory / Description


Field Name
Transaction Request Message: Characters Optional
Additional Fields
FS 1 O

ax1 1 O VC Data ID ‘W’

ax2 Var O VC Data

FS 1 O

ay1 1 O VC Data ID ‘X’

ay2 Var O VC Data

FS 1 O

az1 1 O VC Data ID ‘Y’

az2 Var O VC Data

FS 1 O

ba1 1 O VC Data ID ‘Z’

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

3-6 Using NDC Exits


Communications Between the Host, Exits and NDC
Expanded Transaction Request and Transaction Reply Messages

ba2 Var O VC Data

FS 1 O

bb1 1 O VC Data ID ‘[‘

bb2 Var O VC Data

FS 1 O

bc1 1 O VC Data ID ‘\’

bc2 Var O VC Data

Note: These additional fields form groups which include the


preceding field separator; for example <FS, ax1, ax2> form one
group. The name of each group is given by two alphabetic
characters; for example ax. The subfields are identified by the
numeric character; for example ax1. If any of these groups are
included in a message, then the initial field separator and the ID
subfield must be present in each case, even if the associated data
subfield is not.

The following additional fields have been added to the Transaction


Additional Fields in the Reply message.
Transaction Reply
Message 3

Table 3-4 Number of Mandatory / Description


Field Name
Transaction Reply Message: Characters Optional
Additional Fields
FS 1 O

am1 1 O VC Data ID ‘M’

am2 Var O VC Data

FS 1 O

an1 1 O VC Data ID ‘N’

an2 Var O VC Data

FS 1 O

ao1 1 O VC Data ID ‘O’

ao2 Var O VC Data

FS 1 O

ap1 1 O VC Data ID ‘P’

ap2 Var O VC Data

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 3-7


Communications Between the Host, Exits and NDC
Expanded Transaction Request and Transaction Reply Messages

FS 1 O

aq1 1 O VC Data ID ‘Q’.

aq2 Var O VC Data.

FS 1 O

ar1 1 O VC Data ID ‘R’.

ar2 Var O VC Data.

Note: These additional fields form groups which include the


preceding field separator; for example <FS, am1, am2> form one
group. The name of each group is given by two alphabetic
characters; for example am. The subfields are identified by the
numeric character; for example am1. If any of these groups are
included in a message, then the initial field separator and the ID
subfield must be present in each case, even if the associated data
subfield is not.

When Exit data is transferred using the additional fields in the


Message Security 3

Transaction Request and Transaction Reply messages, it is subject to


the same security measures as the message in which it is transferred:
● Overall MACing
● Selective MACing
● Message sequence numbers
● Time variant number.

Additions To MAC Field Selection Load 3

When Selective MACing is used, the MAC Field Selection Load


message specifies which fields in the Transaction Request and
Transaction Reply messages are to be MACed. In order to
accommodate the new additional fields the offsets have been
increased as follows:
● Transaction Request Message - offset values 40 to 45 added to
cover new fields ax - bc
● Transaction Reply Message - offset values 29 to 34 added to
cover new fields am - ar.
For further information on additions to the MAC Field Selection
Load message, see the “Message Authentication Field Selection
Load“ section in the NDC+ Programmer’s Reference Manual.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

3-8 Using NDC Exits


Communications Between the Host, Exits and NDC
Status Messages

Status Messages 3

For a full description of the operation of solicited and unsolicited


Status Messages in NDC+, see the chapter called “Status Messages“
in the NDC+ Programmer’s Reference Manual.
In Native Mode, an Exit may send Solicited Status Messages or
Unsolicited Status Messages based on a supplied DIG (Device
Identifier Graphic) and status field to the host. In Diebold Mode, the
Exit can send a READY message only.
To send a Status message the Exit must use the SendStatus routine,
which is located in the DLL [Link]. The routine signature is:
extern unsigned char pascal far _loadds
SendStatus(char far *DataPtr, unsigned char Sol,
unsigned char ViaInterceptor);

where:

DataPtr is a pointer to a null terminated string which will be


sent as the status field(s) of the message: field f and g in a
Solicited Status message and field e in an Unsolicited Status
message. The content of the status field is not checked or
validated in any way by NDC+.

Sol is a boolean parameter. If TRUE, the data is sent as a Solicited


Status message. If FALSE, it is sent as an Unsolicited Status
message.

ViaInterceptor is a boolean parameter that defines the


transmission path to be used for the message. If TRUE, the
message will pass through any outgoing Virtual Controller
interceptors that are present. If FALSE, the message will be sent
directly to High Order Comms avoiding any interceptors.

SendStatus returns the following values:

0 Good, message transmitted

1 Failed to transmit. Link up

2 Failed to transmit. Link down

3 Illegal message

Note: Calling SendStatus does not affect memory allocation.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 3-9


Communications Between the Host, Exits and NDC
Status Messages

Solicited Status Message 3

When sending a Solicited Status message, the value of Sol should


be TRUE. The first character of the string pointed to by DataPtr
should be the status descriptor, field f of the Solicited Status
Message and the remaining characters should be the status data.

Unsolicited Status Message 3

When an Exit sends an Unsolicited Status message, the value of Sol


should be FALSE. NDC+ sends the string pointed to by DataPtr as
the data field, field e, of the Unsolicited Status Message.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

3-10 Using NDC Exits


Communications Between the Host, Exits and NDC
Free Form Messages

Free Form Messages 3

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.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 3-11


Communications Between the Host, Exits and NDC
SNA Translation, IBM Loop/SNA ETX Character

SNA Translation, IBM Loop/SNA


ETX Character 3

If the protocol being used requires conversion between ASCII and


EBCDIC, or that an ETX character is added or stripped, then this
will be done by NDC+; the Exit DLL will not have to do this.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

3-12 Using NDC Exits


Table of Contents
Message Security

Chapter 4
Message Security

Overview 4-1

Logical Unit Number and MAC Machine Number 4-2


Logical Unit Number 4-2
Exit Impact 4-2
MAC Machine Number 4-2

Message Co-ordination Number 4-3

Selective MAC 4-4

Time Variant Number 4-5


Exit Impact 4-5

Top Of Receipt Flag 4-6


Exit Impact 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

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits


Table of Contents
Message Security

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits


Message Security
4

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.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 4-1


Message Security
Logical Unit Number and MAC Machine Number

Logical Unit Number and MAC


Machine Number 4

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

value is set to 000. This can be changed by a message downloaded


from the host. NDC does not perform any checks on the Logical
Unit Number.

Exit Impact 4

The LUNO field will be added to outbound messages at a point


between the last outbound Virtual Controller and the High Order
Comms. The Exit application does not need to add the LUNO field,
but simply supply the field separator characters which delimit the
field.

If used, the MAC Machine Number extends the Logical Unit


MAC Machine Number 4

Number by six further characters. An operator can set it to a six


digit number using the Enter MAC supervisor function on the
Access menu.
If the security feature is turned on, the MAC machine number is
appended to the LUNO and transmitted.

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.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

4-2 Using NDC Exits


Message Security
Message Co-ordination Number

Message Co-ordination Number 4

The Message Co-ordination Number is a one-byte field which takes


hex values between ‘31’ and ‘3F’, or between ‘31’ and ‘7E’ as an
option in Native mode. The option to extend the MCN range is set
by Enhanced Configuration parameter option number 34, ‘MCN
Range’.
An MCN is assigned by the terminal to each transaction request
message. The terminal increments this number for each successive
transaction request, on a rotating basis. The host must include the
corresponding co-ordination number when responding with a
Transaction Reply Command. This ensures that the Transaction
Reply matches the Transaction Request.
If the co-ordination numbers do not match, the terminal sends a
Solicited Status message with a Command Reject status. Central can
override the Message Co-Ordination Number check by sending a
Co-Ordination Number of ‘0’ in a Transaction Reply command. As a
result, the terminal does not verify that the Transaction Reply
co-ordinates with the last transaction request message.
One byte must be allocated to this field when an Exit sends a
message to the ‘real’ host. The current value of the field will be
copied into the message by NDC at a point between the last
outbound Virtual Controller and the High Order Comms.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 4-3


Message Security
Selective MAC

Selective MAC 4

MAC (Message Authentication Code) is a type of checksum which


NDC performs over part or all of a message. The checksum value is
appended to the message.
NDC may send the MAC in the following types of message:
● Transaction Request
● Solicited Status
● Terminal State Messages.
NDC may test the checksum in the following message types:
● Transaction Reply
● State Table Load
● FIT (Financial Institution Table) Load
● MAC Field Selection Load.
The MAC is set and checked by NDC. When setting the MAC, NDC
also adds the preceding field separator.
NDC can be set to selectively MAC the new Exit data fields in the
Transaction Request and Transaction Reply messages.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

4-4 Using NDC Exits


Message Security
Time Variant Number

Time Variant Number 4

The Time Variant Number is a guaranteed non repeating number of


8 characters, which is generated by NDC.
NDC sends the Time Variant Number to the host in Transaction
Request messages and Solicited Status Messages. It checks the next
Transaction Reply that it receives has a copy of the same number.

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.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 4-5


Message Security
Top Of Receipt Flag

Top Of Receipt Flag 4

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.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

4-6 Using NDC Exits


Message Security
Transaction Status

Transaction Status 4

The use of the Transaction Status field in Transaction Request


messages is controlled by the enhanced configuration option 15,
Transaction Status Information option. The Transaction Status field
consists of the following four subfields:
● Last Transaction Serial Number
● Last Message Status
● Last Dispensed Cash Amount
● Last Dispensed Coin Amount.
For more information on these subfields see the APTRA Advance
NDC, Reference Manual or the NDC+ Programmer’s Reference Manual.

This number is included in the Transaction Request message under


Last Transaction Serial control of the enhanced configuration option, discussed above. It is
Number 4
always included in the Counters Terminal Status message. The
serial number is also used in picture data, some depository printing
and comms trace printing.
The host downloads the value of this field in the corresponding field
in the Transaction Reply message. The value is maintained in
NVRAM, along with a backup to protect it from any failure that
occurs during transaction processing.
NDC is responsible for maintaining and adding this value to any
messages, and the Exit application need not be concerned with it.

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

When NDC receives a Transaction Reply, it sets the Last Message


Status field to 0. Thereafter, when NDC sends a status message, the
value is changed to denote the last type of message sent.
Any Exit operation requesting NDC to send status messages should
ensure that this field is summarised correctly for the ‘real host’.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 4-7


Message Security
Transaction Status

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.

NDC normally sets this subfield. It allows host verification of the


Last Dispensed Coin last coin dispenser activity.
Amount 4

This field can be present only if the coin dispensing module is


present. It is present when the counters status is queried and, under
option control, in the Transaction Request message.
If an Exit performs hidden coin dispense operations, it will have to
manipulate this field so as to provide a valid total to the host.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

4-8 Using NDC Exits


Message Security
Trace

Trace 4

There is an existing NDC+ feature which traces messages to the


journal.
Tracing takes place at NDC+, so that Exits do not need to do it. The
traces refer to messages sent and received at High Order Comms.
All tracing present before NDC+ Release 6.00 continues.
From NDC+ Release 6.00 onwards, the following message prefixes
have been introduced to identify traces of Exit messages that
comply with known NDC+ formats. These new traces refer to
messages sent and received by High Order Comms. These are:
● VCCLS - Virtual Controller close link
● VCOPN - Virtual Controller open link
● VCREC - the trace of a message received at a point between the
High Order Comms and the first inbound Virtual Controller
● VCRST - Virtual Controller reset command
● VCSND - the trace of a message at a point between the last
Virtual Controller and the High Order Comms
● VCSOL - Virtual Controller status information in response to a
command
● VCUNS - Virtual Controller status information unsolicited.
For further information on the Trace feature with Exits see the
section “Communications Trace” in the NDC+ Supervisor‘s Reference
Manual.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 4-9


Message Security
Trace

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

4-10 Using NDC Exits


Table of Contents
Exits

Chapter 5
Exits

Overview 5-1

Exits 5-2
Error Actions 5-2

Exits - Start of Day Initialisation 5-3


Errors at Start of Day Initialisation 5-3

Exit States 5-4


Understanding STCONT 5-4
STCONT File Structure 5-5
Invocation of Exit State 5-6
Value Returned by Exit State 5-7
Invocation of NDC+ Standard State from an Exit 5-7
Values Returned 5-8
Time Out 5-8
State Table (STCONT) Error Handling 5-8

Exit Supervisors 5-10


Understanding SUPCTR 5-10
How to Add an Exit Supervisor Function to an Existing NDC+
Menu 5-11
How to Add New Exit Supervisor Menus 5-11
How to Replace the Initial NDC+ Menu with an Exit Supervisor
Menu 5-11
Signature of Exit Supervisor Routines 5-12
Transition Into Supervisor Mode Hook 5-13
Transition Out Of Supervisor Mode Hook 5-13
Stop Supervisor Hook 5-14
Supervisor Table Control (SUPCTR) Error Handling 5-14

Virtual Controllers 5-15


Data and Device Sharing 5-16
Example Showing How Virtual Controllers Work 5-17

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits


Table of Contents
Exits

Understanding VCCONT 5-17


DLLs 5-18
Structure of Messages 5-20
Virtual Controller Control (VCCONT) Error Handling 5-22

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

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits


Exits 5

Overview

Overview 5

There are four different types of Exit. These are:


● Exit States
● Exit Supervisors
● Virtual Controllers
● Hooks.
This chapter discusses each of these in turn and gives tips on how to
make use of them in your own Exit application.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 5-1


Exits
Exits

Exits 5

There are four kinds of Exit:


● Exit States
● Exit Supervisors
● Virtual Controllers
● Hooks
Exits are executed as callouts from NDC. They consist of routines
packaged in dynamically linked libraries (DLLs). The name of the
DLL and the routine which will be invoked at a particular point in
NDC operation are specified by field entries within a rule file. There
is a separate rule file for each kind of Exit.

Error Actions 5

When it is unable to access an Exit, NDC+ prints one of the


following error messages on the journal:
● DLL LOAD ERROR - when NDC+ could not load the DLL.
● DLL CALL ERROR - when NDC+ could not find the named
routine within the DLL.
● ERROR_INVALID_HANDLE - when a C-Exit DLL calls an
external routine which will also be called by another C-Exit DLL
at load time. Because this problem only occurs with load time
DLLs it is suggested that either :
● runtime DLLs are used for external functions
● or that the mainline argument ‘unload’ is used for
[Link] in the RUN file used for NDC+ start-up, for
example S4_START.RUN. This would unload the Exit DLL
after completion of the Exit routine. The statement would be:
ASYNC C:\\NDCADI\[Link] unload

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.

Note: To ensure easy migration from NDC+ to Advance NDC, you


must ensure the correct use of capital (upper case) and normal
(lower case) letters in names, as they are case sensitive.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

5-2 Using NDC Exits


Exits
Exits - Start of Day Initialisation

Exits - Start of Day Initialisation 5

At the Start of Day, irrespective of a cold or warm start, NDC+ will


attempt to load all of the support files associated with Exits. These
are:
● State Table Control (STCONT)
● Supervisor Table Control (SUPCTR)
● Virtual Controller Control (VCCONT)
● Miscellaneous Support File (MISCONT).
The support files will be validated and read into memory.
Based on the files, NDC+ will determine which Exit support
features are required and will set up support for those features
accordingly.
In order to allow any initialisation required by Exits to take place,
NDC+ will call a Start of Day hook, if an entry has been specified for
this in the MISCONT table. For details, see on “Start Of Day - Hook”
on page 5-24 for details.

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.

Table 5-1 Missing File Error Type Consequence


Start-of-Day Errors
STCONT Table not present, NDC+ will be unable to access any
Load error states. If an attempt is made to go In
Service, NDC+ will perform a
Default Close operation.

SUPCTR Table not present, NDC+ will be unable to access any


Load error Supervisor routines. NDC+ will
allow the use of Supervisor Select
menu, function 9: Exit (leave
supervisor mode). The control file
will not be able to overload function
9 on the Select Menu.

VCCONT Table not present Normal NDC+ communications


operations continue.

Load error NDC+ will not send any messages to


the host.

MISCONT Table not present, NDC+ will not be able to call any of
Load error the Hooks DLLs.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 5-3


Exits
Exit States

Exit States 5

An Exit State type may be additional to the NDC+ standard state


types, or it may replace one of them.
Once an Exit state has been created it can be used within the state
flow in the same way as one of the standard NDC+ states. You may
position an Exit State at any point in the state flow, with the
exception of state zero or any of its mandatory subsequent states.
Note that the normal NDC+ Time-Out state cannot be replaced (for
details, see “Time Out” on page 5-8).
A rule file called STCONT lists and defines each state type.

NDC+ reads STCONT at power up. STCONT must contain details


Understanding STCONT 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.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

5-4 Using NDC Exits


Exits
Exit States

STCONT File Structure 5

The file STCONT holds one entry per state type. Each entry is as
follows:

Table 5-2 Field Description


STCONT File: Field Descriptions
State Type Character The State Letter. State letters d to g (lower
case) are available for use as Exit state
types.

Group separator

Support flag The Support Flag entry indicates if this is


an NDC+ or Exit state type, and must be
one of the following:
● ASCII ‘E’ (45 hex) - state type is
supported by an Exit
● ASCII ‘N’ (4E hex) - state type is
supported by the NDC+ standard
state.

Group separator

DLL name If this is an Exit state type, this entry


specifies its DLL name, which must be at
least four characters in length. This entry is
left empty if this is a standard NDC+ state
type.

Group separator

Routine name If this is an Exit state type, this entry


specifies the routine called. This entry is
left empty if this is a standard NDC+ state
type.

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

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 5-5


Exits
Exit States

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

Note 1: You must include group separator characters to separate


fields to the point where there is no more data to follow for the
entry. The group separator following the State Type Character is
present to allow future expansion.

Note 2: 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, and so on, 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+.

When a state is about to be executed, NDC+ looks up the state letter


Invocation of Exit State 5

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:

extern unsigned short pascal far _loadds


StateRoutineName(unsigned char StateType);

where:

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

5-6 Using NDC Exits


Exits
Exit States

StateType will be set by NDC+ to the current state letter

The actual name specified will replace the sample


StateRoutineName. When StateRoutineName finishes,
NDC+ resumes control of the terminal.

Value Returned by Exit State 5

The Exit routine must return the number of its successor state.

An Exit may wish to invoke a standard NDC+ state as part of its


Invocation of NDC+ own activities; for example to ask the cardholder to input some
Standard State from an information. NDC+ provides a routine to do this:
Exit 5 PerformNDCState, which is supplied in the file [Link].

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:

extern unsigned char pascal far _loadds


PerformNDCState(char StateLetter, unsigned long far
*NextStateNumber, unsigned long far *TableExitId);

where:

StateLetter is the state letter of the required NDC+ standard


state

NextStateNumber is a pointer to the number of the state that


NDC+ would have executed next. Ignore if the result value
returned indicates an error.

TableExitId is a pointer to the state table entry that was


selected as the source of NextStateNumber, as follows:

TableExitId
Meaning
Value

0 A value of 0 indicates that an NDC+ Transaction


Request state has been invoked and the next state was
specified in the last Transaction Reply message

2-9 Corresponds to table entry 2-9

10-17 Corresponds to first extension table entry 2-9

18-25 Corresponds to second extension table entry 2-9

26-33 Corresponds to third extension table entry 2-9

34-41 Corresponds to fourth extension table entry 2-9

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 5-7


Exits
Exit States

TableExitId
Meaning
Value

42-49 Corresponds to fifth extension table entry 2-9

50-57 Corresponds to sixth extension table entry 2-9

58-65 Corresponds to seventh extension table entry 2-9

66-73 Corresponds to eighth extension table entry 2-9

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

The routine returns one of the following values:

Value Meaning

0 State executed as requested

1 State type illegal

2 State table failed validation

3 State is supported by an Exit

4 Card Read type state was requested

The normal NDC+ Time-Out state cannot be directly accessed or


Time Out 5

replaced as a standard NDC+ state. It is a fixed hard coded state.


Where an Exit invokes an NDC+ standard state, via the
PerformNDCState routine, NDC+ will handle the time out in the
standard way.
If an Exit state interacts with the cardholder, it must implement its
own time out facility. To get an understanding of the standard time
out functionality, see the section called “Time-Out State” in the
NDC+ Programmer’s Reference Manual.

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

● Validation of Primary state table extension flag byte (the fifth


byte of the Primary state table maximum limits) fails range
check - ‘1’ to ‘8’
● Validation of Primary state table detects repeated extension flag
values within a record
● Support flag indicates NDC+ standard support, but the State
Type Character is not an NDC+ standard state letter

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

5-8 Using NDC Exits


Exits
Exit States

● 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.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 5-9


Exits
Exit Supervisors

Exit Supervisors 5

You can implement three distinct forms of Exit Supervisor:


● Add a user-written Exit Supervisor function to one of the
existing NDC+ Supervisor menus
● Add a completely new menu of user-written Exit Supervisor
functions
● Replace the initial Supervisor menu with an Exit Supervisor
menu.
To add an Exit Supervisor feature you need to do two things:
● Make an entry in the appropriate position in the Supervisor
Control file (SUPCTR) for the feature
● Create a DLL and routines to provide the functionality.
The updated SUPCTR file and DLLs must be included in an FM
object for input to Diskbuild/2. See Appendix K of the NCR
publication NDC+ Programmer’s Reference Manual for details.

The supplied default SUPCTR file already has entries for the
Understanding SUPCTR 5

standard NDC+ Supervisor functions. When you create your own


Exit Supervisor functions, menus or entire Exit Supervisor
application you will need to update the SUPCTR file.
The structure of the SUPCTR file is as follows:

Table 5-3 Field Description


SUPCTR File: Field Descriptions
Menu Number The number of the menu to which this table
entry relates.

Group Separator

Support Flag Indicates if the function is a standard NDC+


function ‘N’ or a user defined function ‘E’.

Group Separator

Function Number The function number on the menu


corresponding to this entry.

Group Separator

DLL Name If this function is supported by an Exit, this


entry specifies its DLL name, which must be
at least four characters in length. This entry is
left empty if the menu item is a standard
NDC+ function.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

5-10 Using NDC Exits


Exits
Exit Supervisors

Field Description

Group Separator

Routine Name If this function is supported by an Exit, this


entry specifies the routine name for the
previous DLL. This entry is left empty if the
menu item is a standard NDC+ function.

Group Separator

Host Menu The menu number reported to the host in a


Supervisor Keys unsolicited message, when
Native Mode reporting is used - only required
by Exit Supervisor entries.

Group Separator

Host Function The function number reported to the host in a


Supervisor Keys unsolicited message, when
Native Mode reporting is used - only required
by Exit Supervisor entries.

Field Separator

Next Entry

To add a new Exit Supervisor function to existing NDC+ menus:


How to Add an Exit make an entry in the SUPCTR table specifying as the Menu
Supervisor Function to an Number the NDC+ menu number you want the function added to,
Existing NDC+ Menu 5 enter the Support Flag, Function Number, DLL Name and Routine
Name and the Host Menu and Host Function entries. You will also
need to create the DLL and routine that provides the functionality
for the function.

Note: You cannot replace Functions 0 to 3 on the Select menu,


because Diebold Mode terminal switch control uses them.

Menu numbers 7 and 8 have been reserved for Exit Supervisor


How to Add New Exit menus. To use these, make an entry in the SUPCTR table specifying
Supervisor Menus 5
7 or 8 as the Menu Number, enter the Support Flag, Function
Number, DLL Name and Routine Name and the Host Menu and
Host Function entries. You will also need to create the DLL and
routine that provides the functionality for the function.

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

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 5-11


Exits
Exit Supervisors

1 Make your own menu entry in the SUPCTR file specifying FF


hex as the Menu Number, enter the Support Flag, Function
Number, DLL Name and Routine Name and the Host Menu
and Host Function entries.

2 Set the INIT ENTRY option on the Access Menu to 2, selecting


Exit Supervisor.
You will also need to create the DLL and routine that provides the
functionality for the function.

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

Exit Supervisor routines must have the signature:

extern void pascal far _loadds


SupervisorRoutineName(unsigned short far *MenuId,
unsigned short FunctionNo, unsigned char far
*Interface);

(the actual name will be substituted at runtime in place of the


sample name SupervisorRoutineName)

where:

MenuId is a pointer to the current menu as follows:

*MenuId Current menu

0 Select

1 Replenish

2 Configure

3 Access

4 Reserved

5 Reserved

6 Reserved

7 Reserved for Exit menus

8 Reserved for Exit menus

9 Leave Supervisor when switch changed

0FF hex Initial menu on entry to Supervisor mode

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

5-12 Using NDC Exits


Exits
Exit Supervisors

FunctionNo indicates the selected function number. Function


numbers 70 to 90 should be used if you are adding a function to
an existing NDC+ menu. You should ignore this value if MenuId
is 0FF hex, 7 or 8.

Interface is a pointer to the interface currently in use:

0 Cardholder interface

1 Rear interface

Note: The MenuId and Interface parameters can be used to


request that NDC+ update the menu or interface in use on return
from the Exit Supervisor.

In order to allow an Exit system to do any preparation necessary,


Transition Into Supervisor such as disabling a device, in advance of NDC+ entering Supervisor
Mode Hook 5
mode, NDC+ can call a user specified routine. NDC+ will only call
this routine if the MISCONT rule file has an entry with a point-of-
use value of 1.
The signature of this routine must be:

extern void pascal far _loadds SupEntryName(unsigned


char Interface);

(the actual name will be substituted at runtime in place of the


sample name SupEntryName)
where:

Interface specifies the interface in use:

0 Cardholder interface

1 Rear interface

When the operator takes the terminal out of Supervisor mode,


Transition Out Of NDC+ can make a call to a routine to allow any preparation work to
Supervisor Mode Hook 5
be done, such as putting a device used by an Exit back in service.
NDC+ will only call this routine if the MISCONT rule file has an
entry with a point-of-use value of 3.
The signature of this routine must be:

extern void pascal far _loadds SupExitName(unsigned


char DestinationMode);

(the actual name will be substituted at runtime in place of the


sample name SupExitName)

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 5-13


Exits
Exit Supervisors

where:

DestinationMode indicates the mode to which the terminal will


return:

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

operator can quit Supervisor mode by switching the Mode Switch to


Normal.
If an Exit is in progress when the operator throws the switch, a call
is made to the Exit specified with a point-of-use value of 2 in the
MISCONT rule file. This routine should make the current Exit
Supervisor return as quickly as possible.
The signature of this routine must be:

extern void pascal far _loadds SupStopName(void);

(the actual name will be substituted at runtime in place of the


sample name SupStopName)

The following error conditions can occur when processing Exit


Supervisor Table Control Supervisors.
(SUPCTR) Error Handling 5

Table 5-4 Error Consequence


SUPCTR File: Error Conditions
Exit support is specified and either The terminal displays error
the DLL or routine name fields are screen E0042 or E0047
not fully specified. respectively.

Exit support is specified and there is The terminal displays error


an error in loading or calling the screen E0042 or E0047
specified DLL or routine. respectively.

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.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

5-14 Using NDC Exits


Exits
Virtual Controllers

Virtual Controllers 5

Standard NDC+ can request and accept transaction details and


implement transaction commands sent by the host. However, it has
no capability to make transaction decisions. A type of Exit, called a
Virtual Controller, provides a means for this to happen without
modification to the existing NDC+ application.
When they are used, Virtual Controllers sit between the NDC+
application and High Order Comms. In this position they can
intercept all messages coming from NDC+ or the host.
The Virtual Controller can then examine the message and,
depending on the return code it specifies, NDC+ does one of the
following:
● Pass the message to another Virtual Controller for further
processing
● Pass the message to its destination without going through any
other Virtual Controllers
● Delete the message.
There must be separate Virtual Controllers for outbound and
inbound messages.

Note: When a message is being processed by a Virtual Controller, it


does not contain the Logical Unit Number (LUNO). The LUNO is
added by the Virtual Controller after message processing.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 5-15


Exits
Virtual Controllers

Figure 5-1
Virtual Controllers Operate in Outbound
5

and Inbound Chain Sequences

HO Comms

VC 4 VC 3

VC 5 VC 2

VC 6 VC 1

NDC+

Virtual Controllers can be chained in order to provide a more


structured logic to their operation; so a Virtual Controller can, for
example, look at a message and decide that it should pass control to
another Virtual Controller by setting the appropriate return code
value. NDC+ will pass the message along the chain.
Details of the DLLs and the routines that implement the Virtual
Controllers, and a direction flag which indicates whether the Virtual
Controllers are inbound or outbound, are specified in a rule file
called VCCONT. You will need to create this file if you use Virtual
Controllers.

Virtual Controllers are permitted to share data and devices only at


Data and Device Sharing 5

the following times:


● Operating on a Transaction Request/Transaction Reply session
● Operating on a solicited error response message, which is not a
‘Ready 9’ or ‘Ready B’ from NDC+ after processing a
Transaction Reply message.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

5-16 Using NDC Exits


Exits
Virtual Controllers

Virtual Controllers generally work as follows:


Example Showing How
Virtual Controllers Work 5
1 NDC+ sends a message.

2 NDC+ calls the first outbound Virtual Controller specified in the


VCCONT file, VC1.

3 VC1 examines the message and can do one of the following:


● Return a StopAndDelete code to NDC+. NDC+ will delete the
message with no further operation. This code would be used to
delete unnecessary solicited and unsolicited messages, but
should not be used with Transaction Request or Reply
messages, as this could cause a timeout.
● Return a NoFurtherProcessing code to NDC+. NDC+ will
examine the message to determine the originator’s system
address, and then pass the message to the destination. The
Virtual Controller routine can change the message, including
the originator’s address.
● If the Virtual Controller changes the originator’s address, in
this case marks it as High Order Comms, the message will be
sent back to NDC+. This could happen, for example, if the
original message was Transaction Request and the Virtual
Controller was issuing a Transaction Response.
● If the Virtual Controller doesn’t change the originator’s
address, the message will be passed on to its original
destination.
● Return a Continue code to NDC+. NDC+ will call the next
Virtual Controller specified in the rule file VCCONT if one
exists.

NCR does not supply the file VCCONT. You must create it if you
Understanding VCCONT 5

are using Virtual Controllers.


The file has one entry for each Virtual Controller. The Virtual
Controllers should be entered in the order they occur in the chain,
so the first outbound Virtual Controller should be first, the second
next, and so on.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 5-17


Exits
Virtual Controllers

Table 5-5 Field Description


VCCONT File: Field Descriptions
Direction ‘0’ - this Virtual Controller intercepts
inbound messages
‘1’ - this Virtual Controller intercepts
outbound messages.

DLL name The name of the DLL that includes the


Virtual Controller routine, which must
be at least four characters in length.

Group separator

Routine name Name of the Virtual Controller routine.

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:

extern unsigned char pascal far _loadds


InboundMessageIntercept(char far **Message);

extern unsigned char pascal far _loadds


OutboundMessageIntercept(char far **Message);

(the actual names will be substituted at runtime in place of the


sample names InboundMessageIntercept or
OutboundMessage Intercept )

where:

Message is a pointer to another pointer to the message to be


processed.

Note: The parameter is actually Message, which is a pointer to the


address of the message. You can therefore transform the message
into a longer one. To do this, copy the message into a buffer of the
required length, free the original buffer and edit the message in its
new buffer. Then set the pointer Message to the address of the start
of the new edited message. NDC+ will free the memory associated
with the ultimate message. The Virtual Controller is responsible for
freeing the memory associated with the original message if it is
replaced in this way.

The routine returns one of the following values to NDC+:

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

5-18 Using NDC Exits


Exits
Virtual Controllers

Value Meaning

0 Continue - control passes to the next Virtual Controller in the


chain. If the last Virtual Controller in the chain returns this
value, the message is sent to the destination derived by
examining the originator’s system address.

1 StopAndDelete - NDC+ deletes the message. No further


processing can take place on it.

2 NoFurtherProcessingContinue - NDC+ sends the message to


the destination derived from examining the originator’s
system address.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 5-19


Exits
Virtual Controllers

Structure of Messages 5

NDC to High Order Comms Messages from NDC+ to High 5

Order Comms will have the following structure. This is the


structure a Virtual Controller will see when it intercepts an
outbound message.

Table 5-6 Description Length Meaning


NDC to High Order Comms:
Message Structure Originator’s system 1 Byte 0 - From NDC+ core
address

Reserved 1 Byte

Reserved 1 Byte

Total length of following 1 Word


fields

Reserved 30 Bytes

Message category 1 Byte ‘1’ - Unsolicited message


‘2’ - Solicited message

Message data Var

High Order Comms to NDC+ Messages from High Order 5

Comms to NDC+ will have the following structure. This is the


structure a Virtual Controller will see when it intercepts an inbound
message.

Table 5-7 Description Length Meaning


High Order Comms to NDC+:
Message Structure Originator’s system 1 Byte 2 - From High Order Comms.
address

Reserved 1 Byte

Message length 1 Word Length of the Message Data


field, including the value of
the Offset field below and 1 to
cover the T-code byte.

Severity Length 1 Byte Length of the Severity field


below. See Note 1.

Maintenance Length 1 Byte Length of the Maintenance


field. See Note 1.

Reserved 1 Byte 0

Reserved 1 Byte 0

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

5-20 Using NDC Exits


Exits
Virtual Controllers

Description Length Meaning

T-code 1 Byte A Transaction Status code


whose value reports how
successfully a function was
carried out.

Offset 1 Byte Number of bytes in the


following Reserved field plus
1.

Reserved Var

Message Data Var The data returned to the


application, for example Field
b of a Transaction Reply.

Severity Var This is the Severity data for


either the whole device or for
parts of that device, and
reflects the state of the device
after the last command it
received from the application.
Values and their meanings
are outlined in the applicable
Communication Protocol
Manuals.

Maintenance Var Diagnostic Status information


containing error information.
The significance of the
information is fully described
in the Communication
Protocol Manuals.

Note 1. If the value of any Length Byte is 0, then the corresponding


field will not be included in the structure.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 5-21


Exits
Virtual Controllers

The following error conditions can occur when processing Virtual


Virtual Controller Control Controllers.
(VCCONT) Error
Handling 5

Table 5-8 Error Consequence


SUPCTR File: Error Conditions
Error Loading or Executing a The message processing will halt
Virtual Controller and the message will be deleted. It
will not be passed to its
destination. NDC+ will delete the
memory segment.

Message not processable. NDC+ will delete the message


For example, at the end of the without doing any further
sequence of interceptions a processing on it.
message has an Originator’s
System Address other than 0 or 2

VCCONT File Missing at Start of The link between NDC+ and High
Day Order Comms is maintained.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

5-22 Using NDC Exits


Exits
Hooks

Hooks 5

At the following times during its operation NDC+ calls routines,


called Hooks, in order to notify to the Exit system what it is doing,
and so allow the Exit system to take any necessary action. NDC+
calls Hooks at the following times:
● At start of day
● When it is clearing the fitness of a device
● When a device is physically being cleared
● When polling for external suspend criteria
● When it receives a message from High Order Comms destined
for an Exit
● For close state processing.
Each of these Hooks are discussed in more detail in the following
sections.
There are also three other Hooks, which are related to Exit
Supervisors, and are discussed earlier in this chapter in the “Exit
Supervisors” section:
● Makes transition into Supervisor
● Wishes to indicate a Stop Supervisor
● Makes the transition out of Supervisor mode.

Note: For the differences with Advance NDC, see ‘Migrating


Existing NDC+ Exits’ in Chapter 3 of the APTRA Advance NDC,
Developer’s Guide.

If you use Exits, you may need to make use of some or all of the
Understanding MISCONT 5

Hooks NDC+ calls.


Details of the DLL and routine that provides the functionality for
each point-of-use are specified in a rule file called MISCONT. You
will need to create this file.
Each Hook has a point-of-use value within the file. Each point-of-
use can have multiple entries, which are called in the order they
appear in the file.

Note: From NDC+ 7.00.01 or APTRA Advance NDC 2.05 onwards,


more than one Exit library can define the hook points using
MISCONT. For Advance NDC, the [Link] file enables
multiple Exit libraries to co-exist; for example, with EMV/CAM2
Exits. For more details, see the “Using MISCMULT” section.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 5-23


Exits
Hooks

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.

Table 5-9 Field Description


MISCONT File: Field Descriptions
Point-of-use This identifies the point at which NDC+ will make
this call out.

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

Routine name Name of the Hook routine.

Field separator

Next Entry

Note: To ensure easy migration from NDC+ to Advance NDC, you


must ensure the correct use of capital (upper case) and normal
(lower case) letters in names, as they are case sensitive.

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:

extern void pascal far _loadds


InitialiseExitRoutine(void);

The DLL and routine name are specified in the MISCONT file with a
point-of-use value of 8.

When NDC+ is performing a Clear Fitness operation on any device


Clearing Fitness - Hook 5

that it controls, it invokes the Clear Fitness Hook. This allows an


Exit to clear the fitness of devices which are unknown to NDC+, or
to update its own fitness record. The routine must have the
following signature:

extern void pascal far _loadds


ClearFitnessName(unsigned char DeviceId);

where:

DeviceId is the DIG (Device Identification Graphic) of the


device whose fitness has just been cleared.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

5-24 Using NDC Exits


Exits
Hooks

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.

When NDC+ leaves Supervisor mode, it clears the transport of all


Physically Clearing supported devices. In order to allow any devices controlled by Exits
Devices - Hook 5
to be cleared at the same time, NDC+ makes a call to the Physically
Clearing Devices Hook. NDC+ also calls this routine when the
power to the terminal is turned on. The routine must have the
following signature:

extern void pascal far _loadds


ClearDeviceName(unsigned char DeviceId);

where:

DeviceId is the Device Identification Graphic (DIG) of the


device which has just been cleared.

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.

NDC+ monitors the devices under its control for indications of


Suspend Mechanism - tampering. If it detects tampering, NDC+ will complete the current
Hook 5
transaction and delay the next Card Read State by putting the
terminal into Suspend mode. This is intended to deter the
cardholder from further tampering.
While an Exit is running, NDC+ monitors devices that it is aware of.
If any of these devices returns a suspend severity, NDC+ can
determine whether a standard suspend action is necessary.
NDC+ allows Exits to request a suspend action, although Exits
cannot prevent a suspend action if another NDC+ device requires
one. NDC+ polls for suspension requirements by making a call to
this routine at the following points:
● At the start of each transaction, just before enabling the Card
Reader

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 5-25


Exits
Hooks

● When it is in a Suspend state and checking whether to return to


In Service mode.
NDC+ does not call this routine if one of its own devices has already
determined that a suspend state is required.
The routine must have the following signature:

extern unsigned char pascal far _loadds


NDCSuspendName(void);

The routine must return one of these values:

Return value Meaning

0 Suspend not needed

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.

When NDC+ receives a message destined for an Exit it removes the


High Order Comms NDC+ header from the message and calls this routine. The routine
Message for an Exit - Hook 5
must have the following signature:

extern void pascal far _loadds ProcessHoCommMsg(char


far *DataPtr);

where:

DataPtr is a pointer to the null terminated data.

If there is no appropriate entry in the MISCONT file, then NDC+


will reject the message.
The DLL and the routine name are specified in the MISCONT file
with point-of-use value of 7.

In order to enable close state processing, NDC+ makes a call to the


Close State Processing - Close State Processing Hook. The close state can be a normal close
Hook 5
state (as a result of the state flow) or a default close state (as a result
of an invalid operation or error). The routine must have the
following signature:

extern void pascal far _loadds


EnteredCloseStateRoutine(void);

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

5-26 Using NDC Exits


Exits
Hooks

where:

EnteredCloseStateRoutine is substituted at runtime with the


actual routine name.

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.

The following error conditions can occur when processing Hooks.


Miscellaneous Support File
Control (MISCONT) Error
Handling 5

Table 5-10 Error Consequence


MISCONT File: Error Conditions
An entry has a point-of-use value Entry will be ignored.
outside the permitted range, 1 - 9

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

MISCMULT is a Dynamic Link Library (DLL) file previously


Using MISCMULT 5

provided with APTRA Advance NDC 2.05 or EMV Exits, which


enables more than one Exit library to define the hook points using
MISCONT. This enables multiple Exit libraries to co-exist; for
example, with EMV Exits.

NDC+ 5

With NDC+ 7.01.00, you do not need to use MISCMULT. However,


if you are already doing so, for example with EMV Exits, you can
continue to use MISCMULT.
From NDC+ 7.00.01 onwards, duplicate point-of-use values can be
used, and each entry in MISCONT is called in the order it appears.

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:

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 5-27


Exits
Hooks

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.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

5-28 Using NDC Exits


Exits
Debugging

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]

The C-Exit DLL to be debugged should be in the \S4DLL directory.


You should create a \SOURCE directory to contain the Microsoft C
6.00 [Link] file and the C 6.00 source files used in the DLL.
Now start the run file. When the ‘SYSTEM LOADED’ display is
shown, start another OS/2 session, and go to the \SOURCE
directory. Now type:

cvp /l \s4dll\[Link]\ndcadi\ndcia

Codeview will be invoked and it will be possible to load and debug


a C 6.00 source file used by the C-Exit DLL.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 5-29


Exits
Debugging

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

5-30 Using NDC Exits


Table of Contents
Devices

Chapter 6
Devices

Overview 6-1

Device Sharing 6-2


Restrictions on the Use of Devices 6-2
Using the EKC - Not supported by Advance NDC 6-3
Using the EPP 6-3
Using the System Disk 6-3
Using Combined Devices 6-3
Adding New Devices 6-3
Error Control 6-3

Device Monitoring and Reporting 6-4


Native Mode 6-4
Diebold Mode 6-4

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits


Table of Contents
Devices

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits


Devices 6

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.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 6-1


Devices
Device Sharing

Device Sharing 6

When an Exit is in operation it can use the majority of terminal


devices. Because the devices are also used by NDC+, Exits must
formally share them with NDC+. This means that the Exit must
attach to a device to use it, and detach from the device as soon as it
is finished using it. NDC+ attempts to reattach to a device
immediately after giving up control, and is placed on the reserved
list until the Exit returns control, and the device becomes available.
There is one notable exception to this rule, where we advise that
instead of attaching to the journal device, the [Link] routine
‘PrintToJournal’ should be [Link] allows the user to attach to
whichever printer is active - for instance if hardcopy backup is
activated, using this routine means that the Exit can switch from
printing on the physical device to the electronic journal. For more
information on PrintToJournal routine, see “Call Backs Held In
[Link]” on page 9-10.
More information on device sharing restrictions when using Virtual
Controllers is given in “Data and Device Sharing” on page 5-16.
An Exit makes a request to control a device using the ADI-2
command, ADI_ATTACH: a return of good indicates the attach has
been successful. When the Exit has finished with the device it
detaches using the ADI command ADI_DETACH.
An Exit must relinquish control by detaching from all its attached
devices before using the call-backs:
● DisplayScreen
● PerformNDCState

The following devices are not available to Exits:


Restrictions on the Use of
● Alarms and Tamper indication
Devices 6

● Primary HO Comms connection


● Door access (Not supported by Advance NDC)
● Indicators (Remote Relay, Supervisor LED, In Service LED,
Error LED, In Service Indicator, Status Panel and Beeper).
NDC+ uses the rear operator panel to display State of Health
messages, so an Exit should use it only in Supervisor mode or after
it has set the control in the shared data to inhibit non-supervisor
State of Health.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

6-2 Using NDC Exits


Devices
Device Sharing

Using the EKC - Not supported by Advance NDC 6

If an EKC (Encryptor Keyboard Controller) is in use, the PIN may be


loaded into the encryptor and left until the PIN block is generated
for transmission in a subsequent Transaction Request. The Exit must
not interfere with the contents of the encryptor, or an erroneous PIN
buffer could be sent in the Transaction Request.

Using the EPP 6

If an EPP (Encrypting PIN Pad) is in use, the only restriction is that


the Exit must not interfere with the contents of the encryptor. The
EPP is a combined module containing both the PIN Pad and the
encryptor.

Using the System Disk 6

The System Disk is inherently shareable. Any part of the terminal


software can write to it at any time. The directory \NDCEXIT is
available for use by Exits. Exits should not change any of the NDC+
support files in the \SYSTEM directory.

Using Combined Devices 6

Note that there are special difficulties involved in attaching


combined devices where one part is intended to be controlled by
NDC+ and the other by an Exit. Firstly, such devices often escape if
they detect an illegal sequence in their use. Secondly, if the
combined device required you to modify a state, Exits are restricted
to the state level of granularity and you cannot get below this level.

NDC+ offers the possibility of extending the functionality of the


Adding New Devices 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.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 6-3


Devices
Device Monitoring and Reporting

Device Monitoring and Reporting 6

When an Exit is running, NDC+ monitors all the device responses


that it can access. NDC+ updates the remote status indicators and
remote relay.

In Native Mode, the Exit application may request NDC+ to send a


Native Mode 6

Ready message or a device status message based on a Device


Identification Graphic and a status field.

In Diebold Mode, the Exit application may request NDC+ to send a


Diebold Mode 6

Ready message.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

6-4 Using NDC Exits


Table of Contents
Access To NDC

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
Last Transaction Counts 7-6
Operation During Transaction Reply Processing 7-6
Standard Counts 7-6
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
Storing a Screen 7-11
Return Value 7-12
Retrieving Screen Data 7-12

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits


Table of Contents
Access To NDC

Return Value 7-13


Adding Screen Data 7-13

NDC+ Keyboards 7-15


Return Value 7-16

NVRAM 7-17

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits


Access To NDC
7

Overview

Overview 7

Exits can communicate with NDC+ by reading and writing certain


items of data that NDC+ makes available as shared data. Exits can
also access NDC+ screens and keyboards through supplied utility
functions.
In this chapter we give you information on the following:
● Shared Data
● Data Groups
● Data Accessors
● Displaying NDC+ screens
● Storing NDC+ screens
● Retrieving NDC+ screen data
● Retrieving NDC+ keyboard layouts
● NVRAM usage.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 7-1


Access To NDC
Shared Data

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.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

7-2 Using NDC Exits


Access To NDC
Data Groups

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

going to be returned or retained, data read from the magnetic tracks


and information on the PIN buffer and on attempts to enter a PIN.

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.

This group includes the type of document read (whether magnetic


Document Processing or not) and the status and data of each of the read zones on the
Module Data 7
document.

This group includes the statuses of flags associated with the


Printer Data 7

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 group includes numbers used for message security and


Communications Data 7

authentication. It comprises the current communications protocol,


last message status, logical unit number, message co-ordination
number and transaction serial number.

This gives the screen offset for language partitions, and the override
Screen Data 7

reserved screen values for multi-language support.

This gives current values for all the timers.


Timer Data 7

This gives the type of status messages currently in use and the
Message Mode Options values of entered option strings.
Data 7

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 7-3


Access To NDC
Data Groups

The six byte MAC number is available in this group together with
MAC Number 7

ten bytes of security flags.

This group includes current values of all the downloaded


Downloaded configuration options, e.g. date format, hard copy backup hours.
Configuration Options 7

This group includes the number of notes dispensed, purged etc.


Counters 7

Prior to NDC+ Release 6.00, NDC+ would look at the


Replenishment Count information in device responses to keep a
running record of certain media movements. When an Exit is
controlling the terminal, it has to take responsibility for these
counters.
The counters are described in the following table:

Table 7-1
Counters

Count
Device Description Data Accessor ID Backup Accessor ID
Method

MCRW Card captured count Note 1 IdCardCapCount

Cash Handler Notes remaining in cassette 1 Notes 2, 5 IdNotesInType1 IdBackNotes1

Cash Handler Notes remaining in cassette 2 Notes 2, 5 IdNotesInType2 IdBackNotes2

Cash Handler Notes remaining in cassette 3 Notes 2, 5 IdNotesInType3 IdBackNotes3

Cash Handler Notes remaining in cassette 4 Notes 2, 5 IdNotesInType4 IdBackNotes4

Cash Handler Notes purged from cassette 1 Notes 1, 5 IdNotesPurgedType1 IdBackPurge1

Cash Handler Notes purged from cassette 2 Notes 1, 5 IdNotesPurgedType2 IdBackPurge2

Cash Handler Notes purged from cassette 3 Notes 1, 5 IdNotesPurgedType3 IdBackPurge3

Cash Handler Notes purged from cassette 4 Notes 1, 5 IdNotesPurgedType4 IdBackPurge4

Cash Handler Notes dispensed from cassette 1 Notes 2, 5 IdNotesDispType1 IdBackDisp1

Cash Handler Notes dispensed from cassette 2 Notes 2, 5 IdNotesDispType2 IdBackDisp2

Cash Handler Notes dispensed from cassette 3 Notes 2, 5 IdNotesDispType3 IdBackDisp3

Cash Handler Notes dispensed from cassette 4 Notes 2, 5 IdNotesDispType4 IdBackDisp4

Depository Deposit count Note 1 IdEnvDepCount

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

7-4 Using NDC Exits


Access To NDC
Data Groups

Count
Device Description Data Accessor ID Backup Accessor ID
Method

Camera (Not Picture capacity depends on Note 3 IdCamCount


supported by camera
Advance
NDC)

Statement Capture count Note 1 IdStmtCapCnt


Printer

DPM Pocket A count Note 1 IdDPMACount

DPM Pocket B count Note 1 IdDPMBCount

DPM Pocket C count Note 1 IdDPMCCount

DPM Reject count Note 1 IdDPMRejCount

Coin Dispenser Coins dispensed from hopper 1 Note 1 IdCoinDisp1 IdBackCoinDisp1

Coin Dispenser Coins dispensed from hopper 2 Note 1 IdCoinDisp2 IdBackCoinDisp2

Coin Dispenser Coins dispensed from hopper 3 Note 1 IdCoinDisp3 IdBackCoinDisp3

Coin Dispenser Coins dispensed from hopper 4 Note 1 IdCoinDisp4 IdBackCoinDisp4

Coin Dispenser Coins remaining in hopper 1 Note 4 IdCoinRem1 IdBackCoinRem1

Coin Dispenser Coins remaining in hopper 2 Note 4 IdCoinRem2 IdBackCoinRem2

Coin Dispenser Coins remaining in hopper 3 Note 4 IdCoinRem3 IdBackCoinRem3

Coin Dispenser Coins remaining in hopper 4 Note 4 IdCoinRem4 IdBackCoinRem4

Note 1: Value is cumulative. At a limit of 65535 it will roll over.

Note 2: The Cash Handler returns cassette counts in groups of three


bytes for each cassette. The first and third bytes of the group are
added together to become the addition to the corresponding ‘Notes
Dispensed’ count.
All three bytes of the group are added to obtain a total movement of
bills for the response. This is subtracted from the ‘Notes Remaining
in Cassette’ value unless either of the following conditions apply:
● The ‘Notes Remaining in Cassette’ value is already 65535
● The ‘Notes Remaining in Cassette’ value is less than the totals of
the Replenishment Count values.
In either case the ‘Notes Remaining in Cassette’ value will become
65535.

Note 3: Extract directly from the device’s Replenishment Count


fields.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 7-5


Access To NDC
Data Groups

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.

Note 5: The Cash Handler returns cassette counts in groups of three


bytes for each cassette. The second byte is used to add to the ‘Notes
Purged’ count.

Last Transaction Counts 7

Certain variables are used to supply information used in the last


transaction counts fields.

Operation During Transaction Reply Processing 7

At the start of processing a dispense Transaction Reply, NDC+


copies the current value of ‘Notes in Cassette’, ‘Notes Purged’ and
‘Notes Dispensed’ to the corresponding notes backup variables as it
clears the dispenser counts. It also sets the value of IdPowerFailrec
to 1 to indicate the start of a dispense function (a value of 0 would
mean no transaction, and 2 would mean other transaction).
At the end of the dispense transaction, the last dispensed value for
each cassette is set to the ‘Notes Dispensed’ value minus the
‘Backup Dispensed’ value.
If the transaction just completed was not a dispense function, the
‘Last Dispensed’ values are set to zero.
The same actions are also performed on the coin dispenser fields,
where IdLastCoinsDisp1.. 4 with the ‘Coins Dispensed’ value minus
the ‘backup coins dispensed’ value. IdPowerFailrec is set to ‘no
transaction’ at this point.

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.

This group includes current version of the software, machine


Miscellaneous Data 7

number, initial supervisor entry menu, initial supervisor display,


the current State of Health display, etc.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

7-6 Using NDC Exits


Access To NDC
Data Accessors

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:

ID is the mnemonic for the shared data item you want to


retrieve. See “Data Available In NDC Structures” on page 9-20.

Error control: If the call is illegal because of illegal access timing, 7

NDC+ will system escape with a file ID of 47H and a caller ID of A0


hex.

This function will determine the item specified by the parameter ID


Read String Item 7

and return a pointer to a copy of the requested data, which is a


string terminated by a Null. You are responsible for freeing the
buffer which holds the data item.
Its signature is:
extern unsigned char far *pascal far _loadds
GetStringVal(long ID);

where:

ID is the mnemonic for the shared data item you want to


retrieve. See “Data Available In NDC Structures” on page 9-20.

Error control: If the call is illegal because of illegal access timing, 7

the routine system escapes with a file ID of 47H and a caller ID of A1


hex.

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

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 7-7


Access To NDC
Data Accessors

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:

ID is the mnemonic for the shared data item you want to


retrieve. See “Data Available In NDC Structures” on page 9-20.

NewValue is the value which is to be written to it.

Error control: If the call is illegal because of illegal access timing, 7

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

NULL encountered is treated as a string terminator, and any


subsequent characters are ignored.
The string 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. Its signature is:
extern void pascal far _loadds PutStringVal(long ID,
char far *NewValuePtr);

where:

ID is the mnemonic identifier for the data item you want to


write. See “Data Available In NDC Structures” on page 9-20.

NewValuePtr is a pointer to the NULL terminated string which is


to replace the data item.

Error control: If the call is illegal because of illegal access timing, 7

the routine system escapes with file ID 47 hex and caller ID A3 hex.

This routine can be used for debugging. It is located in the DLL


Dump Data 7

[Link]. It writes copies of the shared data on to files for


debugging purposes. The data transferred by NDC+ will be written
to the file OPDATA, and the data from the Exit which is read back
to NDC+ will be written to INDATA. Both files are held in the
directory \SYSTEM.
Its signature is:
extern void pascal far _loadds DumpData(unsigned long
DumpDataFromNdc, unsigned long DumpDataToNdc);

where:

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

7-8 Using NDC Exits


Access To NDC
Data Accessors

DumpDataFromNdc and DumpDataToNdc are flags:

● DumpDataFromNdc - To dump the data to file OPDATA


when NDC+ transfers control to an Exit DumpDataFromNdc
must be any value other than 0, else the value should be 0
● DumpDataToNdc - To dump the data to file INDATA when
the Exit transfers control back to NDC+, DumpDataToNdc
must be any value other than 0, else the value should be 0.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 7-9


Access To NDC
NDC+ Screens

NDC+ Screens 7

Exits can use routines provided to have NDC+ do the following:


● Display a screen
● Store a screen
● Retrieve a screen
● Retrieve an associated keyboard.
An Exit must detach from all devices in order to allow NDC+ to
display an NDC+ screen.
Screens and keyboards are loaded onto the terminal by host
download. This means that no screen numbers can be available
solely for Exit use, as the host application may overwrite any
screens stored by Exits.

The routine DisplayScreen displays a screen on the cardholder


Displaying a Screen and display and can also set up the associated keyboard layout. It is
Activating the Associated supplied in the DLL [Link].
Keyboard 7

Its signature is:


extern void pascal far _loadds DisplayScreen(unsigned
short ScreenGroup, unsigned short ScreenNumber,
unsigned short UpdateKeyboard, unsigned short Idle);

where:

ScreenGroup is the NDC+ screen group that contains the


screen. To display a user screen, ScreenGroup should be ‘0’ (30
hex).

ScreenNumber is the screen number within the group. Invalid


values of ScreenNumber are ignored.

UpdateKeyboard should be TRUE if the keyboard layout


associated with the screen is to be set up, and FALSE otherwise.
In other words, this specifies whether the first of the three steps
required to set up a keyboard should be performed while
displaying the screen. See the “Keyboard Data” chapter in the
NDC+ Programmer’s Reference Manual for details of these steps.

Idle is TRUE if the screen is to be allowed to idle and FALSE


otherwise.

No indication of animation completion is available in the NDC+


environment.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

7-10 Using NDC Exits


Access To NDC
NDC+ Screens

The routine StoreScreen lets an Exit store a screen in the NDC+


Storing a Screen 7

screen pool. Screens stored by StoreScreen may be overwritten


when a host download stores screens. NDC+ does very little
validation on stored screens, and will not necessarily return an
indication of failure when the screen data is erroneous.
StoreScreen is supplied in the DLL [Link]. Its signature is:
extern unsigned char pascal far _loadds
StoreScreen(char far *ScreenData, unsigned long
DataLength);

where:

ScreenData is a pointer to screen data.

DataLength is the length of the screen data.

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

Table 7-2 Field Length Description


Screen Data Format
Screen Byte The screen group to use. The screen group
group should be ‘0’ (30 hex) if the screen is a user
screen.

Screen Word The screen number to be stored


number

Screen var The content of the screen to be stored. The


data screen data may contain control sequences.

Group Separator

Keyboard var Keyboard data for the NDC+ keyboard store.


data The keyboard data comprises keyboard
layout data, touch screen data, nesting data,
and a reserved field.
Keyboard Number
3 characters for each keyboard number followed
by possible multiples of:

Keyboard layout data


2 characters for position, ‘01’ to ‘62’
2 characters for return code: any two ASCII
digits

Group separator

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 7-11


Access To NDC
NDC+ Screens

Field Length Description

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

Reserved for future expansion

Return Value 7

StoreScreen returns TRUE, unless the screen pools are unable to


hold the data. In that case the routine returns FALSE. Invalid values
of ScreenNumber are ignored.

The routine RetrieveScreen allows an Exit to retrieve a screen


Retrieving Screen Data 7

from the NDC+ screen pool. The routine is supplied in the DLL
[Link]. Its signature is:

extern unsigned char pascal far _loadds


RetrieveScreen(unsigned short ScreenGroup, unsigned
short ScreenNumber, char far **ScreenData, unsigned
long far *DataSize);

where:

ScreenGroup - specifies the NDC+ screen group to use. This


should be ‘0’ if the screen is a user screen. See “Screen Data” on
page 9-32.

ScreenNumber - specifies the screen number within the group.


The range of legal values depends upon the screen group.

ScreenData - is a pointer to a pointer to the start of the screen


data.

DataSize - is a pointer to an unsigned long which will be


updated to contain the number of bytes returned.

The screen data returned consist of the displayable characters and


control codes that make up the screen, followed by the keyboard
number. The keyboard number is provided so that you can identify
the keyboard associated with the screen. There will always be a
keyboard associated with a screen, since NDC+ supplies a default

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

7-12 Using NDC Exits


Access To NDC
NDC+ Screens

when no keyboard association has been specified by the


programmer.
You should free the buffer that contains the screen data.

Return Value 7

RetrieveScreen returns TRUE if it was successful and FALSE if the


screen number was illegal.

Error control: Invalid values of ScreenNumber are ignored. 7

The routine DisplayString allows NDC screen control characters


Adding Screen Data 7

and text to be added to the screen currently displayed on the


Cardholder Display.

Note: This routine is applicable for Advance NDC only.

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:

screenData is the string to display from the current cursor


position.

ScreenDataLength is the length of the data contained in


screenData.

bFocusWindow defines whether to bring the window displaying


the screen data to the front of the Cardholder Display. If TRUE,
the window displaying the screen data is made visible on the
Cardholder Display, whether that window is currently
displayed or not. If FALSE, the window displaying the screen
data is not brought to the front if it is not currently visible on the
Cardholder Display.

inSupv defines whether to set the default background colour for


the screen to black when displaying a Supervisor screen on the
Cardholder Display. If TRUE, the background colour is set to

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 7-13


Access To NDC
NDC+ Screens

black when displaying a Supervisor screen on the Cardholder


Display. If FALSE, no change is made to the current background
colour.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

7-14 Using NDC Exits


Access To NDC
NDC+ Keyboards

NDC+ Keyboards 7

The routine RetrieveKeyboard allows an Exit to retrieve a keyboard


layout from NDC+. The routine is supplied in the DLL
[Link]. Its signature is:
extern unsigned char pascal far _loadds
RetrieveKeyboard(unsigned short KeyboardNumber, char
far **KeyboardData, unsigned long far *DataSize);

where:

KeyboardNumber - specifies the keyboard to be retrieved. The


valid range is 000 to 999. Invalid values are ignored.

KeyboardData - is a pointer to a pointer to the keyboard data.

DataSize - is a pointer to the number of bytes returned.

The keyboard data is in the same format as keyboard data accepted


by StoreScreen:

Table 7-3 Field Length Description


Keyboard Data
Keyboard var Keyboard data for the NDC+ keyboard store
data The keyboard data comprises keyboard layout
data, touch screen data, nesting data, and a
reserved field.

Keyboard Number
3 characters for each keyboard number followed
by possible multiples of:

Keyboard layout data


2 characters for position, ‘01’ to ‘62’
2 characters for return code: any two ASCII digits

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

Reserved for future expansion

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 7-15


Access To NDC
NDC+ Keyboards

Return Value 7

RetrieveKeyboard returns TRUE if it was successful and FALSE if you


requested an illegal keyboard number.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

7-16 Using NDC Exits


Access To NDC
NVRAM

NVRAM 7

NDC+ makes exclusive use of the migrated NVRAM area. It is not


available to Exits.
An Exit that wants to make use of S4 NVRAM must use the interface
provided by ADI-2, namely:
● ADI_OPEN_NVRAM_FILE
● ADI_CLOSE_NVRAM_FILE
● ADI_READ_NVRAM_FILE, etc.

For information on the ADI-2 interface the NCR publication, Self


Service Platform Software Programmer’s Guide.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 7-17


Access To NDC
NVRAM

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

7-18 Using NDC Exits


Table of Contents
Forward Compatibility Considerations

Chapter 8
Forward Compatibility
Considerations

Overview 8-1

Forward Compatibility Considerations 8-2


State Letters Available for Exits Use 8-2
Supervisor Menus and Menu Numbers Available for
Exits Use 8-2
Migration to Advance NDC 8-2
Screen Numbers 8-3
Timers 8-3

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits


Table of Contents
Forward Compatibility Considerations

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits


Forward Compatibility Considerations
8

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.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 8-1


Forward Compatibility Considerations
Forward Compatibility Considerations

Forward Compatibility
Considerations 8

When using Exits, you need to consider how future releases of


Advance NDC might affect your application, so that you remain
compatible with them wherever possible.
Certain letters have been made available for use by Exit states, and
certain Supervisor menu numbers and menu options have been
made available for Exit Supervisors. These are detailed in the
sections that follow. You should use these. Do not use any state type
identifiers, Supervisor menu numbers or Supervisor menu options
or functions which are reserved. You could accidentally replace a
standard state type, menu or menu option in a later release of
Advance NDC.

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

menus - functions 70 to 90 inclusive are available


● To add Exit Supervisor menus to the existing NDC+ Supervisor
- Menus 7 and 8 are available. Menus 4, 5, 6, 9 and 255 are
reserved for NDC+ use only
● To replace the entire NDC+ Supervisor by your own user
defined Exit Supervisor Menu - 0FF hex is available for use as
the initial Supervisor menu.

If you wish to migrate NDC+ exits to Advance NDC, you should be


Migration to Advance aware that there are some differences. These are described in the
NDC 8
“Migrating Existing NDC+ Exits” section of the APTRA Advance
NDC, Developer’s Guide.
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.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

8-2 Using NDC Exits


Forward Compatibility Considerations
Forward Compatibility Considerations

Certain ADI-2 calls cannot be used in the Advance NDC


environment. For information on ADI-2 calls, see the “ADI-2
Interfacing” section in the APTRA Advance ADE, Programmer’s
Guide.

There are no screen or keyboard numbers available exclusively for


Screen Numbers 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.

There are no timer numbers available solely for Exit use.


Timers 8

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 8-3


Forward Compatibility Considerations
Forward Compatibility Considerations

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

8-4 Using NDC Exits


Table of Contents
Reference Information

Chapter 9
Reference Information

Overview 9-1

Rule Files 9-2


State Table Control - \SYSTEM\STCONT 9-2
Supervisor Table Control - \SYSTEM\SUPCTR 9-5
Virtual Controller Control - \SYSTEM\VCCONT 9-7
Miscellaneous Support File - \SYSTEM\MISCONT 9-7

Signatures and Synopses of the Routines 9-10


Call Backs Held In [Link] 9-10
PerformNDCState 9-10
RetrieveKeyboard 9-10
RetrieveScreen 9-10
SendStatus 9-11
SendUnformatedData 9-11
StoreScreen 9-12
PrintToJournal 9-12
SetDigitalAudioPath 9-12
Call Backs Held In [Link] 9-12
DisplayScreen 9-12
DisplayString 9-13
Call Backs Held In [Link] 9-13
GetIntVal 9-13
GetStringVal 9-14
PutIntVal 9-14
PutStringVal 9-14
malloc 9-14
_fmalloc 9-14
free 9-15
_ffree 9-15
DumpData 9-15
Callout From State Table Control File 9-16
StateRoutineName 9-16
Callout From Supervisor Table Control File 9-17
SupervisorRoutineName 9-17
Callouts From Virtual Controller Control File 9-17

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits


Table of Contents
Reference Information

OutboundMessageIntercept, InboundMessageIntercept 9-17


Callouts From Miscellaneous Support File 9-17
ClearDeviceName 9-17
ClearFitnessName 9-17
InitialiseExitRoutine 9-18
NDCSuspendName 9-18
ProcessHoCommMsg 9-18
SupEntryName 9-18
SupExitName 9-18
SupStopName 9-19
SetDigitalAudioPath 9-19
EnteredCloseStateRoutine 9-19

Data Available In NDC Structures 9-20

New Screen Definitions 9-46

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits


Reference Information
9

Overview

Overview 9

This chapter brings together the following reference information for


NDC+:
● Rule Files
● Callouts - signatures and parameters
● Call backs - signatures and parameters
● Exposed Data - NDC+ shared data items
● New Screen Definitions.
For the differences with Advance NDC, see the APTRA Advance
NDC, Developer’s Guide.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 9-1


Reference Information
Rule Files

Rule Files 9

There are four rule files. These are:


● STCONT- State Table Control file
● SUPCTR - Supervisor Control File
● VCCONT - Virtual Controller Control File
● MISCONT - Miscellaneous Support File (Hooks).
Each rule file specifies when a certain set of callouts shall be
invoked. STCONT and SUPCTR also specify which states and
supervisor functions shall be performed by NDC+ standard
mechanisms.
Where a function is supplied by NDC+ as standard, you can leave
the corresponding DLL name and routine name blank.
The DLL file names may be complete path names, but should not
include the extension .DLL. NDC+ will supply the extension.
DLL names are case insensitive, but the routine names must be
uppercase.
For software management purposes, rule files are of Type 3.

NDC+ provides a default STCONT file. STCONT resides in the


State Table Control - SYSTEM directory.
\SYSTEM\STCONT 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:

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

9-2 Using NDC Exits


Reference Information
Rule Files

Table 9-1 Number of


Field Description Value
STCONT File: Field Descriptions Bytes

State Type Character Var(1) ‘d’ ... ‘g’


The state letter of this state type. The state
letters d to g (lower case) are available for
use as Exit state types.

Group separator 1 01D hex

Support flag 1 ‘N’ or ‘E’


Indicates if the state is a standard NDC+
state ‘N’ or a user defined state ‘E’.

Group separator 1 01D hex

DLL name Var ASCII


If this state is supported by an Exit, this characters
entry specifies its DLL name. Entry is left
empty if the menu item is a standard
NDC+ state.

Group separator 1 01D hex

Routine name Var ASCII


If this state is supported by an Exit, this characters
entry specifies the routine name for the
previous DLL. Entry is left empty if the
state is a standard NDC+ state.

Group separator 1 01D hex

Primary state table max. limits Var, max 8 sets of 5 bytes


Specifies 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 “State Table Max
Limits” below.

Group separator 1 01D hex

1st extension state table, max. limits Var, max 8 sets of 4 bytes

Group separator 1 01D hex

2nd extension state table, max. limits Var, max 8 sets of 4 bytes

Group separator 1 01D hex

3rd extension state table, max. limits Var, max 8 sets of 4 bytes

Group separator 1 01D hex

4th extension state table, max. limits Var, max 8 sets of 4 bytes

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 9-3


Reference Information
Rule Files

Number of
Field Description Value
Bytes

Group separator 1 01D hex

5th extension state table, max. limits Var, max 8 sets of 4 bytes

Group separator 1 01D hex

6th extension state table, max. limits Var, max 8 sets of 4 bytes

Group separator 1 01D hex

7th extension state table, max. limits Var, max 8 sets of 4 bytes

Group separator 1 01D hex

8th extension state table, max. limits Var, max 8 sets of 4 bytes

Field separator 1 01C hex

Note: The group separator following the State Type Character is


present to allow future expansion. You must include a field
separator after the last entry in the table.

The meanings of the fields are:


● State Type Character

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

The Support Flag entry must be one of the following:

— ASCII ‘E’ - state type is supported by an Exit


— ASCII ‘N’- state type is supported by the NDC+ standard
state.

Note: Any Support Flag entry other than ‘E’ or ‘N’ will be
regarded as ‘N’.

State Table Max Limits 9

‘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

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

9-4 Using NDC Exits


Reference Information
Rule Files

value ‘1’ to ‘8’ will result in the matching limit being replaced by the
maximum state number supported by the current release of NDC.

For information on error conditions, see “State Table (STCONT)


Error Handling” on page 5-8.

NDC+ provides a default SUPCTR file. SUPCTR resides in the


Supervisor Table Control - SYSTEM directory.
\SYSTEM\SUPCTR 9

If you create Exit Supervisors, you will need to update SUPCTR


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.
The supervisor table control file defines:
● The full set of valid functions defined by NDC+ and any Exit
Supervisor
● For each specified function, an indication of whether it is NDC+
or an Exit that provides the functionality
● The DLLs and Routines that implement Exit functions
● For Exit Supervisors only - a definition of the Host Menu and
Host Function key selection message values that will be
reported to the host, if Native Mode Supervisor Menu Key
Reporting is switched on. If the option is switched off, then by
default only the Select Menu reporting is switched on.
The structure of SUPCTR is as follows:

Table 9-2 Number of


Field Description Value
SUPCTR File: Field Descriptions Bytes

Menu number Var(2) ASCII


the number of the menu to which this digits
table entry relates. To place an Exit
Supervisor in a standard NDC+ menu,
specify the NDC+ menu number. To place
an Exit Supervisor in a new Exit
Supervisor menu, specify menu 7 or 8
which are reserved for use by Exit
Supervisor.
To replace the standard NDC+ initial
menu entirely, specify menu FF (Hex).
You will need to set the INIT ENTRY
option on the Access Menu to 2.

Group separator 1 01D hex

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 9-5


Reference Information
Rule Files

Number of
Field Description Value
Bytes

Support flag 1 ’N’ or ’E’


indicates if the function is a standard
NDC+ function ‘N’ or a user defined
function ‘E’.

Group separator 1 01D hex

Function number Var(2) ASCII


the function number corresponding to this digits
entry.

Group separator 1 01D hex

DLL name Var ASCII


If this function is supported by an Exit, characters
this entry specifies its DLL name. Entry is
left empty if the menu item is a standard
NDC+ function.

Group separator 1 01D hex

Routine name Var ASCII


If this function is supported by an Exit, characters
this entry specifies the routine name for
the previous DLL. Entry is left empty if the
menu item is a standard NDC+ function.

Group separator 1 01D hex

Host menu Var(2) ASCII


The menu number reported to the host in digits
a Supervisor Keys unsolicited message,
when Native Mode reporting is used -
only required by Exit Supervisor entries.

Group separator 1 01D hex

Host function Var(2) ASCII


The function number reported to the host digits
in a Supervisor Keys unsolicited message,
when Native Mode reporting is used -
only required by Exit Supervisor entries.

Field separator 1 01C hex

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.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

9-6 Using NDC Exits


Reference Information
Rule Files

There is no default VCCONT file. You will need to create it if you


Virtual Controller Control use Virtual Controllers and along with the DLLs update it in an FM
- \SYSTEM\VCCONT 9
object for input to Diskbuild/2. See the NCR publication NDC+
Programmer’s Reference Manual, Appendix K, for details.
The VCCONT table specifies the following:
● Each Virtual Controller DLL and its routine
● Whether it is an inbound or outbound Virtual Controller
● The order of the Virtual Controllers in the table sets the chaining
sequence, so the first inbound Virtual Controller must come
before the second, which in turn must come before the third, etc.
Each entry has the structure:

Table 9-3 Field name Size Description


VCCONT File: Field Descriptions
Direction Byte ‘0’ or ‘1’
‘0’ - This VC intercepts incoming messages
‘1’ - This VC intercepts outgoing messages

DLL name Var ASCII


Name of the DLL which includes the characters
Virtual Controller routine

Group separator 1 01D hex

Routine name Var ASCII


Name of the Virtual Controller routine characters

Field separator 1 01C hex

Note: You must include a field separator after the last entry in the
table.

For information on error conditions, see “Virtual Controller Control


(VCCONT) Error Handling” on page 5-22.

There is no default MISCONT file; you will need to create it if you


Miscellaneous Support File use Hooks. MISCONT specifies which routines NDC calls at the
- \SYSTEM\MISCONT 9
various Hooks, see “Hooks” on page 5-23.
From Advance NDC 2.05 or NDC+ 7.00.01, multiple Exits can be
used; see “Using MISCMULT” in Chapter 5, “Exits”.
For NDC+, the MISCONT file must be included with the DLLs and
routines in an FM object for input to Diskbuild/2. See the NDC+
Programmers Reference Manual, Appendix K for details.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 9-7


Reference Information
Rule Files

Each hook has a point-of-use of use value, which links the hook
with its corresponding entry in the table.

Point of Use Hook

‘1’ Transition into Supervisor mode

‘2’ Leaving Supervisor mode: Mode switch thrown

‘3’ Leaving Supervisor mode by menu item

‘4’ Clearing fitness.


Not supported by Advance NDC.

‘5’ Physically clearing devices.


Not supported by Advance NDC.

‘6’ Polling for suspend requirement.


Not supported by Advance NDC.

‘7’ Received Host To Exit message.


Not supported by Advance NDC.

‘8’ Start of day

‘9’ Close state entered

Illegal point-of-use values will be ignored.


From Advance NDC 2.05 or NDC+ 7.00.01, multiple Exits can be
used; see “Using MISCMULT” in Chapter 5, “Exits”.
If you use Exits, you will need to create any DLL and routines
required.

Table 9-4 Number of


Field name Value
MISCONT File: Field Descriptions Bytes

Point of use Var (1) ‘1’ to ‘9’


Indicates which hook invokes this Exit

Group separator 1 01D hex

DLL name Var ASCII


Name of the DLL which includes the characters
Hook routine

Group separator 1 01D hex

Routine name Var ASCII


Name of the Hook routine characters

Field separator 1 01C hex

Note: You must include a field separator after the last entry in the
table.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

9-8 Using NDC Exits


Reference Information
Rule Files

For information on error conditions, see “Miscellaneous Support


File Control (MISCONT) Error Handling” on page 5-27.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 9-9


Reference Information
Signatures and Synopses of the Routines

Signatures and Synopses of the


Routines 9

In this section we bring together for reference the signatures of all


the call back and callout routines. Call backs are listed before
callouts. Call backs are listed alphabetically for each file that
contains them, and callouts are listed alphabetically for each rule
file.

The following call back routines are held in the file [Link]:
Call Backs Held In
[Link] 9 PerformNDCState 9

Executes an NDC+ standard state.

extern unsigned char pascal far _loadds


PerformNDCState(char StateLetter, unsigned long far
*NextStateNumber, unsigned long far *TableExitId);

where:
StateLetter is the state letter of the required state

NextStateNumber is a pointer to the number of the state that NDC+


would have executed next
TableExitId is a pointer to the state table entry that was selected as
the source of NextStateNumber

RetrieveKeyboard 9

Retrieves keyboard from NDC+.

extern unsigned char pascal far _loadds


RetrieveKeyboard(unsigned short KeyboardNumber, char
far **KeyboardData, unsigned long far *DataSize);

where:
KeyboardNumber Number of the keyboard

KeyboardData is a pointer to a pointer to keyboard data

DataSize is a pointer to the number of bytes returned

RetrieveScreen 9

Retrieves screen from the NDC+ screen store.

extern unsigned char pascal far _loadds

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

9-10 Using NDC Exits


Reference Information
Signatures and Synopses of the Routines

RetrieveScreen(unsigned short ScreenGroup, unsigned


short ScreenNumber, char far **ScreenData, unsigned
long far *DataSize);

where:

ScreenGroup which screen group to use

ScreenNumber Screen number within the group

ScreenData is a pointer to a pointer to the start of screen data

DataSize is a pointer to the number of bytes returned

SendStatus 9

Sends a Status message.

extern unsigned char pascal far _loadds


SendStatus(char far *DataPtr, unsigned char Sol,
unsigned char ViaInterceptor);

where:

DataPtr is a pointer to null terminated data which is


transmitted in the Status Information Field of the message

Sol is either TRUE (send as a solicited status message) or FALSE


(send as an unsolicited status message).

ViaInterceptor is a boolean parameter that defines the


transmission path to be used for the message. If TRUE, the
message will pass through any outgoing interceptors that are
present. If FALSE, the message will be sent directly to HO
Comms. avoiding any Virtual Controller interceptors.

SendUnformatedData 9

Sends an Exit To Host message.

extern unsigned char pascal far _loadds


SendUnformatedData(char far *DataPtr, unsigned char
ViaInterceptor);

where:

DataPtr is a pointer to null terminated data which will be


transmitted.

ViaInterceptor is a boolean parameter that defines the


transmission path to be used for the message. If TRUE, the
message will pass through any outgoing interceptors that are
present. If FALSE, the message will be sent directly to HO
Comms. avoiding any Virtual Controller interceptors.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 9-11


Reference Information
Signatures and Synopses of the Routines

StoreScreen 9

Stores a screen in the NDC+ screen pool.

extern unsigned char pascal far _loadds


StoreScreen(char far *ScreenData, unsigned long
DataLength);

where:

ScreenData is a pointer to screen data

DataLength is the length of the screen data

PrintToJournal 9

Allows an Exit to print on whatever journal device is active, i.e.


the physical printer (hard copy backup) or electronic journal.

extern void pascal far _loadds PrintToJournal (char


far *JournalData, unsigned long DataLength, char far
*Response) ;

where:

JournalData is a pointer to source of data stream

DataLength is the length of the data stream. Maximum limit is


500 bytes of data.

Response is the response from the journal printer.

SetDigitalAudioPath 9

Sets the digital audio path.


extern void pascal far _loadds
SetDigitalAudioPath(unsigned char language);

where:

language is in the range 0 to 7 inclusive.

The following call backs are supplied in the file [Link]:


Call Backs Held In
[Link] 9
DisplayScreen 9

Display screen and set up keyboard.

extern void pascal far _loadds DisplayScreen(unsigned


short ScreenGroup, unsigned short ScreenNumber,
unsigned short UpdateKeyboard, unsigned short Idle);

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

9-12 Using NDC Exits


Reference Information
Signatures and Synopses of the Routines

where:
ScreenGroup is NDC+ screen group to use.

ScreenNumber is Screen number within the group.

UpdateKeyboard TRUE if the associated keyboard layout is to be set


up, FALSE otherwise.
Idle is TRUE if the screen is to be allowed to idle, FALSE otherwise

DisplayString 9

Display screen data on Cardholder Display.

Note: This routine is applicable for Advance NDC only.

extern void far_loadds DisplayString (const char*


screenData, unsigned long ScreenDataLength, unsigned
long bFocusWindow, unsigned long inSupv);

where:
screenData is the string to display from the current cursor position.

ScreenDataLength is the length of the data contained in


screenData.

bFocusWindow defines whether to bring the window displaying the


screen data to the front of the Cardholder Display. If TRUE, the
window displaying the screen data is made visible on the
Cardholder Display, whether that window is currently displayed or
not. If FALSE, the window displaying the screen data is not brought
to the front if it is not currently visible on the Cardholder Display.
inSupv defines whether to set the default background colour for the
screen to black when displaying a Supervisor screen on the
Cardholder Display. If TRUE, the background colour is set to black
when displaying a Supervisor screen on the Cardholder Display. If
FALSE, no change is made to the current background colour.

The following call backs are supplied in the file [Link]


Call Backs Held In
[Link] 9
GetIntVal 9

Retrieve numeric value from shared data area.

extern unsigned long pascal far _loadds


GetIntVal(long ID);

where:

ID is the mnemonic for the required numeric data item.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 9-13


Reference Information
Signatures and Synopses of the Routines

GetStringVal 9

Return a pointer to a copy of the null terminated string.

extern unsigned char far *pascal far _loadds


GetStringVal(long ID);

where:

ID is the mnemonic for the required string data item.

PutIntVal 9

Write numeric value into shared data area.

extern void pascal far _loadds PutIntVal(long ID,


long NewValue);

where:

ID is the mnemonic for the required numeric data item

NewValue is the value.

PutStringVal 9

Write string data into shared data area.

extern void pascal far _loadds PutStringVal(long ID,


char far *NewValuePtr);

where:

ID is the mnemonic for the required data item

NewValuePtr is a pointer to string data.

malloc 9

Allow use of compiler independent memory calls avoiding any


memory leakage.

extern void * pascal far _loadds malloc(unsigned int


size);

where:

size is the size of memory to allocate, in bytes

buffer is a pointer to the buffer to free

_fmalloc 9

Allow use of compiler independent memory calls avoiding any


memory leakage.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

9-14 Using NDC Exits


Reference Information
Signatures and Synopses of the Routines

extern void far * pascal far _loadds


_fmalloc(unsigned int size);

where:

size is the size of memory to allocate, in bytes

buffer is a pointer to the buffer to free

free 9

Allow use of compiler independent memory calls avoiding any


memory leakage.

extern void pascal far _loadds free(void far


*buffer);

where:

size is the size of memory to allocate, in bytes

buffer is a pointer to the buffer to free

_ffree 9

Allow use of compiler independent memory calls avoiding any


memory leakage.

extern void pascal far _loadds _ffree(void far


*buffer);

where:

size is the size of memory to allocate, in bytes

buffer is a pointer to the buffer to free

DumpData 9

Write shared data to files.

extern void pascal far _loadds DumpData(unsigned long


DumpDataFromNdc, unsigned long DumpDataToNdc);

DumpDataFromNdc 1 if data should be dumped on starting Exit, 0


otherwise
DumpDataToNdc 1 if data should be dumped on leaving Exit, 0
otherwise

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 9-15


Reference Information
Signatures and Synopses of the Routines

Callout From State Table StateRoutineName 9

Control File 9

Routine executes an Exit State.

extern unsigned short pascal far _loadds


StateRoutineName(unsigned char StateType);

where:

StateType is the value of the current state type.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

9-16 Using NDC Exits


Reference Information
Signatures and Synopses of the Routines

Callout From Supervisor SupervisorRoutineName 9

Table Control File 9

Routine executes an Exit Supervisor function.

extern void pascal far _loadds


SupervisorRoutineName(unsigned short far *MenuId,
unsigned short FunctionNo, unsigned char far
*Interface);

where:

MenuId is a pointer to the current menu

FunctionNo indicates the selected function number

Interface is a pointer to the interface currently in use.

OutboundMessageIntercept, InboundMessageIntercept 9

Callouts From Virtual


Controller Control File 9
Virtual Controllers, invoked on outgoing and incoming messages
respectively.

extern unsigned char pascal far _loadds


OutboundMessageIntercept(char far **Message);

extern unsigned char pascal far _loadds


InboundMessageIntercept(char far **Message);

where:

Message is a pointer to a pointer to the message.

Callouts From ClearDeviceName 9

Miscellaneous Support
File 9
Invoked when NDC+ is physically clearing any device.

extern void pascal far _loadds


ClearDeviceName(unsigned char DeviceId);

where:

DeviceId is the Device Identification Graphic (DIG) of the


device which has just been cleared.

ClearFitnessName 9

Invoked when NDC+ is clearing fitness of any device.

extern void pascal far _loadds


ClearFitnessName(unsigned char DeviceId);

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 9-17


Reference Information
Signatures and Synopses of the Routines

where:

DeviceId is the DIG (Device Identification Graphic) of the


device whose fitness has just been cleared.

InitialiseExitRoutine 9

Invoked at start of day.

extern void pascal far _loadds


InitialiseExitRoutine(void);

NDCSuspendName 9

Invoked to poll for suspend requirement.

extern unsigned char pascal far _loadds


NDCSuspendName(void);

ProcessHoCommMsg 9

Invoked on the arrival of a Host To Exit message.

extern void pascal far _loadds ProcessHoCommMsg(char


far *DataPtr);

where:

DataPtr is a pointer to null terminated data from the H O


Comms message field g.

SupEntryName 9

Invoked on entry to Supervisor mode.

extern void pascal far _loadds SupEntryName(unsigned


char Interface);

where:

Interface specifies the interface in use.

SupExitName 9

Invoked on exit from Supervisor mode.

extern void pascal far _loadds SupExitName(unsigned


char DestinationMode);

where:

DestinationMode indicates the mode to which the terminal will


return.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

9-18 Using NDC Exits


Reference Information
Signatures and Synopses of the Routines

SupStopName 9

Invoked when the operator leaves supervisor mode by throwing the


mode switch with Supervisor Auto Exit Mode enabled.

extern void pascal far _loadds SupStopName(void);

SetDigitalAudioPath 9

Invoked to set the digital audio path.


extern void pascal far _loadds
SetDigitalAudioPath(unsigned char language);

where:

language is in the range 0 to 7 inclusive.

The DLL and routine name are specified in the MISCONT file with
point-of-use value of 5.

EnteredCloseStateRoutine 9

To enable close state processing, NDC+ makes a call to the Close


State Processing hook. The close state can be a normal close state (as
a result of the state flow) or a default close state (as a result of an
invalid operation or error).
extern void pascal far _loadds
EnteredCloseStateRoutine(void);

where:

EnteredCloseStateRoutine is substituted at runtime with the


actual routine name.

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.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 9-19


Reference Information
Data Available In NDC Structures

Data Available In NDC Structures 9

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: For the differences with Advance NDC, see ‘Unsupported


Features and Restrictions’ section ‘Unsupported Shared Data’ in
Chapter 3 of the APTRA Advance NDC, Developer’s Guide.
Each shared data item is identified by an Accessor ID. The Accessor
IDs are listed in the header file NDCDATA.H. You should #include
this file and use the accessor IDs to access the data.

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.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

9-20 Using NDC Exits


Reference Information
Data Available In NDC Structures

Table 9-5
Card And Buffer Data

NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type

Card State Byte unsigned IdCardState 0 - in reader


long 1 - ejected
2 - ejected & taken
3 - captured (suspect card)
4 - not taken & captured after
timeout
5 - eject fail
6 - smart card staged
7 - smart card release fail

Card Return / Byte unsigned IdCardRet As per field defined in standard


Retain long transaction reply - See “Transaction
Reply” in the NDC+ Programmer’s
Reference Manual.
0 - return card
1 - retain card

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.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 9-21


Reference Information
Data Available In NDC Structures

NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type

MCRW accept Byte unsigned IdMCRWAcceptOpt MCRW Accept option. Determines


option long card accept operation. Possible
values are :
0 - normal magnetic operation
1 - non-magnetic card accept always
2 - magnetic accept on state 0, non-
magnetic accept on all other
occurrences of the Card Read state.

Buffer A (PIN) 32 string IdBufferA ‘0’..’?’ PIN buffer as sent to host.


Bytes

Buffer A length Byte unsigned IdBufLengthA Length of data in buffer A


long

Buffer B digits after Byte unsigned IdBufBPoint 0..12. Indicates decimal point
decimal point long position of the next buffer.

Buffer B (PIN) 32 string IdBufferB ‘0’..’9’, ‘E’ or ‘T’


Bytes

Buffer B length Byte unsigned IdBufLengthB Length of data in buffer B


long

Buffer C digits after Byte unsigned IdBufCPoint 0..12. Indicates decimal point
decimal point long position of the next buffer.

Buffer C (PIN) 32 string IdBufferC ‘0’..’9’, ‘E’ or ‘T’


Bytes

Buffer C length Byte unsigned IdBufLengthB Length of data in buffer C


long

Amount buffer Byte unsigned IdAmtPoint 0..12. Indicates decimal point


digits after decimal long position of the next buffer.
point

Amount buffer 12 string IdAmtBuffer ‘0’..’9’


Bytes

Amount buffer Byte unsigned IdBufLength Length of amount buffer, either 8 or


length long 12.

Op code buffer 8 Bytes string IdOpBuffer ‘A’..’D’, ‘F’.. ‘I’ and 20H

Boolean indicator Byte unsigned IdPinAtt1 0 - FALSE, 0FFH - TRUE


of 1st attempt of long
new PIN

Buffer for 1st 32 string IdPin1stBuf ‘0’..’?’


attempt of new PIN Bytes

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

9-22 Using NDC Exits


Reference Information
Data Available In NDC Structures

NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type

Boolean indicator Byte unsigned IdPinAtt2 0 - FALSE, 0FFH - TRUE


of 2nd attempt of long
new PIN

Buffer for 2nd 32 string IdPin2ndBuf ‘0’..’?’


attempt of new PIN Bytes

SCIF hardware Byte unsigned IdSCIFWVariant Smart card firmware variant.


variant long ‘0’ - standard smart card.
Anything else: EMV smart card
reader.

Track 1 to update Byte unsigned IdT1Update 0 - FALSE, 0FFH - TRUE


flag long

Track 2 to update Byte unsigned IdT2Update 0 - FALSE, 0FFH - TRUE


flag long

Track 3 to update Byte unsigned IdT3Update 0 - FALSE, 0FFH - TRUE


flag long

Table 9-6
Financial Institution Table Data

NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type

FIT match found Byte unsigned IdFitMatch 0 - FALSE 0FFH - TRUE


long

PIDDX Byte unsigned IdPIDDX See “Financial Institution Tables”


long section in the NDC+ Programmer’s
Reference Manual.

PFIID 5 Bytes 5 unsigned IdPFIID0 “ “


long items :
IdPFIID4

PSTDX Byte unsigned IdPSTDX “ “


long

PAGDX Byte unsigned IdPAGDX “ “


long

PMXPN Byte unsigned IdPMXPN “ “


long

PCKLN Byte unsigned IdPCKLN “ “


long

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 9-23


Reference Information
Data Available In NDC Structures

NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type

PINPD Byte unsigned IdPINPD “ “


long

PANDX Byte unsigned IdPANDX “ “


long

PANLN Byte unsigned IdPANLN “ “


long

PANPD Byte unsigned IdPANPD “ “


long

PRCNT Byte unsigned IdPRCNT “ “


long

POFDX Byte unsigned IdPOFDX “ “


long

PDCTB 8 Bytes 8 unsigned IdPDCTB0 “ “


long items :
IdPDCTB7

PEKEY 8 Bytes 8 unsigned IdPEKEY0. “ “


long items :
IdPEKEY7

PINDX 3 Bytes 3 unsigned IdPINDX0 “ “


long items :
IdPINDX2

PLNDX Byte unsigned IdPLNDX “ “


long

PMMSR Byte unsigned IdPMMSR “ “


long

PREF2 Byte unsigned IdPREF2 “ “


long

PVBDX Byte unsigned IdPVBDX “ “


long

PVBLN Byte unsigned IdPVBLN “ “


long

PBFMT Byte unsigned IdPBFMT “ “


long

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

9-24 Using NDC Exits


Reference Information
Data Available In NDC Structures

Table 9-7
Document Processing Module Data

NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type

DPM Magnetic Byte unsigned IdDPMFlux 0 - unknown


Flux State long 1 - non-magnetic document present
2 - magnetic document present

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 1 Byte unsigned IdRdZo1Sta “ “


Status long

DPM Read Zone 2 Byte unsigned IdRdZo2Sta “ “


Status long

DPM Read Zone 3 Byte unsigned IdRdZo3Sta “ “


Status long

DPM Read Zone 4 Byte unsigned IdRdZo4Sta “ “


Status long

DPM Read Zone 5 Byte unsigned IdRdZo5Sta “ “


Status long

DPM Read Zone 6 Byte unsigned IdRdZo6Sta “ “


Status long

DPM Read Zone 7 Byte unsigned IdRdZo7Sta “ “


Status long

DPM Read Zone 8 Byte unsigned IdRdZo8Sta ‘


Status long

DPM Read Zone 9 Byte unsigned IdRdZo9Sta “ “


Status long

DPM Read Zone 0 100 string IdRdZo0Data Data read from the DPM
Data Bytes

DPM Read Zone 1 100 string IdRdZo1Data “ “


Data Bytes

DPM Read Zone 2 100 string IdRdZo2Data “ “


Data Bytes

DPM Read Zone 3 100 string IdRdZo3Data “ “


Data Bytes

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 9-25


Reference Information
Data Available In NDC Structures

NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type

DPM Read Zone 4 100 string IdRdZo4Data “ “


Data Bytes

DPM Read Zone 5 100 string IdRdZo5Data “ “


Data Bytes

DPM Read Zone 6 100 string IdRdZo6Data “ “


Data Bytes

DPM Read Zone 7 100 string IdRdZo7Data “ “


Data Bytes

DPM Read Zone 8 100 string IdRdZo8Data “ “


Data Bytes

DPM Read Zone 9 100 string IdRdZo9Data “ “


Data Bytes

Error position Byte unsigned IdDPMErrPos Records where a DPM error


long happened. See Appendix O, “DPM
Error Data” in the NDC+
Programmer’s Reference Manual.

Document present Byte unsigned IdDocPres 0 - Document not present


flag long 1 - Document present

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.

Number of Byte unsigned IdCandNums 1..3 The number of possibilities of


candidates long the document type.

Candidate 1 used Byte unsigned IdCan1Used Set to TRUE when the first of a
long number (max 3) of candidates has
been selected.

Candidate 0 Byte unsigned IdCand0Or Value returned by DPM or ‘?’ if


Orientation long unknown.

Candidate 1 Byte unsigned IdCand1Or “ “


Orientation long

Candidate 2 Byte unsigned IdCand2Or “ “


Orientation long

Candidate 0 Enable Word unsigned IdCand0En Enable code associated with


Code long candidate.

Candidate 1 Enable Word unsigned IdCand1En “ “


Code long

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

9-26 Using NDC Exits


Reference Information
Data Available In NDC Structures

NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type

Candidate 2 Enable Word unsigned IdCand2En “ “


Code long

Candidate 0 17 string IdCand0Clas See Appendix P, “Document


Classname Bytes Processing” in the NDC+
Programmer’s Reference Manual.

Candidate 1 17 string IdCand1Clas “ “


Classname Bytes

Candidate 2 17 string IdCand2Clas “ “


Classname Bytes

Candidate 0 17 string IdCand0Doc “ “


[Link] Bytes

Candidate 1 17 string IdCand1Doc “ “


[Link] Bytes

Candidate 2 17 string IdCand2Doc “ “


[Link] Bytes

DPM Archive 17 17 IdDPMArch0 See Appendix O, “DPM Error Data”


Summary Bytes Unsigned . in the NDC+ Programmer’s Reference
Long Items . Manual.
IdDPMArch16

Current Document Byte unsigned IdCurOrient Value returned by DPM or ‘?’ if


Orientation long unknown

Current Enable Word unsigned IdCurEnable See Appendix P, “Document


Code long Processing” in the NDC+
Programmer’s Reference Manual.

Current Classname 17 string IdCurClasName “ “


Bytes

Current [Link] 17 string IdCurDocName “ “


Bytes

Zone verification 10 string IdZoneVerRes Records the result of the zone


result Bytes verification exercise:
‘B’ - blank
‘M’ - marked

Dumping of DPM Byte unsigned IdDPMDump False - Dumping not allowed.


Images Enabled long True - Dumping allowed.
This records the terminal command
sent by the host.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 9-27


Reference Information
Data Available In NDC Structures

Table 9-8
Printer Data

NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type

Top of receipt flag Byte unsigned IdReceiptTop 0 - FALSE


long 0FFH - TRUE

Top of statement Byte unsigned IdStmtTop 0 - FALSE


flag long 0FFH - TRUE

Receipt printed Byte unsigned IdRecptPrinted 0 - FALSE


Boolean flag long 0FFH - TRUE
When TRUE this indicates printing
has occurred on the receipt printer.
It is used to tidy up in the close
state.

Statement printed Byte unsigned IdStmtPrinted 0 - FALSE


Boolean flag long 0FFH - TRUE
When TRUE this indicates printing
has occurred on the statement
printer. It is used to tidy up in the
close state.

Journal printed Byte unsigned IdJnlPrinted 0 - FALSE


Boolean flag long 0FFH - TRUE
When TRUE this indicates printing
has occurred on the journal printer
or to the electronic journal. It is used
to tidy up in the close state.

Journal first use Byte unsigned IdJnlSup 0 - FALSE


after supervisor long 0FFH - TRUE.
mode flag See receipt equivalent for full
description.

Journal printer Byte unsigned IdJrn1Opt Journal printer option value:


option value long 0 - Hard copy (printed) Journal
2 - Electronic Journal
3 - Reserved

Receipt first use Byte unsigned IdRecSup 0 - FALSE


after supervisor long 0FFH - TRUE
mode flag This is used to prevent multiple
error host messages when
replenishable errors are detected in
a working device. When TRUE, a
message will be forced to the host.
Used on exit from supervisor mode.
The rest of the similar flags follow.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

9-28 Using NDC Exits


Reference Information
Data Available In NDC Structures

NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type

Statement first use Byte unsigned IdStmtSup 0 - FALSE


after supervisor long 0FFH - TRUE
mode flag See receipt equivalent for full
description.

DPM first use after Byte unsigned IdDPMSup 0 - FALSE


supervisor mode long 0FFH - TRUE.
flag See receipt equivalent for full
description.

Envelope dispenser Byte unsigned IdEnvSup 0 - FALSE


first use after long 0FFH - TRUE.
supervisor mode See receipt equivalent for full
flag description.

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 word unsigned IdCurrStateNumber 000-254, 256-750


number long

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

Secondary 8 8 unsigned IdSecExStateData0 As above for secondary extension.


extension state words longs .
table IdSecExStateData7

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 9-29


Reference Information
Data Available In NDC Structures

NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type

Tertiary extension 8 8 unsigned IdTerExStateData0 As above for third extension.


state table words longs .
IdTerExStateData7

Fourth extension 8 8 unsigned IdFourExStateData0 As above for fourth extension.


state table words longs .
IdFourExStateData7

Fifth extension 8 8 unsigned IdFiveExStateData0 As above for fifth extension.


state table words longs .
IDFiveExStateData7

Sixth extension 8 8 unsigned IdSixExStateData0 As above for sixth extension.


state table words longs .
IDSixExStateData7

Seventh extension 8 8 unsigned IdSevenExStateData0 As above for seventh extension.


state table words longs .
IDSevenExStateData7

Eighth extension 8 8 unsigned IdEightExStateData0 As above for eighth extension.


state table words longs .
IDEightExStateData7

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

9-30 Using NDC Exits


Reference Information
Data Available In NDC Structures

Table 9-10
Communications Data

NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type

Message byte unsigned IdCoordNo 31H ... 3FH (default).


Coordination long 31H ... 7EH if option 34 in the
Number Enhanced Configuration Parameter
Load message is set (Native mode
only).
The cycling number used in
transaction request messages,
returned by transaction replies.
Incremented by NDC+ each time a
transaction request is sent. If
examined before the first such
message is sent it may be out of
legal range.

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

Transaction Serial 4 bytes string IdTSNBackup Backup for above value


Number Backup

Comms Protocol byte unsigned IdCommsProt 1 - IBM 3275, 8 - SNA 3624,


long 9 - SNA general, 12 - IBM loop etc.
(These are the values returned from
the comms driver).

Comms Status byte unsigned IdCommsStatus 0 - Closed


long 1 - Up
2 - Offline
3 - Down
4 - Open pending

Logical Unit 3 bytes string IdLUNO The LUNO used in comms


Number messages

Last Message byte unsigned IdLastMesStatus 0 - No status


Status long 1 - ready sent
2 - status sent
3 - reject sent

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 9-31


Reference Information
Data Available In NDC Structures

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.

Override Reserved word unsigned IdDScrOver0 Override reserved screen 0


Screen 0 long

Override Reserved word unsigned IdDScrOver1 Override reserved screen 1


Screen 1 long

Override Reserved word unsigned IdDScrOver2 Override reserved screen 2


Screen 2 long

Override Reserved word unsigned IdDScrOver3 Override reserved screen 3


Screen 3 long

Override Reserved word unsigned IdDScrOver4 Override reserved screen 4


Screen 4 long

Override Reserved word unsigned IdDScrOver5 Override reserved screen 5


Screen 5 long

Override Reserved word unsigned IdDScrOver6 Override reserved screen 6


Screen 6 long

Override Reserved word unsigned IdDScrOver7 Override reserved screen 7


Screen 7 long

Override Reserved word unsigned IdDScrOver8 Override reserved screen 8


Screen 8 long

Override Reserved word unsigned IdDScrOver9 Override reserved screen 9


Screen 9 long

Override Reserved word unsigned IdDScrOver10 Override reserved screen 10


Screen 10 long

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

9-32 Using NDC Exits


Reference Information
Data Available In NDC Structures

Table 9-12
Timer Data

NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type

Timer 00 - Byte unsigned IdTimer0 For Timer descriptions, see the


Keyboard Entry long “Configuration Parameters Load”
Timeout section in Chapter 4 of the NDC+
Programmer’s Reference Manual.

Timer 01 - Timeout Byte unsigned IdTimer1 “ “


State Timeout long

Timer 02 - Close Byte unsigned IdTimer2 “ “


State Timeout long

Timer 03 - Comms Byte unsigned IdTimer3 “ “


Response Timeout long

Timer 04 - Byte unsigned IdTimer4 “ “


Envelope/ long
Document Insert
Timeout

Timer 05 - Cash Byte unsigned IdTimer5 “ “


Retract Timeout long

Timer 06 - Byte unsigned IdTimer6 “ “


Poll/Select long
Timeout

Timer 07 - Present Byte unsigned IdTimer7 “ “


Timeout long

Timer 08 - Night Byte unsigned IdTimer8 “ “


Safe Deposit long
Timeout

Timer 09 - Card Byte unsigned IdTimer9 “ “


Removal Timeout long

Timer 10 - Byte unsigned IdTimer10 “ “


Additional Present long
Timeout

Timer 68 - Byte unsigned IdTimer68 “ “


Statement MEI long
Duration Timeout

Timer 69 - Byte unsigned IdTimer69 “ “


Receipt MEI long
Duration Timeout

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 9-33


Reference Information
Data Available In NDC Structures

NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type

Timer 70 - Remove Byte unsigned IdTimer70 “ “


Card Screen Delay long

Timer 71 - Card Byte unsigned IdTimer71 “ “


Remove Timer long

Timer 80 - Byte unsigned N/A Reserved


Reserved long

Timer 81 - Byte unsigned N/A Reserved


Reserved long

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.

Timer 83 - DCS Word unsigned IdTimer83 “ “


Deletion Period long

Timer 84 - Byte unsigned N/A Reserved


Reserved long

Timer 85 - Byte unsigned N/A Reserved


Reserved long

Timer 86 - Byte unsigned IdTimer86 For Timer descriptions, see the


Settlement Timeout long “Configuration Parameters Load”
section in Chapter 4 of the NDC+
Programmer’s Reference Manual.

Timer 87 - Doc Byte unsigned IdTimer87 “ “


Captured Screen long
Timeout

Timer 88-90 Byte unsigned N/A Reserved


Reserved long

Timer 91 - In Byte unsigned IdTimer91 For Timer descriptions, see the


Service Inspection long “Configuration Parameters Load”
Timeout section in Chapter 4 of the NDC+
Programmer’s Reference Manual.

Timer 92 - SOH Byte unsigned IdTimer92 “ “


Cycle Timeout long

Timer 93 - SOH Byte unsigned IdTimer93 “ “


Manual Override long
Rate

Timer 94 - Doc / Byte unsigned IdTimer94 “ “


Envelope Eject long
Timeout

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

9-34 Using NDC Exits


Reference Information
Data Available In NDC Structures

NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type

Timer 95 - Byte unsigned IdTimer95 “ “


Statement Not long
Taken Timeout

Timer 96 - Byte unsigned IdTimer96 “ “


Statement Present long
Timeout

Timer 97 - Door Byte unsigned IdTimer97 “ “


Access Open long
Timeout (Not
supported by
Advance NDC)

Timer 98-99 Byte unsigned N/A Reserved.


Reserved long

Table 9-13
Message Mode Options Data

NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type

Message mode byte unsigned IdMsgMode 1 - Native Status Messages


long 2 - Diebold Status Messages (PIN)
3 - Diebold Status Messages (No
PIN)

Options 16 16 unsigned IdOptionArray0 Decimal values of entered option


bytes longs . string. Unused digits will be 0.
. See Appendix A, “Native Mode
. Options” in the NDC+ Supervisor’s
IdOptionArray15 Reference Manual.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 9-35


Reference Information
Data Available In NDC Structures

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.

Security Flags 10 string IdSecurityFlags As per the last 10 characters of MAC


bytes 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

Camera Control byte unsigned IdCamOption See the “Customisation Data


Option (Not long Commands” chapter in the NDC+
supported by Programmer’s Reference Manual.
Advance NDC)

Card Reader Error byte unsigned IdCardThreshOpt “ “


Threshold long

Track 3 Write Error byte unsigned IdT3WriteThresOpt “ “


Threshold long

Supply and Ready byte unsigned IdSupRdyOption “ “


Option long

Auto Voice byte unsigned IdAutoVoiceOption “ “


long

Date Format byte unsigned IdDateOption “ “


long

Roll Width byte unsigned IdWidthOption “ “


long

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

9-36 Using NDC Exits


Reference Information
Data Available In NDC Structures

NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type

Left Margin byte unsigned IdMarginOpt “ “


long

Track 1 Format byte unsigned IdT1FormatOpt “ “


long

TI Control byte unsigned IdTIOption “ “


long

Extended Status byte unsigned IdExtendedOption “ “


Control long

Specific Command byte unsigned IdSCROption “ “


Reject long

Transaction Status byte unsigned IdTransInfOpt “ “


Information Option long

Hard Copy Backup byte unsigned IdEJHrsOpt “ “


Hours long

Hard Copy Backup byte unsigned IdEJRecOpt “ “


Records long

Ignore MM Sensor byte unsigned IdMMOption “ “


long

Hard Copy Backup byte unsigned IdEJTampeOpt “ “


Log Tamper long
Reporting

Envelope byte unsigned IdEnvRepOpt “ “


Reporting Control long

Enhanced TI / byte unsigned IdTISensOpt “ “


Sensor Control long

MEI Flash Rate byte unsigned IdMEIControlOpt “ “


Control long

Touch Screen byte unsigned IdTouchRepOpt “ “


Reporting Control long

Remote Relay byte unsigned IdRemRelayOpt “ “


Operation long

Report Status Of byte unsigned IdSMStatusOpt “ “


SM Installation long
Process

PAN In DCS Misc. byte unsigned IdPANDCSOpt “ “


Field long

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 9-37


Reference Information
Data Available In NDC Structures

NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type

Audio Echo Of byte unsigned IdAudEchoOpt “ “


Keyboard Control long

Digital Audio byte unsigned IdDASRepOpt “ “


Reporting Control long

Enhanced EJ byte unsigned IdRCOPYModeOpt 000 - Standard backup (RCOPY)


Backup Option long 001 - Enhanced backup (RCOPY)
(RCOPY)

Disable Integrated byte unsigned IdDisICCManipulation 000 - Do not disable ICC


Circuit Card (ICC) long manipulation
Manipulation 001 - Disable ICC manipulation

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

Cards Captured word unsigned IdCardCapCount Incrementing count of cards


Count long captured

Cash Last Cleared 6 bytes string IdCashClrDate Year, month, day, hour, minute,
Date second

Notes In Cassette word unsigned IdNotesInType1 Decrementing count of notes in


Type 1 long cassette

Notes In Cassette word unsigned IdNotesInType2 Decrementing count of notes in


Type 2 long cassette

Notes In Cassette word unsigned IdNotesInType3 Decrementing count of notes in


Type 3 long cassette

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

9-38 Using NDC Exits


Reference Information
Data Available In NDC Structures

NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type

Notes In Cassette word unsigned IdNotesInType4 Decrementing count of notes in


Type 4 long cassette

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

Notes Dispensed word unsigned IdNotesDispType1 Cumulative count of corresponding


From Cassette long replenishment count byte 1 plus
Type 1 replenishment count byte 3

Notes Dispensed word unsigned IdNotesDispType2 Cumulative count of corresponding


From Cassette long replenishment count byte 1 plus
Type 2 replenishment count byte 3

Notes Dispensed word unsigned IdNotesDispType3 Cumulative count of corresponding


From Cassette long replenishment count byte 1 plus
Type 3 replenishment count byte 3

Notes Dispensed word unsigned IdNotesDispType4 Cumulative count of corresponding


From Cassette long replenishment count byte 1 plus
Type 4 replenishment count byte 3

Notes Dispensed word unsigned IdLastNotesDispType1 Updated at end of Transaction


Last Transaction long Reply processing
From Cassette
Type 1

Notes Dispensed word unsigned IdLastNotesDispType2 Updated at end of Transaction


Last Transaction long Reply processing
From Cassette
Type 2

Notes Dispensed word unsigned IdLastNotesDispType3 Updated at end of Transaction


Last Transaction long Reply processing
From Cassette
Type 3

Notes Dispensed word unsigned IdLastNotesDispType4 Updated at end of Transaction


Last Transaction long Reply processing
From Cassette
Type 4

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 9-39


Reference Information
Data Available In NDC Structures

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

Standard Notes word unsigned IdStdNotes1 Used to allow fast (fixed)


Added To Cassette long replenishment
Type 1

Standard Notes word unsigned IdStdNotes2 Used to allow fast (fixed)


Added To Cassette long replenishment
Type 2

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

9-40 Using NDC Exits


Reference Information
Data Available In NDC Structures

NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type

Standard Notes word unsigned IdStdNotes3 Used to allow fast (fixed)


Added To Cassette long replenishment
Type 3

Standard Notes word unsigned IdStdNotes4 Used to allow fast (fixed)


Added To Cassette long replenishment
Type 4

Accumulated word unsigned IdTransCountLo This and the following counter


Transaction Count long work together as a double word
(Low) variable. This low value is
incremented each time the
transaction serial number changes.

Accumulated word unsigned IdTransCountHi See above. This high value is


Transaction Count long incremented whenever the low
(High) value has reached its limit and rolls
over.

Power Fail byte unsigned IdPowerFailRec Failure condition:


Recovery Flag long 0 - no transaction
1 - dispense transaction
2 - other transaction

Envelope Last 6 bytes string IdEnvClrDate Year, month, day, hour, minute,
Cleared Date second

Envelopes word unsigned IdEnvDepCount Cumulative counter


Deposited Count long

Camera Frames 5 bytes string IdCamCount Camera dependent counter


Remaining (Not
supported by
Advance NDC)

DPM Pocket A word unsigned IdDPMACount Cumulative deposit counter


Deposit Count long

DPM Pocket B word unsigned IdDPMBCount Cumulative deposit counter


Deposit Count long

DPM Pocket C word unsigned IdDPMCCount Cumulative deposit counter


Deposit Count long

DPM Reject Bin word unsigned IdDPMRejCount Cumulative deposit counter


Count long

Coins Last Cleared 6 bytes string IdCoinClrDate Year, month, day, hour, minute,
Date second

Coins Dispensed word unsigned IdCoinDisp1 Cumulative count of coins


From Hopper 1 long dispensed from hopper

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 9-41


Reference Information
Data Available In NDC Structures

NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type

Coins Dispensed word unsigned IdCoinDisp2 Cumulative count of coins


From Hopper 2 long dispensed from hopper

Coins Dispensed word unsigned IdCoinDisp3 Cumulative count of coins


From Hopper 3 long dispensed from hopper

Coins Dispensed word unsigned IdCoinDisp4 Cumulative count of coins


From Hopper 4 long dispensed from hopper

Coins Remaining word unsigned IdCoinRem1 Decrementing count of coins in


In Hopper 1 long hopper 1

Coins Remaining word unsigned IdCoinRem2 Decrementing count of coins in


In Hopper 2 long hopper 2

Coins Remaining word unsigned IdCoinRem3 Decrementing count of coins in


In Hopper 3 long hopper 3

Coins Remaining word unsigned IdCoinRem4 Decrementing count of coins in


In Hopper 4 long hopper 4

Coins Dispensed word unsigned IdLastCoinDisp1 Updated at end of transaction


Last Transaction long processing
From Hopper 1

Coins Dispensed word unsigned IdLastCoinDisp2 Updated at end of transaction


Last Transaction long processing
From Hopper 2

Coins Dispensed word unsigned IdLastCoinDisp3 Updated at end of transaction


Last Transaction long processing
From Hopper 3

Coins Dispensed word unsigned IdLastCoinDisp4 Updated at end of transaction


Last Transaction long processing
From Hopper 4

Backup Coins word unsigned IdBackCoinDisp1 Backup copy of count at start of


Dispensed From long transaction processing
Hopper 1

Backup Coins word unsigned IdBackCoinDisp2 Backup copy of count at start of


Dispensed From long transaction processing
Hopper 2

Backup Coins word unsigned IdBackCoinDisp3 Backup copy of count at start of


Dispensed From long transaction processing
Hopper 3

Backup Coins word unsigned IdBackCoinDisp4 Backup copy of count at start of


Dispensed From long transaction processing
Hopper 4

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

9-42 Using NDC Exits


Reference Information
Data Available In NDC Structures

NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type

Backup Coins word unsigned IdBackCoinRem1 Backup copy of count at start of


Remaining In long transaction processing
Hopper 1

Backup Coins word unsigned IdBackCoinRem2 Backup copy of count at start of


Remaining In long transaction processing
Hopper 2

Backup Coins word unsigned IdBackCoinRem3 Backup copy of count at start of


Remaining In long transaction processing
Hopper 3

Backup Coins word unsigned IdBackCoinRem4 Backup copy of count at start of


Remaining In long transaction processing
Hopper 4

Standard Coins word unsigned IdStdCoin1 Used to allow fast (fixed)


Added To Hopper long replenishment
1

Standard Coins word unsigned IdStdCoin2 Used to allow fast (fixed)


Added To Hopper long replenishment
2

Standard Coins word unsigned IdStdCoin3 Used to allow fast (fixed)


Added To Hopper long replenishment
3

Standard Coins word unsigned IdStdCoin4 Used to allow fast (fixed)


Added To Hopper long replenishment
4

Statement Capture word unsigned IdStmtCapCnt Cumulative count of captured


Bin Count long statements

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 9-43


Reference Information
Data Available In NDC Structures

Table 9-17
Miscellaneous Data

NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type

Restart mode byte unsigned IdRestartMode 0 - Default Action


long 1 - Diebold Equivalent
2 - Native Mode
3 - Auto Recovery

Current version 6 bytes string IdCurrVersion Identifies the version of NDC, for
example ‘020600’ for Advance NDC
release 02.06.00

Current operating byte unsigned IdTerminalMode 0 - Initialise


mode of terminal long 1 - Power up
2 - Out of service
3 - Supply
4 - In service
5 - Offline
6 - Simulate supply

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.

Initial Supervisor byte unsigned IdInitSupvMenu 0 - Select


Entry Menu long 1 - Replenish
2 - Exit supplied menu.

Initial Supervisor byte unsigned IdInitSupvDisplay 0 - Rear Display


Display long 1 - Cardholder Display

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

9-44 Using NDC Exits


Reference Information
Data Available In NDC Structures

NDC+
Data Accessor
Data Item Data Accessor ID Value or Description
Type
Type

Auto Exit Flag byte unsigned IdAutoExit 0 - Switch movement needs to be


long accompanied by selection of
function 9 in the Select menu.
0FFH - Switch movement only
needed. Supervisor mode will exit
automatically as soon as it has
completed any current NDC+
function.

Password In Use byte unsigned IdPassInUse 0 - No password protection of


long replenish or access menus.
0FFH - Password protection in use
for replenish and access menus.

Password word unsigned IdSupPassword The password value. Any number


long up to 4 digits long.

Supervisor Keys byte unsigned IdSupKeys Native Mode:


Record long 0..4 reflects the latest use of one of
the functions 0..4 in the Select menu.
Diebold Mode:
Bit 2 set: Supervisor Switch Set.
Bit 0 set: Supply Switch Set.

Product Class byte unsigned IdProductClass For example, 0E - 5663 , 10 - 5675


long Product class identifiers are listed
under “Solicited Status Messages,
Send Configuration Information,
Hardware Configuration - Subfield
‘g4’ ” in the NDC+ Programmer’s
Reference Manual.

Product ID 9 bytes string IdProductId For example, G530-0205

Default for State Of byte unsigned IdSOHInSup 0 - No SOH display


Health Display On long 0FFH - SOH display switched on
Entry To
Supervisor

Default For State byte unsigned IdSOHOutSup 0 - No SOH display


Of Health Display long 0FFH - SOH display switched on
When Supervisor
Exited

Current State Of byte unsigned IdSOHDispActive 0 - SOH display off


SOH Display long 0FFH - SOH display on

Current State Of byte unsigned IdTMADispActive Not currently used by NDC+ / TM-
TM-Alert Display long Alert

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 9-45


Reference Information
New Screen Definitions

New Screen Definitions 9

The following new screens relating to problems loading DLLs or


accessing Exit routines were defined in NDC+ Release 6.00:

Screen number Contents

E0042 LOAD ERROR

E0047 CALL ERROR

T93 DLL LOAD ERROR

T94 DLL CALL ERROR

For the latest screens defined in Advance NDC, see the APTRA
Advance NDC, Supervisor’s Guide and the APTRA Advance NDC,
Reference Manual.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

9-46 Using NDC Exits


Table of Contents
Programmer’s Tips

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

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits


Table of Contents
Programmer’s Tips

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits


Programmer’s Tips
10

Overview

Overview 10

This chapter contains notes which have been provided by


programmers developing Exits.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 10-1


Programmer’s Tips
Some Rules For Using Virtual Controllers

Some Rules For Using Virtual


Controllers 10

The Exit/VC writer is responsible for ensuring that the chain of


Communications Virtual Controllers completes its operation within the time limits
Response Time-out 10
set by the Communications Response Time-out, Timer 3. This timer
is set when the terminal is ready to transmit a Transaction Request
message to the Host. If the terminal does not receive a Transaction
Reply command before Timer 3 expires, the terminal exits the
Transaction Request State and advances to the central response
time-out next state specified in the Transaction Request state table.

In NDC+, during a Print Statement and Wait function, NDC+ issues


Fast Replies to ‘Print Fast Ready 9’s to the Host in order to optimise transaction
Statement and Wait’ 10
performance by keeping the print data coming quickly. This will not
happen if a Virtual Controller is being used. However, the Virtual
Controller can be coded or written to issue Fast Ready 9’s if the
effect is required.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

10-2 Using NDC Exits


Programmer’s Tips
ADI-2 Call Restrictions

ADI-2 Call Restrictions 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

Process that operates in the ADI-2 environment and as such the


calling task(s) will have already been created and will continue to
operate after an Exit routine has completed. If an Exit writer still
requires to create new task(s), there are no restrictions, and S4
ADI-2 calls are available i.e. ADI_CREATE_TASK and
ADI_INITIALISE_TASK.
However, care should be taken to ensure that the Exit writer only
terminates the task(s) they have created by calling the
ADI_EXIT_TASK call with the exit_type parameter value equal to
1 (ADI_EXIT_THREAD). This will ensure that the exit is from the
calling task only. If the ADI_EXIT_TASK is called with an exit_type
parameter value of 2 (ADI_EXIT_PROCESS), this will result in not
just terminating the Exit writer created task but the termination of
the NDC+ process that called the Exit DLL. NDC+ would then be
unable to support further calls to Exit DLLs.
Alternative S4I ADI-2 calls exist to register and de-register tasks not
created by ADI_CREATE_TASK and similar restrictions apply
regarding task termination. The Exit writer is required to use the
ADI_TERMINATE call to de-register a task which was previously
registered with the ADI_INITIALISE call. The
ADI_TERMINATE _PROCESS should not be used as it results in the
NDC+ Process termination as outlined above.
The ADI-2 Supplementary Utility calls ALLOCATE_MEMORY and
FREE_MEMORY should not be used as outlined in the Memory
Allocation and De-allocation section below.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 10-3


Programmer’s Tips
Attaching to and Detaching from S4 Services

Attaching to and Detaching from S4


Services 10

Before an Exit communicates with an S4 device, it must first attach


to it. The ADI_ATTACH call must be made and the ‘attached’
return value must be received before an Exit communicates with
any device NDC+ is aware of. An Exit must ensure that it detaches
from all devices NDC+ is aware of before control is passed back to
NDC+.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

10-4 Using NDC Exits


Programmer’s Tips
Memory Allocation and De-allocation

Memory Allocation and


De-allocation 10

The Exit writer is required to use the ISO standard functions


supplied with their compiler for allocating and de-allocating
memory which has been passed between the NDC+ Exit support
DLLs and their Exit Applications.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 10-5


Programmer’s Tips
Using File Management Interface

Using File Management Interface 10

The File Management Interface can be used freely by an Exit writer


provided that they do not alter any of the executables or support
files used by NDC+. There is a directory reserved exclusively for
use by exits called \NDCEXIT.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

10-6 Using NDC Exits


Programmer’s Tips
Linking Exit DLLs

Linking Exit DLLs 10

If you are using Microsoft C6 to link C-Exit DLLs, and


[Link] is involved in the link, do not use the option /NOI .
This is because /NOI causes the link to be case sensitive, which is
not compatible with Pascal calls.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits 10-7


Programmer’s Tips
Linking Exit DLLs

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

10-8 Using NDC Exits


Table of Contents
Examples of Exits

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
The Link File A-60

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits


Table of Contents
Examples of Exits

Confidential and proprietary information of NCR.

Unauthorised use, reproduction and/or distribution is strictly prohibited

Using NDC Exits


Examples of Exits
A

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

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-1


Examples of Exits
Example 1 - State Exit

Example 1 - State Exit A

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)

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-2 Using NDC Exits


Examples of Exits
Example 1 - State Exit

{
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);

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-3


Examples of Exits
Example 1 - State Exit

/****************************************************************************/
/* */
/* 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);
}

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-4 Using NDC Exits


Examples of Exits
Example 1 - State Exit

/****************************************************************************/
/* */
/* 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 */
/* */
/****************************************************************************/

unsigned short pascal far _loadds State_XXX(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;

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-5


Examples of Exits
Example 1 - State Exit

unsigned short Idle = 0;


char str[50];
ScreenNumber = (unsigned short) GetIntVal(IdStateData1);
Cancel_NextStateNum = (unsigned short) GetIntVal(IdStateData2);
DisplayScreen(ScreenGroup, ScreenNumber, UpdateKeyboard, Idle);
/* Display screen number and StateType letter */
sprintf(str, “%cSCR %d STATE TYPE IS %XH\0”, 0x0d, ScreenNumber,
StateType);
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);
/* Wait for keypress */
get_keys(cardholder_keyboard_dev, &detachable, tdata);
DetachDev(cardholder_keyboard_dev, detachable);
return (Cancel_NextStateNum);
}
/****************************************************************************/
/* */
/* PROCEDURE NAME : State_j */
/* */
/* DESCRIPTION : Displays a screen and sends one of three possible */
/* HO comms messages using SendUnformatedData dependant upon */
/* which of two FDKs is pressed (FDK A for a msg that is too long for */
/* the current protocol, FDK B for one that does not exceed the current */
/* protocol, and FDK C for one that exceeds the maximum length, */
/* regardless of protocol). */
/* */
/****************************************************************************/

unsigned short pascal far _loadds State_j(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;
int length = 0;
char message[2000];
int i;
unsigned char temp;
char str[100];
StateType;
ScreenNumber = (unsigned short) GetIntVal(IdStateData0);

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-6 Using NDC Exits


Examples of Exits
Example 1 - State Exit

Cancel_NextStateNum = (unsigned short) GetIntVal(IdStateData1);


ActiveFDKs = (BYTE) 0x7; /* Only FDK_A, FDK_B, FDK_C */
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:
case FDK_B:
switch ((int) GetIntVal(IdCommsProt))
{
case BISYNC_3275:
length = BISYNC_3275_TXMAX;
break;
case TC500_ASYNC:
length = TC500_ASYNC_TXMAX;
break;
case NCRISO_ASYNC:
length = NCRISO_ASYNC_TXMAX;
break;
case IBM_2265_ASYNC:
length = IBM_2265_ASYNC_TXMAX;
break;
case HDLC_NRM:
length = HDLC_NRM_TXMAX;
break;
case NCR_DLC:
length = NCR_DLC_TXMAX;
break;
case SNA_3624:
length = SNA_3624_TXMAX;
break;
case SNA_LU0:
length = SNA_LU0_TXMAX;
break;
case X25_LAPB:
length = X25_LAPB_TXMAX;
break;
case IBM_3600:
length = IBM_3600_TXMAX;
break;
case ASYNC_3270:
length = ASYNC_3270_TXMAX;
break;
case UTS20:

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-7


Examples of Exits
Example 1 - State Exit

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;

for (i = 0; i < (length - 1); i++)


message[i] = ‘A’;
message[i] = ‘\0’;
temp = SendUnformatedData(message, TRUE);
if (temp != 0)
{
sprintf(str, “%cVALUE RETURNED = %d\0”, 0x0c, temp);
my_StoreScreen(SCREEN_TO_USE, str);
DisplayScreen(ScreenGroup, SCREEN_TO_USE, UpdateKeyboard, Idle);
ELAPSE_TIME(50);
}
break;
case FDK_C:
length = 1622 + 100;
for (i = 0; i < (length - 1); i++)
message[i] = ‘A’;
message[i] = ‘\0’;
temp = SendUnformatedData(message, TRUE);
/* If above maximum limit, instead of system escape, error value of 3*/
/*returned */
if (temp == 3)
sprintf(str, “%cOK - VALUE RETURNED IS 3\0”, 0x0c);
else
sprintf(str, “%cINVALID VALUE OF %d\0”, 0x0c, temp);

my_StoreScreen(SCREEN_TO_USE, str);
DisplayScreen(ScreenGroup, SCREEN_TO_USE, UpdateKeyboard, Idle);

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-8 Using NDC Exits


Examples of Exits
Example 1 - State Exit

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:

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-9


Examples of Exits
Example 1 - State Exit

PutValues(72L, 15L, 15L, 15L, 15L, 15L, 15L, 15L);


error = PerformNDCState('z', &NextStateNumber, &TableExitId);
break;
case FDK_B:
PutValues(15L, 15L, 15L, 15L, 15L, 15L, 15L, 255L);
error = PerformNDCState('S', &NextStateNumber, &TableExitId);
break;
case FDK_C:
PutValues(74L, 15L, 4L, 7L, 7L, 7L, 1L, 0L);
error = PerformNDCState('A', &NextStateNumber, &TableExitId);
break;
case FDK_D:
PutValues(75L, 15L, 4L, 7L, 7L, 7L, 0L, 5L);
error = PerformNDCState('T', &NextStateNumber, &TableExitId);
break;
case FDK_F:
PutValues(0L, 76L, 15L, 15L, 15L, 15L, 15L, 15L);
error = PerformNDCState('N', &NextStateNumber, &TableExitId);
break;
case FDK_G:
PutValues(77L, 255L, 15L, 15L, 15L, 255L, 255L, 101L);
error = PerformNDCState('F', &NextStateNumber, &TableExitId);
break;
case FDK_H:
PutValues(78L, 255L, 998L, 700L, 255L, 255L, 255L, 101L);
error = PerformNDCState('F', &NextStateNumber, &TableExitId);
Cancel_NextStateNum = (int)NextStateNumber;
break;
case FDK_I:
PutValues(79L, 255L, 999L, 700L, 255L, 255L, 255L, 101L);
error = PerformNDCState('F', &NextStateNumber, &TableExitId);
break;
case CANCEL:
terminate = TRUE;
error = 0;
break;
}
if (terminate != TRUE)
{
switch (error)
{
case 0:
sprintf(str, "%cTABLE EXIT ID: %lu%c"
"NEXT STATE NUMBER: %lu%c"
"PRESS CANCEL TO CONTINUE\0",
0x0c, TableExitId, 0x0d, NextStateNumber, 0x0d);
break;

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;

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-10 Using NDC Exits


Examples of Exits
Example 1 - State Exit

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;

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-11


Examples of Exits
Example 1 - State Exit

unsigned long NextStateNumber = 0;


unsigned long TableExitId = 0;
int terminate = FALSE;
int DeviceUsage[4];
int i = 999;
WORD tlength = 0;
char str[500];
BYTE temp_buf[200];
WORD saddr_list[2];
WORD exception;
WORD wait_time = INFINITE;

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);

while (terminate == FALSE)


{
i = 999;

DisplayScreen(ScreenGroup, ScreenNumber, UpdateKeyboard, Idle);


/* If CARDHOLDER_KEYBOARD not present then might as well system*/
/*escape. */
/* The following line will do that if cardholder_keyboard_dev = 0 */
AttachDev(cardholder_keyboard_dev, &detachable[0]);
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[0], tdata);
DetachDev(cardholder_keyboard_dev, detachable[0]);

response = (enable_rsp_type *) &tdata[0];


switch (response->tdata[0])
{
case FDK_A:
i = 0;
break;
case FDK_B:
i = 1;
break;
case FDK_C:
i = 2;
break;
case FDK_D:
i = 3;
break;
case FDK_F:
PutValues(45L, 15L, 0L, 0L, 1L, 1L, 0L, 0L);
PerformNDCState('I', &NextStateNumber, &TableExitId);
Cancel_NextStateNum = (int) NextStateNumber;
break;
case CANCEL:
terminate = TRUE;
break;

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-12 Using NDC Exits


Examples of Exits
Example 1 - State Exit

}
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]);

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-13


Examples of Exits
Example 1 - State Exit

}
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]);

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-14 Using NDC Exits


Examples of Exits
Example 1 - State Exit

DisplayScreen(ScreenGroup, ScreenNumber, UpdateKeyboard, Idle);


}
else
if (journal_printer_dev != 0)
{
strcpy(&send_msg.cdata[0], "MCRW 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 6:
LookUpDev("CASH_HANDLER", &cash_handler_dev);
if (cash_handler_dev != 0)
{
AttachDev(cash_handler_dev, &detachable[2]);
send_msg.clen = 8; /* Positions 0-3 indicate how many notes from each
cassette */
send_msg.cdata[0] = 1;
send_msg.cdata[1] = 1;
send_msg.cdata[2] = 1;
send_msg.cdata[3] = 1;
send_msg.cdata[4] = 1;
send_msg.cdata[5] = 2;
send_msg.cdata[6] = 3;
send_msg.cdata[7] = 4;
ADI_SEND_AND_RECEIVE(cash_handler_dev, CURRENCY_DISPENSE,
(BYTE far *) &send_msg,
temp_buf); (BYTE far *) &tran_msg, temp_buf, temp_buf, temp_buf,

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]);
}
}

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-15


Examples of Exits
Example 1 - State Exit

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). */
/* */
/****************************************************************************/

unsigned short pascal far _loadds State_*m(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;
unsigned long NextStateNumber = 0;
unsigned long TableExitId = 0;
send_msg_type send_msg;
enable_rsp_type *response;
int terminate = FALSE;
long ID_Int;
int NumIntBytes;
long ID_String;
int NumStringBytes;
long NewValue;
char str[500];
StateType;
ScreenNumber = (unsigned short) GetIntVal(IdStateData0);
Cancel_NextStateNum = (unsigned short) GetIntVal(IdStateData1);
NumIntBytes = (int) GetIntVal(IdStateData3);
NumStringBytes = (int) GetIntVal(IdStateData5);
ActiveFDKs = 0x7F; /* Only FDK_A to FDK_H */

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;

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-16 Using NDC Exits


Examples of Exits
Example 1 - State Exit

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));

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-17


Examples of Exits
Example 1 - State Exit

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);
}

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-18 Using NDC Exits


Examples of Exits
Example 1 - State Exit

/****************************************************************************/
/* */
/* 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);

outcome = RetrieveKeyboard(kbno, &kbdata, &kbsize);

/* Add any keyboard data found to screen to be displayed and store it */


strcpy(&str[i + 4], kbdata);
my_StoreScreen(ScreenNumber, str);

if (strstr(Data, "SANDKNK") || strstr(Data, "SANDKIK"))


{
/* Erase keyboard 200 */
sprintf(&rep[0],"\x1d" "200\0");

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-19


Examples of Exits
Example 1 - State Exit

my_StoreScreen(890, rep);
}
}

DisplayScreen(ScreenGroup, ScreenNumber, UpdateKeyboard, Idle);


LookUpDev("CARDHOLDER_KEYBOARD", &cardholder_keyboard_dev);
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];
if (response->tdata[0] == FDK_A)
{
ScreenToRetrieve = (unsigned short) GetIntVal(IdStateData2);
ScreenToStore = (unsigned short) GetIntVal(IdStateData3);

outcome = RetrieveScreen (ScreenGroup, ScreenToRetrieve, &Data, &DataSize);


memcpy(str, Data, (int) DataSize);
str[DataSize] = '\0';
/* If keyboard is to be erased set it to the present test keyboard number */
if ((str[0] == 0x1d) && (ScreenToRetrieve != 607))
strcpy(&str[1], "200\0");

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);

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-20 Using NDC Exits


Examples of Exits
Example 1 - State Exit

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;

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-21


Examples of Exits
Example 1 - State Exit

ScreenNumber = (unsigned short) GetIntVal(IdPrimExStateData0);


Cancel_NextStateNum = (unsigned short) GetIntVal(IdPrimExStateData1);
for (i=2; i<64; ++i)
IgnoreValue[i-2] = GetIntVal(IdPrimExStateData0 + (WW * 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);
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);
}

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

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-22 Using NDC Exits


Examples of Exits
Example 1 - State Exit

#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

#define BISYNC_3275_TXMAX 400


#define TC500_ASYNC_TXMAX 400
#define NCRISO_ASYNC_TXMAX 400
#define IBM_2265_ASYNC_TXMAX 400
#define HDLC_NRM_TXMAX 400
#define NCR_DLC_TXMAX 400
#define SNA_3624_TXMAX 400
#define SNA_LU0_TXMAX 512
#define X25_LAPB_TXMAX 1622
#define IBM_3600_TXMAX 256
#define ASYNC_3270_TXMAX 400
#define UTS20_TXMAX 400
#define TC500_SYNC_TXMAX 400
#define RS232_TXMAX 400
#define SNA_X25_TXMAX 1622
#define FBSS_SNA_TXMAX 400
#define LUA_SNA_TXMAX 400

/************************************************************************/

extern void far pascal _loadds DumpData(unsigned long DumpDataFromNdc,


unsigned long DumpDataToNdc);

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);

unsigned short pascal far _loadds State_1(unsigned char StateType);


unsigned short pascal far _loadds State_2(unsigned char StateType);
unsigned short pascal far _loadds State_3(unsigned char StateType);
unsigned short pascal far _loadds State_XXX(unsigned char StateType);
unsigned short pascal far _loadds State_j(unsigned char StateType);
unsigned short pascal far _loadds State_k(unsigned char StateType);
unsigned short pascal far _loadds State_l(unsigned char StateType);
unsigned short pascal far _loadds State_m(unsigned char StateType);
unsigned short pascal far _loadds State_n(unsigned char StateType);
unsigned short pascal far _loadds State_o(unsigned char StateType);
unsigned short pascal far _loadds State_y(unsigned char StateType);

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-23


Examples of Exits
Example 1 - State Exit

# 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 = exstates.h exconst.h exgener.h
COPT = /Zip /Os /Gs2 /Lp /Fc /Fm /AL /c /W3

[Link]: $*.c $(INCS) $(DEPENDS)


cl $(COPT) $*.c

[Link]: $*.c $(INCS) $(DEPENDS)


cl $(COPT) $*.c

[Link]: [Link] [Link] [Link] $(DEPENDS)


link @[Link]
implib [Link] [Link]

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],

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-24 Using NDC Exits


Examples of Exits
Example 2 - Virtual Controller Exit

Example 2 - Virtual Controller Exit A

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;

char far*TempPtr = *Message;


HOCOMMS_type far*incoming_msg = (HOCOMMS_type far*) *Message;
char far*NewMessage;
char far*TempNewPtr;
char far*ReplacePtr;
int fs;
int CurrentPos = 0;
int TotalLength = 0;
int NewLength = 0;
int AbsoluteOffset = 0;
int NewSize = 0;
int MesCheck = 0;
BYTE *vc_present;
char str[1000];
char pstbuff;
char data[20];
int datapos;
char *PrevPtr = TempPtr;

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-25


Examples of Exits
Example 2 - Virtual Controller Exit

AbsoluteOffset = ((sizeof(BYTE) * 8) + sizeof(WORD) + incoming_msg->offset);

/* Skip to the start of Message Data */


for (CurrentPos = 0; CurrentPos < (AbsoluteOffset - 1); CurrentPos++)
TempPtr++;

/* If the string “REPLY WITH VC BUFFERS” is found replace it with */


/* “REPLY WITHOUT BUFFERS” */
ReplacePtr = strstr(TempPtr, “REPLY WITH VC BUFFERS”);
if (ReplacePtr != NULL)
strncpy(ReplacePtr, “REPLY WITHOUT BUFFERS”, 21);

/* Skip 6 field separators */


for (fs = 0; fs < 6; TempPtr++)
{
CurrentPos++;
if (*TempPtr == FS)
fs++;
}

/* Calculate full length of message */


TotalLength = ((sizeof(BYTE) * 6) + sizeof(WORD) + incoming_msg->messagelen
+ incoming_msg->reserved_2[0] + incoming_msg->reserved_2[1]
+ incoming_msg->reserved_2[2] + incoming_msg->reserved_2[3]);

vc_present = calloc(TotalLength, sizeof(BYTE));


memset (vc_present, 0, (TotalLength * sizeof(BYTE)));

sprintf(str, “%cPRESS CNL TO CONTINUE%cCONTENTS OF ANY VC


BUFFERS:%c%c\0”,
0x0c, 0x0d, 0x0d, 0x0d);

MesCheck = ((sizeof(BYTE) * 6) + sizeof(WORD) + incoming_msg->messagelen);

/* Look for a field separator then a VC buffer ID of M,N,O,P,Q, or R */


while (CurrentPos < MesCheck)
{

if (*TempPtr == FS)
{

if ((*(TempPtr + 1) > ‘L’) && (*(TempPtr + 1) < ‘S’))


{

*/ vc_present[CurrentPos] = TRUE; /* Highlighting field separator position


TempPtr++;

pstbuff = *TempPtr; /* Setting the VC buffer ID found for displaying */

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))

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-26 Using NDC Exits


Examples of Exits
Example 2 - Virtual Controller Exit

{
data[datapos] = *TempPtr;
vc_present[CurrentPos] = TRUE;

PrevPtr = TempPtr;
TempPtr++;
CurrentPos++;
datapos++;
}

data[datapos] = ‘\0’;
TempPtr = PrevPtr;
CurrentPos--;

sprintf(&str[strlen(str)], “VC(%c): %s%c\0”, pstbuff, data, 0x0d);

}
}

TempPtr++;
CurrentPos++;
}

/* Displaying screen with any VC buffers found in the reply */


my_StoreScreen(SCREEN_TO_USE, str);
DisplayScreen(ScreenGroup, SCREEN_TO_USE, UpdateKeyboard, Idle);

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--;

NewMessage = malloc(NewLength * sizeof(BYTE));

TempNewPtr = NewMessage;
TempPtr = *Message;

/* Copy all data into new reply except for VC buffers */


for (CurrentPos = 0; CurrentPos < TotalLength; CurrentPos++)
{
if (vc_present[CurrentPos] != TRUE)
{
*TempNewPtr = *TempPtr;
TempNewPtr++;
}
TempPtr++;
}

TempNewPtr = NewMessage;

TempNewPtr += 2;
*TempNewPtr = (char) (incoming_msg->messagelen - (TotalLength -
NewLength));
TempNewPtr ++;
*TempNewPtr = 0x0;

free(*Message);

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-27


Examples of Exits
Example 2 - Virtual Controller Exit

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). */
/* */
/****************************************************************************/

extern unsigned char pascal far _loadds Incoming(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;
int terminate = FALSE;

/* Check message is transaction reply */


if ((in_msg->tdata[0] == ‘4’) && (in_msg->tdata[1] == FS))
{

DisplayScreen(ScreenGroup, SCREEN_INCOMING, UpdateKeyboard, Idle);

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);

/* Wait for keypress */


get_keys(cardholder_keyboard_dev, &detachable, tdata);

response = (enable_rsp_type *) &tdata[0];

switch (response->tdata[0])
{

case FDK_A:
/* Do Nothing */
break;

case FDK_B:
process_FDK_B(Message);

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-28 Using NDC Exits


Examples of Exits
Example 2 - Virtual Controller Exit

/* Wait for CANCEL key to continue*/


initialise_keys(cardholder_keyboard_dev, &send_msg);
enable_cancel_key(&send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);
get_keys(cardholder_keyboard_dev, &detachable, tdata);
break;

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 ‘]’). */
/* */
/* */
/***************************************************************************/

void AddVCBuffers(char far **Message, int NumberVCBuffers)


{
NDC_type *outgoing_msg = (NDC_type *) *Message;
NDC_type *NewMessage;
int Offset = 0;
int ExtraMemory = 0;
int i;

if (NumberVCBuffers != 7)
{

ExtraMemory = ((8 * NumberVCBuffers) + 1); /* 1 is for extra field separator */

NewMessage = malloc(sizeof(BYTE) * 3 + sizeof(WORD) +


outgoing_msg->messagelen + ExtraMemory);

memcpy(NewMessage, outgoing_msg,
(sizeof(BYTE) * 3 + sizeof(WORD) + outgoing_msg->messagelen));

Offset = NewMessage->messagelen - 31;


NewMessage->tdata[Offset] = FS;

for (i=0; i < NumberVCBuffers; i++)


{

if (i==0)
Offset = NewMessage->messagelen - 30;
else

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-29


Examples of Exits
Example 2 - Virtual Controller Exit

Offset = NewMessage->messagelen - 30 + (8 * i);

/* 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;

NewMessage = malloc(sizeof(BYTE) * 3 + sizeof(WORD) +


outgoing_msg->messagelen + ExtraMemory);

memcpy(NewMessage, outgoing_msg,
(sizeof(BYTE) * 3 + sizeof(WORD) + outgoing_msg->messagelen));

Offset = NewMessage->messagelen - 31;

/* Adds an illegal buffer of ‘]’ to the request */


NewMessage->tdata[Offset] = FS;
NewMessage->tdata[Offset + 1] = ‘]’;
NewMessage->tdata[Offset + 2] = ‘1’;
NewMessage->tdata[Offset + 3] = ‘2’;
NewMessage->tdata[Offset + 4] = ‘3’;
}

NewMessage->messagelen = NewMessage->messagelen + ExtraMemory;

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. */
/**************************************************************************/

void process_KEY_8(char far **Message)


{
unsigned short ScreenGroup = ‘0’;
unsigned short ScreenNumber = 0;
unsigned short UpdateKeyboard = 0;
unsigned short Idle = 0;
NDC_type *outgoing_msg = (NDC_type *) *Message;
int CurrentPos = 0;
int fs;
char str[500];
char data[9];

/* Skip 7 field separators */

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-30 Using NDC Exits


Examples of Exits
Example 2 - Virtual Controller Exit

for (fs = 0; fs < 7; CurrentPos++)


if (outgoing_msg->tdata[CurrentPos] == FS)
fs++;

/* Build up and display screen with opcode buffer */


strncpy (data, &(outgoing_msg->tdata[CurrentPos]), 8);
data[8] = 0;
sprintf(str, “%cOPCODE BUFFER: %s%c”
“PRESS CANCEL TO CONTINUE\0”, 0x0c, data, 0x0d);

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;

/* Turn reply class and subclass into illegal values */


outgoing_msg->category = ‘Z’;
outgoing_msg->tdata[0] = ‘Z’;

}
/****************************************************************************/
/* */
/* 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;

/* Checks if message is a transacton request */


if ((out_msg->category == ‘1’) && (out_msg->tdata[0] == ‘1’) &&
(out_msg->tdata[1] == FS))

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-31


Examples of Exits
Example 2 - Virtual Controller Exit

DisplayScreen(ScreenGroup, SCREEN_OUTGOING, 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_numeric_keys(&send_msg);
enable_enter_key(&send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);

/* Wait for keypress */


get_keys(cardholder_keyboard_dev, &detachable, tdata);

response = (enable_rsp_type *) &tdata[0];

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:

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-32 Using NDC Exits


Examples of Exits
Example 2 - Virtual Controller Exit

process_KEY_8(Message);

/* Wait for keypress */


initialise_keys(cardholder_keyboard_dev, &send_msg);
enable_cancel_key(&send_msg);
enable_enter_key(&send_msg);
activate_keys(cardholder_keyboard_dev, &send_msg);
get_keys(cardholder_keyboard_dev, &detachable, tdata);
DetachDev(cardholder_keyboard_dev, detachable);
return (1);
break;

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;

/* Check message is transaction reply */


if ((in_msg->tdata[0] == ‘4’) && (in_msg->tdata[1] == FS))

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-33


Examples of Exits
Example 2 - Virtual Controller Exit

DisplayScreen(ScreenGroup, SCREEN_VCIN2, UpdateKeyboard, Idle);

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);

/* Wait for keypress */


get_keys(cardholder_keyboard_dev, &detachable, tdata);

response = (enable_rsp_type *) &tdata[0];

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);
}

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-34 Using NDC Exits


Examples of Exits
Example 2 - Virtual Controller Exit

/****************************************************************************/
/* */
/* 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;

/* Check if message is a transaction request */


if ((out_msg->category == ‘1’) && (out_msg->tdata[0] == ‘1’) &&
(out_msg->tdata[1] == FS))
{

DisplayScreen(ScreenGroup, SCREEN_VCOUT2, UpdateKeyboard, Idle);

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);

/* Wait for keypress */


get_keys(cardholder_keyboard_dev, &detachable, tdata);

response = (enable_rsp_type *) &tdata[0];

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 */

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-35


Examples of Exits
Example 2 - Virtual Controller Exit

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);
}

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-36 Using NDC Exits


Examples of Exits
Example 2 - Virtual Controller Exit

/****************************************************************************/
/* */
/* 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”;

/* Check message is a Exit generated HO comms message */


if ((out_msg->category == ‘5’) && (out_msg->tdata[0] == ‘1’))
{

/* Position of 3 is after the subclass and 2 field separators */


memcpy(&out_msg->tdata[3], (BYTE*) initmes1, 12);

/* Pblock of 30, class byte, subclass byte, two field separators and data */
out_msg->messagelen = sizeof(BYTE) * 46;

return(0); /* Allows any other outgoing interceptors, if any to be used */


}

/****************************************************************************/
/* */
/* 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”;

/* Check message is a Exit generated HO comms message */


if ((out_msg->category == ‘5’) && (out_msg->tdata[0] == ‘1’))
{

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;

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-37


Examples of Exits
Example 2 - Virtual Controller Exit

return(2); /* No further processing if any other outgoing interceptors. */


}

/****************************************************************************/
/* */
/* 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”;

/* Check message is a Exit generated HO comms message */


if ((out_msg->category == ‘5’) && (out_msg->tdata[0] == ‘1’))
{

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;
}

return(2); /* No further processing if any other outgoing interceptors. */


}

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-38 Using NDC Exits


Examples of Exits
Example 2 - Virtual Controller Exit

/****************************************************************************/
/* */
/* 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;

/* Check message is a Exit generated HO comms message */


if ((out_msg->category == ‘5’) && (out_msg->tdata[0] == ‘1’))
out_msg->sender = 1;

return(2); /* No further processing if any other outgoing interceptors. */


}

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];

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-39


Examples of Exits
Example 2 - Virtual Controller Exit

} NDC_type;

/************************************************************************/

#define SCREEN_INCOMING 401


#define SCREEN_OUTGOING 402
#define SCREEN_VCIN2 411
#define SCREEN_VCOUT2 412

#define FS 0x1c

/************************************************************************/

void process_FDK_B(char far **Message);

extern unsigned char pascal far _loadds Incoming(char far **Message);

void AddVCBuffers(char far **Message, int NumberVCBuffers);


void process_KEY_8(char far **Message);
void process_KEY_9(char far **Message);

extern unsigned char pascal far _loadds Outgoing(char far **Message);

extern unsigned char pascal far _loadds VCOut2(char far **Message);

extern unsigned char pascal far _loadds VCIn2(char far **Message);

extern unsigned char pascal far _loadds HOOut1(char far **Message);

extern unsigned char pascal far _loadds HOOut2(char far **Message);

extern unsigned char pascal far _loadds HOOut3(char far **Message);

extern unsigned char pascal far _loadds HOIll(char far **Message);

# 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]: $*.c $(INCS) $(DEPENDS)


cl $(COPT) $*.c

[Link]: $*.c $(INCS) $(DEPENDS)


cl $(COPT) $*.c

[Link]: [Link] [Link] [Link] $(DEPENDS)

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-40 Using NDC Exits


Examples of Exits
Example 2 - Virtual Controller Exit

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],

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-41


Examples of Exits
Example 3 - Supervisor Exit

Example 3 - Supervisor Exit A

/****************************************************************************/
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];

/* Display MenuId and FunctionNo */


sprintf(str, “%cTHIS IS AN EXIT SCREEN%c”
“MENU: %d FUNCTION: %d%c”
“INTERFACE: %d%c”
“PRESS CANCEL TO CONTINUE\0”,
0x0c,0x0d, *MenuId, FunctionNo, 0x0d, *Interface, 0x0d);

my_StoreScreen(SCREEN_TO_USE, str);

DisplayScreen(ScreenGroup, SCREEN_TO_USE, UpdateKeyboard, Idle);

LookUpDev(“CARDHOLDER_KEYBOARD”, &cardholder_keyboard_dev);
AttachDev(cardholder_keyboard_dev, &detachable);

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-42 Using NDC Exits


Examples of Exits
Example 3 - Supervisor Exit

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);

/****************************************************************************/
/* */
/* 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);

DisplayScreen(ScreenGroup, SCREEN_MENU, UpdateKeyboard, Idle);

/* Display MenuId and FunctionNo */


sprintf(str, “%c%c MENU: %d\0”, 0x0d, 0x0d, *MenuId);
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);

/* 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])

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-43


Examples of Exits
Example 3 - Supervisor Exit

{
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);

/* Wait for keypress */


get_keys(cardholder_keyboard_dev, &detachable, tdata);
DetachDev(cardholder_keyboard_dev, detachable);

response = (enable_rsp_type *) &tdata[0];

if ((response->tdata[0] >= ‘1’) && (response->tdata[0] <= ‘4’))


*MenuId = response->tdata[0] - ‘1’;
else
*MenuId = 0;
break;

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);

/* Wait for keypress */


get_keys(cardholder_keyboard_dev, &detachable, tdata);
DetachDev(cardholder_keyboard_dev, detachable);

response = (enable_rsp_type *) &tdata[0];

if (response->tdata[0] = KEY_1)
*MenuId = 5;
else
if (response->tdata[0] = KEY_2)
*MenuId = 6;
else

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-44 Using NDC Exits


Examples of Exits
Example 3 - Supervisor Exit

*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;

sprintf(str, “%cSCREEN SWITCHED TO FRONT%c”


“PRESS CANCEL TO CONTINUE\0”,
0x0c,0x0d);
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);

/* Wait for keypress */


get_keys(cardholder_keyboard_dev, &detachable, tdata);
DetachDev(cardholder_keyboard_dev, detachable);

*MenuId = 0;
break;

case KEY_8:
*Interface = 1;

sprintf(str, “%cSCREEN SWITCHED TO REAR%c”


“PRESS CANCEL TO CONTINUE\0”,
0x0c,0x0d);

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);

/* Wait for keypress */


get_keys(cardholder_keyboard_dev, &detachable, tdata);

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-45


Examples of Exits
Example 3 - Supervisor Exit

DetachDev(cardholder_keyboard_dev, detachable);
*MenuId = 0;
break;

case KEY_9:
*MenuId = 7;
FunctionNo = 5;
break;

case KEY_0:
*Interface = 2;

sprintf(str, “%cSCREEN SWITCHED TO INVALID VALUE%c”


“PRESS CANCEL TO CONTINUE\0”,
0x0c,0x0d);

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);

/* Wait for keypress */


get_keys(cardholder_keyboard_dev, &detachable, tdata);

DetachDev(cardholder_keyboard_dev, detachable);
*MenuId = 0;
break;

default :
*MenuId = 0;
break;

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-46 Using NDC Exits


Examples of Exits
Example 3 - Supervisor Exit

/****************************************************************************/
/* */
/* 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) || (screen == BOP))


LookUpDev(“SYSTEM_DISPLAY”, &display_dev);
else
LookUpDev(“CARDHOLDER_DISPLAY”, &display_dev);

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]);

ADI_SEND_AND_RECEIVE(display_dev, ACTION_PRINT_STREAM, (BYTE far


*) &send_msg,
temp_buf, temp_buf, temp_buf, temp_buf, temp_buf);

DetachDev(display_dev, detachable[0]);

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-47


Examples of Exits
Example 3 - Supervisor Exit

if ((screen == EOP) || (screen == BOP))


LookUpDev(“OPERATOR_KEYBOARD”, &keyboard_dev);
else
LookUpDev(“CARDHOLDER_KEYBOARD”, &keyboard_dev);

send_msg.clen = 1;
send_msg.cdata[send_msg.clen - 1] = 0xF3;

AttachDev(keyboard_dev, &detachable[1]);

/* Define which keys are to be enabled */

ADI_SEND_AND_RECEIVE(keyboard_dev, DEFINE_KB_ENABLE, (BYTE *)


&send_msg,
tdata, temp_buf, temp_buf, temp_buf, temp_buf);

if ((screen == BOP) || (screen == EOP))


{
send_msg.clen = 1;
send_msg.cdata[0] = 1; /* Number of keys */
}
else
{
send_msg.clen = 4;
send_msg.cdata[0] = 0;
send_msg.cdata[1] = 0;
send_msg.cdata[2] = 1;
send_msg.cdata[3] = 0;
}

/* Enable the specified keys */

ADI_SEND_AND_RECEIVE(keyboard_dev, ENABLE_KEYBOARD_MODE,
(BYTE *) &send_msg,
temp_buf, temp_buf, temp_buf, temp_buf, temp_buf);

/* Wait for keypress */


get_keys(keyboard_dev, &detachable[1], tdata);

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;

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-48 Using NDC Exits


Examples of Exits
Example 3 - Supervisor Exit

enable_rsp_type *data;
int i;

LookUpDev(“SYSTEM_MONITOR”, &system_monitor_dev);

if (system_monitor_dev != 0)
{

send_msg.clen = 0;

ADI_SEND_AND_RECEIVE(system_monitor_dev, 7, (BYTE *) &send_msg,


tdata, temp_buf, temp_buf, temp_buf, temp_buf);

LookUpDev(“SYSTEM_DISPLAY”, &system_display_dev);

if (system_display_dev != 0)
{

data = (enable_rsp_type *) tdata;

displayID = NO_EOP_OR_BOP;

for (i=sizeof(BYTE); ((i < data->tlen) && (displayID == NO_EOP_OR_BOP));


i+=(sizeof(BYTE)*3))
{

saddr = (WORD) data->tdata[i + sizeof(BYTE)];


saddr = (WORD) ((saddr << 8) + (data->tdata[i]));

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

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-49


Examples of Exits
Example 3 - Supervisor Exit

/************************************************************************/
The Header File A

#define SCREEN_MENU 400

/* Values used for SST display */


#define UNKNOWN 0
#define NO_EOP_OR_BOP 1
#define BOP 2
#define EOP 3

/************************************************************************/

void pascal far _loadds Menu(unsigned short far *MenuId,


unsigned short FunctionNo,
unsigned char far *Interface);

void pascal far _loadds Screen(unsigned short far *MenuId,


unsigned short FunctionNo,
unsigned char far *Interface);

int DetermineDisplay(void);

void pascal far _loadds Rear(unsigned short far *MenuId,


unsigned short FunctionNo,
unsigned char far *Interface);

# 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

[Link]: $*.c $(INCS) $(DEPENDS)


cl $(COPT) $*.c

[Link]: $*.c $(INCS) $(DEPENDS)


cl $(COPT) $*.c

[Link]: [Link] [Link] [Link] $(DEPENDS)


link @[Link]
implib [Link] [Link]

exsup+dllstart+exgener
The Link File A [Link] /M/NOD,
exsup /LI,
/NOD:LLIBCE D:\MSC51\LIB\[Link] [Link] +
\pj015\code\ndcia\[Link]
[Link],

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-50 Using NDC Exits


Examples of Exits
Example 4 - Miscellaneous Exit

Example 4 - Miscellaneous Exit A

/****************************************************************************/
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];

DisplayScreen(ScreenGroup, SCREEN_POINT_1, UpdateKeyboard, Idle);

/* Display Interface value onscreen */


sprintf(str, “%c%c INTERFACE: %d\0”, 0x0d, 0x0d, Interface);
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);

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-51


Examples of Exits
Example 4 - Miscellaneous Exit

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);
}

/****************************************************************************/
/* */
/* 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;

DisplayScreen(ScreenGroup, SCREEN_POINT_2, UpdateKeyboard, Idle);


}

/****************************************************************************/
/* */
/* 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];

DisplayScreen(ScreenGroup, SCREEN_POINT_3, UpdateKeyboard, Idle);

/* 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);

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-52 Using NDC Exits


Examples of Exits
Example 4 - Miscellaneous Exit

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);

/* Wait for keypress */


get_keys(cardholder_keyboard_dev, &detachable, tdata);

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];

/* DeviceId displayed onscreen as a hex value */


sprintf(str, “%cCLEARING DEVICE FITNESS%c”
“DIG OF PRIOR DEVICE%c”
“CLEARED BY NDC+ IS %XH%c”
“WAIT TO CONTINUE\0”,
0x0c,0x0d, 0x0d, DeviceId,0x0d);

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;

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-53


Examples of Exits
Example 4 - Miscellaneous Exit

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];

/* DeviceId deisplayed onscreen as a hex value */


sprintf(str, “%cPHYSICALLY CLEARING DEVICE%c”
“DIG OF PRIOR DEVICE%c”
“CLEARED BY NDC+ IS %XH%c”
“PRESS ANY FDK TO CONTINUE\0”,
0x0c,0x0d, 0x0d, DeviceId,0x0d);

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);

/* Wait for keypress */


get_keys(cardholder_keyboard_dev, &detachable, tdata);

DetachDev(cardholder_keyboard_dev, detachable);
}

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-54 Using NDC Exits


Examples of Exits
Example 4 - Miscellaneous Exit

/****************************************************************************/
/* */
/* 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;

DisplayScreen(ScreenGroup, SCREEN_POINT_6, UpdateKeyboard, Idle);

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);

/* 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:
suspend = 1;
break;

case FDK_B:
suspend = 0;
break;
}

return(suspend);
}

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-55


Examples of Exits
Example 4 - Miscellaneous Exit

/****************************************************************************/
/* */
/* 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];

/* Only need to display the first 25 bytes */


strncpy(data, DataPtr, 25);
sprintf(str, “%cHO COMMS MSG RECEIVED%cDATA: %s\0”, 0x0c, 0x0d, data);
my_StoreScreen(SCREEN_TO_USE, str);

DisplayScreen(ScreenGroup, SCREEN_TO_USE, UpdateKeyboard, Idle);

/****************************************************************************/
/* */
/* 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;

DisplayScreen(ScreenGroup, SCREEN_POINT_8, 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);

/* Wait for keypress */


get_keys(cardholder_keyboard_dev, &detachable, tdata);

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-56 Using NDC Exits


Examples of Exits
Example 4 - Miscellaneous Exit

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;

DisplayScreen(ScreenGroup, SCREEN_POINT_8, 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);

/* Wait for keypress */


get_keys(cardholder_keyboard_dev, &detachable, tdata);

/* Doesn’t detach from keyboard to test Exits not handing over all devices */

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-57


Examples of Exits
Example 4 - Miscellaneous Exit

/****************************************************************************/
/* */
/* 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;

sprintf(str, “%cCLEARING DEVICE FITNESS%c”


“DIG OF PRIOR DEVICE%c”
“CLEARED BY NDC+ IS %XH%c”
“WAIT FOR LUNO TO BE WRITTEN\0”,
0x0c,0x0d, 0x0d, DeviceId,0x0d);

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;

sprintf(str, “%cCLEARING DEVICE FITNESS%c”


“DIG OF PRIOR DEVICE%c”
“CLEARED BY NDC+ IS %XH%c”
“WAIT FOR AMOUNT BUFFER CHANGE\0”,
0x0c,0x0d, 0x0d, DeviceId,0x0d);

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-58 Using NDC Exits


Examples of Exits
Example 4 - Miscellaneous Exit

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

#define SCREEN_POINT_1 403


#define SCREEN_POINT_2 404
#define SCREEN_POINT_3 405
#define SCREEN_POINT_4 406
#define SCREEN_POINT_5 407
#define SCREEN_POINT_6 408
#define SCREEN_POINT_8 410

/************************************************************************/

void pascal far _loadds Point_1(unsigned char Interface);


void pascal far _loadds Point_2(void);
void pascal far _loadds Point_3(unsigned char DestinationMode);
void pascal far _loadds Point_4(unsigned char DeviceId);
void pascal far _loadds Point_5(unsigned char DeviceId);
unsigned char pascal far _loadds Point_6(void);
void pascal far _loadds Point_7(char far *DataPtr);
void pascal far _loadds Point_8(void);
void pascal far _loadds Nodet_8(void);
void pascal far _loadds Illbyte_4(unsigned char DeviceId);
void pascal far _loadds Illstring_4(unsigned char DeviceId);

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits A-59


Examples of Exits
Example 4 - Miscellaneous Exit

# 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

[Link]: $*.c $(INCS) $(DEPENDS)


cl $(COPT) $*.c

[Link]: $*.c $(INCS) $(DEPENDS)


cl $(COPT) $*.c

[Link]: [Link] [Link] [Link] $(DEPENDS)


link @[Link]
implib [Link] [Link]

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],

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

A-60 Using NDC Exits


Glossary

Glossary 0

ADI Application Device Interface.


A
ADI-2 Application Device Interface between the application and the
S4 platform. Note NDC+ has its own application device interface,
NDC-ADI.
Advance NDC A version of NDC which runs in the APTRA Advance
ADE (Application Development Environment).
American Standard Code for Information Interchange (ASCII) This is a
computer code for representing alphanumeric characters.
ASCII See American Standard Code for Information Interchange.

CDM Coin Dispenser Module.


C
CEN Comité Européen de Normalisation (European Committee for
Standardization). Responsible for the XFS interface specification.
Clear State of Health An application to clear the State of Health
settings in the terminal.
Cold Start This is the first time the terminal is powered up, with no
previously downloaded software.
CSOH Clear State of Health.

Data Accessors Routines provided by NDC+ to allow Exits to access


D NDC+ shared data.
Device Identifier Graphic A unique identifier used to identify the
terminal components in status messages.
DIG Device Identification Graphic.
DLL Dynamically Linked Library.
Diskbuild/2 A development tool used to build load disks for loading
software on to the terminal.
Document Processing Module (DPM) The document processing module
that fits into an NCR Self-Service Terminal.
DPM See Document Processing Module.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits Glossary-1


Glossary

EBCDIC See Extended Binary-Coded Decimal Interchange Code.


E
EKC See Encryptor Keyboard Controller. Not supported by
Advance NDC.
Encrypting PIN Pad (EPP) A combined module containing both the
PIN Pad and the encryptor. Supersedes the Encryptor Keyboard
Controller. See Encryptor Keyboard Controller (EKC).
Encryptor Keyboard Controller (EKC) A secure module contained
within the keyboard used for encryption and decryption. Not
supported by Advance NDC.
EPP See Encrypting PIN Pad.
ETX An ASCII character denoting End of Transmission.
Exits The general term covering user defined states, supervisor
features, Virtual Controllers, and special synchronization routines
called Hooks.
Exit State A state defined and programmed by the user.
Exit Supervisor A supervisor function defined and programmed by
the user.
Extended Binary-Coded Decimal Interchange Code (EBCDIC) An eight-bit
character code.

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.

GS ASCII character denoting Group Separator.


G
High Order Comms The communications link between the Host and
H the terminal.
HO Comms See High Order Comms.
Hook General term for miscellaneous Exits detailed in MISCONT
file.
Host The central computer with which an SST communicates.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Glossary-2 Using NDC Exits


Glossary

IBM International Business Machines Inc.


I
IBM Loop Name of a communications protocol.
Intercept routine See Virtual Controller.

LED Light Emitting Diode.


L
LUNO Logical Unit Number.

MAC See Message Authentication Code.


M
Magnetic Card Reader/Writer (MCRW) This is used to read data from a
standard magnetic stripe card and, depending on the MCRW
variant, write data to one of the tracks on the card’s magnetic stripe.
MEI Media Entry/Exit Indicator.
Message Authentication Code (MAC) This is a method of protecting
messages which pass between the terminal and Central from
interference.
Message Co-ordination Number A security field that can be added to
an NDC+ Transaction Request message. The corresponding
Transaction Reply should have the same number.
MISCONT A rule file detailing miscellaneous Exits: Hooks.

NCR Direct Connect + An NCR application that works in conjunction


N with a Central system to perform self-service transactions.
NDC+ Native Mode NDC+ can run in two modes, NDC Native mode
which uses all of the terminals capabilities, and Diebold mode,
which emulates the Diebold application, and uses Diebold
compatible status messages.
NDC-ADI NDC Application Device Interface.
Non-Volatile Random Access Memory (NVRAM) This kind of RAM
retains information when the power is switched off.
NVRAM See Non-Volatile Random Access Memory.

OAR See Open Account Relationship.


O
Open Account Relationship (OAR) An equivalent name for an
Interactive Transaction Response (ITR).
OS/2 IBM operating system, used by NDC+.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits Glossary-3


Glossary

Rule File A file which tells NDC+ which supervisor functions or


R states are NDC+ standard, which are user written, and where the
user written routines are to be found. A rule file also gives
information about the chaining of hooks and Virtual Controllers.

S4 Self Service System Software.


S
S4 Diags S4 diagnostics program.
SNA Systems Network Architecture, a communication protocol.
Software Management An NCR application that co-resides in the
terminal and is used to manage software distribution.
SST Self Service Terminal.
STCONT Rule file which defines which states are Exits and which
are NDC core, and gives information about Exit DLLs and routine
names.
SUPCTR Rule file which defines which supervisor menus and
functions are Exits and which are standard NDC+, and gives
information about Exit Supervisor DLLs and functions.

Terminal Management (TM) An application that monitors the status of


T the terminal and ensures that it is open and ready for business for
the maximum possible time.
TI Tamper Indicating. An S4 service that informs the application if
the terminal is being tampered with.
Time Variant Number A security field that can be inserted in NDC+
Transaction Request and Status messages.
TM See Terminal Management.
TM Alert One of the Terminal Management products.
Top of Receipt Flag A security field that can be included in NDC+
Transaction Request messages. It indicates to the host the current
state of the terminal receipt printer.
TPA Transaction Processing Application (NDC Application).
TSN Transaction Serial Number.
TVN Time Variant Number.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Glossary-4 Using NDC Exits


Glossary

VC See: Virtual controller.


V
VCCONT A rule file used by Exits when Virtual Controllers are
added.
Virtual Controller (or Intercept Routine) A routine defined and
programmed by the user which can intercept and respond to
messages.

Warm Start This is when the terminal is powered up where


W previously downloaded software has been retained.
Windows NT Microsoft® Windows® New Technology operating
system.
Windows XP Microsoft® Windows® eXPerience Professional
operating system.

XFS Extensions for Financial Services. Application and service


X provider interface specifications from CEN.

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits Glossary-5


Glossary

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Glossary-6 Using NDC Exits


Index

Index 0

_ffree call back 9-15


Symbols _fmalloc call back 9-14

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

Card and buffer data 7-3, 9-21


C Chain sequences in virtual controllers 5-16
ClearDeviceName callout 9-17
ClearFitnessName callout 9-17
Clearing fitness hook 5-24
Close state processing 5-26
Communication between Host, Exits and NDC 3-2
Communications data 7-3, 9-31
Communications response time-out 10-2
Counters shared data 7-4, 9-38
Counts
last transaction 7-6
standard 7-6

Data accessors 7-7


D Data groups 7-3
Data sharing 1-5, 5-16
Debugging 5-29
Device sharing 1-6, 5-16, 6-2
error control 6-3
Devices
monitoring and reporting 6-4
Diebold mode 6-4
native mode 6-4
new 6-3
physically clearing 5-25
sharing 6-2

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits Index-1


Index

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

E0042 screen definition 9-46


E E0047 screen definition 9-46
EnteredCloseStateRoutine callout 9-19
Error control 6-3
Errors
handling VCCONT errors 5-22
start of day initialisation 5-3
Examples
how virtual controllers work 5-17
Miscellaneous Exit A-51
State Exit A-2
Supervisor Exit A-42
Virtual Controller Exit A-25
Exit States 5-4
Exit supervisors 5-10
Exit to Host message 3-3
Exits 5-2
error actions 5-2
exit states 1-7, 5-4
invocation 5-6
invocation of standard state 5-7
returned value 5-7
state letters 8-2
timing out 5-8
exit supervisors 1-7
invocation of exit states 5-12
menu numbers 8-1–8-2
menu option numbers 8-1–8-2
stop supervisor 5-14
transition into supervisor mode 5-13
transition out of supervisor mode 5-13
hooks 5-23
purpose 1-2
start of day 5-24
start of day initialisation 5-3
virtual controllers 1-8
Expanded Transaction Request message 3-6

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Index-2 Using NDC Exits


Index

Exposed data 1-10


[Link] file 9-10

File management interface 10-6


F Financial institution table data 7-3, 9-23
Forward compatibility 8-2
Advance NDC 8-1–8-2
menu numbers 8-1–8-2
menu option numbers 8-1–8-2
state letters 8-2
free call back 9-15
Free form message 3-11

GetIntVal call back 9-13


G GetStringVal call back 9-14

High Order Comms 2-3, 5-26


H Hooks 1-9, 5-23
clearing fitness 5-24
close state processing 5-26
high order comms message 5-26
physically clearing devices 5-25
start of day 5-24
suspend mechanism 5-25
Host 2-4
Host to Exit message 3-4

InboundMessageIntercept 9-17
I InitialiseExitRoutine callout 9-18

Last dispensed cash amount 4-8


L Last dispensed coin amount 4-8
Last message status 4-7
Last transaction counts 7-6
Last transaction serial number 4-7
Linking Exit DLLs 10-7
Logical unit number 4-2
LUNO
See logical unit number

MAC field selection load message 3-8


M MAC machine number 4-2
MAC number 7-4, 9-36
malloc call back 9-14
MCN
See message coordination number
Memory allocation 10-5
Menus 8-1–8-2
adding functions to an exit supervisor menu 5-11

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits Index-3


Index

adding new exit supervisor menus 5-11


replacing the initial NDC+ menu with an exit supervisor menu 5-11
Message
exit to host 3-3
expanded transaction request 3-6
free form 3-11
high order comms 5-26
host to exit 3-4
MAC field selection load 3-8
security 4-1
SNA translation, IBM loop/SNA ETX character 3-12
solicited status 3-10
status 3-9
Transaction Reply 3-6
unsolicited status 3-10
Message co-ordination number 4-3
Message mode options data 7-3, 9-35
Message security 3-8, 4-1
logical unit number 4-2
LUNO 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
trace 4-9
transaction status 4-7
last dispensed cash amount 4-8
last dispensed coin amount 4-8
last message status 4-7
last transaction serial number 4-7
Message size restrictions 3-2
Miscellaneous shared data 7-6, 9-44
MISCMULT 5-27
MISCONT 5-23
MISCONT file 9-7, 9-17
Multitasking 10-3

NDC+ 1-3, 2-3


N new environment 1-5
previous environment 1-3
NDC+ screens 7-10
NDC-ADI 1-3, 2-3
[Link] file 9-13
NDCDATA.H 9-20
NDCSuspendName callout 9-18
New devices 6-3
New message classes 3-3
New screen definitions 9-46

OutboundMessageIntercept callout 9-17


O

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Index-4 Using NDC Exits


Index

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

Read numerical item 7-7


R Read string item 7-7
Relevance of Using NDC Exits to Advance NDC xxiii
Replacing the initial NDC+ menu with an exit supervisor menu 5-11
Restrictions on message size 3-2
Restrictions on the use of devices 6-2
RetrieveKeyboard 9-10
RetrieveScreen 9-10
Rule files 5-2, 9-2
MISCONT 9-7, 9-17
STCONT 9-2, 9-16
SUPCTR 9-5, 9-17
VCCONT 9-7, 9-17

Screen data 7-3, 9-32


S Screen definition
E0042 9-46
E0047 9-46
T93 9-46
T94 9-46
Screens 9-46
Security
message security 4-1
Selective MAC 4-4
SendStatus 9-11
SendUnformatedData 9-11
SetDigitalAudioPath 9-12
SetDigitalAudioPath callout 9-19
Shared data 1-10, 7-2, 9-20
accessor id 9-20
card and buffer data 7-3, 9-21
communications data 7-3, 9-31
counters 7-4, 9-38
data accessors 7-7
dump data 7-8
read numerical item 7-7
read string item 7-7
write numerical item 7-7
write string item 7-8
document processing module 7-3
document processing module (DPM) shared data 9-25

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits Index-5


Index

downloaded configuration options 7-4, 9-36


financial institution table data 7-3, 9-23
MAC number 7-4, 9-36
message mode options data 7-3, 9-35
miscellaneous 7-6, 9-44
NDCDATA.H 9-20
printer data 7-3, 9-28
screen data 7-3, 9-32
state control data 7-3, 9-29
timer data 7-3, 9-33
Sharing
data and devices 5-16
Solicited status message 3-10
Standard counts 7-6
Standard state
invocation from exit state 5-7
Start of day 5-24
Start of day hook 5-24
State control data 7-3, 9-29
StateRoutineName callout 9-16
Status message 3-9
STCONT 5-4
file structure 5-5
STCONT file 9-2, 9-16
Stop supervisor 5-14
StoreScreen 9-12
Structure of Terminal Application 2-2
SUPCTR 5-10
SUPCTR file 9-5, 9-17
SupEntryName callout 9-18
Supervisor mode
stop supervisor 5-14
transition into 5-13
transition out of 5-13
SupervisorRoutineName callout 9-17
SupExitName 9-18
SupExitName callout 9-18
SupStopName callout 9-19
Suspend 5-25

T93 screen definition 9-46


T T94 screen definition 9-46
Terminal Application structure 2-2
Time variant number 4-5
Timer data 7-3, 9-33
Timing out exit state 5-8
Top of receipt flag 4-6
Trace 4-9
Transaction Reply message 3-6
Transaction status 4-7
last dispensed cash amount 4-8
last dispensed coin amount 4-8

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Index-6 Using NDC Exits


Index

last message status 4-7


last transaction serial number 4-7

Unsolicited status message 3-10


U Using NDC Exits, relevance to Advance NDC xxiii

VCCONT file 5-17, 9-7, 9-17


V error handling 5-22
Virtual controllers 1-8, 5-15
chain sequences 5-16
how they work 5-17
rules 10-2

Write numerical item 7-7


W Write string item 7-8

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Using NDC Exits Index-7


Index

Confidential and proprietary information of NCR.


Unauthorised use, reproduction and/or distribution is strictly prohibited.

Index-8 Using NDC Exits


User Feedback Form

Title: Using NDC Exits


Number: B006-5102-D000 Issue 3 Date: July 2007

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.

Ease of use 5 4 3 2 1 0 5 = Excellent


4 = Good
Accuracy 5 4 3 2 1 0
3 = Adequate
Clarity 5 4 3 2 1 0 2 = Fair
1 = Poor
Completeness 5 4 3 2 1 0
Organization 5 4 3 2 1 0 0 = Not applicable
Appearance 5 4 3 2 1 0
Examples 5 4 3 2 1 0
Illustrations 5 4 3 2 1 0
Job performance 5 4 3 2 1 0
Question resolution 5 4 3 2 1 0
Overall satisfaction 5 4 3 2 1 0

Indicate the ways you feel we could improve this publication.

❑ Improve the table of contents ❑ Add more/better quick reference aids


❑ Improve the overview/introduction ❑ Add more examples
❑ Improve the organization ❑ Add more illustrations
❑ Improve the index ❑ Add more step-by-step procedures
❑ Make it less technical ❑ Add more troubleshooting information
❑ Make it more concise/brief ❑ Add more detail
Write any additional comments you may have below and on additional sheets, if necessary. Include page
numbers where applicable.

Use the following address to send your comments to us electronically:


E-mail: userfeedback@[Link]

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

NCR Financial Solutions Group Ltd.


Information Solutions, Software and Services
Kingsway West
Dundee
Scotland
DD2 3XX

You might also like