Hope not cause inconvenience. I 'm developing a very simple app as part of my educational project, using the ZKteco SDK 6.3.1.37 in VB.net, and the SCR100 device in Windows 10...
Using "connect_net" I have no trouble, the connection to device is successful.
The problem is when I use "OnHIDNum", punching a RFID card and trigger an event. It works for a few minutes and after that it does not work anymore. Even when I restart My app, I tried another PC, and the same thing, I have connection to device and the OnHIDNum event works again a few minutes, and suddenly no more....
I could use a timer to disconnect and connect every so often to restart sdk, but some records might be lost at runtime. If anyone can help me, I have no idea what's going on, VB.net compatibility, the SDK, code, or device..... Thanks a lot...
Here is the VB.net code:
Dim sIp As String = “192.168.1.201”
Dim iPort As Integer = 4370
Dim iMachineNumber As Integer = 1
Dim count As Integer = 0
Private Sub Connect_toDevice(sIp As String, iPort As Integer, iMachineNumber As Integer)
Dim bIsConnected As Boolean = False
'the serial number of the device.After connecting the device ,this value will be changed.
Dim idwErrorCode As Integer = 0
bIsConnected = axCZKEM1.Connect_Net(sIp, iPort)
If bIsConnected = True Then
iMachineNumber = 1 'In fact,when you are using the tcp/ip communication,this parameter will be ignored,that is any integer will all right.Here we use 1.
axCZKEM1.RegEvent(iMachineNumber, 65535) 'Here you can register the realtime events that you want to be triggered(the parameters 65535 means registering all)
AddHandler axCZKEM1.OnHIDNum, AddressOf AxCZKEM1_OnHIDNum
Else
axCZKEM1.GetLastError(idwErrorCode)
MsgBox(“Err: ” & idwErrorCode, MsgBoxStyle.Exclamation, title_msg)
End If
End Sub
Private Sub AxCZKEM1_OnHIDNum(ByVal iCardNumber As Integer)
count += 1
'I have result in my dataGridView for a few minutes, and no more
Me.myDataGridView.Rows.Add(count, iCardNumber, DateAndTime.Now)
'the same thing when I use an alert MsgBox
MsgBox("card number: " + iCardNumber, MsgBoxStyle.Information, "title")
End Sub