Appendix A - Infinite Peripherals PP-50 Developer's Manual

Pda printer
Table of Contents

Advertisement

. .
. .
. .
. .

Appendix A

.
Card Reader Example Code:
The example code uses the Basic language to read credit card information from the PP-50.
Dim strSend as String
Dim intCount as Integer
Dim received as String
Dim datastream as String
Dim err as Integer
Dim delay as Integer
Dim cardTrack as Integer
'---Initialize buffer, counter and track to read
receive = ""
datastream = ""
intCount = 1
cardTrack = 0
delay = 1
'---Send the read card information command
Call SerialOpen(57600,0)
strSend = chr(27)+chr(63)+chr(cardTrack)
err = SerialSend (strSend, 3)
'---Get the card information from the serial buffer one character at a time.
err=SerialReceive (received,1, delay)
Do while err = 0 And intCount <= 400
datastream = datastream + received
err = SerialReceive (received, 1, delay)
intCount = intCount + 1
Loop
Note: After successfully reading the data form the PP-50 into a buffer, field
information must then be extracted using programming language string
functions.
Infinite Peripherals, Inc.
www.ipcprint.com
Version 2.00
'---Reveive buffer
'---Data buffer
'---Time out delay
'---Store tracks to read
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
'---Open the serial port
'---Send the read card command
'---Send the command (3) bytes
'---Put the character read into buffer
Page 32

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the PP-50 and is the answer not in the manual?

Table of Contents