Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeEnglishEspañolContact

The text of a manual · part 6 of 37

TCL Terminal Control Language Programmer's Manual, pages 51 to 60

Pages 51 to 60 of 362

The original document is the PDF (13 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

For the VeriFone Tranz 330

Page 51 read from a scan by OCR; it may hold reading errors

Example 2: Message Format Flag 6

2. Terminal Basics

Command Description

S Begin dialing F3 = Command to display fixed prompt 3, "AMOUNT OF SALE”

K4 Command to accept input from the keypad only; accept only numeric characters and force two decimal places

K accept input from keypad only

4 the type of input the terminal should accept; numbers only with two forced decimal places (used when entering dollar amounts).

Note: When the second parameter of a K command is not stated, the terminal uses the default value, 60 characters, except for type 4, which has a default value of 10 characters.

The control string for message format flag 6 uses the VISA second generation protocol with the Luhn check digit, and requires the user to enter a transaction code before entering the account number. The control string associated with message format flag 6 is:

QF4K2.2F1E5.2CSF2K2.411CSR28F3K4R28 or

Q F4 K2.2 F1 E5.2 C S F2 K24 11 C S R28 F3 K4 R28 Where: Command Description

Q The write control character (WCC); a special code inserted into the transmit packet telling the host which protocol to use (single or multiple-transaction protocol) and how the account number was entered (from cardreader or keypad)

F4 Command to display fixed prompt 4, "ENTER TRAN CODE.” The F command signals a fixed prompt; the number following the F identifies which fixed prompt the terminal should display.

K2.2 | Command to accept input from the keypad only; valid inputs include up to 2 numeric characters

K accept input from keypad only

2 the type of input the terminal should accept; numeric only

2 the maximum number of characters to accept

Page 52 read from a scan by OCR; it may hold reading errors

TCL Programmer’s Manual

Command Description

F1 Command to display fixed prompt 1, "ENTER ACCOUNT #.”

E5.2 Command to accept numeric input from either the cardreader or the keypad, and skip 5 steps if input was received from the cardreader.

E input command which tells the terminal to accept data from either the cardreader or the keypad

5 the number of commands to skip when input is received from the cardreader

2 the type of input the terminal should accept; numeric only

Note: The E command can have a third parameter specifying the number of characters the terminal should accept for this input. When the third parameter is not included the terminal uses the default value of 60 characters.

Cc Command to verify the Luhn check digit; verifies the validity of the account number

S Begin dialing F2 Command to display fixed prompt 2, "EXPIRY DATE MMYY"

K2.4, command to accept input from the keypad only; valid inputs include up to 4 numeric characters

K_ accept input from keypad only

2 the type of input the terminal should accept; numeric only

4 the maximum number of characters to accept 11 Command to skip one command C Verify Luhn check digit S Begin dialing R28 Command to append a field separator into the destination buffer

R_ append literal string or an ASCII decimal value to the destination buffer

28 the ASCII decimal equivalent for a field separator

Page 53 read from a scan by OCR; it may hold reading errors

2. Terminal Basics

Command Description

F3 Command to display fixed prompt 3, "AMOUNT OF SALE"

K4 Command to accept input from the keypad only; accept only numeric characters and force two decimal places

K accept input from keypad only

4 the type of input the terminal should accept; numbers only with two forced decimal places (used when entering dollar amounts).

Note: When the second parameter of the K command is not stated, the terminal uses the default value, 60 characters, except for type 4, which has a default value of 10 characters

R28 Command to append a field separator into the destination buffer

Page 54 read from a scan by OCR; it may hold reading errors

TCL Programmer’s Manual

Page 55 read from a scan by OCR; it may hold reading errors

Designing the Application

Defining Your Memory Map

Memory Management Guide

3. Programming Basics

Now that you have a better understanding of the terminal and its operating system, you should be ready for your application development. This section will lead you through the steps of designing, writing and debugging your application.

The first step in developing an application program is the design phase. You will need to create a detailed description of each operation the terminal is to perform, identifying which keys must be pressed to initiate the operation. Remember, transactions (operations requiring communications) may be triggered by a single key press or card swipe while functions (operations that do not require communications) require two keys to be pressed in sequence.

Your application description should also include a list of prompts to be displayed, the proper prompt sequence for each operation, and the type (alphabetic, numeric, or alphanumeric) and source (cardreader, bar code reader or keypad) of operator input. If the application requires local data storage, you should also define the data storage format.

To support your design, you may also want to develop flow charts and pseudo code. You can then use the flow charts as an application "outline" or guide, and use the pseudo code as the base for developing the entire application code.

Once you have the design specification, you will need to allocate blocks of memory to your different operations to ensure the terminal has sufficient memory to accommodate the application program.

The terminal has memory locations reserved for dedicated control strings, parameter data, and special functions. (See Appendix A for a complete memory map with a summary of these locations.) In addition to these locations, you will need to select memory locations for data and other control strings.

Since data collection requires a large amount of extraction, formatting, and manipulation of data, you will often find your control strings exceeding the 120 character capacity of a single memory location. To accommodate lengthy control strings, the terminal allows you to chain to other control Strings, which can be stored in any logical block of general purpose memory locations, at your discretion. While reviewing the terminal's memory map, define sections (or blocks) of memory locations for your various operations and control strings.

To help you optimize use of memory, VeriFone offers the following "Memory Management by Location" guide. Please remember, this guide is offered only as an example, it does not represent stringent memory management rules.

Page 56 read from a scan by OCR; it may hold reading errors

Do You Have Enough Memory?

Writing the Application

TCL Programmer’s Manual

Note: In the table below, TRANZ 380 corresponding memory locations have 4-digits (40 = 0040, 113 = 0113, etc.).

Table 3-1. Memory Management by Location

Memory Location Description 0-39 Reserved for the operating system.

Note: Although memory locations 20-29 are normally reserved for login strings, you can use these locations for regular control strings or data if no login strings will be used in your application.

40-99 Used for special prompts, temporary data, flags, and counters. It's a good idea to store data that will be accessed often by the control strings in these locations as you can call the location using "nn" instead of "nnn’, saving one character space. For example, you can use *L44 to call memory location *L044.

x00-x12 Reserved for host parameters.

113-199,

213-255 Available for any type of control strings.

256-299, Used for control strings, not including self-modified

313-399 Code that redirects control within this range of memory locations.

Note: VeriFone suggests you use these locations for control strings on the XL only due to variable size limitations. TRANZ 330/380 locations up to 949 (except those reserved for host parameters) are available for any type of control strings. 950 - 999 are reserved for the operating system.

1050/1999 General records (TRANZ 380 only).

At this point, you should know whether there is sufficient memory available in the terminal to accommodate your application. Once this determination is made, you can complete your specification.

Should you determine the terminal cannot accommodate your application, contact your VeriFone sales representative. Your representative can show you one of the VeriFone full-feature terminals that offers more memory and more capability.

Using your design specification, identify the different "modules” or subroutines required for the application. Most applications will require three types of modules: transaction modules (transaction control strings initiated from location x07/0x07), special function modules (function control strings initiated from locations 031/0031 to 036/0036, and 039/0039), and support modules (subroutines called up by the transaction and function control strings for account ranging, accumulator updates, building data capture detail records, data entry, building the transmit buffer, etc.).

Once you've identified the modules required for your application, you will be ready to begin writing the source code.

Page 57 read from a scan by OCR; it may hold reading errors

Tips for Writing Source Code

Control String Basics

3. Programming Basics

* You can use any text editor to write source code; the only requirement is the editor must be able to store the text in a standard MS-DOS ASCII disk file format. VeriFone recommends using an IBM PC or 100% compatible computer and word processor with a non-document or text editing mode. Terminal application development tools supported by VeriFone will only run on IBM PC or compatibles.

* Ensure the syntax of the source code conforms to the guidelines outlined in the TCLOAD Reference Manual, part number 10016. TCLOAD is a proprietary development tool designed by VeriFone to allow you to quick-ly download applications to a terminal during the testing and development phase. TCLOAD also creates files that can be used by ZONTALK 2000 to downline load terminals out in the field.

* Write your control strings in long hand, including comments. The ";” is used as the comment symbol. For example:

Control

String Comments

B5.5 ;select buffer 5 as both source and destination buffer G ;clear buffer

A5 ;append contents of memory location 005/0005

* Make sure all data used with the commands are in upper case only. For example, use R’ABCDE’, not R’abcde’. When data is stored in the terminal, it is upper shifted. If you then try to compare this with lower case data, it will not match.

* Remember, the maximum length of each memory control string location is 120 characters (60 for TRANZ EPROM versions prior to 2.1, XL versions prior to 2.4). After writing the control string in long hand, break it into groups of 120 characters.

¢ When counting the characters in a control string, remember to count every character, including periods (.) and commas (,).

* When your control string exceeds 120 characters, you will need more than one memory location in which to store it. Store the remainder of the control string in general record memory locations, using the "L” command to link one memory location to another.

* When breaking control strings longer than 120 characters, place the break on or before the 116th character as the "L" command will take up four characters (Lnnn; nnn = memory location to link to).

Each TCL command is one or two characters long, and may have up to seven parameters, which modify the command. When you combine a series of commands into a single command line, you create a "control string.” Control strings determine how the terminal will perform a transaction or function. By interpreting the control string, the terminal knows which prompts to display, what type of data input to accept, and which command it should execute next.

You can create control strings for each programmable transaction and function. You can create your own control strings to program up to nine transactions and seven functions.

Page 58 read from a scan by OCR; it may hold reading errors

Transaction Control Strings

Function Control Strings

Loading the Application

TCL Programmer’s Manual

You can write up to three control strings for each of the nine programmable transactions (associated with keys [1] through [9]). When a transaction key is pressed, the terminal begins executing the transaction control string stored in memory location x07/0x07 (where x = the number of the pressed key). The terminal will execute the control string beginning in x07/0x07, and continue by executing any control string that the transaction control string links to.

Note: The primary phone number (memory location x00/0x00) and the merchant identification (memory location x04/0x04) must be properly stored before the terminal can begin to execute the transaction control string.

The "Out of Memory Control String” (037/0037) is executed when the operating system determines that there is not enough memory available to perform the requested data storage command. After executing the control string in location 037/0037, control will return to the point in the control string where the out of memory condition first occurred. The control string in location 037/0037 should be written such that it either aborts (*K) the control string in progress or attempts to "free up” more memory by deleting old batches, etc.

Note: The Out of Memory Control String is not used in any terminal such as the XL300 or TRANZ 330 (3.0+), PNC 330 or TRANZ 380, that uses the new memory manager.

After the terminal executes the transaction control string, it will communicate with the host. Upon completing its communications with the host, the terminal will execute the "response analysis control string” stored in memory location x10/0x10, then execute the "auxiliary control string” stored in location x11/0x11. When memory locations x10/0x10 and x11/0x11 are empty, the terminal displays the response message received from the host, and returns to the idle state.

Note: The response analysis control string and the auxiliary control string are not mandatory. Should you desire, you can write a response analysis control String to examine the host's response, and save portions of the response message for record keeping purposes. The optional control string (x11/0x11) is available for any purpose.

You may write only one function control string for each of the seven programmable local functions. These control strings determine how the terminal performs certain functions.

When a function key is pressed (i.e., [FUNC] key + one of the keys numbered [1] through [6], or [9]), the terminal begins executing the function control string stored in memory location 03x/003x (where x = the number of the pressed key, e.g., 031/0031, 032/0032, etc.). The terminal will then execute any control strings linked to the function control string.

After writing your control strings on a PC, you will need to load them into a terminal for testing. To load your application into the terminal, you can either manually enter it, or use a download program or transfer program offered by VeriFone. Because manual entry (keying in data via the terminal’s keypad)

Page 59 read from a scan by OCR; it may hold reading errors

Debugging the Application

3. Programming Basics can be a lengthy and tedious process involving many keystrokes, VeriFone does not recommend it. Instead, VeriFone recommends using TCLOAD to download the application during the testing and development phase, or ZONTALK 2000 (the VeriFone proprietary download and database management software) to download your terminals once they are out in the field. See Section 4, Programming Tools, for more information about TCLOAD and ZONTALK 2000.

Once the application is loaded into the terminal, you can test and debug it without any external software or hardware by observing the input to and output from the terminal. You can set up memory locations to hold "snapshots" of the application input or output to facilitate debugging, and examine these memory locations using the terminal's STORE and RECALL functions.

Page 60 read from a scan by OCR; it may hold reading errors

TCL Programmer’s Manual