0% found this document useful (0 votes)
16 views68 pages

PullSDK Development Guide v2.0

The ZKPulI SDK Development Guide provides comprehensive instructions for using the PullSDK interfaces to access data from C3 and C4 access control panels. It includes details on installation, function descriptions, and parameters for various operations such as connecting to devices, setting and getting device parameters, and controlling device actions. The document emphasizes the importance of proper connection parameters and outlines the structure of the SDK functions and their usage.

Uploaded by

insideauthority
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views68 pages

PullSDK Development Guide v2.0

The ZKPulI SDK Development Guide provides comprehensive instructions for using the PullSDK interfaces to access data from C3 and C4 access control panels. It includes details on installation, function descriptions, and parameters for various operations such as connecting to devices, setting and getting device parameters, and controlling device actions. The document emphasizes the importance of proper connection parameters and outlines the structure of the SDK functions and their usage.

Uploaded by

insideauthority
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 68

ZKPulI SDK Development Guide

Version: 2.0, Rev. A.1

Date: 2021.10.25
Copyright:

ZKTeco is a registered trademark and prohibits any other person from

using (including but not limited to disclosing, copying or distributing in

whole or in part) the information in this document in any form.

Copyright ©ZKTECO CO., LTD.2021.All rights reserved.

Release history:

Date Version Change

2021-10-25 2.0, Rev. A.1 New release version

contact information:

Software Park Phase III, Jimei District, Xiamen city, Fujian Province

B02 20-22Zkteco Software

Web:www.zkteco.com

For more branch offices and office addresses, please visit

www.zkteco.com
1.Overview of the PulISDK Interfaces.....................................................................................5
2.Description of the PullSDK Interface Technology.......................................................... 5
3.Installation of the PullSDK Interface.............................................................................. 6
4.Detailed Description of the PullSDK Interface Functions.......................................... 6
4.1 Connect............................................................................................................................... 6
4.2 ConnectExt.........................................................................................................................7
4.3 Disconnect.........................................................................................................................8
4.4 SetDeviceParam.................................................................................................................8
4.5 GetDeviceParam.................................................................................................................9
4.6 ControlDevice.................................................................................................................10
4.7 SetDeviceData.................................................................................................................11
4.8 GetDeviceData.................................................................................................................12
4.9 GetDeviceDataCount.......................................................................................................13
4.10 DeleteDeviceData.........................................................................................................14
4.11 GetRTLog.........................................................................................................................15
4.12 GetRTLogExt...................................................................................................................16
4.13 SearchDevice.................................................................................................................17
4.14 ModifyIPAddress...........................................................................................................18
4.15 PullLastError...............................................................................................................19
4.16 SetDeviceFileData.......................................................................................................19
4.17 GetDeviceFileData.......................................................................................................20
4.18 ProcessBackupData.......................................................................................................20
4.19 BufferToProtocolData.................................................................................................21
4.20 ProtocolDataToBuffer.................................................................................................21
4.21 SetParameters...............................................................................................................22
4.22 GetPullSDKVersion.......................................................................................................22
4.23 GetDeviceFileDataToPath...........................................................................................23
5. Appendix..................................................................................................................................... 23
5.1 Attached Table 1:Detailed Description of Interface Files......................23
5.2 Attached Table 2:Description of Controller Parameters............................ 24
5.3 Attached Table 3:Description of ControlDevice Parameters ....................31
5.4 Attached Table 4:Description of Structure of Function Tables..............32
5.4.1 Description of ladder control meter structure.................................... 32
5.4.1.1 Card number information table structure(user)....................32
5.4.1.2 pin authorization table(userauthorize).................................. 32
5.4.1.3 Holiday table(holiday).................................................................... 33
5.4.1.4 timezone table(timezone).............................................................. 34
5.4.1.5 Event table(transaction).............................................................. 35
5.4.1.6 First card door opening table(firstcard).............................. 36
5.4.1.7 Multicard door opening combination table(multimcard)......37
5.4.1.8 Linkage control i / o table(inoutfun).................................... 37
5.4.1.9 9.0Fingerprint template table(template)................................ 39
5.4.1.10 10.3Fingerprint template table (only on devices supporting
fingerprint 10.0)(templatev10).................................................................. 39
5.4.1.11 Loss report card (losscard).......................................................... 40
5.4.2 Old schema table structure instructions................................................ 40
5.4.2.1 Card number information table structure(user)....................40
5.4.2.2 Pin authorization table(userauthorize).................................. 41
5.4.2.3 holiday table(holiday).................................................................. 42
5.4.2.4 timezone table(timezone).............................................................. 42
5.4.2.5Event table(transaction)................................................................ 44
5.4.2.6 First card door opening table(firstcard).............................. 45
5.4.2.7 Multicard door opening combination table(multimcard)......45
5.4.2.8 Linkage control i/o table(inoutfun)........................................ 46
5.4.2.9 9.0 Fingerprint template table(template).............................. 47
5.4.2.10 10.3 Fingerprint template table (only on devices supporting
fingerprint 10.0)(templatev10).................................................................. 48
5.4.3 New schema table structure instructions................................................ 49
5.4.3.1 Card number information table structure(user)....................49
5.4.3.2 Pin authorization table(userauthorize).................................. 49
5.4.3.3 holiday table(holiday).................................................................. 50
5.4.3.4 timezone table(timezone).............................................................. 51
5.4.3.5 Event table(transaction).............................................................. 52
5.4.3.6 First card door opening table(firstcard).............................. 53
5.4.3.7 Multicard door opening combination table(multimcard)......53
5.4.3.8 Linkage control i/o table(inoutfun)........................................ 54
5.4.3.9 9.0 Fingerprint template table(template).............................. 55
5.4.3.10 10.3 Fingerprint template table (only on devices supporting
fingerprint 10.0)(templatev10).................................................................. 55
5.4.3.11 Loss report card(losscard)............................................................ 56
5.4.3.12 Antisubmarine table (antipassback)............................................ 56
5.4.3.13 Card number information table (cardinfo)................................ 56
5.4.3.14 Extended user (extuser).................................................................. 57
5.4.3.15 One person with more cards (mulcarduser)................................ 57
5.4.3.16 Auxiliary output setting table (outrelaysetting)................57
5.4.3.17 Daylight saving time (time setting) table(DSTSetting)......57
5.5 Attached Table5:Description of Error Codes in the Returnd Values......58
5.6 Attached Table 6:Description of Event Types and Code.............................. 60
5.7 Attached Table 7:Description of the data format returned by the parameter
Buffer in the GetRTLog function.................................................................................... 65
5.8 Attached Table 8:Description of data format returned by parameter Buffer
in GetRTLogExt function.....................................................................................................66
1.Overview of the PullSDK Interfaces

The PullSDK interfaces are a group of functions, which are used to access the data of the C3
and C4 access control panels.
PullSDK enables the developers of final application programs to aces the aces control panel
more visually, conveniently, and concisely. The PullSDK interface provides the following
functions:
Read and set the controller parameters

Read, set, and delete the related information (fr example, time segment, user information, and
holiday information) of the controller

Search for and modify the device information

2.Description of the PullSDK Interface Technology

In the eyes of the developers of final application programs, the PullSDK interfaces are a
group of extract interfaces that are used to set and get the data in the aces control panel. It seems
that the developers are using the most universal SQL sentences while accessing the user data. In
the eyes of the developers of application programs, the PullSDK interfaces seem to be a database
server.
The PullSDK interfaces support the TCP/IP and RS485 communication protocol.
The PullSDK interfaces are developed by using the ( language. Data communication is highly
optimized, thus turning the PullSDK interfaces into the concise and efficient access interfaces.
Initially, the PullSDK interfaces are designed by referring to the SQL, but the most commonly
used service model is the first consideration. Generally, the PullSDK interfaces are a group of
elaborately abstracted interfaces, which attain a good balance between design, implementation,
and use.
3.Installation of the PullSDK Interface

The PullSDK interface functions are contained in the plcommpro.dll file, which relies upon
several other files. You need to copy the following five DLL files together to the system directory
under Windows (windows / system32 under 32-bit operating system , windows / syswow64 under
64 bit operating system).After the file is copied, it does not need to be registered. It can be used
directly according to the following interface functions.

(Note: Attached table 1 describes the functions of every file).

4.Detailed Description of the PullSDK Interface

Functions

4.1 Connect

Long Connect(const char *Parameters)


Connect the device and return the connection handle after the connection is successful.
Parameter
The following table describes the parameters:
Parameter
Type Parameter properties Parameter description
names
Specify connection option
Parameters Const char * [in]
parameters
Return
Return Value Description:
Return value Return Value Description
Greater than 0 connection handle
0 failed
Note
Parameters connection strings are case sensitive.
Use the Parameter Parameter to specify connection options, as in the following example:
"protocol=RS485,port=COM2,baudrate=38400bps,deviceid=1,timeout=50000,passwd=";
"protocol=TCP,ipaddress=192.168.12.154,port=4370,timeout=4000,passwd=";
need to pass device-specific connection parameters to this function to implement the connection
function。
protocol Indicates the communication protocol, including RS485 and TCP;
port : device communication port 。 Such as , Connected in RS485 mode, port can be set to
COM1;The port for TCP communication, if not specially emphasized, is 4370 by default;
deviceid:RS485 communication address of equipment used for serial port;
baudrate:Baud rate used for serial communication;
ipaddress:TCP/IP Indicates the IP address of a device for communication;
timeout : connection timeout in milliseconds 。 In case of poor network connection quality,
increase the timeout value。generally,“timeout=5000”(5seconds)can meet the basic network
use;When the - 2 error code often appears in the query data, increase the timeout value,You can
set :“timeout=20000”(20seconds)。
passwd:Set the connection password for communication. It can be empty to indicate that no
password is used.

4.2 ConnectExt

Long ConnectExt(const char *Parameters, int *pErrorCode)


Connect the device and return the connection handle after successful connection , if the
connection fails, an error code is returned by *pErrorCode.
Parameter
T he following table describes the parameters:
Parameter
Type Parameter properties Parameter description
names
Specify connection option
Parameters Const char * [in]
parameters
Error code for connection
pErrorCode int * [in/out]
failure
Return
Return Value Description:
Return value Return Value Description
Greater than 0 connection handle
0 failed
Note
Parameters connection strings are case sensitive.
Use the Parameter Parameter to specify connection options, as in the following example:
"protocol=RS485,port=COM2,baudrate=38400bps,deviceid=1,timeout=50000,passwd=";
"protocol=TCP,ipaddress=192.168.12.154,port=4370,timeout=4000,passwd=";
need to pass device-specific connection parameters to this function to implement the connection
function。
protocol Indicates the communication protocol, including RS485 and TCP;
port:device communication port。For example, if the port is connected in RS485 mode, set port
to COM1. The TCP port is used for communication. If not specified, the default port is 4370;
deviceid:RS485 communication address of equipment used for serial port;
baudrate:Baud rate used for serial communication;
ipaddress:IP address of TCP / IP communication related equipment;
timeout : connection timeout in milliseconds 。 In case of poor network connection quality,
increase the timeout value。generally,“timeout=5000”(5seconds)can meet the basic network
use;When the - 2 error code often appears in the query data, increase the timeout value,You can
set :“timeout=20000”(20seconds)。
passwd:Set the connection password for communication. It can be empty to indicate that no
password is used。

4.3 Disconnect

Void Disconnect(void *handle)


Disconnect from the device.
Parameter
The following table describes the parameters:
Parameter
Type Parameter properties Parameter description
names
handle void * [in] connection handle
Return
null
Note

4.4 SetDeviceParam

int SetDeviceParam(void *handle, const char *ItemValues)


Set controller parameters, such as equipment number, door magnetic type, lock driving
time, card reading interval, etc.
Parameter
The following table describes the parameters:
Parameter
Type Parameter properties Parameter description
names
handle void * [in] connection handle
For the device parameter
values to be set, multiple
Parameter values can be
separated by commas. At
ItemValues const char * [in]
most 30 Parameter can be
set at one time (see Table 2
for the settable parameter
value attributes).
Return
Return Value Description:
Return value Return Value Description
0 success
Less than 0 failed,see attached table 5 for information on error codes
Note

4.5 GetDeviceParam

int GetDeviceParam(void *handle, char *Buffer, int BufferSize, const char *Items)
Read the controller Parameter, such as equipment number, door magnetic Type, lock driving
time, card reading interval, etc
Parameter
The following table describes the parameters:
Parameter
Type Parameter properties Parameter description
names
handle void * [in] connection handle
The buffer used to receive
return data. The return data
is in text format and may be
Buffer char * [in/out]
multiple parameter values.
Each parameter is separated
by commas.
The size of the buffer
BufferSize int [in]
used to receive Return data
The device parameter
names to be read are called
the table. Multiple names
can be separated by
Items const char * [in] commas. At most 30
parameters can be read at a
time (see Table 2 for the
readable parameter value
attribute).
Return
Return Value Description:
Return value Return Value Description
0 success
Less than 0 failed,see attached table 5 for information on error codes
Note

4.6 ControlDevice

int ControlDevice(void *handle, LONG OperationID, LONG Param1, LONG Param2, LONG
Param3, LONG Param4, const char *Options)
Control controller action。
Parameter
The following table describes the parameters:
Parameter
Type Parameter properties Parameter description
names
handle void * [in] connection handle
Operation contents: 1
means lock output or
auxiliary output, 2 means
cancel alarm, 3 restart the
equipment, 4 enable and
disable normally open (here,
OperationID LONG [in]
the disabled normally open
includes first open normally
open, five consecutive card
enabled normally open, and
remotely enabled normally
open).
When OperationID is
output operation, if param2
is door output, this
parameter represents the
number of the door in the
equipment; if param2 is
auxiliary output, this
Param1 LONG [in]
parameter represents the
number of the auxiliary
output port in the
equipment. For details, see
attached table 3; When
OperationID is cancel alarm,
the default value is 0
Param2 LONG [in] When OperationID is
output operation, this
parameter indicates the
address type of the
equipment output point (1:
lock output, 2: auxiliary
output). See attached table 3
for details; When
OperationID is cancel alarm,
the default value is 0; When
OperationID is 4, i.e.
normally open, this
parameter indicates whether
to normally open or disable
normally open (0: disabled;
1: enabled)
When OperationID is
output operation, this
parameter indicates the door
opening time (0 means
Param3 LONG closed, 255 means normally
open, the value range is 1 ~
60 (seconds)), and the
default value is 0

Param4 LONG Reserved. The default


value is 0
It is empty by default and
Options const char *
used for extension
Return
Return Value Description:
Return value Return Value Description
0 When return is 0 or positive, it indicates success
Less than 0 failed,see attached table 5 for information on error codes
Note

4.7 SetDeviceData

int SetDeviceData(void *handle,const char *TableName,const char *Data,const char *Options)


Setting data to the device is used to set data such as time period, user information and holiday
settings. The data can be one record or multiple records. If the primary key of the inserted record
is already in the device, the original record will be overwritten。
Parameter
The following table describes the parameters:
Parameter
Type Parameter properties Parameter description
names
handle void * [in] connection handle
Data table name. Please
TableName const char * [in] refer to attached Table IV for
the currently available tables
The data record indicates
that the data is in text format.
Multiple records are
Data const char * [in]
separated by \ r \ n, and each
field = value pair is separated
by \ t
It is empty by default and
Options const char * [in]
used for extension
Return
Return Value Description:
Return value Return Value Description
0 success
Less than 0 failed,see attached table 5 for information on error codes
Note

4.8 GetDeviceData

int GetDeviceData(void *handle, char *Buffer, int BufferSize, const char *TableName, const
char *FieldNames,const char *Filter, const char *Options)
Reading data from the device is used to read card swiping records, time periods, user
information, holiday settings and other data. The data can be one record or multiple records.
Parameter
The following table describes the parameters:
Parameter
Type Parameter properties Parameter description
names
handle void * [in] connection handle
The buffer used to receive
return data. The return data
is in text format and may be
Buffer char * [in]
multiple records. Each
record is separated by
\r\n
The size of the buffer
BufferSize int [in]
used to receive return data
Data table name. see
TableName const char * [in]
attached Table IV for
currently available table
names
A list of field names.
Multiple fields are separated
by \t, and "*" indicates all
FieldNames const char * [in]
fields. At this time, the first
row of the return data field
is the field name
Conditions for reading
data. When a single string
composed of "field name
operator value", multiple
conditions can be supported,
Filter const char * [in] separated by \ T, as follows:

< field name > = <


value > ("=" symbol cannot
have spaces on both sides)

Currently, it is only valid


when downloading the data
of access control event
record table. When the value
is "new record", download
Options const char * [in]
new records; when it is
empty, Download all
records. When downloading
other table data, this field
can be set to an empty string
Return
Return Value Description:
Return value Return Value Description
When return is 0 or a positive number, it indicates the success of the
0
operation, and its value is the number of records
Less than 0 failed,see attached table 5 for information on error codes
Note

4.9 GetDeviceDataCount

int GetDeviceDataCount(void *Handle, const char *TableName, const char *Filter,const char
*Options)
Read the total number of records in the device. Return specifies the number of records of the
data.
Parameter
The following table describes the parameters:
Parameter
Type Parameter properties Parameter description
names
handle void * [in] connection handle
Data table name. see
attached Table IV for
TableName const char * [in]
currently available table
names
It is empty by default and
Filter const char * [in]
used for extension;
It is empty by default and
Options const char * [in]
used for extension;
Return
Return Value Description:
Return value Return Value Description
When return is 0 or a positive number, it indicates the success of the
0
operation, and its value is the number of records
Less than 0 failed,see attached table 5 for information on error codes
Note

4.10 DeleteDeviceData

int DeleteDeviceData(void *handle, const char *TableName,const char *Data,const char


*Options)
Delete data in the device, such as user information, time period, etc.
Parameter
The following table describes the parameters:
Parameter
Type Parameter properties Parameter description
names
handle void * [in] connection handle
Data table name. see
attached Table IV for
TableName const char * [in]
currently available table
names.
For deleted conditions,
the data record indicates that
the data is in text format,
Data const char * [in]
and each "condition field =
value" pair is separated by
\t, * means delete all.
It is empty by default and
Options const char * [in]
used for extension;
Return
Return Value Description:
Return value Return Value Description
0 When return is 0 or positive, it indicates success
Less than 0 failed,see attached table 5 for information on error codes
Note

4.11 GetRTLog
int GetRTLog(void *handle,char *Buffer, int BufferSize)
Obtain the real-time event records generated by the equipment, as well as the door status and
alarm status of the equipment.
Parameter
The following table describes the parameters:
Parameter
Type Parameter properties Parameter description
names
handle void * [in] connection handle
The buffer used to receive
return data. The return data
is in text format.
There are two types of
data stored in the buffer, one
is real-time event recording,
and the other is door status /
alarm status. The data
returned with this function
can only be one of them at a
Buffer char * [in] time.If it is a real-time event
record, multiple event
records can be returned at
the same time (depending on
the number of event records
in the real-time monitoring
buffer in the device at the
current time).see attached
table 7 for detailed data
format in buffer。

The size of the buffer


BufferSize int [in]
used to receive return data
Return
Return Value Description:
Return value Return Value Description
0 When return is 0 or positive, it is the number of records receiving data
Less than 0 failed,see attached table 5 for information on error codes
Note

4.12 GetRTLogExt

int GetRTLogExt(void *handle,char *Buffer, int BufferSize)


Obtain the real-time event records generated by the equipment, as well as the door status and
alarm status of the equipment. Unlike GetRTLog, this function obtains a record in PUSH format。
Parameter
The following table describes the parameters:
Parameter
Type Parameter properties Parameter description
names
handle void * [in] connection handle
The buffer used to receive
return data. The return data
is in text format.
There are two types of data
stored in the buffer, one is
real-time event recording,
and the other is door status /
alarm status.The data
returned with this function
can only be one of them at a
time. If it is a real-time
Buffer char * [in]
event record, multiple event
records can be returned at
the same time (depending on
the number of event records
in the real-time monitoring
buffer in the device at the
current time).see attached
table 8 for detailed data
format in buffer。

The size of the buffer used


BufferSize int [in]
to receive return data
Return
Return Value Description:
Return value Return Value Description
0 When return is 0 or positive, it is the number of records receiving data
Less than 0 failed,see attached table 5 for information on error codes
Note

4.13 SearchDevice

int SearchDevice(char *CommType,char *Address, char *Buffer)


Search access controller in LAN.
Parameter
The following table describes the parameters:
Parameter
Type Parameter properties Parameter description
names
If the communication type is
"UDP" (or Ethernet), the
CommType char * [in] device with the specified
communication type will be
searched
Broadcast address: the LAN
devices within the specified
IP address range will be
Address char * [in]
searched. The default is
255.255.255.255, that is, the
whole network broadcast;
The buffer used to store the
searched devices. The user
shall determine the
requested memory value
according to the number of
Buffer char * [in]
devices in the network. For
example, it is recommended
to apply for 32K memory
within 50 devices and 64K
memory within 100 devices.
Return
Return Value Description:
Return value Return Value Description
When return is 0 or positive, it is the number of access control controllers
0
searched
Less than 0 failed,see attached table 5 for information on error codes
Note
Because this method searches the access control controller in the LAN by UDP broadcast, the
UDP broadcast packet cannot pass through the router, so the controller and the server cannot be
separated by a router.
In addition, if the device and server are not in the same network segment, but Ping cannot find the
controller IP address through this method, please try to adjust the controller IP address and server
address to the same subnet (not necessarily the same network segment). For the network settings
in the specific network, consult the corresponding network management to obtain the correct IP
address, Subnet mask and gateway.

4.14 ModifyIPAddress

int ModifyIPAddress(char *CommType,char *Address, char *Buffer)


Modify the IP address of the controller through UDP broadcasting (considering the security of the
device, only the IP address, subnet mask and gateway of the controller without password can be
modified).
Parameter
The following table describes the parameters:
Parameter
Type Parameter properties Parameter description
names
Communication mode used
when searching access
CommType char * [in]
controller 。 Here is "UDP"
(or Ethernet);
The broadcast address is
Address char * [in]
255.255.255.255 by default
Used to store the MAC
address and new IP address
of the target device;

Buffer char * [in]


In addition to the IP address,
please set the subnet mask
and gateway according to
the current network.
Return
Return Value Description:
Return value Return Value Description
0 When return is 0 or positive, it is the number of records receiving data
Less than 0 failed,see attached table 5 for information on error codes
Note
the current device has set the device communication password, in order to ensure the device
security, the IP address of the device cannot be modified through this method. To modify the IP
address, use SetDeviceParam to set the IP address, gateway and subnet mask.If you forget the
communication password, you can use the dial switch to initialize the communication parameter,
and the communication password will also be cancelled. The 7th bit of the dial switch is off by
default; When you dial it up and down for three times within 10 seconds, and finally dial it back to
the off bit, restart the device to recover the IP address, gateway, subnet mask and communication
password.

4.15 PullLastError

int PullLastError()
The function is used to Obtain the returned error code.If an error code return fails by using other
error codes,this function can be called to obtain the error code.For example,if 0 is returned when
an equipment connection fails by calling Connect(),you can run this function to obtain current
error code.
Parameter description
None
Return
Return error ID number
Note

4.16 SetDeviceFileData

int SetDeviceFileData(void *Handle, const char *FileName, char *Buffer,int BufferSize,const


char *Options)
Transfer files from PC to device。
Parameter
The following table describes the parameters:
Parameter
Type Parameter properties Parameter description
names
Handle void * [in] connection handle
The file name passed to the
FileName const char * [in] device, such as the emfw.cfg
file
Data buffer for files to be
Buffer char * [in]
transferred;
BufferSize int [in] Length of transmitted data;
It is empty by default and
Options const char * [in]
used for extension
Return
Return Value Description:
Return value Return Value Description
0 When return is 0 or positive, it indicates success
Less than 0 failed,see attached table 5 for information on error codes
Note
4.17 GetDeviceFileData

int GetDeviceFileData(void *Handle,char *Buffer,int *BufferSize,const char *FileName,const


char *Options)
Get files from device to PC.
Parameter
The following table describes the parameters:
Parameter
Type Parameter properties Parameter description
names
Handle void * [in] connection handle
Buffer char * [in] Buffer for receiving data
BufferSize int * [in] Length of received data
The file name obtained from
FileName const char * [in] the device, such as the main
file
It is empty by default and
Options const char * [in]
used for extension
Return
Return Value Description:
Return value Return Value Description
0 When return is 0 or positive, it indicates success
Less than 0 failed,see attached table 5 for information on error codes
Note

4.18 ProcessBackupData

int ProcessBackupData(const unsigned char *revBuf,int fileLen,char *outBuf,int outSize)


Files used to process device backup, such as backup files in SD card, etc
Parameter
The following table describes the parameters:
Parameter
Type Parameter properties Parameter description
names
const unsigned c Is the content of the file
revBuf [in]
har * passed in
fileLen int [in] Is the file length
Is the data to receive the
outBuf char * [in]
return
Is the maximum length of
outSize int [in]
accepted data
Return
Return Value Description:
Return value Return Value Description
0 When return is 0 or positive, it indicates success
Less than 0 failed,see attached table 5 for information on error codes
Note

4.19 BufferToProtocolData

int BufferToProtocolData(char *ProStruct, char *Buffer, int Datalen);


Converts a byte stream to a formatted string。
Parameter
The following table describes the parameters:
Parameter
Type Parameter properties Parameter description
names
ProStruct char * [in] Table structure information
When calling a function, the
buffer of the byte stream to
Buffer char * [in]
be converted and the format
string after the function call
Datalen int [in] Data length of byte stream
Return
Return Value Description:
Return value Return Value Description
When return is 0 or positive, it indicates success. Return is the number of
0
records in the format string
Less than 0 failed,see attached table 5 for information on error codes
Note

4.20 ProtocolDataToBuffer

int ProtocolDataToBuffer(char *Buffer, char *Datas, char *ProStruct, char *TableName);


Converts a formatted string to a byte stream。
Parameter
The following table describes the parameters:
Parameter
Type Parameter properties Parameter description
names
Buffer of converted byte
Buffer char * [in]
stream
The content of the format
Datas char * [in] string that needs to be
converted
ProStruct char * [in] Table structure information
TableName char * [in] Table name
Return
Return Value Description:
Return value Return Value Description
When return is 0 or positive, it indicates success, and the length of the byte
0
stream of return
Less than 0 failed,see attached table 5 for information on error codes
Note

4.21 SetParameters

int SetParameters(void *Handle, const char *Parameters)


Set SDK related Parameter
Parameter
The following table describes the parameters:
Parameter
Type Parameter properties Parameter description
names
Handle void * [in] connection handle
The SDK Parameter needs
Parameters const char * [in]
to be set
Return
Return Value Description:
Return value Return Value Description
0 When return is 0 or positive, it indicates success
Less than 0 failed,see attached table 5 for information on error codes
Note
At present, only setting communication timeout is supported,and
”timeout=**”

4.22 GetPullSDKVersion

int GetPullSDKVersion(unsigned char *buffer, int size);


Get pull SDK version
Parameter
The following table describes the parameters:
Parameter
Type Parameter properties Parameter description
names
buffer unsigned char * [in] Data cache
size int [in] data size
Return
Return Value Description:
Return value Return Value Description
When return is 0 or positive, it indicates success. The length of the buffer of
0
return
Less than 0 failed,see attached table 5 for information on error codes
Note

4.23 GetDeviceFileDataToPath

int GetDeviceFileDataToPath(void *Handle, const char *SrcFileName,const char


*DecFileName,const char *Options)
Obtain the file from the device and save it to the specified directory, including the file name to be
saved Parameter
The following table describes the parameters:
Parameter
Type Parameter properties Parameter description
names
Handle void * [in] connection handle
The file name obtained from
SrcFileName const char * [in] the device, such as the main
file
DecFileName const char * [in] File name to save, full path
It is empty by default and
Options const char * [in]
used for extension
Return
Return Value Description:
Return value Return Value Description
0 When return is 0 or positive, it indicates success
Less than 0 failed,see attached table 5 for information on error codes
Note

5. Appendix

5.1 Attached Table 1:Detailed Description of Interface Files

File Name Description


plcommpro.dll Dynamic connection database interface of the PullSDK function
plcomms.dll Database on which the PullSDK interfaces rely

plrscomm.dll Database on which the PullSDK interfaces rely


pltcpcomm.dll Database on which the PullSDK interfaces rely

plrscagent.dll Database on which the PullSDK interfaces rely


plusbcomm.dll Database on which the PullSDK interfaces rely
ZKCommuCryptoClient.
Database on which the PullSDK interfaces rely
dll
libareacode.dll Database on which regional

5.2 Attached Table 2 :Description of Controller Parameters


Note:Due to the large number of controller versions, the parameters cannot be listed one by one.
If necessary, contact technical support for help
Read
Attribute Name Parameter /write Remarks
Type
SerialNumber of
~SerialNumber Read only
device
MAC address MAC Read only
the number of locks on the control
Number of doors LockCount Read only
board
Number of read Only the number of Wiegand read
ReaderCount Read only
heads heads
Auxiliary input
AuxInCount Read only
quantity
Auxiliary onput
AuxOutCount Read only
quantity
Default:null character string.Maximum:
Communication Read
ComPwd 15-bit characters (including digits and
password /write
letters).
Read
IP address IPAddress Default :192.168.1.201
/write
Read
Gateway GATEIPAddress Default value is IPAddress
/write
Read
Baud rate RS232BaudRate Default : 38400
/write
Read
Subnet mask NetMask Default: 255.255.255.0
/write
One-door and two-way controller
1:Enable the anti-passback function
between the readers of Door 1
Two-door and single-way controller
Read
Anti-passback rule AntiPassback 1 Enable the anti-passback function
/write
between the Door1 and Door 2
Two-door and two-way controller
1:Enable the anti-passback function
between the readers of Door 1
2:Enable the anti-passback function
between the readers of Door 2
3:Enable the anti-passback function
between the readers of Door1 and
between the readers of Door2
respectively.
4:Enable the anti-passback function
between Doo1 and Door2.
Four-door and single-way controller
(anti-passback between reading heads
here only refers to anti submarine
between inbio reading heads)
1 :Enable the anti-passback function
between Door1 and Door2
2 :Enable the anti-passback function
between Door3 and Door4
3 :Enable the anti-passback function
between Door1 and Door2,and between
Door3 and Door4
4:Enable the anti-passback function
between Door1,2and Door3,4
5:Enable the anti-passback function
between Door1 and Door2,3.
6:Enable the anti-passback function
between Door1 and Door2,3,4
16:denotes that only supports
anti-passback function between the
readers of Door1
32:denotes that only supports
anti-passback function between the
readers of Door2
64:denotes that only supports
anti-passback function between the
readers of Door3
128 :denotes that only supports
anti-passback function between the
readers of Door4
Other options:
48 :denotes that Door1 and 2 support
concurrent anti-passback among their
respective readers.
80:denotes that Door1 and 2 support
concurrent anti-passback among their
respective readers.
144 :denotes that Door1 and 4 support
concurrent anti-passback among their
respective readers.
96 :denotes that Door2 and 3 support
concurrent anti-passback among their
respective readers.
160 :denotes that Door2 and 4 support
concurrent anti-passback among their
respective readers.
196:denotes that Door3 and 4 support
concurrent anti-passback among their
respective readers.
112 :denotes that Door1,2 and 3 support
concurrent anti-passback among their
respective readers.
176 :denotes that Door1,2 and 4 support
concurrent anti-passback among their
respective readers.
208:denotes that Door1,3 and 4 support
concurrent anti-passback among their
respective readers.
224 :denotes that Door2,3 and 4 support
concurrent anti-passback among their
respective readers.
240 :denotes that Door1,2,3 and 4
support concurrent anti-passback
among their respective readers.
(Choose and configure the preceding
options as required)
Two-door controller

1 :InterLock Door 1 and Door 2


mutually

Four-door controller

Read
Interlock InterLock 1 :InterLock Door 1 and Door 2
/write
mutually

2 :InterLock Door 3 and Door 4


mutually

3 :InterLock Door 1,Door 2 and Door 3


mutually
4:InterLock Door 1 and Door 2
mutually,and interLock Door 3 and
Door 4 mutually

5:InterLock Door 1 ,Door 2,Door 3 and


Door 4 mutually

Door1ForcePassWord
Door2ForcePassWord Read
Coercion code Maximum 8 bits
Door3ForcePassWord /write
Door4ForcePassWord
Door1SupperPassWord
Emergency Door2SupperPassWord Read
Maximum 8 bits
password Door3SupperPassWord /write
Door4SupperPassWord
Door1CloseAndLock
Lock at door Door2CloseAndLock Read 1: Enabled
closing Door3CloseAndLock /write 0 : Disabled
Door4CloseAndLock
Door1SensorType
0:Not available
Door2SensorType Read
Door senor type 1: Normal open
Door3SensorType /write
2:Normal closed
Door4SensorType
The set range(0~255)
Door1Drivertime
0 :Normal closed
Lock drive time Door2Drivertime Read
255 : Normal open
length Door3Drivertime /write
1~254 :Door-opening duration
Door4Drivertime
Note:The ladder control has 120 doors
Door1Detectortime
Timeout alarm
Door2Detectortime Read The set range(0~255)
duration of door
Door3Detectortime /write Unit :second
magnet
Door4Detectortime
1:Fingerprint
Door1VerifyType
4 :Card
Door2VerifyType Read
Verify mode 6:Card or fingerprint
Door3VerifyType /write
10:Card and fingerprint
Door4VerifyType
11: Card and Password
Door1MultiCardOpenDoor
Multi-card open Door2MultiCardOpenDoor Read 0 :Disabled
door Enable Door3MultiCardOpenDoor /write 1: Enabled
Door4MultiCardOpenDoor
Door1FirstCardOpenDoor
Opening the door 0: Disabled
Door2FirstCardOpenDoor Read
through the first
Door3FirstCardOpenDoor /write
card 1: First card normal open
Door4FirstCardOpenDoor
Active time
Door1ValidTZ The default value of 0 indicates that the
segment of the door
Door2ValidTZ Read lock is not activated
(time segment in
Door3ValidTZ /write
which a valid
Door4ValidTZ Note: the ladder control has 120 doors
punch)
Door1KeepOpenTimeZone
Normal-open time
Door2KeepOpenTimeZone Read Default 0(the parameter is not set)
segement of the
Door3KeepOpenTimeZone /write Note: the ladder control has 120 doors
door
Door4KeepOpenTimeZone
Door1Intertime
Door2Intertime Read
Punch interval 0 means no interval (unit:second)
Door3Intertime /write
Door4Intertime
Read 0 : Disabled
MCU watchdog WatchDog
/write 1: Enabled
DateTime= ((Year-2000)*12*31 +
(Month -1)*31 + (Day-1))*(24*60*60)
+ Hour* 60 *60 + Minute*60 + Second;
For example, the time to be set is
2010-10-26 20:54:55 after conversion

DateTime=347748895;Resolution
method:

If you get
Synchronization Write
DateTime “DateTime = 347748895”;
controller time only
Then:
Second = DateTime % 60;
Minute = ( DateTime / 60 ) % 60;
Hour = ( DateTime / 3600 ) % 24;
Day = ( DateTime / 86400 ) % 31 +
1;
Month= ( DateTime / 2678400 ) % 12 +
1;
Year = (DateTime / 32140800 ) +
2000;
Read 0: Disabled
Four doors to two Door4ToDoor2
/write 1: Enabled
Cancel door Door1CancelKeepOpenDay Date saved when canceling normally
Read only
normally open date Door2CancelKeepOpenDay open
Door3CancelKeepOpenDay
Door4CancelKeepOpenDay Note: the ladder control has 120 doors
SD card backup Read
BackupTime 1~24,Set to integer
time /write
Display parameters
Read 0:Never Show(default)
of daylight saving ~DSTF
/write 1:show
time
Enablement Read
parameters of /write 0:Never start(default)
DaylightSavingTimeOn
daylight saving 1:start
time
Enable mode of Read
0:mode 1
daylight saving DLSTMode /write
1:mode 2
time
1 is currently daylight saving time
Daylight saving Read
CurTimeMode 2 is not daylight saving time, and the
time marker /write
firmware is used internally
Start time of
Read The value have 4
daylight saving DaylightSavingTime
/write bytes:”month-date-hour-minute”
time mode
Daylight saving
Read The value have 4
time mode 1 end StandardTime
/write bytes:”month-date-hour-minute”
time
Daylight saving
Read
time mode 2 start WeekOfMonth1 The value range are 1 ~ 12
/write
time: month
Start of daylight
Read
saving time mode WeekOfMonth2 The value range are 1 ~ 6
/write
2: weeks
Daylight saving
Read
time mode 2 start: WeekOfMonth3 The value range are 1~7
/write
day of week
Daylight saving
Read
time mode 2 WeekOfMonth4 The value range are 0~23
/write
start :Hours
Start of daylight
Read
saving time mode WeekOfMonth5 The value range are 0~59
/write
2: minutes
Daylight saving
Read
time mode 2 end WeekOfMonth6 The value range are 1~12
/write
time: month
End of daylight
Read
saving time mode WeekOfMonth7 The value range are1~6
/write
2: what week
End of daylight
Read
saving time mode WeekOfMonth8 The value range are 1~7
/write
2: day of week
Daylight saving
Read
time mode 2 WeekOfMonth9 The value range are 0~23
/write
ends:Hours
End of daylight
Read
saving time mode WeekOfMonth10 The value range are 0~59
/write
2: minutes
Fingerprint
Read
comparison MThreshold The value range are 0~100
/write
threshold

Unique parameter of ladder control:


Master
Read 11 indicates a ladder controlled
configuration MachineType
/write machine
parameter
Master
1 Indicates that the machine is the
configuration IsMasterBoard
master computer
parameter
If C4 is used as an
expansion board,
the expansion board IsExtBoard 1 Indicates an expansion board
needs to be
configured
Activate host and 1 Indicates that the lock of the
ExtBoard1ID
expansion board host is activated
1 Indicates that the lock of
expansion board 1 is activated, and the
ExtBoard2ID
485 address of corresponding expansion
board 1 is 2, and so on
..
1 Indicates that the lock of the
ExtBoard12ID
expansion board 11 is activated
1 Indicates that the relay is on and the
digital key is inactive.
Configuration
RelayReverseFunOn If the controller controls the door lock
method of relay
for other purposes, the parameter is
configured as 0, indicating normal use.
Configure
parameter for the 16 indicates 16 relay extension board. If
number of locks on ExtLockCount C4 is used as an expansion board, this
the expansion parameter may not be configured
boardr
Host lock + expansion board
Calculation method
lock*ExtLockCount
of controllable lock
(such as 10 + 2*16 = 42)
The 485 address of 485 read head must
be configured as 1 before it can be
used.

Read head
The four Wiegand heads do not
configuration
distinguish the number one.

The access status in ladder control is


none。

5.3 Attached Table 3:Description of ControlDevice Parameters

Descripti
Operation Param1 Param2 Param3 Param4 Options
on
ID
0: disable
255: normal
1: Door open state
output 1~60: normal
Door number 2: auxiliary open or the Expansion
Output or auxiliary output(the duration of parameter
1 reserved
operation output address type normal open is null
number of output (If Param2=1,
operation) the value of
Param3 makes
sense)

Expansion
Cancel 0(null) 0(null) 0(null) parameter
2 reserved
alarm is null

Expansion
reboot 0(null) 0(null) 0(null) parameter
3 reserved
device is null

Enable/ Expansion
0:Disable 0(null)
4 disable Door number reserved parameter
1:Enable
normal is null
open state

Note: If OperationID=1, Param2 determine the Param1 value is door number or auxiliary output
number. If Param1 is door number, the max value is the door number that the device permitted. If
the Param1 is auxiliary output number, the max value is the auxiliary output number that the
device permitted.

5.4 Attached Table 4:Description of Structure of Function Tables

5.4.1 Description of ladder control meter structure

5.4.1.1 Card number information table structure(user)

Table name user


Field ID Field name width Type constraint remarks
User ID, firmware internal self
1 UID 2 int
increment field
2 CardNo 4 int Card number
Primary Personnel number, nine digit code,
3 Pin 4 int
key can only be numbers
4 Password 8 string password
5 Group 4 int Multicard door opener group
Validity start time
6 StartTime 4 int YYYYMMDD, such as:
20100823;
Expiration date YYYYMMDD,
7 EndTime 4 int
such as: 20100823;
8 Name 24 string User name
9 SuperAuthorize 4 int 1 Superuser privileges

5.4.1.2 pin authorization table(userauthorize)

Table name userauthorize


Field ID Field name width Type constraint remarks
Primary
1 Pin 4 int
key
AuthorizeTimez Primary
2 4 int timezoneID
oneId key
AuthorizeDoorI Primary AuthorizeDoorId indicates which
3 30 string
d key floors of the equipment are
included in this permission. The
value is a string of 30 byte
hexadecimal string. Every 2
hexadecimal characters are
converted into binary, indicating 8
floor permissions. If the
corresponding binary bit is 1, this
floor belongs to this permission.
For details, please refer to the
following:

0F0000000000000000000000000
000

Indicates that layers 1 ~ 4 have


permission

F00000000000000000000000000
000

Indicates that layers 5 ~ 8 have


permission

And so on (if the number of layers


is insufficient, you don't need to
fill in the following zeros, just
reserve the front part)

5.4.1.3 Holiday table(holiday)

Table name holiday


Field ID Field name width Type constraint remarks
Primary
1 Holiday 4 int 20100101 means January 1, 2010
key
2 HolidayType 4 int Holiday Type,only 1,2,3
1 means annual cycle, and the
month and day can be equal. 2
3 Loop 4 int
means that the month, month and
day must be equal
5.4.1.4 timezone table(timezone)

Table name timezone


Field ID Field name width Type constraint remarks
Primary
1 TimezoneId 4 int Index number
key
For example, the value from 8:30
2 SunTime1 4 int to 12:00 is (830 < < 16) + 1200,
that is 0x33e04b0
3 SunTime2 4 int
4 SunTime3 4 int
For example, the value from 8:30
5 MonTime1 4 int to 12:00 is (830 < < 16) + 1200,
that is 0x33e04b0
6 MonTime2 4 int
7 MonTime3 4 int
For example, the value from 8:30
8 TueTime1 4 int to 12:00 is (830 < < 16) + 1200,
that is 0x33e04b0
9 TueTime2 4 int
10 TueTime3 4 int
For example, the value from 8:30
11 WedTime1 4 int to 12:00 is (830 < < 16) + 1200,
that is 0x33e04b0
12 WedTime2 4 int
13 WedTime3 4 int
For example, the value from 8:30
14 ThuTime1 4 int to 12:00 is (830 < < 16) + 1200,
that is 0x33e04b0
15 ThuTime2 4 int
16 ThuTime3 4 int
For example, the value from 8:30
17 FriTime1 4 int to 12:00 is (830 < < 16) + 1200,
that is 0x33e04b0
18 FriTime2 4 int
19 FriTime3 4 int
For example, the value from 8:30
20 SatTime1 4 int to 12:00 is (830 < < 16) + 1200,
that is 0x33e04b0
21 SatTime2 4 int
22 SatTime3 4 int
Holiday 1 // For example, the
23 Hol1Time1 4 int
value from 8:30 to 12:00 is (830 <
< 16) + 1200, that is 0x33e04b0
Holiday 2 // For example, the
24 Hol1Time2 4 int value from 8:30 to 12:00 is (830 <
< 16) + 1200, that is 0x33e04b0
Holiday 3 // For example, the
25 Hol1Time3 4 int value from 8:30 to 12:00 is (830 <
< 16) + 1200, that is 0x33e04b0
26 Hol2Time1 4 int
27 Hol2Time2 4 int
28 Hol2Time3 4 int
29 Hol3Time1 4 int
30 Hol3Time2 4 int
31 Hol3Time3 4 int

5.4.1.5Event table(transaction)

Table name transaction


Field ID Field name width Type constraint remarks
1 Cardno 4 Int Card number
Primary
2 Pin 4 Int
key
Authentication method: 3 means
"password only" authentication;

4 stands for "card only"


verification;
3 Verified 1 char

11 represents "card plus


password" authentication;

200 stands for "other"


4 DoorID 1 char Door ID
Event type
5 EventType 1 char
See attached table 6 for details
6 InOutState 1 char Access status 0: out 1: in 2: other
Time stamp

If you want to take it out for


7 Time_second 4 Int analysis, the analysis formula is as
follows:
second = t % 60;
t /= 60;
minute = t % 60;
t /= 60;
hour = t % 24;
t /= 24;
day = t % 31 + 1;
t /= 31;
month = t % 12 + 1;
t /= 12;
year = t + 2000;)

5.4.1.6 First card door opening table(firstcard)

Table name firstcard


Field ID Field name width Type constraint remarks
Primary
1 Pin 4 int
key
It indicates which floors of the
equipment are included in this
permission. The value is a string
of 30 byte hexadecimal string.
Every 2 hexadecimal characters
are converted into binary,
indicating 8 floor permissions. If
the corresponding binary bit is 1,
this floor belongs to this
permission. For details, please
refer to the following:

0F0000000000000000000000000
Primary
2 DoorID 30 string 000
key

Indicates that layers 1 ~ 4 have


permission

F00000000000000000000000000
000

Indicates that layers 5 ~ 8 have


permission

and so on
Primary
3 TimezoneID 4 int
key

5.4.1.7 Multicard door opening combination table(multimcard)

Table name multimcard


Field ID Field name width Type constraint remarks
Primary
1 Index 4 int
key
2 DoorId 4 Int
Group number of multi card door
3 Group1 4 int
opening
Group number of multi card door
4 Group2 4 int
opening
Group number of multi card door
5 Group3 4 int
opening
Group number of multi card door
6 Group4 4 int
opening
Group number of multi card door
7 Group5 4 int
opening

5.4.1.8 Linkage control i / o table(inoutfun)

Table name inoutfun


Field ID Field name width Type constraint remarks
Primary
1 Index 2 int Trigger event index
key
All event types. When the event
type is 220 (auxiliary input point
off) and 221 (auxiliary input point
2 EventType 1 char short circuit), the input point is
auxiliary input; When the event
type is other than the above two
types, the input point is the door:
The input point InAddr is the
door:

0 any;
3 InAddr 1 char
1 door 1;

2 doors 2;
3 door 3;

4 doors 4;

The input point InAddr is an


auxiliary input:

0 any;

1 auxiliary input 1;

2 auxiliary input 2;

3 auxiliary input 3;

4 auxiliary input 4;
Output type 0 refers to door lock
4 OutType 1 char
and 1 refers to auxiliary output
OutAddr indicates lock:

1 door lock 1;

2 door lock 2;

3 door lock 3;

4 door lock 4;

Whenthe output type ‘OutType’


is 1, the output point
‘OutAddr ’represents auxiliary
5 OutAddr 1 char
output:

1 auxiliary output 1;

2 auxiliary output 2;

3 auxiliary output 3;

4 auxiliary output 4;

5 auxiliary output 5;

6auxiliary output 6
Output action time: 0 off, 1 ~ 254
6 OutTime 1 char
on, N seconds, 255 normally open
7 Reserved 1 char Reserve to ensure alignment

5.4.1.9 9.0Fingerprint template table(template)

Table name template


Field ID Field name width Type constraint remarks
1 Size 2 Int Fingerprint template length
Primary
2 Pin 2 Int Personnel pin
key
Finger number: if the fingerprint
is an ordinary fingerprint, the
value is 0 ~ 9; if it is a coercive
fingerprint, the value is 16 ~ 25
3 FingerID 1 char
(the finger number of the coercive
fingerprint is the finger number of
the normal fingerprint + 16);

0: invalid flag;

4 Valid 1 char 1: Valid signs;

3: Stress markers
5 Template 608 string Fingerprint template

5.4.1.10 10.3Fingerprint template table (only on devices supporting fingerprint

10.0)(templatev10)

Table name templatev10

Field ID Field name width Type constraint remarks

1 Size 2 int Fingerprint template length


2 UID 2 Int Firmware internal use
Primary
3 Pin 4 int Personnel pin
key
Finger number: if the fingerprint
is an ordinary fingerprint, the
value is 0 ~ 9; if it is a coercive
4 FingerID 1 char
fingerprint, the value is 16 ~ 25
(the finger number of the coercive
fingerprint is the finger number of
the normal fingerprint + 16);
0: invalid flag;

5 Valid 1 char 1: Valid signs;

3: Stress markers
LONG_B
6 Template 2080 Fingerprint template
YTE_T
7 Resverd 1 char reservefield
8 EndTag 1 char Firmware internal use

5.4.1.11 Loss report card (losscard)

Table name losscard


Field ID Field name width Type constraint remarks
Primary
1 CardNo 4 int Card number
key
Primary
2 Reserved 4 int
key

5.4.2 Old schema table structure instructions

5.4.2.1 Card number information table structure(user)

Table name user


Field ID Field name width Type constraint remarks
User ID, firmware internal self
1 UID 2 int
incrementing field
Card number. The maximum is
2 CardNo 4 int
2147483647
Primary Personnel number, nine digit code,
3 Pin 4 int
key can only be numbers
4 Password 8 string password
5 Group 4 int Multi card door opener group
Validity period start time
6 StartTime 4 int YYYYMMDD, for example:
20100823;
Expiration date: YYYYMMDD,
7 EndTime 4 int
for example: 20100823;
8 Name 24 string User name
9 SuperAuthorize 4 int
5.4.2.2 Pin authorization table(userauthorize)

Table name userauthorize


Field ID Field name width Type constraint remarks
Primary
1 Pin 4 int
key
AuthorizeTimez Primary
2 4 int timezoneID
oneId key
AuthorizeDoorId indicates which
doors of the device are included in
the permission. The value is
obtained through binary coding.
Each door is represented by a
binary bit. If the bit is 1, the door
belongs to the permission. For
details, please refer to the
following:

1 denotes lock1;

2 denotes lock2;

3 denotes lock1 and lock2;

4 denotes lock3;
AuthorizeDoorI Primary
3 4 int
d key 5 denotes lock1 and lock3;

6 denotes lock2 and lock3;

7 denotes lock1, lock2 and lock3;

8 denotes lock4;

9 denotes lock1 and lock4;

10 denotes lock2 and lock4;

11 denotes lock1, lock2 and


lock4;

12denotes lock3 and lock4;

13 denotes lock1, lock3 and


lock4;

14 denotes lock2, lock3 and


lock4;

15 denotes lock1, lock2, lock3 and


lock4

15 it can be calculated that the


numbers of the four doors are 1, 2,
3 and 4 respectively, then:

1<<(1-1)+1<<(2-1)+1<<(3-1)+1<
<(4-1)=15

or(1111)2 =(15)10

5.4.2.3 holiday table(holiday)

Table name holiday


Field ID Field name width Type constraint remarks
Primary
1 Holiday 4 int 20100101 means January 1, 2010
key
2 HolidayType 4 int Holiday type, can only be 1, 2, 3
1 means annual cycle, and the
month and day can be equal. 2
3 Loop 4 int
means that the month, month and
day must be equal

5.4.2.4 timezone table(timezone)

Table name timezone


Field ID Field name width Type constraint remarks
Primary
1 TimezoneId 4 int index
key
For example, the value from 8:30
2 SunTime1 4 int to 12:00 is (830 < < 16) + 1200,
that is 0x33e04b0
3 SunTime2 4 int
4 SunTime3 4 int
For example, the value from 8:30
5 MonTime1 4 int to 12:00 is (830 < < 16) + 1200,
that is 0x33e04b0
6 MonTime2 4 int
7 MonTime3 4 int
For example, the value from 8:30
8 TueTime1 4 int to 12:00 is (830 < < 16) + 1200,
that is 0x33e04b0
9 TueTime2 4 int
10 TueTime3 4 int
For example, the value from 8:30
11 WedTime1 4 int to 12:00 is (830 < < 16) + 1200,
that is 0x33e04b0
12 WedTime2 4 int
13 WedTime3 4 int
For example, the value from 8:30
14 ThuTime1 4 int to 12:00 is (830 < < 16) + 1200,
that is 0x33e04b0
15 ThuTime2 4 int
16 ThuTime3 4 int
For example, the value from 8:30
17 FriTime1 4 int to 12:00 is (830 < < 16) + 1200,
that is 0x33e04b0
18 FriTime2 4 int
19 FriTime3 4 int
For example, the value from 8:30
20 SatTime1 4 int to 12:00 is (830 < < 16) + 1200,
that is 0x33e04b0
21 SatTime2 4 int
22 SatTime3 4 int
Holiday 1 // For example, the
23 Hol1Time1 4 int value from 8:30 to 12:00 is (830 <
< 16) + 1200, that is 0x33e04b0
Holiday 2 // For example, the
24 Hol1Time2 4 int value from 8:30 to 12:00 is (830 <
< 16) + 1200, that is 0x33e04b0
Holiday 3 // For example, the
25 Hol1Time3 4 int value from 8:30 to 12:00 is (830 <
< 16) + 1200, that is 0x33e04b0
26 Hol2Time1 4 int
27 Hol2Time2 4 int
28 Hol2Time3 4 int
29 Hol3Time1 4 int
30 Hol3Time2 4 int
31 Hol3Time3 4 int
5.4.2.5Event table(transaction)

Table name transaction


Field ID Field name width Type constraint remarks
1 Cardno 4 Int Card number
Primary
2 Pin 4 Int
key
Authentication method: 3 means
"password only" authentication;

4 stands for "card only"


verification;

3 Verified 1 char
11 represents "card plus
password" authentication;

200 stands for "other"

1 stands for "fingerprint"


4 DoorID 1 char Door ID
Event type
5 EventType 1 char
See attached table VI for details
6 InOutState 1 char
Time stamp

If you want to take it out for


analysis, the analysis formula is as
follows:
second = t % 60;
t /= 60;
minute = t % 60;
7 Time_second 4 Int t /= 60;
hour = t % 24;
t /= 24;
day = t % 31 + 1;
t /= 31;
month = t % 12 + 1;
t /= 12;
year = t + 2000;)
5.4.2.6 First card door opening table(firstcard)

Table name firstcard


Field ID Field name width Type constraint remarks
Primary
1 Pin 4 int
key
It indicates which floors of the
equipment are included in this
permission. The value is a string
of 30 byte hexadecimal string.
Every 2 hexadecimal characters
are converted into binary,
indicating 8 floor permissions. If
the corresponding binary bit is 1,
this floor belongs to this
permission. For details, please
refer to the following:

0F0000000000000000000000000
Primary
2 DoorID 30 string 000
key

Indicates that layers 1 ~ 4 have


permission

F00000000000000000000000000
000

Indicates that layers 5 ~ 8 have


permission

and so on
Primary
3 TimezoneID 4 int Max 20
key

5.4.2.7 Multicard door opening combination table(multimcard)

Table name multimcard


Field ID Field name width Type constraint remarks
Primary
1 Index 4 int
key
2 DoorId 4 Int
Group number of multi card door
3 Group1 4 int
opening
Group number of multi card door
4 Group2 4 int
opening
Group number of multi card door
5 Group3 4 int
opening
Group number of multi card door
6 Group4 4 int
opening
Group number of multi card door
7 Group5 4 int
opening

5.4.2.8 Linkage control i/o table(inoutfun)

Table name inoutfun


Field ID Field name width Type constraint remarks
Primary
1 Index 2 int Trigger event index
key
All event types. When the event
type is 220 (auxiliary input point
off) and 221 (auxiliary input point
2 EventType 1 char short circuit), the input point is
auxiliary input; When the event
type is other than the above two
types, the input point is the door:
The input point InAddr is the
door:

0 any;

1 door 1;

2 doors 2;

3 InAddr 1 char 3 door 3;

4 doors 4;

The input point InAddr is an


auxiliary input:

0 any;

1 auxiliary input 1;
2 auxiliary input 2;

3 auxiliary input 3;

4 auxiliary input 4;
Output type 0 refers to door lock
4 OutType 1 char
and 1 refers to auxiliary output
OutAddr indicates lock:

1 door lock 1;

2 door lock 2;

3 door lock 3;

4 door lock 4;

When the output type ‘OutType’


is 1, the output point ‘OutAddr’
5 OutAddr 1 char represents auxiliary output:

1 auxiliary output 1;

2 auxiliary output 2;

3 auxiliary output 3;

4 auxiliary output 4;

5 auxiliary output 5;

6auxiliary output 6;
Output action time: 0 off, 1 ~ 254
6 OutTime 1 char
on, n seconds, 255 normally open
7 Reserved 1 char Reserve to ensure alignment

5.4.2.9 9.0 Fingerprint template table(template)

Table name template


Field ID Field name width Type constraint remarks
1 Size 2 Int Fingerprint template length
Primary
2 Pin 2 Int Personnel Pin
key
Finger number: if the fingerprint
is an ordinary fingerprint, the
value is 0 ~ 9; if it is a coercive
fingerprint, the value is 16 ~ 25
3 FingerID 1 char
(the finger number of the coercive
fingerprint is the finger number of
the normal fingerprint + 16);

0: invalid flag;

4 Valid 1 char 1: Valid signs;

3: Stress markers
5 Template 608 string Fingerprint template

5.4.2.10 10.3Fingerprint template table (only on devices supporting fingerprint

10.0)(templatev10)

Table name templatev10


Field ID Field name width Type constraint remarks
1 Size 2 int Fingerprint template length
2 UID 2 Int Firmware internal use
Primary
3 Pin 4 int Personnel Pin
key
Finger number: if the fingerprint
is an ordinary fingerprint, the
value is 0 ~ 9; if it is a coercive
fingerprint, the value is 16 ~ 25
4 FingerID 1 char
(the finger number of the coercive
fingerprint is the finger number of
the normal fingerprint + 16);

0: invalid flag;

5 Valid 1 char 1: Valid signs;

3: Stress markers
LONG_B
6 Template 2080 Fingerprint template
YTE_T
7 Resverd 1 char reservefield
8 EndTag 1 char Firmware internal use
5.4.3 New schema table structure instructions

5.4.3.1 Card number information table structure(user)

Table name user


Field ID Field name width Type constraint remarks
User ID, firmware internal self
1 UID 2 int
incrementing field
2 CardNo 4 int Card Number
Primary Personnel number, nine digit code,
3 Pin 24 string
key can only be numbers
4 Password 8 string password
5 Group 4 int Multicard door opener group
Validity period start time
6 StartTime 4 int YYYYMMDD, for example:
20100823;
Expiration date: YYYYMMDD,
7 EndTime 4 int
for example: 20100823;
8 Name 24 string User name
9 SuperAuthorize 4 int
10 Disable 1 char Enable and Disable

5.4.3.2 Pin authorization table(userauthorize)

Table name userauthorize


Field ID Field name width Type constraint remarks
Primary
1 Pin 24 string
key
AuthorizeTimez Primary
2 4 int timezoneID
oneId key
AuthorizeDoorId indicates which
doors of the device are included in
the permission. The value is
obtained through binary coding.
Each door is represented by a
AuthorizeDoorI Primary binary bit. If the bit is 1, the door
3 4 int
d key belongs to the permission. For
details, please refer to the
following:

1 denotes lock1;
2 denotes lock2;

3 denotes lock1 and lock2;

4 denotes lock3;

5denotes lock1 and lock3;

6 denotes lock2 and lock3;

7 denotes lock1, lock2 and lock3;

8 denotes lock4;

9 denotes lock1 and lock4;

10 denotes lock2 and lock4;

11 denotes lock1, lock2 and


lock4;

12 denotes lock3 and lock4;

13 denotes lock1, lock3 and


lock4;

14 denotes lock2, lock3 and


lock4;

15 denotes lock1, lock2, lock3 and


lock4

15 it can be calculated that the


numbers of the four doors are 1, 2,
3 and 4 respectively, then:

1<<(1-1)+1<<(2-1)+1<<(3-1)+1<
<(4-1)=15
or(1111)2 =(15)10

5.4.3.3 holiday table(holiday)

Table name holiday


Field ID Field name width Type constraint remarks
Primary
1 Holiday 4 int 20100101 means January 1, 2010
key
2 HolidayType 4 int Holiday type, can only be 1, 2, 3
1 means annual cycle, and the
month and day can be equal. 2
3 Loop 4 int
means that the month, month and
day must be equal

5.4.3.4 timezone table(timezone)

Table name timezone


Field ID Field name width Type constraint remarks
Primary
1 TimezoneId 4 int Index
key
For example, the value from 8:30
2 SunTime1 4 int to 12:00 is (830 < < 16) + 1200,
that is 0x33e04b0
3 SunTime2 4 int
4 SunTime3 4 int
For example, the value from 8:30
5 MonTime1 4 int to 12:00 is (830 < < 16) + 1200,
that is 0x33e04b0
6 MonTime2 4 int
7 MonTime3 4 int
For example, the value from 8:30
8 TueTime1 4 int to 12:00 is (830 < < 16) + 1200,
that is 0x33e04b0
9 TueTime2 4 int
10 TueTime3 4 int
For example, the value from 8:30
11 WedTime1 4 int to 12:00 is (830 < < 16) + 1200,
that is 0x33e04b0
12 WedTime2 4 int
13 WedTime3 4 int
For example, the value from 8:30
14 ThuTime1 4 int to 12:00 is (830 < < 16) + 1200,
that is 0x33e04b0
15 ThuTime2 4 int
16 ThuTime3 4 int
For example, the value from 8:30
17 FriTime1 4 int to 12:00 is (830 < < 16) + 1200,
that is 0x33e04b0
18 FriTime2 4 int
19 FriTime3 4 int
For example, the value from 8:30
20 SatTime1 4 int to 12:00 is (830 < < 16) + 1200,
that is 0x33e04b0
21 SatTime2 4 int
22 SatTime3 4 int
Holiday 1 // For example, the
23 Hol1Time1 4 int value from 8:30 to 12:00 is (830 <
< 16) + 1200, that is 0x33e04b0
Holiday 2 // For example, the
24 Hol1Time2 4 int value from 8:30 to 12:00 is (830 <
< 16) + 1200, that is 0x33e04b0
Holiday 3// For example, the
25 Hol1Time3 4 int value from 8:30 to 12:00 is (830 <
< 16) + 1200, that is 0x33e04b0
26 Hol2Time1 4 int
27 Hol2Time2 4 int
28 Hol2Time3 4 int
29 Hol3Time1 4 int
30 Hol3Time2 4 int
31 Hol3Time3 4 int

5.4.3.5 Event table(transaction)

Table name transaction


Field ID Field name width Type constraint remarks
Primary
1 Pin 24 string
key
Authentication method: 3 means
"password only" authentication;

4 stands for "card only"


verification;
2 Verified 1 char

11 represents "card plus


password" authentication;

200 stands for "other"


3 DoorID 1 char Door ID
Event options ‘EventType’
4 EventType 1 char
See attached table VI for details
5 InOutState 1 char
Time stamp

If you want to take it out for


analysis, the analysis formula is as
follows:
second = t % 60;
t /= 60;
minute = t % 60;
6 Time_second 4 int
t /= 60;
hour = t % 24;
t /= 24;
day = t % 31 + 1;
t /= 31;
month = t % 12 + 1;
t /= 12;
year = t + 2000;)
Configuration ID number of
7 Index 4 Int
linkage
8 Cardno 8 Long long Card number
9 Sitecode 4 int

5.4.3.6 First card door opening table(firstcard)

Table name firstcard


Field ID Field name width Type constraint remarks
Primary
1 Pin 24 string
key
Primary
2 DoorID 4 int
key
3 TimezoneID 4 int

5.4.3.7 Multicard door opening combination table(multimcard)

Table name multimcard


Field ID Field name width Type constraint remarks
Primary
1 Index 4 int
key
2 DoorId 4 Int
Group number of multi card door
3 Group1 4 int
opening
Group number of multi card door
4 Group2 4 int
opening
5 Group3 4 int Group number of multi card door
opening
Group number of multi card door
6 Group4 4 int
opening
Group number of multi card door
7 Group5 4 int
opening

5.4.3.8 Linkage control i/o table(inoutfun)

Table name inoutfun


Field ID Field name width Type constraint remarks
Primary
1 Index 4 int Trigger event index
key
All event types. When the event
type is 220 (auxiliary input point
off) and 221 (auxiliary input point
2 EventType 1 char short circuit), the input point is
auxiliary input; When the event
type is other than the above two
types, the input point is the door:
The input point InAddr is the
door:

0 any;
1 door 1;
2 doors 2;

3 door 3;
3 InAddr 1 char
4 doors 4;
The input point InAddr is an
auxiliary input:
0 any;
1 auxiliary input 1;
2 auxiliary input 2;
3 auxiliary input 3;
4 auxiliary input 4;
Output type 0 refers to door lock
4 OutType 1 char
and 1 refers to auxiliary output
OutAddr indicates lock:
1 door lock 1;
2 door lock 2;
5 OutAddr 1 char
3 door lock 3;
4 door lock 4;
When the output type ‘OutType’
is 1, the output point ‘OutAddr’
represents auxiliary output:
1 auxiliary output 1;
2 auxiliary output 2;
3 auxiliary output 3;
4 auxiliary output 4;
5 auxiliary output 5;
6auxiliary output 6
Output action time: 0 off, 1 ~ 254
6 OutTime 1 char
on, N seconds, 255 normally open
7 Reserved 1 char Reserve to ensure alignment

5.4.3.9 9.0 Fingerprint template table(template)

Table name template


Field ID Field name width Type constraint remarks
1 Size 2 Int Fingerprint template length
Primary
2 Pin 24 string Personnel Pin
key
Finger number: if the fingerprint
is an ordinary fingerprint, the
value is 0 ~ 9; if it is a coercive
fingerprint, the value is 16 ~ 25
3 FingerID 1 char
(the finger number of the coercive
fingerprint is the finger number of
the normal fingerprint + 16);

0: invalid flag;

4 Valid 1 char 1: Valid signs;

3: Stress markers
5 Template 608 string Fingerprint template

5.4.3.10 10.3 Fingerprint template table (only on devices supporting fingerprint

10.0)(templatev10)

Table name templatev10


Field ID Field name width Type constraint remarks
1 Size 2 int Fingerprint template length
2 UID 2 Int Firmware internal use
3 Pin 24 string Primary Personnel Pin
key
Finger number: if the fingerprint
is an ordinary fingerprint, the
value is 0 ~ 9; if it is a coercive
4 FingerID 1 char fingerprint, the value is 16 ~ 25
(the finger number of the coercive
fingerprint is the finger number of
the normal fingerprint + 16);
0: invalid markers;

5 Valid 1 char 1: Valid markers;

3: Duress markers
LONG_B
6 Template 2080 Fingerprint template
YTE_T
7 Resverd 1 char Reserve field
8 EndTag 1 char Firmware internal use

5.4.3.11 Loss report card(losscard)

Table name losscard


Field ID Field name width Type constraint remark
Primary
1 CardNo 4 int Card number
key
Primary
2 Reserved 4 int
key

5.4.3.12 Antisubmarine table (antipassback)

Table name antipassback


Field ID Field name width Type constraint remark
Primary
1 Index 4 int
key
2 AddrID 4 int
ConditionAddrI
3 4 int
D

5.4.3.13Card number information table (cardinfo)

Table name cardinfo


Field ID Field name width Type constraint remark
1 Pin 24 string Primary
key
2 CardNo 4 int Card number

5.4.3.14 Extended user (extuser)

Table name extuser


Field ID Field name width Type constraint remark
Primary
1 Pin 24 string
key
2 FunSwitch 4 int

5.4.3.15 One person with more cards (mulcarduser)

Table name mulcarduser


Field ID Field name width Type constraint remark
1 Pin 24 string
Primary
2 CardNo 8 Long long Card number
key
Primary
3 SiteCode 2 int Location code
key

5.4.3.16 Auxiliary output setting table (outrelaysetting)

Table name outrelaysetting


Field ID Field name width Type constraint remark
Primary
1 Num 1 char Output point
key
0 indicates door and 1 indicates
2 OutType 1 char
auxiliary output
Indicates 0 none, 2 normally
3 ActionType 1 char
closed, 1 normally open
4 TimezoneId 4 int Is the id number of timezone.dat

5.4.3.17 Daylight saving time (time setting) table(DSTSetting)

Table name DSTSetting


Field ID Field name width Type constraint remark
Primary
1 Year 4 int
key
2 StartTime 4 int
3 EndTime 4 int
4 Loop 4 int
Note: please the case of the field in the Note table.

5.5 Attached Table5 : Description of Error Codes in the

Returned Values

(1)Error Code of PullSDK and Firmware By provided


Error code Description
-1 The command is not sent successfully
-2 The command has no response
-3 The buffer is not enough
-4 The decompression fails
-5 The length of the read data is not correct
-6 The length of the decompressed data is not consistent with the
expected length
-7 The command is repeated
-8 The connection is not authorized
-9 Data error: The CRC result is failure
-10 Data error: PullSDK cannot resolve the data
-11 Data parameter error
-12 The command is not executed correctly
-13 Command error: This command is not available
-14 The communication password is not correct
-15 Fail to write the file
-16 Fail to read the file
-17 The file does not exist
-18 Insufficient equipment space
-19 Checksum error
-20 The received data length is inconsistent with the given data length
-21 Platform parameter is not set in the device
-22 During firmware upgrade, the platform of the transmitted firmware
is inconsistent with the local platform
-23 The upgraded firmware version is older than the firmware version in
the device
-24 Error upgrading file ID
-25 During firmware upgrade, the file name passed is incorrect, that is,
it is not emfw.cfg
-26 The length of the transmitted fingerprint template is 0
-27 The pin number of the fingerprint passed is wrong. The user cannot
be found

-28 Execute door opening command in normally open period


-99 unknown error
-100 The table structure does not exist
-101 In the table structure, the Condition field does not exit
-102 The total number of fields is not consistent
-103 The sequence of fields is not consistent
-104 Real-time event data error
-105 Data errors occur during data resolution.
-106 Data overflow: The delivered data is more than 4 MB in length
-107 Fail to get the table structure
-108 Invalid options
-112 PC incoming data receive buffer insufficient
-201 Load Library failure
-202 Fail to invoke the interface
-203 Communication initialization fails
The serial port agent fails to start because the serial port does not
-206
exist or the serial port is occupied
-301 Requested TCP/IP version error
-302 Incorrect version number
-303 Fail to get the protocol type
-304 Invalid socket
-305 Socket error
-306 Host error
-307 connection timed out

(2)Some common winsocket error codes

Resources temporarily unavailable.


This error is returned from operations on nonblocking sockets that cannot be
completed immediately, for example, recv (Wsapiref_2i9e.asp) when no data is
queued to be read from the socket. It is a non-fatal error, and the operation
10035
should be retried later. It is normal for WSAEWOULDBLOCK to be reported as
the result from calling connect on a nonblocking SOCK_STREAM socket
(Wsapiref_8m7m.asp), since some time must elapse for the connection to be
established.
An operation was attempted on something that is not a socket. Ether the
10038 socket handle parameter did not reference a valid socket, or for select, a
member of an fd_set was no valid.
Connection reset by peer.
An existing connection was forcibly closed by the remote host. This normally
results if the peer application on the remote host is suddenly stopped, the host
is rebooted, the host or remote network interface is disabled, or the remote
host uses a hard close (See setsockopt (Wsapiref_94aa.asp) for more
10054
information on the SO_LINGER option on the remote socket). This error may
also result if a connection was broken due to keep-alive activity detecting a
failure while one or more operations are in progress. Operations that were in
progress fail with WSAENETRESET. Subsequent operations fail with
WSAECONNRESET.
Connection timed out.
A connection attempt failed because the connected party did not properly
10060
respond after a period of time, or established connection failed because
connected host has failed to respond.
Connection refused.
No connection could be made because the target machine actively refused it.
10061
This usually results from trying to connect to a server that is inactive on the
foreign host — that is, one with no server application running.
No route to host.
10065 A socket operation was attempted to an unreachable host. See
WSAENETUNREACH.

5.6 Attached Table 6:Description of Event Types and Code

Code Event Types Description

In [Card Only] verification mode, the person has open


0 Normal Punch Open door permission punch the card and triggers this normal
event of open the door.
At the normally open period (set to normally open period
of a single door or the door open period after the first card
Punch during Normal Open Time normally open), or through the remote normal open
1
Zone operation, the person has open door permission punch the
effective card at the opened door to trigger this normal
events.
In [Card Only] verification mode, the person has first card
First Card Normal Open (Punch normally open permission, punch card at the setting first
2
Card) card normally open period but the door is not opened, and
trigger the normal event.
In [Card Only] verification mode, multi-card combination can
3 Multi-Card Open (Punching Card) be used to open the door. After the last piece of card verified, the
system trigger this normal event.
The password (also known as the super password) set for the
4 Emergency Password Open current door can be used for door open. It will trigger this
normal event after the emergency password verified.
If the current door is set a normally open period, the door
Open during Normal Open Time
5 will open automatically after the setting start time, and
Zone
trigger this normal event.
When the linkage setting the system takes effect, trigger
6 Linkage Event Triggered
this normal event.
When the user cancel the alarm of the corresponding door, and
7 Cancel Alarm
the operation is success, trigger this normal event.
When the user opens a door from remote and the
8 Remote Opening
operation is successful, it will trigger this normal event.
When the user close a door from remote and the operation
9 Remote Closing
is successful, it will trigger this normal event.
When the door is in Normally Open (NO) state, swipe
Disable Intraday Normal Open
your valid card five times through the reader or call
10 Time Zone
ControlDevice to disable the NO period on that day. In
this case, trigger this normal event.
When the door’s NO period is disabled, swipe your valid
Enable Intraday Normal Open card (held by the same user) five times through the reader or call
11
Time Zone ControlDevice to enable the NO period on that day.
In this case, trigger this normal event.
If the output point address is set to a specific auxiliary
Open Auxiliary Output output point and the action type is set enabled in a linkage
12
setting record, then this normal event will be triggered as
long as this linkage setting takes effect.
Close Auxiliary Output Events that are triggered when you disable the auxiliary input
13
through linkage operations or by calling ControlDevice.
Normal events that are triggered after any person
Press Fingerprint Open authorized to open the door presses his fingerprint and
14
passes the verification in “Fingerprint only” or
“Card/Fingerprint” verification modes.
Multi-Card Open (Press Multi-card open(Fingerprint required): normal events that
15 Fingerprint) are triggered when the last person opens the door with his
fingerprint in “Finger print” verification mode.
Normal events that are triggered after any person
Press Fingerprint during Normal authorized to open the door presses his valid fingerprint
16 Open Time Zone during the NO duration (including the NO durations set
for single doors and the first-card NO duration) and
through remote operations.
Normal events that are triggered after any person
Card plus Fingerprint Open authorized to open the door swipes his card and presses
17
his fingerprint to pass the verification in the “Card +
Fingerprint” verification mode.
Normal events that are triggered after any person authorized to
First Card Normal Open (Press open the door becomes the first one to press his fingerprint and
18 Fingerprint) pass the verification during the preset first-card NO duration and
in either the “Fingerprint only” or the “Card/Fingerprint”
verification mode.
Normal events that are triggered after any person
First Card Normal Open (Card
authorized to open the door becomes the first one to swipe
plus
19 his card and press his fingerprint to pass the verification
Fingerprint)
during the preset first-card NO duration and in the “Card
+ Fingerprint” verification mode.
When the interval between two card punching is less than the
20 Too Short Punch Interval
interval preset for the door, trigger this abnormal event.
In [Card Only] verification mode, the user has the door open
Door Inactive Time Zone (Punch
21 permission, punch card but not at the door effective period of
Card)
time, and trigger this abnormal event.
The user with the permission of opening the current door,
22 Illegal Time Zone punches the card during the invalid time zone, and triggers this
abnormal event.
The registered card without the access permission of the current
23 Access Denied
door, punch to open the door, triggers this abnormal event.
When the anti-pass back setting of the system takes effect,
24 Anti-Passback
triggers this abnormal event.
When the interlocking rules of the system take effect, trigger this
25 Interlock
abnormal event
Multi-Card Authentication Use multi-card combination to open the door, the card
26 (Punching verification before the last one (whether verified or not), trigger
Card) this normal event
Refers to the current card is not registered in the system, trigger
27 Unregistered Card
this abnormal event.
The door sensor detect that it is expired the delay time after
28 Opening Timeout:
opened, if not close the door, trigger this abnormal event
The person with the door access permission, punch card to open
29 Card Expired the door after the effective time of the access control, can not be
verified and will trigger this abnormal event.
Use card plus password, duress password or emergency
30 Password Error password to open the door, trigger this event if the
password is wrong.
When the interval between two consecutive fingerprints is
Too Short Fingerprint Pressing
31 less than the interval preset for the door, trigger this
Interval
abnormal event.
In either the “Fingerprint only” or the “Card/Fingerprint”
verification mode, when any person presses his fingerprint to
Multi-Card Authentication (Press
32 open the door through the multi-card access mode and before
Fingerprint)
the last verification, trigger this event regardless of whether the
verification attempt succeeds.
When any person fails to pass the verification with his
33 Fingerprint Expired fingerprint at the end of the access control duration preset
by himself, trigger this event.
Events that are triggered when any fingerprints are not
34 Unregistered Fingerprint registered in the system or registered but not synchronized
to the device.
Abnormal events that are triggered when any person
Door Inactive Time Zone (Press
35 authorized to open the door presses his fingerprint during
Fingerprint)
the preset valid duration.
Abnormal events that are triggered when any person fails
Door Inactive Time Zone (Exit
36 to open the door by pressing the Unlock button during the
Button)
preset valid duration.
Failed to Close during Normal Abnormal events that are triggered when any person fails
37
Open Time Zone to close the door in NO state by calling ControlDevice.
Event triggered by brushing the corresponding Card when the
38 Card has report the loss of
Card number is reported as lost
When the user number is blacklisted, this event will occur when
39 blacklist
the user makes any comparison.
During combined verification, multiple users perform fingerprint
40 Multi fingerprint verification failed comparison. This event is generated when one user's fingerprint
verification fails
This event occurs when the authentication method used by the
41 Validation method error
user is inconsistent with the setting
The event is triggered when the number of digits of the card is
42 Wiegand format error
inconsistent with the configuration
43 Background verification

44 Background validation failed

45 Background verification timeout

46 Background authentication event

It is defined in ladder control and used for the event of


47 Send command failed communication failed prompt when the master control sends a
command to the sub control
48 Multi card door opening failed Events prompted when combining validation failed

100 Tamper alarm An event uploaded when the machine is dismantled

Use the duress password of current door verified and triggered


101 Duress Password Open
alarm event.
Except all the normal events (normal events such as user with
door open permission to punch card and open the door,
password open door, open the door at normally open period,
102 Opened Accidentally
remote door open, the linkage triggered door open), the door
sensor detect the door is opened, that is the door is unexpectedly
opened.
Use the duress fingerprint of current door verified and triggered
103 Duress Fingerprint Open
alarm event.
When the door sensor detects that the door has been properly
200 Door Opened Correctly
opened, triggering this normal event.
When the door sensor detects that the door has been properly
201 Door Closed Correctly
closed, triggering this normal event.
User press the exit button to open the door within the door valid
202 Exit button Open
time zone, and trigger this normal event.
Normal events that are triggered when any person passes
Multi-Card Open (Card plus
203 the verification with his card and fingerprint in multi-card
Fingerprint)
access mode.
After the setting normal open time zone, the door will close
automatically. The normal open time zone include the normal
204 Normal Open Time Zone Over
open time zone in door setting and the selected normal open
time zone in first card setting.
Normal events that are triggered when the door is set to
205 Remote Normal Opening
the NO state for remote opening operations.
206 Device Start When the device is being activated, this normal event is triggered.

207 Password open the door The user uses the password to generate a door opening event

208 Super user open the door Event generated when the user is a super user
When the door is configured as locked state, the door cannot be
209 The door is locked opened by using the door switch button and this event will be
triggered.
210 Fire open Fire protection function, use all doors are always open
Use event in ladder control. After the super user starts normally
211 Shutdown of superuser
open, swipe the card again to close normally open state.
When any auxiliary input point breaks down, this normal
220 Auxiliary Input Disconnected
event is triggered.
When any auxiliary input point has short circuited, this
221 Auxiliary Input Shorted
normal event is triggered.
222 Background verification success
Background verification network
223
instability
Enable antisubmarine in the
224
background
Actually that obtain door status
255 See Attachment 7
and alarm status

5.7 Attached Table 7:Description of the data format returned by

the parameter Buffer in the GetRTLog function

When the data in the buffer is resolved and detected to be:


 Multiple realtime event records: separate those records into single ones with “\r\n”.
 Door and alarm status recorded in single entries: separate those single records with a
comma considering
that the data of single records is separated with a comma.
When you resolve single records, make adjustments according to bit 4 of the separated data. If
bit 4 is 255, this record
contains the door status and alarm status only; otherwise, this record contains realtime event
records.
The following table compares the data structures of these two records.
Bit 0 Bit 1 Bit 2 Bit 3 Bit4 Bit 5 Bit6

200
DSS status Alarm (Indicates
(0: no DSS; status (1: that the
Temporarily Tempor
Door/Alar 1: door alarm; 2: verification
Time not in arily not
m Status closed; door mode is
use 255 in use
2: door opening “none”);
open) timeout) not
in use

The
Entry/Ex
Door No., Event type verification
Realtime Pin it
namely code. See mode is the
Event Time (Employee Card No. status:
lock Attachment same as the
Records No.) (0:
number 6 for details. door
entry;
opening
1: exit:
mode of
2: none)
controller
parameters
described in
Attachment
2.

Note:
(1) The device can temporarily save a maximum of 30 realtime event records. You can call
GetRTLog to check whether the cache contains event records. If so, the device returns all records
(30 entries at most) in the current cache; otherwise, the device returns the door and alarm status
events referred above.
(2) The door status records contain the open/closed status of current door (on the premise that
the DSS is connected). Additionally, you can judge the current door status through “Door already
open” (Event code: 200) and “Door already closed” (Event code: 201).
(3) When the record adopts the door/alarm status, the door status contained in all records
actually is the door status (four doors at most) of all doors of the device. 4 bytes are respectively
represents four door status, arranged in an ascending order separately represent doors 1 to 4.
For example, if this value is 0x01020001, door No.1 is closed, door No.2 is not configured with
the DSS, door No.3 is door opened, and door No.4 is door closed. Contained in the alarm status
(and Opening Timeout) (The Second place) the same that 4 bytes are respectively represents four
door status, behind two place of Each byte respectively represents whether that have alarm or
door open is overtime, arranged in an ascending order separately represent alarm or door
opening timeout. For example, if this value is 0x01020001, door No.1 is closed, door No.3 means
door opening timeout, door No.2 and No.4 means alarm.
(4)When the record adopts “realtime event” status and type of event is Triggered Linkage Event
(the code of type event: 6), the sixth place saved Linkage Event Triggered, and the second is for
reuse of Linkage ID, It have software for the device synchronous linkage setting (usually the
linkage in the ID value of software end database).
(5)The values of the three types in the event point number can be corresponding to the
silkscreen on the access control panel. For example, door number 1 corresponds to Lock1 on the
control panel, auxiliary input 1 corresponds to Aux In1 on the control panel, and auxiliary output
2 corresponds to Aux Out2 on the control panel (Note: The screen printing contents may be
different depending on the device model, but the numbers correspond.

5.8 Attached Table 8 : Description of data format returned by

parameter Buffer in GetRTLogExt function

The data in Buffer is a string record in PUSH format. If the record is a real-time event record,

it contains multiple single records separated by '\r\n'. If the data Type obtained is the door state

and alarm state, the contained record is already a single record.

A single record is divided into two string formats of real-time event record and door state
alarm state, and each format is divided into multiple fields segmented by '\ t'.The two string

formats for a single record are as follows:

String format

type=rtstate\ttime=%s\tsensor=%02X\trelay=%02X\talarm=%02X%02X%02X%02X%\r\n

Description:

type=rtstate\ttime=xx\tsensor=AA\trelay=CC\talarm=DDEEFFGGHHIIJJKK\r\n

‘time’ indicates the current time in the format of %04d-%02d-%02d %02d:%02d:%02d;

‘sensor’ represents the status of door status, each door occupies two binary bits, AA

represents 1-4 doors, and 1 occupies the first and second bits of the first byte, and so on.

0b00 indicates that the Type of the current door status is set to no door status, 0b01

indicates that the current door is closed (with door status), and 0b10 is open (without door

status).

‘relay’ represents the relay state, each door occupies a binary bit, 0b0 represents the
Door/Alarm
Status relay closing, 0b1 represents the relay disconnection, the first digit is the relay state of 1

door, and so on; (Both are currently 0)

‘Alarm’ indicates the alarm status. Each door occupies one byte and can express up to

8 alarms. DD is the alarm status of one door, and so on. At present, the alarm is defined as

follows:

No. 1: Unexpected door opening event

No. 2: anti-demolition alarm

No. 3: Duress password alarm

No. 4: Duress fingerprint alarm

No. 5: door magnetic timeout alarm

No. 6:-No. 8::reserved field

type=rtlog\ttime=%s\tpin=%u\tcardno=%u\teventaddr=%d\tevent=%d\tinoutstatus=

%d\tverifytype=%d\r\n

Real time Description:

event ‘time’ indicates the current time in the format of %04d-%02d-%02d %02d:%02d:%02d;

recording ‘pin’ indicates a person number;

‘cardno’ indicates card number;

‘Eventaddr’ indicates the event point number,Including door number (i.e. lock
number), auxiliary input number, auxiliary output number;

‘event’ event Type code, see Attached Table 6;

‘inoutstatus’ indicates in and out status (0 is in, 1 is out, and 2 is none);

‘verifytype’ indicates the verification mode, which is the same as the opening mode in

the description of controller parameters in Attached Table 2.


Note:
(1) The device can temporarily save a maximum of 30 realtime event records. You can call
GetRTLog to check whether the cache contains event records. If so, the device returns all records
(30 entries at most) in the current cache; otherwise, the device returns the door and alarm status
events referred above.
(2) The door status records contain the open/closed status of current door (on the premise that
the DSS is connected). Additionally, you can judge the current door status through “Door already
open” (Event code: 200) and “Door already closed” (Event code: 201).
(3)When the record adopts “realtime event” status and type of event is Triggered Linkage Event
(the code of type event: 6), the sixth place saved Linkage Event Triggered, and the second is for
reuse of Linkage ID, It have software for the device synchronous linkage setting (usually the
linkage in the ID value of software end database).
(4)The values of the three types in the event point number can be corresponding to the
silkscreen on the access control panel. For example, door number 1 corresponds to Lock1 on the
control panel, auxiliary input 1 corresponds to Aux In1 on the control panel, and auxiliary output
2 corresponds to Aux Out2 on the control panel (Note: The screen printing contents may be
different depending on the device model, but the numbers correspond.

(5) When parsing a single record, it is necessary to parse the string format records in the Buffer.

You might also like