AGW Systems, DLL Interface Definicion
AGW Systems, DLL Interface Definicion
AüW
Systems
by l&B Engineering Group
.0 i
VER 3.10A
Pas6 - 1 VB Definitions J
Doc.Revision 3.104
f-¡
l\
AAW
Systems by J&B Engineering Group
Pase-2 VB Definitions
Doc.Revision 3.10A
AAW
Systems by l&B Engineering Group
1.
2.
3.
3.1, ovEBvrEw
6
3.2. PRoGRAMMTNG
7
4.1. lNtraLrzaroN
4.2. 15
ENDING uP
l5
5.1. SETCo,IPARAMEfERs
5.2. lNüCoM ,uMcanoNs 16
5.3, lNtrcowuNtcAnoNsEx 17
5.4. l8
5.5. AGWOPENVB ( AGWOPEN FoR N1NVB
5.6. ACWOPENEXVB ( AGWOPENEX FoR NoNvB UsERs)
5.7.
5.8, TE38 WORNNG
5.9. AGWENRoLL USER BY
5.10. ACWENRoLL USER BY FINGERDAIA
5.11. AGWREAD FINGERDA
5.12. AG WD E LETE E N R o LLED U s E R
5.13. ACWDELE.ÍE ALL ENRoLLED IlsERs
5.14. AGWGEfVERSIoN
5.15. AGWSEÍDATETIME
5.16. ACWWBITEINcIDENcE
5.17.
5.18. AGWSENDDT9PLA
5.19. AGWREADMESSAGEEXVB
5.20. AGWREADMESSAGEEr
5.21.
5.22. A G WR EAD B AwD ATAP o INfE R
5.23. ACWSETRAWDATAPoINTER
5.24. AG WR Es EÍRAw D ATAP oI NTER
5.25. AGWfESfHoRN
5.26. AGWSENDHoRN
6.
Page - 3 VB Definitions
Doc.Revision 3. ,l0A
Aow
Systems bl I&B Engineering Group
1. INTRODUCTION
. . Thj:.¡q qgnieve!
.lnterface(FlAP|) which
by providing a Function Levet Apilication programming
delive¡s.the full func.tionatity of rire AGW st"ñoárJ iniÉgration
Set in
a manner that is easy and efficient for application development p"r.onnát to ,"."
Page - 4 VB Definitions
Doc.Revision 3. ,l0A
A{iw
Systems by l&B Enüneering Group
function name
input parameters
output parameters
return values
additional i nformatio n
cross-references
Also included are a list of important FLApI data types and structures
that are often
utilized as calling parameters to the FLApI functions.
Pase-s VB Definitions
Doc.Revision 3.10A
/,(iw
Systems by l&B Engineering Group
3. FLAPI's ENVTRONMENT
3.1. Overview
client aplication
FUNCTIONS
AGW Devices
Pase-6 VB Def¡nitions
Doc.Revision 3.10A
AAW
Systems by J&B Engineering Group
3.2. ProgrammingLanguages
Agw dll has been tested in multiple environments, typically VC++ , VB and
Delphi samples are available. Some functions are ,,Language Oriented', (i.e.
AGWOpenVB) while the main body of the DLL remains language independant.
Backups of raw-data.dat file are made by comunications module to protect all the
information. Date is annexed to copied raw_data files to easily check Backüp periods.
"..\\Exes" D¡rectory:
Comunications.exe
Comunications.ini (configuration file, generated automatically with default values)
records.txt (records file, generated automatically)
agwdll.dll
Page - 7 VB Definitions
Doc.Revision 3. 10A
AOW
Systems b! J&B Engineering Group
3.4. MainConfiguration
Bus Com=COM2
lf this option is enabteffi
module comunications.exe will appear as an icon on
the taskbar. lf disable (=NO) comunications.exe will
not have a graphical presentation.
lcon=YES
This option must be set torESJorEr\/dll to;ork
properly with the PATH oaramerer
This option sets the maximumiapñity ot ttréTCW
Net connected to the pC, minimum ¡s iS and tne
,
maximum is 50. lt should be set to the lowest
number available, to ensure fast communication.
NTERMS = 15
Absolute or relative path where AGWDLL-DLL is
stored, lf set in the same directory as
comunications.exe then ,,.\\,, musi be set
PATH =.II
Thisoptionmustbesffi
are used. Comunications.exe will then send
and
receive data from the configured lp List . By
is setto N ' Deiault
TCP=N
1P1...tP15 lPListwhereTCp/m
TCP/|P are avaitabte. This is fiiled
communications when configured through
"rtomáti.áfry-6y
the
program , in "TCp/lp Configuration,,
|P1...1Pl5 = 0.0.0.0
options marked with (-) can be modified direcily with FLApr functions, see
SetComParameters for more info.
Pags . I VB Definitions
Doc.Revision 3.i0A
A(iw
Systems bl l&B Engineering Group
.have absolute
Rearrime option is by far the most comprex of ail, but ailows the
contror on rear time
Host apprication to
events manágemánt. severar rr_npr tunct¡oñJare
provided in order to make this implementation eásier.
AGW DLL sends a d-efined wM to Host apprication to achieve
this rear t¡me
operation. Note that AGWopenExtunction shoúlá be used
in this mode instead of the
normal AGWOpen.
oDBC storage, t¡me&attendance and access contror punches can be easiry stored
in this way to any Database which has a osru properrv
configured. rnformation can be
stored in rear time or at time intervars, us somé dátabáse
are very time consuming for
constant.storage. Exampres oDBc enabred sources , lr¡s nüá..,'H¡é'üiJ"l,'v"¡.r"r
_of
FoxPro databases, dBase , SeL Server, ORACLE
Page - '10
VB Definitions
Doc.Revision S.10A
AAW
Systems by l&B Engineering Group
3.5.1. RealTime
Note:
openEx Function must be cailed instead of open to achieve this
Rearrime method
An exampre of this working mode can be found in comunications
mode in Anatyze
Option, a window like this wilt appear, showing ail evánb
¡n reat t¡me .
Page - 11 VB Definitions
Doc.Revision 3.10A
. ,4(;W
Systems by l&B Engineering Group
Pase - 12 VB Definitions
Doc.Revision 3.10A
A(|W
Systems by l&B Engineeing Group
3.5.2.1.Backup Options of Raw_Data files
F6frr3
Femole lemiráls Modem
Ma¡arietp liE-
T Send Datá toTF4o
17 TEP¡Ptnrelace
T Tm.ta.end.ñc¿Bypas3 f-;;-_--l
T Lbck syncnroniz¿hon 6v",y p-l ruri^
| |
l: DlC240 connection
Page - 13 VB Definitions
Doc.Revision 3.10A
AAW
Systems by J&B Engineering Group
3.5,3. ODBC Storage
. ..This.mode will process.records as they are received from AGW terminals and
store them in an external database through its ODBCOrivers.
A DSN source must be selected, tñen a table tf the
selected database , and
after this, thererationship between AGW Termináls
oata ano each fierd on the tabre.
1lr" ODBC configurarion window can be found at Comunicátions " ü;;d,
^
Conlqur.e,
lxtended Options , Externat OB Ctirage.
Due to the comprexity of fine tuning this option, dDBC
.
stored in errors.rogfire with a detaired expranation
rerated errors are
records.
of the ODBC án t"ir"o f..á.,
The following window will appear
'nde, Forn¿r
L [. e- E cocMusic t¡or shar¡bl¿I
úr
ForPb Fier Word Jnol shnrabtel ds.
@visua rolPn rab es fnoi srrar:r
- * l--- .
re
f Prccess Ontine Records
[e*¡" I c."".r".]
Card / Usár lD
llmE
Processes
information al Oale
time intervals,
for Sharlng T Prcces9 online.Records
purposes or ¡n §¡ oK
BealT¡me
Page - 14 VB Definit¡ons
Doc.Revision 3.10A
AüW
Systems by l&B Engineering Group
4.1 . lnitialization
lnitCommunications Tostartupcomunicationsmodulewh¡ch
manages all the protocols involved in the AGW
Devices control
Pase - 15 VB Definitions
Doc.Revision 3.i0A
AAW
Systems by l&B Engineering Group
5. FLAP¡FUNCTIONS
5.1. SetOomparameters
Function prototype:
lnput Parameters
COMPoT
lnitCommunications0
lnitCommunicationsEx (Byval path As
Str¡ng )
Pase - 16 VB Definitions
Doc.Revision 3.10A
AAW
Systems by l&B Bngineering Group
5.2. lnitCommunications
Funct¡on prctotype:
lnitCommunications 0 As tnteger
Return Value
Possiblereturnvaluesare: AGW_SUCCESS,AGW_FAILED
Cross-References
Pase. 17 VB Definitions
Doc.Revision S.10A
AúW
Systems by l&B Engineering Group
5.5. lnitCommunicationsEx
Function prototype:
Return Value
Possiblereturnvaluesare: AGW_SUCCESS,AGW_FAILED
Cross-Beferences
lnitCommunications0
2:!9::l::ye_!.ers.bh?r.coMport,bootMinimized)
t e rm n ateco m m u n
icat io n s 0
Pase - rB VB Definitions
Doc.Revision 3.10A
AAW
Systems by f&B Engineering Group
5.4. TerminateCommunications
Function prototype:
TerminateCommunications 0 As lnteger
Return Values
Possiblereturnvaluesare: AGW_SUCCESS,AGW_FAILED,
AGW_COMUNICATIONS-NOT-STARTED
Cross-References
lnitCommunications 0
lnitCommunicat¡onsEx (ByVat path As String)
Pase - 1e VB Definitions
Doc.Rev¡sion g.1OA
A(iw
Systems by l&B Engineering Group
5.5. AGWOpenVB ( AGWOpen for nonVB users)
Function prototype:
AGWOpenVBQ As tnteger
Possiblereturnvaluesare: AGW_SUCCESS,AGW_FAILED,
AGW-COMUNICATIONS-NOT_STARTED
Cross-Beterences
Pase - 20 VB Definitions
Doc.Revision S.10A
AúW
Systems by l&B Engineering Group
Function prototype:
lnput Parameters:
m_pHnd
ld-p
Retum Values
Possiblereturnvaluesare: AGW_SUCCESS,AGW_FAILED.
AGW-COM UN ICATIONS-NOT_STARTED
Bemarks:
A message wifl be posted with windows Message identifier
rd_p in the host
message queue whenever an event occurs in AGW N;t terminals.=
No ¡nformat¡on is sent
or LpARAM . Data is retreived and anatyzed by cafling AOWneaoüessage
ffiH:ff^r,
Cross-References
5.7. SendAlfieMessage
Pase - 2i VB Definitions
Doc.Revision 3.10A
AAW
Systems by J&B Engineering Group
Function prototype:
lnput Parameters:
Alfie As lnteger
Possiblereturnvatuesare: AGW_SUCCESS,AGW_FAILED,
AGW_COMUNICATIONS_NOr-'STERTEP
Example:
To Reset terminal Number B o-n AGW Net , the command should be sent
as follows : SendAlfieMessage (3,,,102,,)
Function prototype:
lnput Parameters:
Alfie As lnteger
WithPin As lnteger
PinDigits As lnteger
Return Values
Possiblereturnvaluesare: AGW_SUCCESS,AGW_FAILED,
AGW_COM UN I CATTO NLNor_srnnreo
Cross-references
None
Pase - 23 VB Definitions
Doc.Revision 3.10A
AAW
Systems by J&B Engineering Group
5.9. AGWEnroll User by Scan
Function prototype:
lnput Parameters:
Alfie As lnteger
UserCode As lnteger
Return Values
Possiblereturnvaluesare: AGW_SUCCESS,AGW_FAILED,
AGW-COMUN ICATIONS_NOT-STARTED
Cross-references
AGWEnrollFingerData
Pase - 24 VB Definitions
Doc.Revision S.10A
AúW
Systems by J&B Engineering Group
5.10. AGWEnroll llser by FingerData
Function prototype:
lnput Parameters:
Alfie As lnteger
Return Values
Possiblereturnvaluesare: AGW_SUCCESS,AGW_FAILED,
AGW_COMU N tcATt ONS_NOr_',sra nre o
Cross-references
AGWEnrollScan,AGWReadFingerData,AGWTR3BSetup
Pase - 25 VB Definitions
Doc.Revision 3.10A
AúW
Systems by J&B Engtneering Group
5.11. AGWRead FingerData
Function prototype:
lnput Parameters:
Alfie As lnteger
UserCode As lnteger
Return Values
Possiblereturnvaluesare: AGW_SUCCESS,AGW_FAILED,
AGW-COMUN ICATIONS-NOT_STARTED
Cross-references
AGWEnrollFingerData
Funct¡on prototype:
lnput Parameters:
Alfie As lnteger
Return Values
Possiblereturnvaluesare: AGW_SUCCESS,AGW_FAILED,
AGW-COMUNICATIONS-NOT.STARTED
Cross-references
AGWDeleteAllUsers
Pase - 27 VB Definitions
Doc.Revision 3.10A
A0w
Systems by J&B Engineering Group
Function prototype:
lnput Parameters:
Alfie As lnteger
Return Values
Possiblereturnvaluesare: AGW_SUCCESS,AGW_FAILED,
AGW-COMUNICATIONS-NOT-STARTED
Cross-references
AGWDeleteUser
Pase - 28 VB Definitions
Doc.Revision 3.10A
A(;W
Systems by J&B Engineering Group
5.14. Acwcetversion
Function prototype:
lnput Parameters:
None
Output Parameters;
Return Value
AGW-SUCCESS
Cross-references
None
Pase - 2s VB Definitions
Doc.Revision 3.10A
AAW
Systems by J&B Engineering Group
' 5.15. AGWSetDateTime
Function prototype:
AGWSetDateTime 0 As lnteger
lnput Parameters:
None
Output Parameters:
None
Return Value
Possiblereturnvaluesare: AGW_SUCCESS,AGW_FAILED,
AGW_COMUNICATIONS-NOT-STARTED
Cross-references
None
Pase - 30 VB Definitions
Doc.Revision 3..f 0A
A0w
Systems by J&B Engineering Group
5.16. AGWWritelncidénce
Function prototype:
lnput Parameters:
Posit¡on As Long, order in which this message w,t appear (for TR31 0nty)
Code As Long, Event code tinked with tniAescr¡ítíái
Buffer As String Message to appear on the Disptáy
Output Parameters:
None
Return Value
Possibtereturnvaluesare: AGW_SUCCESS,AGWSINTAX_ERROR
AGW-FAILED,AGW-NO-DATÁ
Cross-references
Pase . sl VB Definitions
Doc.Revision 3.10A
Aü}I
Systems bl l&B Engineering Group
' 5.17. AGWEraselncidence
Function prototype:
lnput Parameters:
Output Parameters:
None
Remarks
This command sets the default message to the desired event code
Return Value
Possiblereturnvaluesare: AGW_SUCCESS,AGWSINTAX_ERROR
AGW-FA¡LED,IéW-Ñó_OÁiÁ-
Cross-references
Pase - 32 VB Definitions
Doc.Revision 3.10A
- AüW
Systems by l&B Engtneering Group
5.18. Acw9endDisplayMessage
Function prototype:
lnput Parameters:
Output Parameters:
None
Return Value
Pase - 3s VB Definitions
Doc.Revision 3.10A
AúW
' Systems by l&B Engineeing Group
5.19. AGWReadMessageExVB
Function prototype:
This function call is made whenever an application needs to read data sent from Alfie
devices. A Message stack is provided and AGWReadMessdgeExvB will success until
stack reaches its end.
since this function call returns data from any success in the AGW Net, the returned
data must be filtered according to DataType value ( please refer to 6.1.3 DataTypes).
lnput Parameters:
None
Output Parameters:
Return Value
Possiblereturnvaluesare: AGW_SUCCESS,AGW_FAILED,AGW_NO_DATA
AGW-COMUNICATIONS NOT STARTED
Function prototype:
This function call is made whenever an applicat¡on needs to read data sent from Alfie
devices. A Message stack ¡s provided and AGWReadMessageEx will success until stack
reaches its end.
lnput Parameters:
None
Output Parameters:
Return Value
Possiblereturnvaruesare: AGW_SuccESS,AGW_FATLED,AGW_NO_DATA
AGW-COMUN ICATIONS_NOT_STARTED
5.21. AGWReadRawData
Function prototype:
This function call is made whenever an application needs to read data sent from Alfie
devices stored in the RawData File , information is retreived in LIFO order and according to
RawData Pointer status. (Please refer to 3.5.2)
BawData Pointer is automatically increased each time this function is called.
This funct¡on succeds until the end of raw data file is reached.
lnput Parameters:
None
Output Parameters:
DataType As String Klndof information received AGWTime, AGWAccess,
AGWSystem) (Chapter 6)
Action As lnteger, Event/lncidence ocurred or typed ¡n
User As Long, Card Number
AGWTime As Sting, T¡me of the Event
AGWDate As Sting, Date in DD/MMNY format
WeekDay As Sting, Weekday (1 for monday)
Alfie As lnteger Terminal Number
Return Value
Cross-references
5.22. AGWReadRawDataPointer
Function prototype:
lnput Parameters:
None
Output Parameters:
Retum Value
Cross-references
AGWSetRawDataPointeO,AGWResetRawDataPointeO;
Pase - 37 VB Definitions
Doc.Revision 3.10A
AAW
Systems b l&B Engineering Group
Function prototype:
lnput Parameters:
Output Parameters:
None
Return Value
Cross-references
AGWReadRawDataPointeO,AGW ResetRawDataPointeO ;
Pase - s8 VB Definitions
Doc.Revision 3.10A
AAW
Systems
by l&B Engineering Group
5.24. AGWResetRawDataPointer
Function prototype:
AGWResetRawDataPointer) As lnteger
lnput Parameters:
None
Output Parameters:
None
Return Value
Cross-references
AGWReadRawDataPointer0,AGWSetRawDataPointeO;
Pase - 3s VB Definitions
Doc.Revision 3.10A
- AAW
by l&B Engineering Group
Systems
5.25. AGWTestHorn
Function prototype:
Sends a test horn to sound in real time according to the configured settings.
This can be done dlrectly through Communications Module in Terminals
Co nf ig u rati o n/S e n d H o m s
lnput Parameters:
Output Parameters:
None
Return Value
Possiblereturnvaluesare: AGW_SUCCESS,AGW_SINTAX_ERROR
Cross-references
AGWSendHorn0;
Function prototype:
AGWSendHorn( ByVat position As Long,
ByVal Atfie As Long,
By Val Timeon As-Long,
By Val TimeOff As Lon-g,
lrlgtQonfis ts Strin{'
Byvat Time As Str¡ng
ByVal WeekDays né Str¡ng) As tnteger
sends a test horn to so.und. in rear time
according to the configured settings.
This configuration can be aone a¡recttv q
- " vu tiün
Terminals Conf ig u ration/Se nd Horn s - - - "' " v communications Modure in
lnput Parameters:
Position _ position in
Alfie - Terminal Number.Terminal Tabte , ranges from
' I to 20
to be configúrea','-
Time On _ Time in secs the AeAy
í,it iá adivated accord¡ng to Confio
rime off _ rime in secs the Retiy iiitlááiáá
conris - e¡gnléÁá',s sett¡ns the t¡mes Retay;,;t:L1r3?{r,* to co-nris
,0,_
Retay
,t' _ Relay Oft
On
i.e.: l00O OOOO _ Horn is act¡vated one time
1010 l0l0 _ Horn switches four times from On
to Off
Time - Time at which the Horn witt sound
, its format is HH:MM
WeekDays: Seven Chars Sett¡ng the
days the siren will sound
i.e:
I I I 1 100_
sound from Monday tiil Friday
.Witt
000001 I - Will sound only on weekend
Output Parameters:
None
Return Value
AGWSendHorn0;
Page - 41
VB Definitions
Doc.Revision 3.10A
' !' Aaw
Systems by l&B Engineering Group
6. StructureDefinitions
ln¡toommunicat¡ons 0 As lnteger
AGWResetRawDatapointer 0 As lnteger
AGWUpdateRawDatapointer 0 As lnteger
Pase - 42 VB Definitions
Doc. Rev¡sion 3. 1 OA
AúW
Systems by I&B Engineering Group
AGWDeactivateCard (ByVal Alfie As Long,
B@
Acwwritetncidence (ByV.al position As Long,
ByVat Code As Long,
ByVat Buffer As StringlAs tnteger
AGWReadRawDatapointer(ByRef Address As
Long) As lnteger
AGWSetRawDatapointe(ByRef Address As Long) As Integer
AGWBesetRawDatapointer$ As lnteger
Const AGW-FAILED
0
Const AGW_SUCCESS 1
Const AGW_StNTAX_ERROR
2
Const AGW_NO_DATA
3
Const AGW-COMUN IcATIoNs-NoT_STARTED
4
6.1.3. DataTypes
struct AGW_RECORD
{
¡nt DataType;
int Action;
long User;
char Time[6];
char Date[1 1];
char WeekDay[2];
int Alfie;
);
Page - 44 VB Definitions
Doc.Revision 3.10A
A(;W
Systems bl I&B Engineering Group
Reset Commands
102 Resets Terminal
125 Resets Records
126 Resets Horns Table
Page - 45 VB Definitions
Doc.Revision 3.10A