1 10-2004
Introduction
You can access the ACR30 Proprietary Driver via ActiveX Component (OCX). Please register the file
ReaderXControl.ocx in your system; you will then be able to program the ACR30 as an object component.
TReaderActiveX Object
The ACR30 component is referred to as TReaderActiveX in your system. It has the following attributes:
Properties
Port 16-bit value to specify which port the ACR30 is connected to. Use 15 to indicate USB port.
Fill up this member before calling the Open method.
CardType 8-bit value to specify which type of card you intend to power up. Fill up this member
before calling the StartSession method. It can have the following values:
MCU T=0
IIC Type 1
IIC Type 2
AT88SC153
AT88SC1608
SLE4418
SLE4428
SLE4432
SLE4442
30
12
13
14
15
16
17
18
19
ATR String, in hexadecimal notation, that holds the cards Answer To Reset String. This property
is filled up by the StartSession method.
ATRLEN Length of the ATR Property. This property is filled up by the StartSession method.
HISTLEN Length of the cards historical bytes. This property is filled up by the StartSession
method.
HISTOFFEST offset in ATR Property containing the cards Historical data. This property is filled up
by the StartSession method.
APDULenMAX maximum length of the APDU Data field. This property is filled up by the
StartSession method.
CStat holds the current status of the reader. This property is filled up by the GetInfo method. It can
have the following values: 0=No Card; 1=Card Inserted; 3=Card Inserted and Powered Up.
szRev String that holds the readers Firmware Revision Code. This property is filled up by the
GetInfo method.
szRevIndx index that allows you to access each character in the szRev member.
CLA byte to hold the CLASS member of the APDU
INS - byte to hold the INS member for the APDU
P1 byte to hold the P1 member for the APDU
P2 byte to hold the P2 member for the APDU
Lc - byte to hold the P2 member for the APDU
Le byte to hold the P2 member for the APDU
DataStr byte to copy to/from APDUDataIn/ApduDataOut, use in conjunction with DataIndx
member
DataIndx byte to indicate which element of APDUDataIn or APDUDataOut you want to access.
Page 2 of 5
Methods
Open connects your application to the ACR30 reader. It requires the Port member to be initialized
by the application.
Close closes your connection to the ACR30 reader. Call this method when your application no
longer needs the ACR30 reader.
StartSession powers up the card inserted in the ACR30 reader. The CardType member must be
initialized by the application. On success, it will fill up the ATR and History properties of
TReaderActiveX.
EndSession powers off the card in the ACR30 reader.
GetInfo retrieves information from the ACR30 reader. It will fill up the following TReaderActiveX
properties: CStat, szRev, nMaxC, nMaxR, nLibVer, lBaudRate.
ApduDataIn this method will copy one byte from the DataStr member to TReaderActiveX APDU
DataIn data structure. Use DataStr and DataIndx to specify the offset to be copied.
ApduDataOut this method will copy one byte from the TReaderActiveX APDU DataOut data
structure to the DataStr member. Use DataStr and DataIndx to specify the offset to be copied.
SendAPDU this method will send an APDU command to the card. The application must fill the
following properties: CLA, INS, P1, P2, Lc, Le, DataIn.
GetStatus holds the SW1 SW2 status bytes in hexadecimal string notation after sending
APDU command to the card.
connect to USB
connect to USB
ReaderX.Close
disconnect reader
Page 3 of 5
connect to USB
ReaderX.GetInfo
' display the Reader's firmware revision code
for i = 0 to 9
ReaderX.szRevIndx = i
temp = temp & chr (ReaderX.szRev)
next
MsgBox "REV CODE: " & temp
' $80
' $A4
' $FF02
copy FF to the 1st element of DataIN
copy 02 to the 2nd element of DataIN
ReaderX.sendapdu
result =ReaderX.getstatus
msgbox "Result: " & result
Page 4 of 5
$80
$B2
ReaderX.sendapdu
result =ReaderX.getstatus
display the SW1 SW2
msgbox "Result: " & result
get DATAOUT, store it in variable TEMP
for i = 0 to 3
ReaderX.dataindx = i
temp = temp &" " & ReaderX.APDUDataOut
next
msgbox temp
Page 5 of 5