ATM Monitoring
ATM Monitoring
ATM Monitoring
Under Supervision of
By
Amjad Mohieldeen Bushra Awad
To
Department of Electrical and Electronic Engineering
Faculty of Engineering and Architecture
University of Khartoum
July 2009
Dedication
To my parents
To my supportive family
To my beloved country
i
Acknowledgement
Thanks to Dr. Iman Abu-Almaali for her patient, support and helpful
advice
ii
Table of Contents
Dedication .................................................................................................................................. i
Acknowledgement ..................................................................................................................... ii
Table of Contents...iii
List of Abbreviations ................................................................................................................. v
List of Figures .......................................................................................................................... vi
Abstract ................................................................................................................................... vii
.................................................................................................................................. viii
Chapter One Introduction .......................................................................................................... 1
1.1 Introduction ..................................................................................................................... 1
1.2 Importance of ATMs ........................................................................................................ 1
1.3NDC+ ................................................................................................................................. 2
1.4 Problem Definition .......................................................................................................... 3
1.5 Objectives ........................................................................................................................ 3
1.6 Methodology and Tools ................................................................................................... 3
1.6.1 Methodology.................................................................................................. 3
1.6.2 Tools .............................................................................................................. 4
1.7 Thesis Layout ................................................................................................................... 4
Chapter Two LITERATURE REVIEW .................................................................................... 5
2. 1 About ATM...................................................................................................................... 5
2.1.1 Historical background.................................................................................... 5
2.1.2 Hardware ....................................................................................................... 6
2.1.3 Work scenario ................................................................................................ 8
2.1.5 Financial networks......................................................................................... 9
2.2 The standard Financial Transaction Card Originated Messages format ....................... 10
2.2.1 Message Type Identifier (MTI) ................................................................... 12
2.2.2 Bit Maps ...................................................................................................... 13
2.2.3 Data Elements .............................................................................................. 13
2.3 Host Security Module (HSM) ......................................................................................... 13
2.4 The NDC+ Software System ........................................................................................... 14
2.4.1 Terminal Application................................................................................... 14
2.4.2 Central Application...................................................................................... 14
2.4.3 NDC+ Modes............................................................................................... 15
2.4.4 Creating a NDC+ System ............................................................................ 16
2.4.4 Changeable data in the NDC+1 ................................................................... 16
2.4.5 NDC+ Operation ......................................................................................... 17
2.4.6 Unrequested Status Messages...................................................................... 18
iii
2.5 Types of ATM Errors ..................................................................................... 19
Chapter Three Design and Implementation ............................................................................. 20
3.1 Introduction .................................................................................................... 20
3.2 Problem Definition ........................................................................................................ 20
3.3 Problem solution ........................................................................................................... 20
3.4 Server client model of the software system ................................................................. 20
3.5 Analysis modeling of the problem ................................................................................. 22
3.5.1 Data Objects Modeling ................................................................................ 22
3.5.2 Scenario Based Analysis ............................................................................. 23
3.6 System design ................................................................................................................ 24
3.6.1 Data Abstraction .......................................................................................... 24
3.7 Components Design....................................................................................................... 25
3.6.4 Interfaces Design ......................................................................................... 26
3.6.5 Architectural Design .................................................................................... 28
3.6 Implementation ............................................................................................................. 29
3.6.1 Implementation Tools .................................................................................. 29
Data Sets ............................................................................................................... 31
Chapter Four Results ............................................................................................................... 35
4.1 System modes ............................................................................................................... 35
4.2 Testing: .......................................................................................................................... 36
4.2.1 The connection ............................................................................................ 36
4.2.2 Data reader................................................................................................... 37
4.2.3 CUT_STAT testing...................................................................................... 39
4.2.3 Sending SMS: .............................................................................................. 44
4.2.4 Timer testing:............................................................................................... 45
Chapter 5 Conclusion & Comments ........................................................................................ 46
5.1 Results ........................................................................................................................... 46
5.2 Technical Limitations ..................................................................................................... 46
5.3 Future work: .................................................................................................................. 47
References ............................................................................................................................... 48
Appendix A: ATM Monitoring System Code ......................................................................... 49
Appendex B: The Softwares help document .......................................................................... 57
Appendex C: The Softwares Forums (Interface) ................................................................... 59
iv
List of Abbreviations
ATM Automated Teller Machine
v
List of Figures
Figure 1.1 2
Figure 2.1 6
Figure 2.2 11
Figure 2.3 12
Figure 3.1 21
Figure 3.2 22
Figure 3.3 23
Figure 3.4 24
Figure 3.5 25
Figure 3.6 29
Figure 3.7 32
Figure 3.8 33
Figure 4.1 36
Figure 4.2 37
Figure 4.3 39
Figure 4.4 40
Figure 4.5 41
Figure 4.6 42
Figure 4.7 43
vi
Abstract
ATM is one of the most significant computerized services that recently banks provide.
The advantages of ATM that it allows customers to access their bank accounts to
make cash withdrawals (or credit card cash advances) and check their account
balances as well as purchasing mobile cell phone prepaid credit.
In order to make this service useful ATMs should be repaired as soon as any error
happens to it, to do so the team which is responsible of repairing ATMs should be
notified with these errors as soon as they happen. In Sudans ATM network the
monitoring is done manually which leads to a lot of delays in the repairing process.
The aim of this project is to develop a software system which is purpose is to monitor
the status of the ATMs and to forward errors to the repair team immediately.
Furthermore the errors that occur to the ATMs are contained in an Oracle database
server. So the monitoring system should access the Oracle database server to read the
errors database. After that it should analyze the read database to check if there is new
error or not. If new errors found it should send them to a GSM Modem one by one.
The system was designed according to standard client server design model in the
software engineering science. The system was developed as set of components to
make it easy to design, understand and implement. The system was implemented
using Visual Basic 2008, .Net framework and ADO.net. The system was implemented
to work under the environment of Windows operating system.
Testing codes had been used to validate the system correctness and the satisfaction of
it intended requirements. The obtained results clearly reflected the project success.
vii
.
.
.
.
.
.
.
.
. Visual Basic .Net Framework
. ADO.net . Windows
.
.
viii
Chapter One Introduction
1.1 Introduction
An automated teller machine (ATM) is a device that combines computerized
communications functions to provide the customers of a financial institution with
access to financial transactions in a public space without the need for a human clerk
or bank teller. On most modern ATMs, the customer is identified by inserting a plastic
ATM card with a magnetic stripe or a plastic smartcard with a chip that contains a
unique card number and some security information, such as an expiration date.
Security is provided by the customer entering a personal identification number (PIN).
ATMs are placed not only near or inside the premises of banks, but also in locations
such as shopping centers/malls, airports, grocery stores, petrol/gas stations,
restaurants, or any place large numbers of people may gather. These represent two
types of ATM installations: on and off premise. On premise ATMs are typically more
advanced, multi-function machines that complement an actual bank branch's
capabilities and thus more expensive. Off premise machines are deployed by financial
institutions and also ISOs (or Independent Sales Organizations) where there is usually
just a straight need for cash, so they typically are the cheaper mono-function devices.
Most ATMs are connected to interbank networks, enabling people to withdraw and
deposit money from machines not belonging to the bank where they have their
account or in the city where their accounts are held.
1
Figure 1.1: ATM system Elements
Most host processors can support either leased-line or dial-up machines. Leased-line
machines connect directly to the host processor through a four-wire, point-to-point
dedicated telephone line. Dial-up ATMs connect to the host processor through a
normal phone line using a modem and a toll-free number, or through an Internet
service provider using a local access number dialed by modem. Leased-line ATMs are
preferred for very high-volume locations because of their throughput capability and
dial-up ATMs are preferred for retail merchant locations where cost is a greater factor
than throughput. The initial cost for a dial-up machine is less than half that for a
leased-line machine. The monthly operating costs for dial-up are only a fraction of the
costs for leased-line. The host processor may be owned by a bank or financial
institution, or it may be owned by an independent service provider. Bank-owned
processors normally support only bank-owned machines, whereas the independent
processors support merchant-owned machines.
1.3NDC+
Mostly ATM systems use the NDC+ software system which is a terminal control
application from NCR. It is table-driven and can be customized to meet the wanted
requirements.
The NDC+ software system is made up of two parts:
l. Terminal application
II. Central application. Although which is not supplied from the corporation.
2
1.4 Problem Definition
In Sudan every bank takes care of its own ATMs by manually sending a car
periodically to take a look at its ATMs to troubleshoot them if necessary or to see if
there is a lack in paper or money or there is some kind of security violation.
Furthermore this process will take a lot of time to cover all the ATMs, cost a lot of
money since some of the covered ATMs may not need maintenance and costs a lot of
effort to be done perfectly.
1.5 Objectives
The project's objective is to make a monitoring system for all the distributed ATMs in
Sudan for a company. The monitoring system objectives are:
1. Sniff the error messages that come from the ATMs.
2. Transform the sniffed NDC+ error message to text message.
3. Route the text message into Mobile system.
4. The laptop or small pc should send the error message to the operator
that is responsible for troubleshooting in the area of the ATM that sent
the error message.
4. Create software on the laptop or small PC that will forward the text message to the
company's Operator.
3
1.6.2 Tools
1. Fully functional ATM testing environment (ATM and Switch (host computer)).
4
Chapter Two LITERATURE REVIEW
2. 1 About ATM
ATMs are made to reduce the time and effort that you need to retrieve your bank
account to make a financial transaction and to make this service available any time
(24 hours a day).
The first mechanical cash dispenser was developed and built by Luther George
Simjian and installed in 1939 in New York City by the City Bank of New York, but
removed after 6 months due to the lack of customer acceptance [6].
Thereafter, the history of ATMs paused for over 25 years, until De La Rue developed
the first electronic ATM, which was installed first in Enfield Town in North London,
United Kingdom on 27 June 1967 by Barclays Bank. This instance of the invention is
credited to John Shepherd-Barron, although various other engineers were awarded
patents for related technologies at the time. Shepherd-Barron was awarded an OBE in
the 2005 New Year's Honours List. The first person to use the machine was the
British variety artist and actor Reg Varney. The first ATMs accepted only a single-use
token or voucher, which was retained by the machine. These worked on various
principles including radiation and low-coercivity magnetism that was wiped by the
card reader to make fraud more difficult. The machine dispensed pre-packaged
envelopes containing ten pounds sterling. The idea of a PIN stored on the card was
developed by the British engineer James Goodfellow in 1965 [6].
In 1968 the networked ATM was pioneered in Dallas, Texas, by Donald Wetzel who
was a department head at an automated baggage-handling company called Docutel.
5
In 1995 the Smithsonian's National Museum of American History recognized Docutel
and Wetzel as the inventors of the networked ATM.ATMs first came into wide UK
use in 1973; the IBM 2984 was designed at the request of Lloyds Bank. The 2984 CIT
(Cash Issuing Terminal) was the first true Cash point, similar in function to today's
machines; Cash point is still a registered trademark of Lloyds TSB in the U.K. All
were online and issued a variable amount which was immediately deducted from the
account [6].
2.1.2 Hardware
6
2.1.2.1 Input
ATM composed of the following input devices:
1. Card reader - The card reader captures the account information stored on the
magnetic stripe on the back of an ATM/debit or credit card. The host
processor uses this information to route the transaction to the cardholder's
bank.
2. Keypad - The keypad lets the cardholder tell the bank what kind of transaction
is required (cash withdrawal, balance inquiry, etc.) and for what amount. Also,
the bank requires the cardholder's personal identification number (PIN) for
verification. Federal law requires that the PIN block be sent to the host
processor in an encrypted form.
2.1.2.2 Output
ATM composed of the following output devices:
1. Display screen - The display screen prompts the cardholder through each step
of the transaction process. Leased-line machines commonly use a
monochrome or color CRT (cathode ray tube) display. Dial-up machines
commonly use a monochrome or color LCD.
2. Receipt printer - The receipt printer provides the cardholder with a paper
receipt of the transaction.
7
2.1.2.2 Rest of components
The following ATM components implement the security and control of input and
output devices:
1. Safe or the Vault it contain the money.
2. ATM CPU contain the hardware and the software of the ATM that organize its
function.
3. Rollers.
4. Suction Cups.
5. Suction device.
Work scenario means how the machine would respond when a specific order is
chosen by a bank client.
8
2.1.3 .2 Depositing checks or cash
When a bank client reaches the ATM to make a deposit the following steps would
occur:
a. After the users ATM card and the personal identification number (PIN) are
approved the ATM screen displays set of available options.
b. Once a deposit envelope is filled out and inserted into the deposit slot, it is pulled
by the rollers into a box.
c. Before it is dropped into the box, the date, users account number, and deposit total
is printed on the envelope.
d. A receipt or complete bank statement is printed, and the transaction is recorded [2].
Most ATMs are connected to interbank networks, enabling people to withdraw and
deposit money from machines not belonging to the bank where they have their
account or in the country where their accounts are held (enabling cash withdrawals in
local currency) [6].
In order to allow a more diverse range of devices to attach to their networks, some
interbank networks have passed rules expanding the definition of an ATM to be a
terminal that either has the vault within its footprint or utilizes the vault or cash
drawer within the merchant establishment, which allows for the use of a scrip cash
dispenser [6].
ATMs typically connect directly to their ATM Controller via either a dial-up modem
over a telephone line or directly via a leased line. Leased lines are preferable to POTS
9
lines because they require less time to establish a connection. Leased lines may be
comparatively expensive to operate versus a POTS line, meaning less-trafficked
machines will usually rely on a dial-up modem. That dilemma may be solved as high-
speed Internet VPN connections become more ubiquitous. Common lower-level layer
communication protocols used by ATMs to communicate back to the bank include
SNA over SDLC, TC500 over X.25, and TCP/IP over Ethernet [6].
ISO 8583 Standard for Financial Transaction Card Originated Messages - Interchange
message specifications is the International Organization for Standardization standard
for systems that exchange electronic transactions made by cardholders using payment
cards [5].
ISO 8583 defines a message format and a communication flow so that different
systems can exchange these transactions. The vast majority of transactions made at
Automated Teller Machines use ISO 8583 at some point in the communication chain,
as do transactions made when a customer uses a card to make a payment in a store. In
particular, both the MasterCard and Visa networks base their authorization
communications on the ISO 8583 standard, as do many other institutions and
networks [5].
10
The placement of fields in different versions of the standard varies; for example, the
currency elements of the 1987 and 1993 versions are no longer used in the 2003
version, which holds currency as a sub-element of any financial amount element. As
of writing, ISO 8583:2003 has yet to achieve wide acceptance [5].
Figure 2.2: The interaction between the E-switch and the HBI [5].
11
Figure 2.3: ISO 8583 message format.
This is a 4 digit numeric field which classifies the high level function of the message.
A Message Type Indicator includes the ISO 8583 version:
12
2.2.2 Bit Maps
The ISO 8583 uses the bit map technique as an index of data elements that are
present. The bit map structure shows if a data element is present or absent.
There are two types of bit maps:
13
5. Key management.
6. Internet Commerce [5].
The terminal application gathers transaction details from the cardholder and sends
these details in a Transaction Request message to Central. When the terminal receives
a Transaction Reply command from Central, it completes the transaction. The
terminal application responds to Terminal commands from Central, such as Go-In-
Service or Go-Out-Of-Service, and requests for information, such as tallies, by
sending Solicited Status messages to Central. An unexpected event can be reported to
Central using an Unsolicited Status message [5].
The Central application receives Transaction Request messages from the terminal,
and determines whether the transaction should be approved or declined. It controls the
terminal by sending Terminal commands to it and acting on responses received.
The Central application must be able to decode and act on the messages it receives
from the terminal. The Central application must also be able to code messages in the
form that the NDC+ software in the terminal understands. When you switch the
terminal on, after loading it with the NDC+ terminal software, it sends a power-up
message to Central. Central downloads any necessary data to the terminal in a series
of messages. After each message is sent, the terminal sends an acknowledgement to
Central [3].
14
When Central has sent all the download data successfully, it will put the terminal in
service. When the terminal processes a transaction, it gathers the details from the
cardholder and card, and sends the information in a Transaction Request message to
Central. Central sends a Transaction Reply command, and the terminal completes the
transaction [5].
If a fault occurs, the terminal sends a message to Central and waits for a further
Transaction Reply command before completing the transaction. Once the transaction
has been completed successfully, the terminal sends a message to Central to confirm it
[5].
15
2.4.4 Creating a NDC+ System
When you create an NDC+ system you will find that there are two distinct tasks
involved:
l. Creating the customization data.
II. Creating the Central control application.
State Tables:
These contain the sequence of states that determine how the terminal processes
transactions.
Screens: 1
These are displayed while the cardholder is using the terminal.
Keyboards:
These define the type of keyboard which is used. This may be a fixed physical
keyboard layout or a touch screen keyboard which is displayed on the screen.
Configuration Parameters 1
These are local configuration parameters, such as camera control, Amount Buffer
size, card reader/writer error thresholds, and timers.
16
Creating a NDC+ System:
The Central control application uses the following commands and messages:
Terminal Commands 1
These send instructions to the terminal.
17
If the next state specified is invalid or undefined, due to either the state table or the
Transaction Reply specifying a state that has not been downloaded, the transaction
flow continues from a default close state. If the Digital Audio Service is configured,
then in certain states the cardholder keyboard will be audibly echoed as the cardholder
uses it. This is turned off in sensitive states those concerned with PIN Entry and those
in which the echo on the cardholder display is shown by asterisks [5].
The Digital Audio Service can also make various announcements during transaction
processing. When the default close state is executed, it will complete the cardholder
transaction by delivering a receipt or statement, and delivering or capturing the card
as specified. The number of the last state executed is displayed in the top left hand
corner of the CRT screen. This allows you to check the parameters of the last state
executed to find out which state the terminal was attempting to execute. From this you
can specify the missing state and include it in the download. You customize the state
by assigning values to its parameters [5].
To build a state flow, you select different state types and place them in the application
flow by linking the states together - one state references another with one or more of
its parameters or entries. When you have finished customizing the state tables, Central
downloads the information to the terminal in Customization Data commands [5].
Unrequested Status messages are used to report any change of condition at the
terminal. These include:
I. Recognition of an external event.
II. Device errors.
III. Supplies problems. Unsolicited status messages do not require a reply from
Central.
They are sent under the following conditions:
I. Power failure. A message is sent on power-up.
II. An external event is detected. This includes bin inserted/removed, alarm activated,
supervisor keys and switches.
18
The reporting of supervisor switch changes is delayed if a card is inserted l A device
fault is detected as a result of processing a Transaction Reply command, but the fault
condition does not require Central recovery action. This means that Transaction Reply
processing can continue as if no fault had occurred l A device fault is detected which
is not the result of processing a Transaction Reply command [5].
For example, printer/MCR errors l If an alarm is activated during a power failure or
communications loss, a message is sent when power or communications are restored l
If supervisor/supply switch values are changed while off-line, the last change of both
switches is reported when communications are restored l If the message mode option
is set to enable the Cancel key while a Statement and Wait function is being carried
out and the cardholder presses the Cancel key. Device fault status information varies
according to whether Native or Diebold Emulation mode status reporting is used [5].
a. Fatal Errors: Errors that fully disables the ATMs service such as:
1. User Command.
2. Loss of Communication.
3. System Malfunction Message Handling Error.
4. System Malfunction Expression Handling.
5. Error.
6. Cash Handler Error.
7. Journal Error.
8. Encryptor Error.
9. Supervisor Mode Entry.
10. Sensor Activated.
b. Functional Errors: Errors that disables one of the ATMs supporting services [3].
19
Chapter Three Design and Implementation
3.1 Introduction
Design is all about understanding the problem and demonstration of how it should be
solved. So for a design to be done the problem must be known first. Then this
problem must be analyzed to extract the data objects. Further a model for the solution
will be developed using diagrams and methods such as object oriented modeling.
20
transaction server since the client sends a request that invokes remote procedures at
the server site. The remote procedures are a set of SQL statements. A transaction
occurs when a request results in the execution of the remote procedure with the result
transmitted back to the client.
The ATM monitoring system software will act as Client for the Oracle database
server. This client will initiate a connection to the server to read the errors table as
mentioned previous. This puts a spot on one of the biggest advantage of the client
server systems is the enables the roles and responsibilities of a computing system to
be distributed among several independent computers that are known to each other
only through a network.
Furthermore all the data is stored on the servers, which generally have far greater
security controls than most clients. Servers can better control access and resources, to
guarantee that only those clients with the appropriate permissions may access and
change data.
21
Figure 3.2: The internal construction of S/C software [4].
Data objects modeling focuses on the data domain to define data objects at the lowest
level of abstraction. A data object is an object which is described by a set of attributes
and will be manipulated within the system [4].
22
Attributes of the data object:
Object: Errors Table.
Number of Records
Number of Fields
Fields names
Use-Cases are a scenario that describes a thread of usage for a system. They are
simply an aid to defining what exists outside the system (actors) and what should be
performed by the system [4].
External characters (such as: people, device) represented in the use cases are
categorized into the two types:
Figure 3.3: The Use-Case diagram for the ATM monitoring system.
23
3.6 System design
The design is the step after defining the attributes (data) and the behavior (procedures)
and their relationship (components). The design gives a general view of how data
objects, components, and overall architecture should be implemented. So it starts with
data abstraction then adds procedures to them to design components then shows the
overall software architecture [4].
Figure 3.4: The Project workspace block diagram (The red blocks are the projects
blocks).
Data abstraction is defining (naming) the data collection that describes a specific data
object [4]. The following is the abstraction of the data object in this software system:
a. Errors Table: Contains the records that are wanted to be sent to the repair
team.
b. Trace Number: Contains the number of the last record sent or the record
that the systems administrator wants the monitoring to start from.
24
3.7 Components Design
Components design gives more details about the components in the system
focusing on their behavior. The system should contain the following
components:
1. Data reader: It should check if there is new record in the Errors table.
2. Timer: It should invoke the data reader every certain period.
3. SMS sender: It receives its input from the Data reader and transforms it according
to certain pattern to text and sends it to a GSM modem.
4. Last checked error: contain the trace number. This trace number is the id of the last
record checked by the software system.
The relationship between these components is that the timer should invoke the
last checked error component every given time. When the last checked is
invoked it invokes the data reader component and passes the value of the trace
number to it. The data reader reads the errors database and compares the id of
last error with the trace number to find if there is new error or not. If the data
reader detects a new error it invokes the SMS sender and passes error record
fields to it. The SMS sender should transform the received error record fields
to SMS message to be sent.
25
3.6.4 Interfaces Design
By referring to the diagram of the projects work space and noting that the software
project would be running on the small computer block we conclude that the system
needs the following interfaces:
26
b. The wait function which will invoke the data reader object (output interface).
a. The check for last status function which will invoke the last checked error object
(output interface).
b. The current status which contains the output of the last error checked object (input
interface).
c. The pass the error fields function which will pass the fields of the error record the
SMS object (output interface).
Pass current status which will pass the number of last error checked to the data
reader object.
4. SMS component
This component contains variables that will receive the values of the error record to
construct the SMS message.
27
3.6.5 Architectural Design
The design is the overall structure of the software and the ways in which that structure
provides conceptual integrity for a system [4]. The architecture of the system is as
follows: the main program invokes a timer component which has a Wait function that
waits for a certain time interval and then invokes the data reader object. The data
reader object will first invoke its connect function which would initiate a connection
to the Oracle database and reads the errors database and passes it to the find last error
number function. The find last error checked function will find the id of the last error
in the database then this component will invoke the last checked error component.
The last checked error component only passes the last error checked number by the
function pass current status to the compare function in the data reader component. The
compare function will compare between the last errors number which was found by
the find last error number function and the number passed from the last checked error
component. If the compare finds a difference between the two it enters a loop for the
difference between the two numbers in which it passes the fields of each new error to
the SMS sender component. The SMS sender component will transform the error
record fields to a predefined SMS pattern by the transform into SMS pattern function.
After that SMS sender component will invoke the pass SMS to the GSM modem
function which will send the previously formed SMS to the GSM modem.
28
Figure 3.6: Architectural design using object oriented design structure.
3.6 Implementation
After the problem solution is well defined in the systems design, the implementation
phase comes in which the design should be transformed into code.
The tools which were used in the implementation are the following:
3.6.1.1 ODBC
Open Data Base Connectivity, a standard database access method developed by the
SQL Access group in 1992. The goal of ODBC is to make it possible to access any
data from any client application, regardless of which database management system
(DBMS) is handling the data. ODBC manages this by inserting a middle layer, called
a database driver, between an application and the DBMS. The purpose of this layer is
29
to translate the application's data queries into commands that the DBMS understands.
For this to work, both the application and the DBMS must be ODBC-compliant -- that
is, the application must be capable of issuing ODBC commands and the DBMS must
be capable of responding to them.
3.6.1.2.1 ADO.net
It is used to access the ODBC data service through which it can access the oracle
database.
1. Data provider
These classes provide access to a data source, such as a Microsoft SQL Server or
Oracle database and OLEDB data provider. Each data source has its own set of
provider objects, but they each have a common set of utility classes:
30
Data Reader: Used to efficiently process a large list of results one record at a time.
It allows records to be accessed in a read-only, forward-only mode, i.e., records
have to be accessed in sequential order; they can neither be randomly accessed nor
can a record which has been processed previously be accessed again(which will be
used here since it is only needed to read the database not to change it).
Data Sets
31
h. A Constraint describes an enforced property of the database, such as the
uniqueness of the values in a primary key column. As data is modified any
violations that arise will cause exceptions.
First of all an ODBC driver was installed and configured on the client side to be
able to read the oracle database that is in the server side as shown in the figure
below.
This made the ODBC ready to receive connection request from ADO.net.
Using Visual Basic.net 2008 the software was made of the parts which was mentioned
in the design section earlier in this chapter with a small alter in the trace object which
contained in the new arrangement access the part which reads the database to find out
last error number.
32
Figure 3.8: ATM Monitoring System Interface.
As the banker starts the execution of the software the previous figure pops out but it
wont start to monitor immediately. It will give the operator time to alter settings
using edit menu to change the mobile phones for the repairing teams. After changes
are made if wanted the operator now can click start on the execution menu to start
monitoring.
This will invoke the timer which contains the main procedure of the program which
will create objects in the following sequence:
It is the first object which will be created and it has two main functions:
It will find out the last error number in the Oracle database by connecting to the
ODBC driver and executing a data Reader.
33
b. Read Previous Trace number:
It will pass these two parameters two the data Reader Object which is invoked next.
It will receive the two trace numbers and it will enter a loop between the two. In this
loop it will start with the most previous error and go on until it reads all the errors that
happened in the time interval of the timer. Every time the loop is invoked it creates a
connection to the ODBC executes a Data Reader and reads the records of the error
and put them into variables It will pass this variables to the SMS object which is
invoked next.
3. SMS object:
This object will receive the error record fields from the data Reader object and it will
transform them into predefined text pattern and it will send it to the serial port with
the settings of the SMS service (meant by the serial port which the GSM modem is
connected to).
34
Chapter Four Results
ATM Monitoring System was deployed to work with the latest versions and
technologies such as 3GPP modem, Oracle 11g, Visual Basic.net 2008, ADO.net,
and ODBC 11. So in the following parts shows how the steps of how the software
was tested.
The value for this parameter is typically obtained from the combination of the
DB_NAME and DB_DOMAIN parameters (DB_NAME.DB_DOMAIN) in the
initialization parameter file, but the value can also contain any valid name used
by clients to identify the service.
35
5. Optional to add the trace number (the record of the last error number field in the
database primary key)
4.2 Testing:
Note that the following windows in the figures that are in this section are not a part
of the actual system. They are only provided to show how the different parts of the
software implementation.
The testing procedure started by checking the connection from the client side to the
Oracle database using ODBC driver. The ODBC driver needs to be configured with
the Oracle database server information to be able to connect to it. The first entered
parameters to the ODBC are not completed so the ODBC driver will not be able to
connect to the Oracle database server as the following figure shows the output of
when a test connection is invoked to the ODBC:
36
In this time the correct parameters are passed to the system:
The data reader reads the fields of the error records from the oracle server through
the ODBC and the oracle client.
37
The database layout is as follows in the figure:
The data reader only needs to read the records that the CUT_STATUS equal to 2
because the CUT_STATUS field means the following:
CUT_STATUS Meaning
1 In service
2 Out of service
38
4.2.3 CUT_STAT testing
First adding record to oracle database in the server that the CUT_STAT equal 1:
The figure 4.3 above shows the the oracle database after adding new error record
with CUT_STATUS = 1 .
39
The datareader no response:
If the orcale database was tested by the data reader with its current status (one
record that has CUT_STATUS = 1) the data reader should ignore this record as the
followign figure shows:
40
If a new record was added to the database with CUT_STATUS = 2 as the following
figure shows:
41
If the database was tested using the same procedure as above the data reader now
will read the fields of the error record and it will find that it has CUT_STATUS =1
so it will show its fields as the following figure shows:
42
Then the data reader was tested to make sure that it is able to read errors even when
the administrator of the Oracle database is editing it. The following figure shows
that the trace number was read while the administrator is making changes:
The following figure shows the Detail_Reason codes and there corresponding
meaning.
43
Bank CodeBank Name mobile
1 BOS Reference Bank
1881 Export Development Bank 09xxxxxxxx
1901 Faisal Islamic Bank
1921 Sudanese Agricultural Bank
1941 Bank of Khartoum
1961 El Nilein Industrial Development Bank Group
1981 Saving & Social Development Bank
2001 Sudanese French Bank
2021 Tadamon Islamic Bank
2041 Sudanese Islamic Bank
2061 Al Baraka Sudanese Bank
2081 Saudi Sudanese Bank
2101 Workers National Bank
2121 Al Shamal Islamic Bank
2141 Commercial & Real State Bank
2161 Farmers Commercial Bank
2181 Animal Resources Bank
2201 Financial Investment Bank
2281 Islamic Co-Operative Development Bank
2681 Blue Nile Mashreg Bank
3481 Omdurman National Bank
3101 Bank of Sudan
3501 Industerial Development Bank
3521 Al Salam Bank
3541 Sudanese Egyptian Bank
5561 CSC LEBANON
3961 Capital Bank
4361 The National Bank of Sudan
4761 123 EGYPT
6361 Elgazeera Sudanese Jordanian Bank
5961 Byblos Bank
6761 Banque Sahelo-Saharinne
The SMS object will send the error SMS after converting error record fields to a
predefined text pattern to make it understandable by the person who responsible for
repairing the error.
44
The pattern of the SMS:
The bank name (45 characters): terminal number (12 character): error reason (50)
:time (8 character).
Example:-
El Nilein Industrial Development Bank Group: WONMGK004: System Malfunction
Expression Handling Error: 1:00 AM.
For the timing two timers were tested. The first one is a built- in timer in the visual
basic. The second one is implemented from scratch. The results of testing the built in
timer:
It shows that the timer which is used will add addition time to the set time which will
make a delay in the monitoring process which is in average 12.5%. Note that a new
timer was implemented to solve this problem. The new timer showed significant
improvement to the system. It has nearly 1% percent error.
45
Chapter 5 Conclusion & Comments
5.1 Conclusion
The project results are satisfying all the objectives and goals. The system has
advantage of network protocol independent which is very great in advantage in server
client systems. The software is lightweight, easy to manage, and efficient.
The lightweight feature comes from using XML file to contain the database of the
phone numbers for the banks instead of using other files for database (such as
Microsoft Access or SQL database) which will make the software take more power to
execute by the CPU.
The default Visual Basic.net 2008 timer which was used in the implementation
of the project wasnt accurate (it has 12.5% delay as mentioned previously).
46
5.3 Future work:
The following features could be added to the system in the future:
1. A new web feature for the software to be able to send feed back to an email.
This tool will make the it able to connect the operators of the system with its
creators.
2. New feature should be added to the system view strip menu to view the
statistics of the errors.
47
References
1. Globalis International, Sophisticated Banking Machines for Cash Despenser Applications,
[Online] www.globalis.com,
Accessed on 29/12/2009.
Accessed on 4/12/2009.
5. Kingsway West, , NCR NDC+ Programmers Reference Manual. s.l. : NCR Corporation,
2001.
Accessed on 12/12/2009.
48
Appendix A: ATM Monitoring System Code
Imports Oracle.DataAccess.Client
Imports Oracle.DataAccess.Types
'This is the Data Reader Compenent which is ment to read the ATM Transaction's
table in the Oracle db that contains
'the status of all the components in the ATM network.The output of this component
(object) is the fields of the
',Error_Type:CUT_STAT,Reason:Details Reason
Sub Orc_connection() 'this function sub is made to make try works and to be
invoked to read from the db
49
'definition of the username and password of the db
conn.ConnectionString = _
"Data Source=(DESCRIPTION=" _
+
"(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=kamil)(PORT=1521))
)" _
+
"(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl.kamil)));"
_
+ "User Id=scott;Password=kamil;"
conn.Open()
parmuser.OracleDbType = OracleDbType.Char
parmuser.Value = TxtUsername
parmpass.OracleDbType = OracleDbType.Char
parmpass.Value = TxtPassword
50
Dim cmd As New OracleCommand(sql, conn)
cmd.CommandType = CommandType.Text
Dim dr As OracleDataReader
dr = cmd.ExecuteReader()
cmd.CommandType = CommandType.Text
dr.Read()
conn.Close()
Error_type = dr.Item("CUT_STATUS")
Bank_Code = dr.Item("BNK_CODE")
'ATM_ID = dr.Item("TRM_NAME")
Reason = dr.Item("DETAIL_REASON")
End If
conn.Dispose()
End Sub
End Class
Imports Oracle.DataAccess.Client
Imports Oracle.DataAccess.Types
Imports System.IO
51
Public Class Trace_Number
+
"(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=kamil)(PORT=1521))
)" _
+
"(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl.kamil)));"
_
+ "User Id=scott;Password=kamil;"
Try 'is made to catch any exception that may occure while working with the db
Connection.Open()
'invoke the member function open of the Connection object which was
initiated before
parmuser.OracleDbType = OracleDbType.Char
52
Dim TxtUsername As String = "scott"
parmuser.Value = TxtUsername
parmpass.OracleDbType = OracleDbType.Char
o2Command.CommandType = CommandType.Text
DR1 = o2Command.ExecuteReader()
DR1.Read()
'Trace_N now contains the ID (number) of the last error in the table
Connection.Close()
Connection.Dispose()
Catch ex As Exception
53
System.Windows.Forms.MessageBox.Show(ex.ToString())
End Try
End Sub
Sub Check_if() 'checks if there is previously saved trace number or not. if not it
creates one
If My.Computer.FileSystem.FileExists("E://Trace.txt") Then
TraceStreamReader.Close()
TraceStreamWriter.WriteLine(Trace_N)
TraceStreamWriter.Close()
Else 'if there is no Trace file that means the monitoring process just started and
there is no previous value
54
Dim TraceStreamWriter2 As System.IO.StreamWriter
TraceStreamWriter2.WriteLine(Trace_N)
TraceStreamWriter2.Close()
End If
End Sub
End Class
Imports System.IO.Ports
Sub sno()
SMS_Sender.Open()
SMS_Sender.Write("AT")
SMS_Sender.WriteLine("AT+CMGF=1" & n) 'set command message
format to text mode(1)
Select Case code
Case "1881"
SMS_Sender.WriteLine("AT+CMGS= + b1 ")
Case "1882"
SMS_Sender.WriteLine("AT+CMGS= + b2 ")
Case "1883"
SMS_Sender.WriteLine("AT+CMGS= + b3 ")
Case "1884"
SMS_Sender.WriteLine("AT+CMGS= + b4 ")
Case "1885"
SMS_Sender.WriteLine("AT+CMGS= + b5 ")
Case "1886"
SMS_Sender.WriteLine("AT+CMGS= + b6 ")
Case "1887"
SMS_Sender.WriteLine("AT+CMGS= + b7 ")
55
Case "1888"
SMS_Sender.WriteLine("AT+CMGS= + b8 ")
Case "1889"
SMS_Sender.WriteLine("AT+CMGS= + b9 ")
Case "1890"
SMS_Sender.WriteLine("AT+CMGS= + b10 ")
Case "1891"
SMS_Sender.WriteLine("AT+CMGS= + b11 ")
Case "1892"
SMS_Sender.WriteLine("AT+CMGS= + b12 ")
Case "1893"
SMS_Sender.WriteLine("AT+CMGS= + b13 ")
Case "1894"
SMS_Sender.WriteLine("AT+CMGS= + b14 ")
Case "1895"
SMS_Sender.WriteLine("AT+CMGS= + b15 ")
Case "1896"
SMS_Sender.WriteLine("AT+CMGS= + b16 ")
Case "1897"
SMS_Sender.WriteLine("AT+CMGS= + b17 ")
Case "1898"
SMS_Sender.WriteLine("AT+CMGS= + b18 ")
Case "1899"
SMS_Sender.WriteLine("AT+CMGS= + b19 ")
Case "1900"
SMS_Sender.WriteLine("AT+CMGS= + b20 ")
Case "1901"
SMS_Sender.WriteLine("AT+CMGS= + b21 ")
Case "1902"
SMS_Sender.WriteLine("AT+CMGS= + b22 ")
Case "1903"
SMS_Sender.WriteLine("AT+CMGS= + b23 ")
Case "1904"
SMS_Sender.WriteLine("AT+CMGS= + b24 ")
Case "1905"
SMS_Sender.WriteLine("AT+CMGS= + b25 ")
Case "1906"
SMS_Sender.WriteLine("AT+CMGS= + b27 ")
Case "1907"
SMS_Sender.WriteLine("AT+CMGS= + b28 ")
Case "1908"
SMS_Sender.WriteLine("AT+CMGS= + b29 ")
End Select
SMS_Sender.WriteLine("An Error occured in +A_ID and the error
type is +E_t and its reason is +Rsn")
SMS_Sender.Close()
End Sub
End Class
56
Appendex B: The Softwares help document
You need to insure that you installed ODBC driver that is compatible with the Oracle
database that you are working with and it is configured as the following figure shows:
Then press the Test Connection button and write down the user name and password of
the Oracle server if the verification successes then proceed with executing the
software if not make reconfigure your network connection and make sure that the
firewall is disabled.
The main forum that pops out after the splash screen consists of the following:
57
1. File menu strip:
It consists of two items Execute and Exit. When you click on Execute the
monitoring process will start and the errors will be sent to the repairing teams.
Exit will close the program.
It contains the data the settings that could be altered by the supervisor of the
system to make sure that the system satisfies the wanted goals. The settings
that could be altered are: the phone numbers of the repairing teams, timer
interval, and COM port for the GSM modem.
System requirement:
1. Windows XP Professional, Windows server 2003, and any later versions of
Windows.
2. .Net framework 3.5.
3. GSM modem connected to one of the COM ports of the computer.
58
Appendex C: The Softwares Forums (Interface)
When the Edit menu strip is pressed the three options appear: Phone Numbers,
Modem, Timer. Each one when it is pressed it shows a new screen. The Timer shows
the Time interval forum. The Modem shows the com forum. The Phone Numbers
59
shows the Enter The Phone numbers of the banks forum. Each of the previous
forums is mentioned later in this section.
It enables the operator to change the interval of the timer by entering the value
in the text box in ms.
60
The Enter The Phone numbers for the banks forum:
It contains text boxes for phone numbers to be entered in and two buttons. The
first button is the Apply button it saves the entered values. The second button
Ok saves the entered values and hides this forum.
61
The File strip menu:
It contains two options Execute and Exit. Execute starts the monitoring
process. Exit will hide this forum and close the program.
The help strip menu will show the Help Document which was mentioned
earlier.
62