HBComm para harbour 1.0.1

HBComm para harbour 1.0.1

Postby oliveiros junior » Wed Aug 19, 2015 4: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
oliveiros junior
 
Posts: 125
Joined: Tue Mar 20, 2007 3:13 pm

Re: HBComm para harbour 1.0.1

Postby Antonio Linares » Wed Aug 19, 2015 7: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41315
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: HBComm para harbour 1.0.1

Postby Verhoven » 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.
Verhoven
 
Posts: 505
Joined: Sun Oct 09, 2005 7:23 pm

Re: HBComm para harbour 1.0.1

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 41315
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: HBComm para harbour 1.0.1

Postby Verhoven » Wed Aug 19, 2015 3:55 pm

De la clase con FW.

Las instrucciones siguientes:

Code: Select all  Expand view
  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.
Verhoven
 
Posts: 505
Joined: Sun Oct 09, 2005 7:23 pm

Re: HBComm para harbour 1.0.1

Postby Antonio Linares » Wed Aug 19, 2015 8: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41315
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: HBComm para harbour 1.0.1

Postby Antonio Linares » Wed Aug 19, 2015 8:08 pm

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41315
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin para Harbour/xHarbour

Who is online

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