GetGeneralLogData

Definition

Usage

Read attendance records one by one from the internal buffer. Before using this function, you can use ReadAllGLogData or ReadGeneralLogData to read attendance records from the device and write them into the internal buffer of the PC. Each time this function is executed, the pointer points to the next attendance record. This function is the same as GetAllGLogData except that interface names are different to achieve compatibility. This function is used on only black & white devices.

Parameter

Device number

Pointer pointing to a long variable. The value is the device number of the received attendance record.

Pointer pointing to a long variable. The value is the user ID of the received attendance record.

Pointer pointing to a long variable. The value is the device number of the received attendance record.

Pointer pointing to a long variable. The value is the verification mode of the received attendance record. The specific values are as follows: Generally, 0: password verification, 1: fingerprint verification, 2: card verification. In multi-verification mode:

FP_OR_PW_OR_RF 0
FP 1
PIN 2
PW 3
RF 4
FP_OR_PW 5
FP_OR_RF 6
PW_OR_RF 7
PIN_AND_FP 8
FP_AND_PW 9
FP_AND_RF 10
PW_AND_RF 11
FP_AND_PW_AND_RF 12
PIN_AND_FP_AND_PW 13
FP_AND_RF_OR_PIN 14

Pointer pointing to a long variable. The value is the attendance state of the received record. The specific values are as follows: 0—Check-In (default value) 1—Check-Out 2—Break-Out 3—Break-In 4—OT-In 5—OT-Out

Pointers pointing to long variables. The values are the date and time of the received attendance record.

Return Value

Return 1 if it is successful, return 0 if all records are read, or return a negative number if an error occurs.

Related Function

GetAllGLogData, GetGeneralLogDataStr

 

Ejemplo

C#

private void GetGeneralLogData(string sIp = "10.0.0.44", int iPort = 4370, int iMachineNumber = 1)
	{
		//Create Standalone SDK class dynamicly.
		zkemkeeper.CZKEMClass axCZKEM1 = new zkemkeeper.CZKEMClass();

		int idwTMachineNumber = 0;
		int idwEnrollNumber = 0;
		int idwEMachineNumber = 0;
		int idwVerifyMode = 0;
		int idwInOutMode = 0;
		int idwYear = 0;
		int idwMonth = 0;
		int idwDay = 0;
		int idwHour = 0;
		int idwMinute = 0;

		int idwErrorCode = 0;
		int iGLCount = 0;
		int iIndex = 0;

		axCZKEM1.EnableDevice(iMachineNumber, false);//disable the device
		if (axCZKEM1.ReadGeneralLogData(iMachineNumber))//read all the attendance records to the memory
		{
			while (axCZKEM1.GetGeneralLogData(iMachineNumber, ref idwTMachineNumber, ref idwEnrollNumber,
					ref idwEMachineNumber, ref idwVerifyMode, ref idwInOutMode, ref idwYear, ref idwMonth, ref idwDay, ref idwHour, ref idwMinute))//get records from the memory
			{
				iGLCount++;
				MessageBox.Show("iGLCount: "+iGLCount.ToString()+
				"idwEnrollNumber : "+idwEnrollNumber.ToString()+
				"idwVerifyMode:" +idwVerifyMode.ToString()+
				"idwInOutMode :" + idwInOutMode.ToString()+
				"idwYear:" +idwYear.ToString() + " - " + idwMonth.ToString() + "-" + idwDay.ToString() + " " + idwHour.ToString() + ":" + idwMinute.ToString());
				iIndex++;
			}
		}
		else
		{
			axCZKEM1.GetLastError(ref idwErrorCode);

			if (idwErrorCode != 0)
			{
				MessageBox.Show("Reading data from terminal failed,ErrorCode: " + idwErrorCode.ToString(), "Error");
			}
			else
			{
				MessageBox.Show("No data from terminal returns!", "Error");
			}
		}
		axCZKEM1.EnableDevice(iMachineNumber, true);//enable the device
	}

VB

Private Sub GetGeneralLogData(Optional ByVal sIp As String = "10.0.0.44", Optional ByVal iPort As Integer = 4370, Optional ByVal iMachineNumber As Integer = 1)

	'Create Standalone SDK class dynamicly.
	Dim axCZKEM1 As New zkemkeeper.CZKEM

	Dim idwTMachineNumber As Integer
	Dim idwEnrollNumber As Integer
	Dim idwEMachineNumber As Integer
	Dim idwVerifyMode As Integer
	Dim idwInOutMode As Integer
	Dim idwYear As Integer
	Dim idwMonth As Integer
	Dim idwDay As Integer
	Dim idwHour As Integer
	Dim idwMinute As Integer

	Dim idwErrorCode As Integer
	Dim iGLCount = 0

	axCZKEM1.EnableDevice(iMachineNumber, False) 'disable the device
	If AxCZKEM1.ReadGeneralLogData(iMachineNumber) Then 'read all the attendance records to the memory
		'get records from the memory
		While AxCZKEM1.GetGeneralLogData(iMachineNumber, idwTMachineNumber, idwEnrollNumber, idwEMachineNumber, idwVerifyMode, idwInOutMode, idwYear, idwMonth, idwDay, idwHour, idwMinute)
			iGLCount += 1
			MsgBox("iGLCount :" & iGLCount.ToString() &
			"idwEnrollNumber :" & idwEnrollNumber.ToString() &
			"idwVerifyMode:" & idwVerifyMode.ToString() &
			"idwInOutMode:" & idwInOutMode.ToString() &
			"idwYear:" & idwYear.ToString() & "-" + idwMonth.ToString() & "-" & idwDay.ToString() & " " & idwHour.ToString() & ":" & idwMinute.ToString())
		End While
	Else
		axCZKEM1.GetLastError(idwErrorCode)
		If idwErrorCode <> 0 Then
			MsgBox("Reading data from terminal failed,ErrorCode: " & idwErrorCode, MsgBoxStyle.Exclamation, "Error")
		Else
			MsgBox("No data from terminal returns!", MsgBoxStyle.Exclamation, "Error")
		End If
	End If

	AxCZKEM1.EnableDevice(iMachineNumber, True) 'enable the device
End Sub