3

I am trying to retrieve data from an attendance device of model number IN01 of ZKteco. I registered the zkemkeeper.dll file for x64 bit operating system. I have written a piece of code to connect it to c# application, but unfortunately it is not working.

Code:

bool bIsConnected = axCZKEM1.Connect_Com(1235,201, 115200); 
if (bIsConnected == true) {
   MessageBox.Show("Device Connected Successfully");
} else {
   MessageBox.Show("Device Not Connect");
}

but it is returning false and I am getting message from the else part.

karel
  • 5,489
  • 46
  • 45
  • 50
Hacked user
  • 373
  • 1
  • 5
  • 20
  • any `Exceptions` thrown in `axCZKEM1.Connect_Com(1235,201, 115200)` ? – Felix D. Mar 17 '17 at 06:44
  • exception is not thrown.It returns false.Two days since I tried fixing it but I am unable.Eagerly waiting for your help. – Hacked user Mar 17 '17 at 06:48
  • I tried connecting it through ip address using bool bIsConnected = axCZKEM1.Connect_Net("192.168.100.6",4370); .Still I am not able to connect it. When I ping the device using command prompt , it is successful. – Hacked user Mar 17 '17 at 06:49
  • do you have an 32bit version of that dll ? – Felix D. Mar 17 '17 at 10:37
  • [this](http://stackoverflow.com/a/39324911/4610605) may also be interesting. - `GetLastError()` and `Convert.ToInt32()` for your port are the first things i would check – Felix D. Mar 17 '17 at 11:52
  • I have a 64 bit dll . I tried using both the above methods but that didn't work. Is there anyway I can connect to attendance device using IP address? I couldn't connect using IP too. – Hacked user Mar 19 '17 at 08:14
  • @Hackeduser Did you find any solution ? I have the same issue today with ZKTeco Vf300 – Adam Aug 06 '21 at 07:50

2 Answers2

1

Try this in your code.

 bool bIsConnected = axCZKEM1.Connect_Net(ipaddress, port);
0
VARIANT_BOOL Connect_Com( [in] long ComPort, [in] long MachineNumber, [in] long BaudRate)

Usage

Connect to the device via a serial port, that is, via RS232 or RS485 port.

Note: This function can be also used for some devices that use USB Client to communicate with the PC. However, the USB client driver must be first installed to simulate a serial port. After the installation succeeds, you can view the serial port number via the device manager on the PC or find the virtual serial port number via the program. For details, see "USBClient" of the demo program from sources.