Alguien ha desarrollado una interfaz con ZKsoftware?

Alguien ha desarrollado una interfaz con ZKsoftware?

Postby devtuxtla » Tue Jul 19, 2016 11:32 pm

Hola Fivewiners.

Requiero hacer una interfaz para leer un reloj ZKsotware, alguien tiene una interfaz que funcione correctamente y este dispuesto vender el codigo fuente?

Saludos
Visite Chiapas, el paraiso de México.
devtuxtla
 
Posts: 392
Joined: Tue Jul 29, 2008 1:55 pm

Re: Alguien ha desarrollado una interfaz con ZKsoftware?

Postby ACC69 » Wed Jul 20, 2016 1:07 am

Hola Ing. Devtuxtla, podrias ser mas especifico a lo que solicitas, algun ejemplo o codigo lo que quieras hacer? referente a reloj, hay una clase tomada desde hace muchos años que me sirvio de mucho, el autor es de William Morales, la gran persona que me ayudo a migrar mis aplicaciones de clipper a fivewin en windows.

Saludos Ing.

Atte: Adrian C. C.
acc69@hotmail.com
ACC69
 
Posts: 632
Joined: Tue Dec 12, 2006 7:34 pm

Re: Alguien ha desarrollado una interfaz con ZKsoftware?

Postby karinha » Wed Jul 20, 2016 1:11 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7151
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Alguien ha desarrollado una interfaz con ZKsoftware?

Postby devtuxtla » Wed Jul 20, 2016 2:59 pm

Hola karinha / Adrian

Lo que requiero es complementar un desarrollo en fivewin que tengo para leer 10 relojes ZK, los cuales se encuentran en edificios separados.

Los requerimientos del clientes son muy especificos asi que hay que desarrollarlos...

Lo que requiero es el codigo fuente para leer los relojes, pasar las huellas de uno a muchos y descargar las checadas, entre otras muchas cosas...
Es por esto que requiero los fuentes para integrar las funciones al sistema actual que tenemos.

Saludos
Visite Chiapas, el paraiso de México.
devtuxtla
 
Posts: 392
Joined: Tue Jul 29, 2008 1:55 pm

Re: Alguien ha desarrollado una interfaz con ZKsoftware?

Postby Lailton » Wed Jul 27, 2016 6:16 pm

Hola,

Llámame a través de Skype y que transmita mis pruebas.
Regards,
Lailton Fernando Mariano
User avatar
Lailton
 
Posts: 125
Joined: Fri Jul 20, 2012 1:49 am
Location: Brazil

Re: Alguien ha desarrollado una interfaz con ZKsoftware?

Postby ACC69 » Thu Jul 28, 2016 12:58 am

Lailton wrote:Hola,

Llámame a través de Skype y que transmita mis pruebas.



Hola Ing. Laiton, porque no mejor y seria formidable que nos compartas tus experiencias y conocimientos para todos los del grupo fivewin, para eso esta el foro, digo se supone para aprender algo nuevo del maestro que nos comparta su codigo fuente, y asi aprender todos y remejorar dia a dia codigo fuente ...

Digo es una sugerencia para todos los del grupo de fivewin o del foro....

Saludos Ing. Laiton

Atte: acc69@hotmail.com
ACC69
 
Posts: 632
Joined: Tue Dec 12, 2006 7:34 pm

Re: Alguien ha desarrollado una interfaz con ZKsoftware?

Postby Lailton » Thu Jul 28, 2016 9:00 pm

demo.prg

Code: Select all  Expand view
#include <fivewin.ch>

function main()
 local m_obj:=getZKTeco()
      if m_obj:connect("192.168.25.200",4370,0)
         msginfo('connected!')
         if m_obj:readGeneralLogData()
            xBrowse(m_obj:getGeralLogData())
         end
      else
         msgstop('fail to connect!')
      end
      m_obj:exit()
return nil

 


zkteco.prg

Code: Select all  Expand view
#include <fiveweb.ch>

#define ZK_ProgID                                    'zkemkeeper.ZKEM' // CreateObject
#define ZK_OnAttTransaction                                          1 // const EnrollNumber: LongInt; const IsInValid: LongInt; const AttState: LongInt; const VerifyMethod: LongInt; const Year: LongInt; const Month: LongInt; const Day: LongInt; const Hour: LongInt; const Minute: LongInt; const Second: LongInt
#define ZK_OnKeyPress                                                2 // const Key: LongInt
#define ZK_OnEnrollFinger                                            3 // const EnrollNumber: LongInt; const FingerIndex: LongInt; const ActionResult: LongInt; const TemplateLength: LongInt
#define ZK_OnNewUser                                                 4 // const EnrollNumber: LongInt
#define ZK_OnEMData                                                  5 // (const DataType: LongInt; const DataLen: LongInt; const DataBuffer: ShortInt); dispid 5;
#define ZK_OnConnected                                               6 //
#define ZK_OnDisConnected                                            7 //
#define ZK_OnFinger                                                  8 //
#define ZK_OnVerify                                                  9 // (const UserID: LongInt): HRESULT; dispid 9;
#define ZK_OnFingerFeature                                          10 // (const Score: LongInt): HRESULT; dispid 10;
#define ZK_OnHIDNum                                                 11 // (const CardNumber: LongInt): HRESULT; dispid 11;
#define ZK_OnDoor                                                   12 // (const EventType: LongInt); dispid 12;
#define ZK_OnAlarm                                                  13 // (const AlarmType: LongInt; const EnrollNumber: LongInt; const Verified: LongInt); dispid 13;
#define ZK_OnWriteCard                                              14 // (const EnrollNumber: LongInt; const ActionResult: LongInt; const Length: LongInt): HRESULT; dispid 14;
#define ZK_OnEmptyCard                                              15 // (const ActionResult: LongInt): HRESULT; dispid 15;
#define ZK_OnDeleteTemplate                                         16 // (const EnrollNumber: LongInt; const FingerIndex: LongInt): HRESULT; dispid 16;
#define ZK_OnAttTransactionEx                                       17 // (const EnrollNumber: WideString; const IsInValid: LongInt; const AttState: LongInt; const VerifyMethod: LongInt; const Year: LongInt; const Month: LongInt; const Day: LongInt; const Hour: LongInt; const Minute: LongInt; const Second: LongInt; const WorkCode: LongInt); dispid 17;
#define ZK_OnEnrollFingerEx                                         18 // (const EnrollNumber: WideString; const FingerIndex: LongInt; const ActionResult: LongInt; const TemplateLength: LongInt); dispid 18;

static g_uid:=1                                                        // ID used for each machine connected

static g_err:={;
               {-100,'Operation failed or data not exist'},;
               { -10,'Transmitted data length is incorrect'},;
               {  -7,'Can not connect to device'},;                   // non-Official define...
               {  -5,'Data already exists'},;
               {  -4,'Space is not enough'},;
               {  -3,'Error size'},;
               {  -2,'Error in file read/write'},;
               {  -1,'SDK is not initialized and needs to be reconnected'},;
               {   0,'Data not found or data repeated'},;
               {   1,'Operation is correct'},;
               {   4,'Parameter is incorrect'},;
               { 101,'Error in allocating buffer'};
              }

function getZKTeco()
return zkteco():init()

class zkteco
 data m_obj, m_uid
 data m_err init .f.
 method init() constructor
 method connect(address,port,password)
 method serialNumber()
 method enableDevice(p_bool)
 method readGeneralLogData()
/*
  SSR_GetGeneralLogData

  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.

*/

 method getGeralLogData()
 method getLastError()
/*
  clearGLog

  Clear all attendance records from the device.
*/

 method clearGLog()
/*
  refreshData
  Refresh the data in the device. This function is usually called after user information or
  fingerprints are uploaded. In this way, the modifications take effect immediately.
*/

 method refreshData()
/*
  getDeviceStatus

  Obtain the data storage status of the device, for example, number of administrators and
  number of current users.

  Data to be obtained. The value ranges from 1 to 22. Values:
  1 Number of administrators
  2 Number of registered users
  3 Number of fingerprint templates in the device
  4 Number of passwords
  5 Number of operation records
  6 Number of attendance records
  7 Fingerprint template capacity
  8 User capacity
  9 Attendance record capacity
  10 Residual fingerprint template capacity
  11 Residual user capacity
  12 Residual attendance record capacity
  21 Number of faces
  22 Face capacity
  Returned 0 in other cases.
*/

 method getDeviceStatus()

 method disconnect()
/*
  clearAdministrators
  Clear all administrator privileges from the device.
*/

 method clearAdministrators()
 method version()

 method getAllUserInfo()
 method readAllUserID()

 method setCardNumber()
 method setUserInfo()

 method exit()
endclass

method init() class zkteco
 local m_err:=.f.
 try
  ::m_obj:=createobject(ZK_ProgID)
  ::m_uid:=(g_uid++)
 catch
  msgstop('Problem with register SDK !!!',::className()+' SDK')
    m_err:=.t.
  ::m_obj:=nil
 end
 ::m_err:=m_err
return self

method connect(address,port,password) class zkteco
 local m_ret:=.f.
 hb_default(@address,'127.0.0.1')
 hb_default(@port,4370)
 hb_default(@password,0)
 if!::m_err
   if password<>0
      if!::m_obj:setCommPassword(password)
         return m_ret
      end
   end
   m_ret:=::m_obj:connect_net(address,port)
 end
return m_ret

method disconnect() class zkteco
 if!::m_err
    ::m_obj:disconnect()
 end
return nil

method version() class zkteco
 local m_str:=''
 if!::m_err
    ::m_obj:getSDKVersion(@m_str)
 end
return m_str

method serialNumber() class zkteco
 local m_num:=0,m_ret:=''
 if!::m_err
    ::m_obj:getSerialNumber(m_num,@m_ret)
 end
return m_ret

method enableDevice(p_bool) class zkteco
 local m_ret:=.f.
 hb_default(@p_bool,.t.)
 if!::m_err
    m_ret:=::m_obj:enableDevice(::m_uid,p_bool)
 end
return m_ret

method readGeneralLogData() class zkteco
 local m_ret:=.f.
 if!::m_err
    m_ret:=::m_obj:readGeneralLogData(::m_uid)
 end
return m_ret

method getGeralLogData() class zkteco
 local m_enrollNumber:=''
 local m_verifyMode:=0
 local m_inOutMode:=0
 local m_year:=0
 local m_month:=0
 local m_day:=0
 local m_hour:=0
 local m_minute:=0
 local m_second:=0
 local m_workCode:=0
 local m_data:={}
 if!::m_err
   while ::m_obj:SSR_GetGeneralLogData(::m_uid,@m_enrollNumber,@m_verifyMode,@m_inOutMode,@m_year,@m_month,@m_day,@m_hour,@m_minute,@m_second,@m_workCode)
    aadd(m_data,{;
         m_enrollNumber                                                               ,; // employee number
         m_verifyMode                                                                 ,; // verifyMode  ??
         m_inOutMode                                                                  ,; // inOutmode   ??
         strzero(m_year,4)+'-'+strzero(m_month,2)+'-'+strzero(m_day,2)+' '            +; // DATE
         strzero(m_hour,2)+':'+strzero(m_minute,2)+':'+strzero(m_second,2)            ,; // TIME
         m_workCode                                                                    ; // workCode
    })
   end
 end
return m_data

method readAllUserID() class zkteco
 local m_ret:=.f.
 if!::m_err
    m_ret:=::m_obj:readAllUserID(::m_uid)
 end
return m_ret

method getAllUserInfo() class zkteco
 local m_enum:=''
 local m_name:=''
 local m_pass:=''
 local m_priv:=0
 local m_bool:=.f.
 local m_card:=''
 local m_data:={}
 if!::m_err
   while ::m_obj:SSR_GetAllUserInfo(::m_uid,@m_enum,@m_name,@m_pass,@m_priv,@m_bool)==true
    ::m_obj:GetStrCardNumber(@m_card)
    aadd(m_data,{m_enum,m_name,m_card,m_priv,m_pass,m_bool})
   end
 end
return m_data

method getDeviceStatus(m_num) class zkteco
 local m_ret:=.f.
 if!::m_err
    m_ret:=::m_obj:getdevicestatus(::m_uid,6,@m_num)
 end
return m_ret

method clearGLog() class zkteco
 local m_ret:=.f.
 if!::m_err
    m_ret:=::m_obj:clearGLog(::m_uid)
 end
return m_ret

method clearAdministrators() class zkteco
 local m_ret:=.f.
 if!::m_err
    m_ret:=::m_obj:clearAdministrators(::m_uid)
 end
return m_ret

method refreshData() class zkteco
 local m_ret:=.f.
 if!::m_err
    m_ret:=::m_obj:refreshData(::m_uid)
 end
return m_ret

method getLastError() class zkteco
 local m_err:=0,m_num,m_ret
 ::m_obj:getLastError(@m_err)
 if(m_num:=ascan(g_err,{|a,b|a[1]==m_err}))>0
    m_ret:=g_err[m_num][2]
 else
    if m_err<>0
       m_ret:='Reading data from terminal failed, ErrorCode: '+alltrim(str(m_err))+' !'
    else
       m_ret:='No data from terminal returns!'
    end
 end
return m_ret

method setCardNumber(p_card) class zkteco
 local m_ret:=.f.
 hb_default(@p_card,0)
 if!::m_err .and. p_card>0
    m_ret:=::m_obj:SetStrCardNumber(p_card)
 end
return m_ret

method setUserInfo(p_enum,p_name,p_pass,p_priv,p_bool,p_card) class zkteco
 local m_ret:=.f.
 hb_default(@p_enum,'')
 hb_default(@p_name,'')
 hb_default(@p_pass,'')
 hb_default(@p_priv,0)
 hb_default(@p_bool,.f.)
 hb_default(@p_card,0)
 if!::m_err
    ::setCardNumber(p_card)
    m_ret:=::m_obj:SSR_SetUserInfo(::m_uid,p_enum,p_name,p_pass,p_priv,p_bool)
 end
return m_ret

method exit() class zkteco
 ::m_obj:=nil
 ::m_err:=.f.
return nil
 


Saludos.
Regards,
Lailton Fernando Mariano
User avatar
Lailton
 
Posts: 125
Joined: Fri Jul 20, 2012 1:49 am
Location: Brazil

Re: Alguien ha desarrollado una interfaz con ZKsoftware?

Postby acuellar » Tue Aug 22, 2017 2:01 pm

Estimado Laiton

Si es tan amable, tiene algún demo para poder acceder a las terminales de reconocimiento facial hanvon

Gracias por la ayuda
Saludos,

Adhemar C.
User avatar
acuellar
 
Posts: 1589
Joined: Tue Oct 28, 2008 6:26 pm
Location: Santa Cruz-Bolivia

Re: Alguien ha desarrollado una interfaz con ZKsoftware?

Postby gabo » Wed Aug 23, 2017 2:02 am

ACC69 wrote:Hola Ing. Devtuxtla, podrias ser mas especifico a lo que solicitas, algun ejemplo o codigo lo que quieras hacer? referente a reloj, hay una clase tomada desde hace muchos años que me sirvio de mucho, el autor es de William Morales, la gran persona que me ayudo a migrar mis aplicaciones de clipper a fivewin en windows.

EL codigo fue para un puerto serial ?? Si es asi y si no mal recuerdo yo le pase ese codigo a William Morales, ahora los relojes tienen interfaz LAN (RJ45) es mucho mas facil hacer la conexion, el codigo de Laiton hace eso.
Saludos!
gabo
 
Posts: 126
Joined: Tue Jan 03, 2006 8:31 pm

Re: Alguien ha desarrollado una interfaz con ZKsoftware?

Postby acuellar » Wed Aug 23, 2017 10:24 am

Gracias Gabo por responder

Ud. no tiene algún ejemplo de como conectar con RJ45
Saludos,

Adhemar C.
User avatar
acuellar
 
Posts: 1589
Joined: Tue Oct 28, 2008 6:26 pm
Location: Santa Cruz-Bolivia

Re: Alguien ha desarrollado una interfaz con ZKsoftware?

Postby Lailton » Thu Aug 24, 2017 12:35 am

Lo source que fiz es para uso con interface Ethernet ( RJ45 ) y no via serial.
Regards,
Lailton Fernando Mariano
User avatar
Lailton
 
Posts: 125
Joined: Fri Jul 20, 2012 1:49 am
Location: Brazil

Re: Alguien ha desarrollado una interfaz con ZKsoftware?

Postby acuellar » Fri Aug 25, 2017 8:13 pm

Gracias Leiton

Pero no logro conectar con un reloj facial Hanvon FA007

Gracias por la ayuda
Saludos,

Adhemar C.
User avatar
acuellar
 
Posts: 1589
Joined: Tue Oct 28, 2008 6:26 pm
Location: Santa Cruz-Bolivia

Re: Alguien ha desarrollado una interfaz con ZKsoftware?

Postby Adolfo » Sat Aug 26, 2017 3:16 pm

Acuellar

Que mensaje o error tienes que no te conectas ?
Le haces ping y responde la ip?
Tienes firewall y bloqueado el puerto ?

Desde Chile
Adolfo
;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 1 TB NVME M.2, 1 TB SSD, GTX 1650
User avatar
Adolfo
 
Posts: 846
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile

Demo de interfaz

Postby Erick Almanza » Fri Sep 01, 2017 12:06 am

Lailton wrote:demo.prg

Code: Select all  Expand view
#include <fivewin.ch>

function main()
 local m_obj:=getZKTeco()
      if m_obj:connect("192.168.25.200",4370,0)
         msginfo('connected!')
         if m_obj:readGeneralLogData()
            xBrowse(m_obj:getGeralLogData())
         end
      else
         msgstop('fail to connect!')
      end
      m_obj:exit()
return nil

 


zkteco.prg

Code: Select all  Expand view
#include <fiveweb.ch>

#define ZK_ProgID                                    'zkemkeeper.ZKEM' // CreateObject
#define ZK_OnAttTransaction                                          1 // const EnrollNumber: LongInt; const IsInValid: LongInt; const AttState: LongInt; const VerifyMethod: LongInt; const Year: LongInt; const Month: LongInt; const Day: LongInt; const Hour: LongInt; const Minute: LongInt; const Second: LongInt
#define ZK_OnKeyPress                                                2 // const Key: LongInt
#define ZK_OnEnrollFinger                                            3 // const EnrollNumber: LongInt; const FingerIndex: LongInt; const ActionResult: LongInt; const TemplateLength: LongInt
#define ZK_OnNewUser                                                 4 // const EnrollNumber: LongInt
#define ZK_OnEMData                                                  5 // (const DataType: LongInt; const DataLen: LongInt; const DataBuffer: ShortInt); dispid 5;
#define ZK_OnConnected                                               6 //
#define ZK_OnDisConnected                                            7 //
#define ZK_OnFinger                                                  8 //
#define ZK_OnVerify                                                  9 // (const UserID: LongInt): HRESULT; dispid 9;
#define ZK_OnFingerFeature                                          10 // (const Score: LongInt): HRESULT; dispid 10;
#define ZK_OnHIDNum                                                 11 // (const CardNumber: LongInt): HRESULT; dispid 11;
#define ZK_OnDoor                                                   12 // (const EventType: LongInt); dispid 12;
#define ZK_OnAlarm                                                  13 // (const AlarmType: LongInt; const EnrollNumber: LongInt; const Verified: LongInt); dispid 13;
#define ZK_OnWriteCard                                              14 // (const EnrollNumber: LongInt; const ActionResult: LongInt; const Length: LongInt): HRESULT; dispid 14;
#define ZK_OnEmptyCard                                              15 // (const ActionResult: LongInt): HRESULT; dispid 15;
#define ZK_OnDeleteTemplate                                         16 // (const EnrollNumber: LongInt; const FingerIndex: LongInt): HRESULT; dispid 16;
#define ZK_OnAttTransactionEx                                       17 // (const EnrollNumber: WideString; const IsInValid: LongInt; const AttState: LongInt; const VerifyMethod: LongInt; const Year: LongInt; const Month: LongInt; const Day: LongInt; const Hour: LongInt; const Minute: LongInt; const Second: LongInt; const WorkCode: LongInt); dispid 17;
#define ZK_OnEnrollFingerEx                                         18 // (const EnrollNumber: WideString; const FingerIndex: LongInt; const ActionResult: LongInt; const TemplateLength: LongInt); dispid 18;

static g_uid:=1                                                        // ID used for each machine connected

static g_err:={;
               {-100,'Operation failed or data not exist'},;
               { -10,'Transmitted data length is incorrect'},;
               {  -7,'Can not connect to device'},;                   // non-Official define...
               {  -5,'Data already exists'},;
               {  -4,'Space is not enough'},;
               {  -3,'Error size'},;
               {  -2,'Error in file read/write'},;
               {  -1,'SDK is not initialized and needs to be reconnected'},;
               {   0,'Data not found or data repeated'},;
               {   1,'Operation is correct'},;
               {   4,'Parameter is incorrect'},;
               { 101,'Error in allocating buffer'};
              }

function getZKTeco()
return zkteco():init()

class zkteco
 data m_obj, m_uid
 data m_err init .f.
 method init() constructor
 method connect(address,port,password)
 method serialNumber()
 method enableDevice(p_bool)
 method readGeneralLogData()
/*
  SSR_GetGeneralLogData

  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.

*/

 method getGeralLogData()
 method getLastError()
/*
  clearGLog

  Clear all attendance records from the device.
*/

 method clearGLog()
/*
  refreshData
  Refresh the data in the device. This function is usually called after user information or
  fingerprints are uploaded. In this way, the modifications take effect immediately.
*/

 method refreshData()
/*
  getDeviceStatus

  Obtain the data storage status of the device, for example, number of administrators and
  number of current users.

  Data to be obtained. The value ranges from 1 to 22. Values:
  1 Number of administrators
  2 Number of registered users
  3 Number of fingerprint templates in the device
  4 Number of passwords
  5 Number of operation records
  6 Number of attendance records
  7 Fingerprint template capacity
  8 User capacity
  9 Attendance record capacity
  10 Residual fingerprint template capacity
  11 Residual user capacity
  12 Residual attendance record capacity
  21 Number of faces
  22 Face capacity
  Returned 0 in other cases.
*/

 method getDeviceStatus()

 method disconnect()
/*
  clearAdministrators
  Clear all administrator privileges from the device.
*/

 method clearAdministrators()
 method version()

 method getAllUserInfo()
 method readAllUserID()

 method setCardNumber()
 method setUserInfo()

 method exit()
endclass

method init() class zkteco
 local m_err:=.f.
 try
  ::m_obj:=createobject(ZK_ProgID)
  ::m_uid:=(g_uid++)
 catch
  msgstop('Problem with register SDK !!!',::className()+' SDK')
    m_err:=.t.
  ::m_obj:=nil
 end
 ::m_err:=m_err
return self

method connect(address,port,password) class zkteco
 local m_ret:=.f.
 hb_default(@address,'127.0.0.1')
 hb_default(@port,4370)
 hb_default(@password,0)
 if!::m_err
   if password<>0
      if!::m_obj:setCommPassword(password)
         return m_ret
      end
   end
   m_ret:=::m_obj:connect_net(address,port)
 end
return m_ret

method disconnect() class zkteco
 if!::m_err
    ::m_obj:disconnect()
 end
return nil

method version() class zkteco
 local m_str:=''
 if!::m_err
    ::m_obj:getSDKVersion(@m_str)
 end
return m_str

method serialNumber() class zkteco
 local m_num:=0,m_ret:=''
 if!::m_err
    ::m_obj:getSerialNumber(m_num,@m_ret)
 end
return m_ret

method enableDevice(p_bool) class zkteco
 local m_ret:=.f.
 hb_default(@p_bool,.t.)
 if!::m_err
    m_ret:=::m_obj:enableDevice(::m_uid,p_bool)
 end
return m_ret

method readGeneralLogData() class zkteco
 local m_ret:=.f.
 if!::m_err
    m_ret:=::m_obj:readGeneralLogData(::m_uid)
 end
return m_ret

method getGeralLogData() class zkteco
 local m_enrollNumber:=''
 local m_verifyMode:=0
 local m_inOutMode:=0
 local m_year:=0
 local m_month:=0
 local m_day:=0
 local m_hour:=0
 local m_minute:=0
 local m_second:=0
 local m_workCode:=0
 local m_data:={}
 if!::m_err
   while ::m_obj:SSR_GetGeneralLogData(::m_uid,@m_enrollNumber,@m_verifyMode,@m_inOutMode,@m_year,@m_month,@m_day,@m_hour,@m_minute,@m_second,@m_workCode)
    aadd(m_data,{;
         m_enrollNumber                                                               ,; // employee number
         m_verifyMode                                                                 ,; // verifyMode  ??
         m_inOutMode                                                                  ,; // inOutmode   ??
         strzero(m_year,4)+'-'+strzero(m_month,2)+'-'+strzero(m_day,2)+' '            +; // DATE
         strzero(m_hour,2)+':'+strzero(m_minute,2)+':'+strzero(m_second,2)            ,; // TIME
         m_workCode                                                                    ; // workCode
    })
   end
 end
return m_data

method readAllUserID() class zkteco
 local m_ret:=.f.
 if!::m_err
    m_ret:=::m_obj:readAllUserID(::m_uid)
 end
return m_ret

method getAllUserInfo() class zkteco
 local m_enum:=''
 local m_name:=''
 local m_pass:=''
 local m_priv:=0
 local m_bool:=.f.
 local m_card:=''
 local m_data:={}
 if!::m_err
   while ::m_obj:SSR_GetAllUserInfo(::m_uid,@m_enum,@m_name,@m_pass,@m_priv,@m_bool)==true
    ::m_obj:GetStrCardNumber(@m_card)
    aadd(m_data,{m_enum,m_name,m_card,m_priv,m_pass,m_bool})
   end
 end
return m_data

method getDeviceStatus(m_num) class zkteco
 local m_ret:=.f.
 if!::m_err
    m_ret:=::m_obj:getdevicestatus(::m_uid,6,@m_num)
 end
return m_ret

method clearGLog() class zkteco
 local m_ret:=.f.
 if!::m_err
    m_ret:=::m_obj:clearGLog(::m_uid)
 end
return m_ret

method clearAdministrators() class zkteco
 local m_ret:=.f.
 if!::m_err
    m_ret:=::m_obj:clearAdministrators(::m_uid)
 end
return m_ret

method refreshData() class zkteco
 local m_ret:=.f.
 if!::m_err
    m_ret:=::m_obj:refreshData(::m_uid)
 end
return m_ret

method getLastError() class zkteco
 local m_err:=0,m_num,m_ret
 ::m_obj:getLastError(@m_err)
 if(m_num:=ascan(g_err,{|a,b|a[1]==m_err}))>0
    m_ret:=g_err[m_num][2]
 else
    if m_err<>0
       m_ret:='Reading data from terminal failed, ErrorCode: '+alltrim(str(m_err))+' !'
    else
       m_ret:='No data from terminal returns!'
    end
 end
return m_ret

method setCardNumber(p_card) class zkteco
 local m_ret:=.f.
 hb_default(@p_card,0)
 if!::m_err .and. p_card>0
    m_ret:=::m_obj:SetStrCardNumber(p_card)
 end
return m_ret

method setUserInfo(p_enum,p_name,p_pass,p_priv,p_bool,p_card) class zkteco
 local m_ret:=.f.
 hb_default(@p_enum,'')
 hb_default(@p_name,'')
 hb_default(@p_pass,'')
 hb_default(@p_priv,0)
 hb_default(@p_bool,.f.)
 hb_default(@p_card,0)
 if!::m_err
    ::setCardNumber(p_card)
    m_ret:=::m_obj:SSR_SetUserInfo(::m_uid,p_enum,p_name,p_pass,p_priv,p_bool)
 end
return m_ret

method exit() class zkteco
 ::m_obj:=nil
 ::m_err:=.f.
return nil
 


Saludos.


Buena tarde
Podrias enviarme un demo para evaluarlo. Requiero desarrollar una aplicacion para relojes

Saludos,
Erick Almanza
Dicoms@gmail.com
Erick Almanza
 
Posts: 85
Joined: Mon Sep 11, 2006 3:52 pm

Re: Alguien ha desarrollado una interfaz con ZKsoftware?

Postby Lailton » Fri Sep 01, 2017 12:58 am

Tiene fecho la configuracion de ethernet del dispositivo?
Tambien tiene de agregar una contrasenã para hacer la comunicacion.

Saludos
Regards,
Lailton Fernando Mariano
User avatar
Lailton
 
Posts: 125
Joined: Fri Jul 20, 2012 1:49 am
Location: Brazil

Next

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 7 guests