FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour HBComm para harbour 1.0.1
Posts: 148
Joined: Tue Mar 20, 2007 03:13 PM

HBComm para harbour 1.0.1

Posted: Wed Aug 19, 2015 04:49 AM

Ol谩,

Bom dia!

Algu茅m saberia informar onde 茅 poss铆vel conseguir a HBComm.lib, que compile com o Harbour 1.0.1 (2007)?

Att.,

Oliveiros Silva Mendes Junior

oliveiros.jr@uol.com.br

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: HBComm para harbour 1.0.1

Posted: Wed Aug 19, 2015 07:58 AM
Oliveiros,

Tienes que descargar el c贸digo fuente de Harbour espec铆fico para esa versi贸n
que usas desde el repositorio de Harbour:

https://github.com/harbour/core

Y luego construir la librer铆a hbcomm que venga con esa versi贸n 贸 comprobar si
la versi贸n m谩s reciente se puede construir con ese Harbour.

Por que no actualizas a la versi贸n m谩s reciente de Harbour ?

https://bitbucket.org/fivetech/harbour-xharbour-builds/downloads/harbour_3.2_32bits_Borland7_20150621.zip
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 563
Joined: Sun Oct 09, 2005 07:23 PM

Re: HBComm para harbour 1.0.1

Posted: Wed Aug 19, 2015 11:32 AM

Antonio,
Estoy tratando de usar la librer铆a hbcomm que viene con Harbour para comunicarme con un Arduino por protocolo serie pero con esta librer铆a, que me funciona bien con otros equipos, no hay forma de comunicar.
Sin embargo cuando utilizo las funciones que vienen en ejemplo como phone.prg de fivewin si logro que comunique.
El puerto serie es v铆a uno virtual creado en un USB, no es un puerto serie standard.
驴Que diferencia hay entre usar hbcomm y la de FW?.
Me interesar铆a utilizar la de hbcomm porque es la que tengo usada hasta ahora sin problemas y para no cambiar el modelo de forma de trabajar.
驴Cual recomiendas tu?.

Gracias.

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: HBComm para harbour 1.0.1

Posted: Wed Aug 19, 2015 11:50 AM

No he usado casi la hbcomm asi que no te sabr铆a decir.

Seguramente otros usuarios pueden darte alguna indicaci贸n

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 563
Joined: Sun Oct 09, 2005 07:23 PM

Re: HBComm para harbour 1.0.1

Posted: Wed Aug 19, 2015 03:55 PM
De la clase con FW.

Las instrucciones siguientes:

Code (fw): Select all Collapse
   oDlg:bCommNotify = { | nComm, nStatus | BytesAtPort( nComm, nStatus ) }

   ACTIVATE DIALOG oDlg ON INIT EnableCommNotification( nComm, oDlg:hWnd, 256, 256 )

function BytesAtPort( nComm, nStatus )
   local cBuffer :=space(1) //Para leer los caracteres recibidos de uno en uno.

   if nSTATUS > 0
      ReadComm( nComm, @cBuffer )  // <<<<---- program will lock here
   endif
return cBuffer


No se qu茅 funci贸n tiene la variable nStatus. Viene en los ejemplos pero no aparece c贸mo est谩 declarada ni donde cambia de valor.
EnableCommNotification( nComm, oDlg:hWnd, 256, 256 ) tampoco entiendo muy bien su significado.
oDlg:bCommNotify No me queda muy claro el funcionamiento.

Adem谩s la comunicaci贸n con el puerto RS232 se queda con un retraso de unos entre dos y tres segundos.
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: HBComm para harbour 1.0.1

Posted: Wed Aug 19, 2015 08:06 PM
WM_COMMNOTIFY (3.1)
WM_COMMNOTIFY
idDevice = wParam; /* communication-device ID */
nNotifyStatus = LOWORD(lParam); /* notification-status flag */

The WM_COMMNOTIFY message is posted by a communication device driver whenever a COM port
event occurs. The message indicates the status of a window's input or output queue.

Parameter Description

idDevice Value of wParam. Specifies the identifier of the communication device that is posting the
notification message.

nNotifyStatus Value of the low-order word of lParam. Specifies the notification status in the low-order
word. The notification status may be one or more of the following flags:

Value Meaning

CN_EVENT Indicates that an event has occurred that was enabled in the event
word of the communication device. This event was enabled by a
call to the SetCommEventMask function. The application
should call the GetCommEventMask function to determine
which event occurred and to clear the event.
CN_RECEIVE Indicates that at least cbWriteNotify bytes are in the input queue.
The cbWriteNotify parameter is a parameter of the
EnableCommNotification function.
CN_TRANSMIT Indicates that fewer than cbOutQueue bytes are in the output
queue waiting to be transmitted. The cbOutQueue parameter is a
parameter of the EnableCommNotification function.

Returns

An application should return zero if it processes this message.

Comments

This message is sent only when the event word changes for the communication device. The application
that sends WM_COMMNOTIFY must clear each event to be sure of receiving future notifications.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: HBComm para harbour 1.0.1

Posted: Wed Aug 19, 2015 08:08 PM
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion