I have a client that is adding a barcode card reader to a turn style access
gate. The reader vendor provided a dll with examples for VB. I have used
3rd party dll's before but never to respond to an event initiated by the
dll.
I can connect to the reader and send data.
When I use there connection string I connect and can send data but return
.Null. as the return value instead of the 0 or 1
nRetval = 0
nGateNumber = 1
nIp = 10.10.1.2
nMyRetval = oreader.SendConnection(nGateNumber, nIp, nRetVal)
It requires the 3rd parameter but always returns .Null. (I have played with
various values of nRetVal although this is actually the retval. and the
value of nRetVal is always the value that I set it to after I call the
method.)
My other issue is I am not sure how to respond to the DataFromGate event
generated when a user scans there card.
I need to take the card number and look it up to see if they are paid up and
open or close the gate.
This will be called from form open on the front desk used to see details if
the account is past due or to manually open the gate. But for 98% of the
people the form will function without any user input other than the scan of
the card triggering the DataFromGate Event which sends the form the card
number.
I believe i need to create a wrapper for the DataFromGate method but and not
sure how to do that or add it to my existing form.
Thanks for your help.
Larry Oliver
All the documentation I have is included below.
dll Reference
Methods
CloseConnection ()
Description:
Closes the connection with the card reader or IPC.
SendData (short validEntry, short sound, short light, variant
textLine1,variant textLine2, variant textLine3, short time)
Description: Controls the connected gate. Can be used to open the gate, keep
it closed and display messages.
Parameters:
validEntry - The action to be taken by the gate. 0 Keep the gate closed, 1
open the gate.
sound - The type of sound to be made by the gate. 0 sound off, 1 valid, 2
not valid, 3 error
light - type of flashing for the light. 0 light off, 1 solid on, 2-13
various flashing speeds.
textLine1 - First line of text to be displayed on card reader.
textLine2 - Second line of text to be displayed on card reader.
textLine3 - Third line of text to be displayed on card reader if available.
time - Length of time in seconds for the gate to flash or display a message
before being reset.
SetConnection (long gateNumber, variant IPAddress, long returnValue)
Description: Connects to an IPC or individual card reader. Must be called
first in order to receive gate events and send data.
Parameters:
gateNumber - The number of the card reader, either 1 or 2, used for
compatibility with systems using an IPC.
IPAddress - A string containing the IP address of the individual card reader
or IPC.
returnValue - The result of the connection attempt. 1 successful, 0 failed.
Events
DataFromGate (String cardNumber)
Description: Called when the gate has received a card number scanned by a
member.
Parameters:
cardNumber - The number on the card scanned by the card reader.