hbcomm.lib - xharbour - fwh1111

Post Reply
User avatar
roberio
Posts: 27
Joined: Fri Jul 22, 2011 4:04 am

hbcomm.lib - xharbour - fwh1111

Post by roberio »

hbcomm.lib para xharbour e fwh1111
donde puedo encontrar?

muchas gracias
FWHX 11.11 # xHarbour 1.2.1 Rev.9411 ## Borland C++ 5.8.2
User avatar
roberio
Posts: 27
Joined: Fri Jul 22, 2011 4:04 am

Re: hbcomm.lib - xharbour - fwh1111 (RESOLVIDO)

Post by roberio »

resolvido
no link com a hbcomm.lib do link :
http://www.fivewin.com.br/forum/topic.a ... C_ID=20198

link da lib:
http://www.salc.com.br/atual/hbcomm.lib

a funcao usada:

Code: Select all

 
*--------------------------------------
Function fLeitura(nTara, oQtd, cPorta)
*--------------------------------------
Local cDados, nPeso

 Default nTara:=0
 Default cPorta:="COM1"

 nHandle:=Init_Port(cPorta,2400,8,0,1,4000)

 If nHandle <= 0
    MsgStop("Erro ao abrir a porta: " + cPorta + CRLF+"Verifique se a mesma não está sendo usada por outro programa.", "Alerta!")
    Return nil
 Endif

 OutBufClr(nHandle)      // Limpa o Buffer de Saida
 OutChr(nHandle,CHR(5))
 SysWait(0.3)
 Bytes := InbufSize(nHandle)
 cDados=Space(20)
 Buffer := InChr( nHandle, Bytes, @cDados) //LER BUFFER DE ENTRADA DA BALANCA
 UnInt_Port(nHandle)
 nPeso=(val(substr(cDados,2,5))/1000)-nTara

 oQtd:Varput( nPeso )
 oQtd:Refresh()
 oQtd:SetFocus()

Return NIL
 
obrigado
FWHX 11.11 # xHarbour 1.2.1 Rev.9411 ## Borland C++ 5.8.2
Post Reply