FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index All products support hbcomm.lib - xharbour - fwh1111
Posts: 27
Joined: Fri Jul 22, 2011 04:04 AM
hbcomm.lib - xharbour - fwh1111
Posted: Sun Mar 11, 2012 11:14 PM

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
Posts: 27
Joined: Fri Jul 22, 2011 04:04 AM
Re: hbcomm.lib - xharbour - fwh1111 (RESOLVIDO)
Posted: Sun Mar 11, 2012 11:37 PM

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

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

a funcao usada:

 
*--------------------------------------
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

Continue the discussion