www.ibm.comLANDP Webpage

LANDP Passbook Printer Practical Tutorial

Introduction

This tutorial will take you through the process of printing into a passbook using an IBM 47X2 Financial Printer. You will also be shown how to make use of the magnetic strip on the back of the passbook to store customer information and positional data, such as the next empty line on the page.

This tutorial makes use of the customization information in the LANDP Financial Printer Beginners Tutorial. You should run through this tutorial before continuing.

The Passbook and MSRE Printer Format Definitions

In the COMMON.SPC you will see two FORM47X2 vectors called PASSBOOK and MAGSTRIP. These specify the parameters for the passbook pages and magnetic strip.

In the PASSBOOK format definition, the following parameters were specified:

CPI=12
LPI=6
The text size is configured for 20 characters-per-inch and 6 lines-per-inch.
PAGESIZE=23 
LINELEN=50
The printing area inside the passbook is 50 characters wide and 23 lines high.
VRTOFFSL=7
HRZOFFS=11
The printing area is offset 7 lines from the top of the page and 11 characters from the left of the page.
FOLDBEG=10
FOLDSKIP=4
The passbook has a horizontal fold, and the printer should avoid printing on the fold area, on 11th to 14th lines.

The MAGSTRIP format definition is simpler, and specifies an IBM 3604/4704 encoding mode on a 144mm wide strip.

A Typical Application for the Passbook

Passbooks are often used by financial organisations to print a customer's account transactions. A typical scenario would be for the application to read the account number and next empty line from the magnetic strip and write any recent account transactions into the book. The application could issue a request for the teller to turn the page when the end of the current page has been reached. Finally, the value of the next empty line could be re-encoded onto the magnetic strip.

Printing into the Passbook

When testing with a passbook, it is useful to stick a piece of paper over the printing area to prevent the book from becoming unusable.

If you have not already done so from the previous printer tutorial, start LANDP and the SVPCPRB program, and issue an IN request to the SPV server.

To begin the printing session, issue an OP request to the printer server as follows. The R flag in the Request Parameter Area signifies that we wish to use the MSRE functions of the printer aswell.

Next we must use the DF function to register our intention to use the PASSBOOK and MAGSTRIP printer formats. Since we will be performing both printing and MSRE operations in the same session, we must call DF twice, once to configure the printer for the PASSBOOK format, and once to configure the MSRE part of the printer.

The next step would be for the application to read from the magnetic strip on the passbook. To do this, first open the passbook and insert it horizontally into the left side of the printer, with the open page facing up.

Issue the RD request to read the magnetic strip as follows. The printer will draw the passbook into it and scan the magnetic strip. The result will be returned in the Reply Data Area.

It is possible that the magnetic strip on the passbook is blank. In this case you will recieve an I3 error return code. Another possibility is that you have incorrectly inserted the passbook into the printer.

The next step is to print a line of text into the passbook. Issue a WR command to the printer server as follows. The LF character, ASCII value0x10, can be used to advance to the line you wish to print on.

To print another line, simply issue a second WR function.

Having written some lines, the application would encode the current line onto the magnetic strip. To do this, you issue a WR function with the MSRE flag set as follows. The data to be encoded is placed in the Request Data Area.

The session has now been completed. To close the session and return the passbook, you should issue a CL function as follows.

Handling Common Errors

Printers rely on complicated mechanisms and work with fallible paper. Because of this they can easily run into trouble. The LANDP Financial Printer server can return a number of runtime errors, known as "Intervention" errors, that require operator intervention before printing can continue.

By far the most common return code is I7, which indicates that there is no paper present in the printer. The operator may also press the STOP button on the printer, which ejects the paper and issues an I5 return code if a printing operation was in progress.

A printing application should be written to handle all errors in a sensible manner. Since some errors can occur at any time, you should always check the return code of every LANDP function you issue to ensure it was successful.

The easiest way to handle an error in many cases is to close the printing session and restart it, although in some cases it may be necessary to recover from the error in mid-session to avoid spoiling a passbook for example.

Introduction New to LANDP? Make the most of LANDP Solving LANDP problems Feedback