The text of a manual · part 29 of 37
TCL Terminal Control Language Programmer's Manual, pages 281 to 290
Pages 281 to 290 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 281
Appendix B. Communications
Message Explanation
HOST DISCONNECT The terminal received an EOT without receiving a response packet.
LOST COMM W/HOST The host has dropped its carrier signal. This could indicate that the host hung up or that the phone line is dead.
Page 282
TCL Programmer’s Manual
Page 283
Account Ranging for the XL
Account Ranging Control String
Appendix C. TCL Code for Commonly Used Functions
This routine compares the first four digits of the entered card number with each low and high range in the Account Range Table to ensure the card number is valid. When the entered card number falls within the range, the host number, card type, floor limit, data capture flag, additional field flag, and valid descriptor codes are put into a designated location for later processing. This routine uses the following setup:
¢ The source code is stored in memory locations 222, 223, 224, 225 and 226,
¢ Buffers 4 and 5 alternate as the source and destination buffers,
* Memory locations 214 through 218 are used for temporary storage: 214 low value of range 215 high value of range 216 memory location of account range entry being searched 217 ~~ card number (first 4 digits) 218 _ self-modified control strings ¢ Memory location 221 reserved for host number, card type, floor limit, etc.; set to 0 at beginning of routine; if range not found, remains 0,
¢ Location 199 holds the "CARD NOT RANGED" message,
¢ Location 231 holds input datas WCC TRANCODE FS ACC.DATA FS AMT.
Note: After executing this routine you should execute the "Transfer" routine to move the host information into the appropriate memory locations.
Command Comments 221=0 222$ ; Begin account ranging - get card number, ; then initialize flags and pointers. B.4 ; Select buffer 4 as the destination buffer G ; Clear it A231 ; Append input data from location 231 to ; buffer 4 B4.5 ; Select buffer 4 as source buffer, and ; buffer 5 as the destination buffer G ; Clear buffer 5
Page 284
TCL Programmer’s Manual
Command
Comments
H
O
X4 U217 G R’43’ U216 R48 U221 L223
223$
G
R’B.4GA’
A216
; Move the extraction pointer to the ist FS in
; the transmit buffer
; Move extraction pointer one more position
; So it points to the first digit of the card number ; Copy first 4 digits of account number to buffer 5 ; Copy 4 digits of account number to location 217 ; Clear destination buffer
; Append ’43’ (location of 1st account range
; entry) to buffer 5
; Copy account range entry to location 216
; Clear buffer 5
; Append 0 (range not found) to buffer 5
; Store buffer 5 contents in location 221
; Continue with the control string stored at
; location 223
; Build control string to get low and high
; ranges from the Account Range Table into
; temporary locations.
; Clear buffer 5
; Append literal control string to buffer
; Append Account Range Table to buffer
5R’B4.5GX4U214GX4U215*M’
U218 *L218 L224
218$ B.4 G Ann
B.4.5
G x4 ; U214 ; G
X4; U215 ; *M
224$
B5.5
A217 7214.1
; Store built control string in location 218
; Execute the control string in location 218
; Continue with the control string stored
; at location 224
; Control string built by $223
; Select buffer 4 as destination buffer
; Clear it
; Append contents of nn
; (nn = 43,44,45,46,47, the current table entry) ; Select buffer 4 as source and buffer 5 as
; the destination buffer
; Clear buffer 5
; Copy low range from source to dest. buffer ; Store in location 214
; Clear buffer 5
; Copy high range from source to dest. buffer ; Store in location 215
; Return to calling control string,
; Location 223
; Compares the low and high values with the ; entered account number.
; Select buffer 5 as both the source and
; destination buffer
; Clear it
; Append first 4 digits of card number
; (low range - card number) store at
; location 214
Page 285
Adding Records to the Data Capture File
Appendix C. TCL Code for Commonly Used Functions
Command Comments
T215.1 ; (high range - card number) store at ; location 215
G ; Clear buffer 5
A214 ; Append (low range - card number)
4.4.48 ; if (low-card#) > 0, the card is not in ; range skip 4 commands
G ; Clear buffer 5
A215 ; Append (high-card number)
11.3.48 ; If (high-card number) < 0, the card is not in ; range skip 1 command
L225 ; If card number found within range, execute ; the control string at location 225
L226 ; lf card number is not found within range,
; execute the control string at location 226
225$ ; Card number found within range table ; get host number, card type, floor limit, etc. ; stored in location 221
B.5 ; Select buffer 5 as the destination buffer G ; Clear it R’B.4GA’ ; Append literal A216 ; Append Account Range Table entry pointer R’B4.5G08XU221*M’ U218 ; Store built control string in location 218 *L218 ; Execute the control string in location 218 *M ; Return 226$ ; Card number not found within range get next ; Account Range Table entry and test again B5.5 ; Select buffer 5 as both the source and ; destination buffer G ; Clear buffer 5 A216 ; Append the account range table pointer 12.3.’48’ ; If range table pointer is less than 48, ; skip 2 commands P199 ; Display "CARD NOT RANGED" *K1 ; and abort; leave display up G ; Clear buffer 5 R49 ; Append °1’ T216 ; Increment account range table pointer to ; next location L223 ; Link back to the control string at location
; 223 to compare to next range
After you create a data capture record in the destination buffer, you can add it to the data capture file using this code. After the terminal adds the record to the end of the data capture file, it will check to see if there is enough memory available to add records.
Page 286
TCL Programmer’s Manual
Command Comments *C ; Add record to batch with contents built in ; current destination buffer *F2.1 ; If not out of memory, skip 2 else ; skip 2 commands P73 ; Display "OUT OF MEMORY" K1 ; Abort and leave the current display
Copying Data This subroutine causes the terminal to copy data from one memory location From One Memory __ to another, with the terminal prompting you to enter the memory locations to Location to Another copy from and to. This subroutine uses the following setup:
¢ The source code is stored in locations 31 and 131, ¢ Buffer 5 is the destination buffer, e Location 214 = location to copy from, e Location 215 = location to copy to,
¢ Locations 216 and 217= self-generated code,
¢ Location 298 = "COPY TO LOC?" prompt,
¢ Location 299 = "COPY FROM LOC?" prompt
Note: TRANZ 380 corresponding memory locations have 4 digits (214 = 0214, 299 = 0219, etc.).
Copy Memory Location Command Comments Control String 31$ ; Get the location numbers
B.5 ; Select buffer 5 as destination buffer
G ; Clear it
P299 ; Display "COPY FROM LOC?"
K2.3 ; Accept 3 digits from keypad
D1 ; Delete the field separator
U214.5 ; Copy data from buffer 5 to location 214
G ; Clear buffer 5
P298 ; Display "COPY TO LOC?"
K2.3 ; Accept 3 digits from keypad
D1 ; Delete field separator
U215.5 ; Copy data from buffer 5 to location 215 ; Build self-generating code
G ; Clear buffer 5
R’A’ ; Put an "A" in the buffer
A214 ; Append data from location 214 to buffer
U216.5 ; Store self-generated code in location 216
G ; Clear the buffer
L131 ; Link to location 131
131$ R’U’ ; Put a "U" in the buffer A215 ; Append data from location 215 to buffer
Page 287
Match Entered Number to Data Capture Record Number
Appendix C. TCL Code for Commonly Used Functions
Command Comments R’.5’ ; Put ".5" in the buffer - Uxxx.5 U217.5 ; Store self-generated code in location 217 G ; Clear the buffer *L216 ; Execute the control string at location 216 *L217 ; Execute the control string at location 217
This routine uses a 4-digit number, entered by the user, to retrieve a data capture record. If the terminal cannot find a matching record, it displays the message "NOT FOUND" and aborts the operations. The control string for this routine is divided into three modules and uses the following setup:
The source code is stored in locations 031, 159, 160 and 161,
Buffer 3 is the source buffer,
Buffer 5 is the destination buffer,
Memory location 214 is a temporary storage area for the 4-digit number, Location 215 is a temporary storage area for the self-generated code.
Command Comments 031$ *L159 ; Get item number and set up batch ; Did the entered item number equal 0? B3.5 ; Select buffer 3 as the source buffer, and ; Buffer 5 as the destination buffer G ; Clear buffer 5 *E1 ; Get the first data capture record *F2.3 ; If no record exists, display F70 ; "NO TRANSACTIONS" *K1 ; and abort the operation ; Set variable for match routine *L160 ; Execute control string at location 160 to ; build self-generating code *L161 ; Execute control string at location 161- match ; routine
; When the routine returns to this point, the ; matching data capture record has been ; found and is in buffer 5.
; Module 1 159$ ; Get the 4-digit number of the record to be ; reviewed B3.3 ; Select buffer 3 for both the source and ; destination buffer G ; Clear buffer 3 F38 ; Display “ENTER ITEM #" prompt
K2.3
Page 288
TCL Programmer’s Manual
Command Comments 13.2.28 ; If entered character is not a FS, skip 3 ; commands ; If character entered character is a FS R49 ; default to record #1 11 D ; otherwise, delete the FS 23.48.1 ; Pad to 3 characters with zeros, right ; justify U214.3 ; Copy buffer 3 to location 214 ; Set up the batch *B ; Select the current batch *F2.2 ; If no batch, display F70 ; "NO TRANSACTIONS" *K1 ; and abort the operation ; Module 2 160$ ; This subroutine builds the self-generating
; code that compares the item numbers and ; retrieves data capture records until the
; item numbers match. This subroutine uses ; variable #5 as a found/not found flag
; (O=not found, 1=found) and assumes
; the entered item number is in location 214.
; Build self-generating code
*N#5.48 ; Set found flag to "not found," ; 48 = ASCII 0 B.3 ; Select buffer 3 as destination buffer G ; Clear it R1.2.’ R39 A214 R39 R’*N#5.49*M’ U215.3 ; Module 3 161$ ; This match routine is executed after the
; first data capture ; record is in buffer number 5.
B5.3 ; Select buffer 5 as source buffer and buffer ; 3 as the destination buffer
G ; Clear buffer 3
X3 ; Get item number from the data capture ; record in buffer 5, and copy it ; to buffer 3
B3.3 ; Select buffer 3 as both source and
; destination buffer
Page 289
Performing a Memory Dump
Removing Characters
Appendix C. TCL Code for Commonly Used Functions
Command Comments *L215 ; Execute control string at location 215 ; (code to compare item numbers) G R48 11.1.45 ; If #5 = O (record not found), ; skip 1 command; if #5 = 1 ; (record found) *M ; Exit subroutine B.5 ; Records did not match - select buffer 5 ; as the destination buffer G ; Clear it *EO ; Copy the next data capture record to buffer 5 *F2.3 ; If no more records, display F71 ; "NOT FOUND" *K1 ; and abort L161 ; Loop to the beginning of this string
Using the "Y" command you can cause the terminal to cycle through all of its memory locations and print the contents of each non-blank memory location. This type of procedure is commonly referred to as a memory dump and may be performed using the following control string.
Command Comments G ; Clear the destination buffer Y2 ; Append a memory location - when no
; Memory locations are left, ; Skip 2 commands N ; Print the destination buffer 1-3 ; Loop back 3 commands (back to "G")
Using the "H" and "X" commands, you can find specific data and copy it from the source buffer to the destination buffer. You can also use the "H" command to find characters you do not want to copy. After moving the extraction pointer past the characters you do not want copied, you can again use the "X" command to copy the rest of the source buffer.
The following example is a subroutine that will cause the terminal to copy the source buffer to the destination buffer, removing the first decimal point encountered.
Command Comments X.46 ; Copy up to a decimal point H2.46 ; Find a decimal point - if the decimal point ; is not found, skip 2 commands 1@) ; Increment the extraction pointer by 1 to ; skip the decimal point X ; Copy the rest of the source buffer
Page 290
Testing Printer Handshake Lines
TCL Programmer’s Manual
The following test checks the printer being powered up by verifying the handshake lines on the serial port. This test is especially useful for checking for the existence of a printer.
Command Comments B1.1 ; Select transmit buffer as source and ; destination G ; Clear it out R17 ; Append XON character to transmit buffer *R5.2.1 ; Set serial port to 9600 baud, ; no handshaking, 7E1 *10 ; Send the transmit buffer (XON) *W1 ; Allow 1 second for printer to respond +R6.2 ; If CTS is now active, ; skip 2 (printer on line) PXxxxx ; Display "PRINTER DOWN" or another message 1-8 ; Repeat loop