Blueprint: lanben10.dll of the 100d Attendance Machine

Source: Internet
Author: User

Original: http://topic.csdn.net/u/20101120/08/29c75bcd-b90a-4a13-a4c0-8baa25771ad0.html

 

Call process:
1. Open the serial port opencomatrix
2. Connection callclock
3. Call related functions
4. Disable the serial disconnectclock.

Do not use connectclock. This function is faulty.
All functions can be normally called by following these four steps.

Interface document:

Lanben10.dll is used as the interface between the upper-layer computer software and the lower-layer Clock. It is completed by Delphi5.0.
Interface custom structure:
Type
Pclockinfo = ^ tclockinfo;
Tclockinfo = record
Clock_id: byte;
Fireware: Double;
Runmode: integer;
Port, baudrate, clock_type: integer;
End;
External call definition: pclk: pclockinfo;
Pclk. port serial port number
Pclk. clock_id clock No.
Pclk. fireware
Pclk. runmode Running Mode
Pclk. baudrate baud rate
Pclk. clock_type clock type
Before using functions in the interface, use setclockparam to set pclockinfo

Type
Picrecord = ^ ticrecord;
Ticrecord = packed record
Card: array [0 .. 15] of char; card number string
Timestring: array [0 .. 15] of char; 14-bit swipe time string in the format of yyyymmddhhnnss
MARK: integer
Flag: integer; record type
End;
External call definition: for example, Buf: array of ticrecord;

Common input parameters for all functions:
Hport is required. Thandle type, the input communication slogan. Can be one of the following: 1, 2, 3, 4
Required by baudrate. Thandle type, the input speed of the Communication slogan. 19200
Clockno is required. Byte type, the input machine number. The value range is: 0-252.
Available for broadcast. Boolean type, which does not need to be passed in during the call. Only false is allowed.

Function disconnectclock (hport: thandle): Boolean; stdcall;
Description: disconnected devices and closed ports
Return Value: Boolean)

Function checkconnectclock (hport: thandle; clockno: byte; broadcast: Boolean = false): byte; stdcall; Return Value: byte0-Online Failure; 1-online success
Returns the running mode of the machine.

Function testcallclock (hport: thandle; clockno: byte; atimeout: integer = 0): byte; stdcall; Return Value: btye Description: return the running mode of the machine. 0-Online Failure, 1-online success
Parameters
Required for atimeout, integer, response timeout

Function resetclock (hport: thandle): Boolean; stdcall; Return Value: Boolean Description: reset Kaka to factory status, reset will clear all data within the clock and download list.

Function getclockparam (hport: thandle; var devicetype: integer; var fireware: Double; var ICID: Boolean): Boolean; stdcall return value: Boolean Description: gets the clock model parameter. Applicable to Delphi. For external calls, use the pclockinfo structure. For details, see pclockinfo.
Parameters
Devicetype required. Obtain the value of public variables in the interface. The returned value is 55.
Required by fireware. Get the value of the public variable in the interface. The return value is 1.0.
Required by ICID. Obtain the value of public variables in the interface. The return value is false.

Function setclockparam (hport: thandle; devicetype: integer; fireware: Double; ICID: Boolean): Boolean; stdcall; Return Value: Boolean Description: it is used to assign values to public variables in the interface. Applicable to Delphi. For external calls, use the pclockinfo structure. For details, see pclockinfo.
Devicetype required. Integer type. 1-Attendance Device. (Model: k55)
Required by fireware. Double type. Must be 1.0
Required. Boolean type. Must be false

Function setupdisplaynumbertype (hport: thandle; kind: integer): Boolean; stdcall; Return Value: Boolean Description: sets the employee ID or card number status when card clock is swiped.
Parameters
Kind required. Integer value. Display type, 0-display card number, 1-display employee number.

Function setupbacklight (hport: thandle; kind: integer; timezone: pchar): Boolean; stdcall; Return Value: Boolean Description: Set the background light
Parameters
Kind required. Integer value. Background display type
0-the background light is normally closed; 1-The background light is always on; 2-the background light is always on at specified time.
The. pchar type required by timezone. It specifies the back-to-back optical segments in the format of hhmmhhmm.

Function setupbrushcardinterval (hport: thandle; samecardinterval: integer; differcardinterval: integer): Boolean; stdcall;
Return Value: Boolean indicates the interval between two swiping attempts.
Parameters
Samecardinterval is required. Integer type. The interval between two card swiping times. (0-99 minutes, 0-no time interval .)
Differcardinterval is required. Integer type. The interval between two card swiping times. (0-10 seconds, 0-no time interval .)

Function setupbrushperiods (hport: thandle; periods: pchar): Boolean; stdcall; Return Value: Boolean Description: Set the attendance period, up to 5 segments.
Periods is required. Pchar, in the format of hhmmhhmm.

Function setuphorntimes (hport: thandle; horntimes: pchar): Boolean; stdcall; Return Value: Boolean Description: Set the alert time, up to 32.
Parameters
Required. Pchar. Format: hhmmddhhmmdd.
Hh: hour, MM: minute, DD: duration of ringing (01--99)

Function setupguardperiods (hport: thandle; guardperiods: pchar): Boolean; stdcall; Return Value: Boolean Description: Set the access time, up to 8 segments.
Parameters
Required by guardperiods. Pchar. Format: hhmmhhmm.

Function setuphorntype (hport: thandle; Value: integer): Boolean; stdcall; Return Value: Boolean Description: logging setting.
Parameters
Value is required. Integer. 0-No ringtone, 1-buzzer ringing, 2-relay 1 External Ring, 3-relay 2 external ring.

Function setupexternalport (hport: thandle; value1: integer; value2: integer; value3: integer): Boolean; stdcall; Return Value: Boolean Description: electric lock settings.
Parameters
Value1 is required. Integer type. Whether there are locks. 0-no locks, 1-relay 1 External locks, 2-relay 2 external locks.
Value2 is required. Integer type. Set the electric lock type. 0 -- no electric lock, 1-external positive lock, 2-external negative lock.
Required by value3. Integer type. Set the delay time of the electronic lock.

Function setnotification (hport: thandle; kind: integer; timezone: pchar; notication: pchar; Company: pchar): Boolean; stdcall; Return Value: Boolean Description: Download Display message, company name.
Parameters
Kind required. Type: integer, value: 1
Required for timezone, type: pchar, message display period, format: mmddmmddhhnnhhnnhhnn
MM: month; DD: Day; hh: hour; nn minute
Required for notication, type: pchar, Display message content (up to 32 bytes). If the message is empty, the input time must be: mmdd 0000 0000 0000
Required for strcomname, type: pchar, company name (up to 16 bytes)
Note: To delete a message, change the time To mmdd 0000 0000 0000 0000.

Function setclockid (hport: thandle; clockid: byte; runmode: integer = 0): Boolean; stdcall; Return Value: Boolean Description: set the clock number and running mode.
Parameters
Clockid is required. Type: byte. New machine number.
Runmode is required. Type: integer. The new running mode. Value: 1 (attendance machine)

Function getclockid (port, baudrate: integer; var clockid: byte): Boolean; stdcall; Return Value: Boolean Description: Get the machine number.
Parameters
Clockid is required. Type: byte. Returns the clock number.

Function readclocktime (hport: thandle; var curtime: Double): Boolean; stdcall; Return Value: Boolean Description: clock time
Parameters
Required by curtime. Type: double. Returns the clock time.

Function setclocktime (hport: thandle; newtime: Double): Boolean; stdcall; Return Value: Boolean Description: set the clock time.
Parameters
Newtime is required. Double type.

Function downloadfontpage (hport: thandle; lpdata: pchar; Size: integer = 16; First: Boolean = false; finish: Boolean = false): Boolean; stdcall; Return Value: Boolean description: download the Chinese Character Library to Kaka
Parameters
Required for lpdata. Pchar type. Font Data Pointer
Size is required. Integer type. The number of bytes. It can only be 16 bytes.
Required. Boolean type. Download starts.
Required for finish. Boolean type. Download complete

Function readclockrecordtotal (hport: thandle; var data: integer; kind: integer = 0): Boolean; stdcall; Return Value: boolean type description: Total number of card swipe records read from the clock
Parameters
Data is required. Integer type. Returns the total number of swipe records.
Kind is optional. Integer type. Only 0

Function batchreadrecord (hport: thandle; var records: array of ticrecord; firstrecord: Boolean; retry: Boolean = false; kind: integer = 0): integer; stdcall; return value: integer Description: reads attendance data in batches.
Parameters
Required. Custom variables. Returned record Array
Firstrecord is required. Boolean type. Read the first record?
Retry is optional. Boolean type. Retry the previous record?
Kind is optional. Integer type. Only 0

Function stopreadrecord (hport: thandle): Boolean; stdcall; Return Value: Boolean Description: Cancel Data Reading in the middle.

Function clearallreadcard (hport: thandle): Boolean; stdcall; Return Value: boolean type description: Clear Card swipe data on the attendance machine.

Function setallowedcard (hport: thandle; card: pchar; emp_id: pchar; emp_name: pchar = nil; First: Boolean = true; finish: Boolean = false; batch: Boolean = false ): boolean; stdcall; Return Value: boolean type description: information about the registration card to the clock.
Parameters
Card is required. Pchar type. ID card number.
Emp_id is required. Pchar type. Employee ID.
Emp_name is required. Pchar type. Employee name.
Optional. Boolean type. Start registration. The value is true for the first call.
Optional. Boolean type. Ends registration. The value is true at the end.
Note: If the values of "first" and "finish" are both true, the registration is added to a single table; otherwise, the registration is re-ordered. Note: Re-sorting registration will delete all previous registration information and then re-register (if you have any questions, please contact the developer .)

Function readallowedcard (hport: thandle; card_id, emp_id, emp_name: pchar; First: Boolean; var finish: Boolean; var Total: integer): Boolean; stdcall; Return Value: boolean type description: read the registration card information from the clock.
Parameters
Card is required. Pchar type. The return card number. The buffer must be greater than 11 bytes.
Emp_id is required. Pchar type. The return employee ID. The buffer must be greater than 11 bytes.
Emp_name is required. Pchar type. The returned name. The buffer must be greater than 11 bytes.
Required. Boolean type. Start to read registration card information.
Required for finish. Boolean type. End read registration card information.
Total is required. Integer type. If first is true, the total number of registration cards is returned.
Note: you cannot exit midway through.

Function deleteallowedcard (hport: thandle; card: pchar): Boolean; stdcall; Return Value: boolean type description: delete a single registration card information.
Parameters
Card is required. Pchar type. The ID of the card to be deleted.

Function deleteallallowedcard (hport: thandle): Boolean; stdcall; Return Value: Boolean Description: delete all registration card information.

Function setemployeecustommessage (hport: thandle; card: pchar; MSG: pchar; First: Boolean; finish: Boolean): Boolean; stdcall; Return Value: Boolean description: set custom swiping message for employees (up to 200 people ).
Parameters
Card is required. Pchar type. The ID of the message to be registered.
MSG is required. Pchar type. To register a message, a maximum of 64 characters can be entered.
Required. Boolean type. Start download.
Required for finish. Boolean type. End download.

Function deleteemployeecustommessage (hport: thandle; card: pchar): Boolean; stdcall; Return Value: boolean type description: delete custom employee swipe messages.
Parameters
Card is required. Pchar type. The ID of the registration message to be deleted.

Function deleteallemployeecustommessage (hport: thandle): Boolean; stdcall; Return Value: boolean type description: delete all custom employee swipe messages.

Real-time communication functions
Function startuprealtime (hport: thandle): Boolean; stdcall; Return Value: boolean type description: starts real-time communication.

Function startuprealcollect (hport: thandle): Boolean; stdcall; Return Value: boolean type description: start to receive data in real time.

Function stoprealcollect (hport: thandle): Boolean; stdcall; Return Value: boolean type description: stop receiving data in real time.
Description: corresponds to startuprealcollect.

Function realreadrecord (hport: thandle; card: pchar; timestring: pchar; var mark, flag, clock_id: integer): integer; stdcall; Return Value: integer description: read a card data in real time (return immediately), success is 0.
Parameters
Card is required. Pchar type. The card number obtained by real-time communication (0 ends). The buffer length must be greater than 20 bytes.
Timestring is required. Pchar type. The 14-bit Card swiping time obtained by real-time communication (0 ends) in the format of yyyymmddhhmmss. The buffer length must be greater than 20 bytes.
Mark required. Integer type. Card data type.
Flag required. Integer type. Record type.
Clock_id is required. Integer type. Card swipe machine number.

Non-real-time communication (Real-time reading card numbers)
Function readcardno (hport: thandle; card: pchar; kind: integer): Boolean; stdcall; Return Value: boolean type description: reads the card number of the card area in real time without waiting for return.
Parameters
Card is required. Pchar type. Returns the read card number buffer, which must be longer than 20 bytes.
Kind required. Integer type. Get the card number status, 0-start read card number, 1-end read card number.

Function realreadcardno (hport: thandle; card: pchar; card_length: integer = 10): Boolean; stdcall; Return Value: boolean type description: Set the status of the card number.
Parameters
Card is required. Pchar type. The card number obtained by instant messaging. The buffer length must be greater than 20 bytes.
Card_length is required. Integer type. The length of the card number to be obtained must be 10.
Note: readcardno must be called first.
Nanben string description:
In input parameters, text is separated by spaces. For example, the input text format is "Chinese people ".

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.