CancelBatchUpdate

Definition

VARIANT_BOOL CancelBatchUpdate([in] LONG dwMachineNumber)

Usage

Cancel uploading data in batches. Generally, this function can be used to release the buffer reserved for batch upload after BeginBatchUpdate and before BatchUpdate.

Parameter

dwMachineNumber Device number

ReturnValue

Return True if it is successful, or return False.

RelatedFunction

BeginBatchUpdate, BatchUpdate

 

Ejemplo

C#

private int batchUpdate(string ipAddr, int port)
        {
int iMachineNumber = 1;
int iUpdateFlag = 1;
int idwErrorCode = 0;
//Create Standalone SDK class dynamicly.
            zkemkeeper.CZKEMClass axCZKEM1 = new zkemkeeper.CZKEMClass();
if (axCZKEM1.Connect_Net(ipAddr, 4370))
            {
                axCZKEM1.EnableDevice(iMachineNumber, false);
if (axCZKEM1.BeginBatchUpdate(iMachineNumber, iUpdateFlag))//create memory space for batching data
                {
//perform batch operations (multiple axCZKEM1.SSR_SetUserInfo,  axCZKEM1.SetUserTmpExStr)
                    
                }
                axCZKEM1.CancelBatchUpdate(iMachineNumber);//upload all the information in the memory

                axCZKEM1.RefreshData(iMachineNumber);//the data in the device should be refreshed
                axCZKEM1.EnableDevice(iMachineNumber, true);
                MessageBox.Show("Operation Success!");
            }
else
            {
                axCZKEM1.GetLastError(ref idwErrorCode);
            }
            axCZKEM1.Disconnect();
return idwErrorCode;
        }

VB

Private Sub batchUpdate(ipAddr As String, port As Int32)
'Create Standalone SDK class dynamicly.
Dim axCZKEM1 As New zkemkeeper.CZKEM
Dim iMachineNumber As Integer
Dim idwErrorCode As Integer
Dim iUpdateFlag As Integer = 1
If axCZKEM1.Connect_Net(ipAddr, port) = True Then
            axCZKEM1.EnableDevice(iMachineNumber, False)
If axCZKEM1.BeginBatchUpdate(iMachineNumber, iUpdateFlag) Then 'create memory space for batching data
'perform batch operations (multiple axCZKEM1.SSR_SetUserInfo,  axCZKEM1.SetUserTmpExStr)
End If
            axCZKEM1.CancelBatchUpdate(iMachineNumber) 'upload all the information in the memory
            axCZKEM1.RefreshData(iMachineNumber) 'the data in the device should be refreshed
            axCZKEM1.EnableDevice(iMachineNumber, True)
            MsgBox("Operation Success!")
Else
            axCZKEM1.GetLastError(idwErrorCode)
End If
        axCZKEM1.Disconnect()
End Sub