DonJuan Posted January 2, 2009 Report Share Posted January 2, 2009 Olá Pessoal alquem teria algum exemplo de uma rotina como pegar peso atraves da balança toledo que possa ser compilado com xHb Free 1.1 e Five810? Tenho um projeto e a finalização esta dependendo de uma rotina nesta área.. Desde Já Agradeço!! FHW 805, XHB110, PELLESC, XDEV, SQLRDD Quote Link to comment Share on other sites More sharing options...
DonJuan Posted January 2, 2009 Author Report Share Posted January 2, 2009 Olá Pessoal alquem teria algum exemplo de uma rotina como pegar peso atraves da balança toledo que possa ser compilado com xHb Free 1.1 e Five810? Tenho um projeto e a finalização esta dependendo de uma rotina nesta área.. Desde Já Agradeço!! FHW 805, XHB110, PELLESC, XDEV, SQLRDD Quote Link to comment Share on other sites More sharing options...
DonJuan Posted January 2, 2009 Author Report Share Posted January 2, 2009 Poxa Ninguem? FHW 805, XHB110, PELLESC, XDEV, SQLRDD Quote Link to comment Share on other sites More sharing options...
netsys Posted January 2, 2009 Report Share Posted January 2, 2009 Ola Don Juan Segue função de leitura de uma Toledo ligada na COM1 *-------------------------------------- Function fLeitura(oGet,oPes,nTara,oDlg) *-------------------------------------- local cDcb, nBytes local nComm := OpenComm( "COM1", 1024, 128 ) local nError, nI if ! BuildCommDcb( "COM1:9600,n,8,1", @cDcb ) nError = GetCommError( nComm ) MsgInfo( "BuildCommDcb Error: " + Str( nError ) ) endif if ! SetCommState( cDcb ) nError = GetCommError( nComm ) MsgInfo( "SetCommState Error: " + Str( nError ) ) endif if ( nBytes := WriteComm( nComm, Chr(5) ) ) < 0 nError = GetCommError( nComm ) MsgInfo( "WriteComm Error: " + Str( nError ) ) End Inkey(1.5) cBuffer:=Space(20) ReadComm( nComm , @cBuffer) If At(".",Upper(cBuffer))#0 cBuffer:=Str(Val(Subs(cBuffer,At(".",Upper(cBuffer))-2,5)),6,2)+"KG" nPesoLido:=Val(cBuffer) End MemoWrit("retorno.txt",cBuffer) oGet:Refresh() nPesoCalc:=nPesoLido-nTara oPes:Refresh() if FlushComm( nComm, 0 ) != 0 nError = GetCommError( nComm ) MsgInfo( "FlushComm Error: " + Str( nError ) ) endif if ! CloseComm( nComm ) nError = GetCommError( nComm ) MsgInfo( "CloseComm Error: " + Str( nError ) ) endif return(Nil) Espero ter ajudado. Alberto Zamai S.Paulo Quote Link to comment Share on other sites More sharing options...
DonJuan Posted January 5, 2009 Author Report Share Posted January 5, 2009 Me diga uma coisa há mais não é preciso agregar nenhuma lib a mais ? ou qualquer outra coisa? do jeito que esta aqui ele pega o peso da balança? FHW 805, XHB110, PELLESC, XDEV, SQLRDD Quote Link to comment Share on other sites More sharing options...
netsys Posted January 5, 2009 Report Share Posted January 5, 2009 Só inclui o comm.ch Isso sempre funcionou com Fw+Clipper. Nunca testei com xHarbour mas deve funcionar. Alberto - SP Quote Link to comment Share on other sites More sharing options...
DonJuan Posted January 21, 2009 Author Report Share Posted January 21, 2009 citação:Só inclui o comm.ch Isso sempre funcionou com Fw+Clipper. Nunca testei com xHarbour mas deve funcionar. Alberto - SP id=quote>id=quote>Alguém sabe dizer se funciona com xHarb? e com impressoras toledo w-300 FHW 805, XHB110, PELLESC, XDEV, SQLRDD Quote Link to comment Share on other sites More sharing options...
DonJuan Posted January 22, 2009 Author Report Share Posted January 22, 2009 citação: citação:Só inclui o comm.ch Isso sempre funcionou com Fw+Clipper. Nunca testei com xHarbour mas deve funcionar. Alberto - SP id=quote>id=quote>Alguém sabe dizer se funciona com xHarb? e com impressoras toledo w-300 FHW 805, XHB110, PELLESC, XDEV, SQLRDD id=quote>id=quote>FHW 805, XHB110, PELLESC, XDEV, SQLRDD Quote Link to comment Share on other sites More sharing options...
DonJuan Posted January 26, 2009 Author Report Share Posted January 26, 2009 citação:Ola Don Juan Segue função de leitura de uma Toledo ligada na COM1 *-------------------------------------- Function fLeitura(oGet,oPes,nTara,oDlg) *-------------------------------------- local cDcb, nBytes local nComm := OpenComm( "COM1", 1024, 128 ) local nError, nI if ! BuildCommDcb( "COM1:9600,n,8,1", @cDcb ) nError = GetCommError( nComm ) MsgInfo( "BuildCommDcb Error: " + Str( nError ) ) endif if ! SetCommState( cDcb ) nError = GetCommError( nComm ) MsgInfo( "SetCommState Error: " + Str( nError ) ) endif if ( nBytes := WriteComm( nComm, Chr(5) ) ) < 0 nError = GetCommError( nComm ) MsgInfo( "WriteComm Error: " + Str( nError ) ) End Inkey(1.5) cBuffer:=Space(20) ReadComm( nComm , @cBuffer) If At(".",Upper(cBuffer))#0 cBuffer:=Str(Val(Subs(cBuffer,At(".",Upper(cBuffer))-2,5)),6,2)+"KG" nPesoLido:=Val(cBuffer) End MemoWrit("retorno.txt",cBuffer) oGet:Refresh() nPesoCalc:=nPesoLido-nTara oPes:Refresh() if FlushComm( nComm, 0 ) != 0 nError = GetCommError( nComm ) MsgInfo( "FlushComm Error: " + Str( nError ) ) endif if ! CloseComm( nComm ) nError = GetCommError( nComm ) MsgInfo( "CloseComm Error: " + Str( nError ) ) endif return(Nil) Espero ter ajudado. Alberto Zamai S.Paulo id=quote>id=quote>COMO EU FAÇO PRA PUXAR ESTE ROTINA PRO MEU GET DE PESO? FHW 805, XHB110, PELLESC, XDEV, SQLRDD Quote Link to comment Share on other sites More sharing options...
kapiaba Posted January 26, 2009 Report Share Posted January 26, 2009 nPesoLido:=Val(cBuffer) TotPeso := nPesoLido oGetPeso:VARPUT( TotPeso ) oGetPeso:Refresh() Abraços. João Santos - São Paulo. kmt_karinha@pop.com.br kapiaba@brfree.com.br Fone: (11) 3106-2832 FWH 2.7 - xHARBOUR 0.99.61 - WorkShop.Exe Quote Link to comment Share on other sites More sharing options...
DonJuan Posted January 27, 2009 Author Report Share Posted January 27, 2009 PESSOAL DESCULPEM MINHA IGNORÂNCIA, MAS NÃO ESTOCONSEGUINTO PUXAR O PESO PARA 0O MEU GET, QUERIA FAZER ISSO ALTOMATICAMENTE ATRAVES DE UM VALID, OU BUTÃO, MAS NÃO ESTOU CONSEGUINDO, MINHA BALANÇA É UMA W-300 TOLEDO.. O MEU CLIENTE ESTA DESESPERADO SERà QUE ALGUEM TERIA UMA ROTINA PRONTA PARA QUEBRAR MINHA ARVORE? DESDE Jà AGRADEÇO FHW 805, XHB110, PELLESC, XDEV, SQLRDD Quote Link to comment Share on other sites More sharing options...
netsys Posted January 27, 2009 Report Share Posted January 27, 2009 Ola DonJuan Desculpe a demora! Estava fora por uns tempos e agora que vi o post. Poderia ser assim: #Include "Fivewin.ch" #Include "Comm.ch" STATIC nPesoCalc, nPesoLido *---------------- Function fBalanca *---------------- Local oGet,oPes,oDlg Local nTara:=0 nPesoCalc:=0 nPesoLido:=0 Define Dialog oDlg from 2,10 to 20,70 Title "Leitura Toledo" @ 10,10 Get nTara Size 40,10 Picture "99999.99" Valid fLeitura(oGet,oPes,nTara,oDlg) @ 20,10 Get oGet VAR nPesoLido Picture "99999.99" @ 30,10 Get oPes VAR nPesoCalc Picture "99999.99" Activate Dialog oDlg Centered Return Nil Ou se vc preferir, poderia ser um Button no final que chama a fLeitura. Abraços Alberto - SP Quote Link to comment Share on other sites More sharing options...
DonJuan Posted January 27, 2009 Author Report Share Posted January 27, 2009 citação:Ola DonJuan Desculpe a demora! Estava fora por uns tempos e agora que vi o post. Poderia ser assim: #Include "Fivewin.ch" #Include "Comm.ch" STATIC nPesoCalc, nPesoLido *---------------- Function fBalanca *---------------- Local oGet,oPes,oDlg Local nTara:=0 nPesoCalc:=0 nPesoLido:=0 Define Dialog oDlg from 2,10 to 20,70 Title "Leitura Toledo" @ 10,10 Get nTara Size 40,10 Picture "99999.99" Valid fLeitura(oGet,oPes,nTara,oDlg) @ 20,10 Get oGet VAR nPesoLido Picture "99999.99" @ 30,10 Get oPes VAR nPesoCalc Picture "99999.99" Activate Dialog oDlg Centered Return Nil Ou se vc preferir, poderia ser um Button no final que chama a fLeitura. Abraços Alberto - SP id=quote>id=quote>MAS ESSA ROTINA VALE PARA QUAIS MODELOS DE BALANÇAS DA TOLEDO? E RODA COM XHB1.1? FHW 805, XHB110, PELLESC, XDEV, SQLRDD Quote Link to comment Share on other sites More sharing options...
netsys Posted January 27, 2009 Report Share Posted January 27, 2009 Olha, se não me engano era uma balança de piso 2124 ou 2124H, utilizada em um frigorÃfico para pesar caixas até 200Kg e divisões de 5g. Quanto a rodar em xHb, como já disse nunca testei, mas creio que sim, pq lá tem o comm.ch Quanto ao tipo de balança, creio que funciona em qq modelo com conexão RS232 nos parametros colocados no programa, mas quem pode confirmar isso é o pessoal de suporte da Toledo. Alberto-SP Quote Link to comment Share on other sites More sharing options...
netsys Posted January 27, 2009 Report Share Posted January 27, 2009 Mais uma coisa,,,,no site da Toledo não achei nada desse modelo W-300,,,tem certeza que é isso mesmo? Quote Link to comment Share on other sites More sharing options...
netsys Posted January 27, 2009 Report Share Posted January 27, 2009 Por acaso não é essa?: http://www.brastek.com.br/index.php?area=produtos&linhas=&idcat=69&idprod=140 Quote Link to comment Share on other sites More sharing options...
Guest n/a Posted January 27, 2009 Report Share Posted January 27, 2009 Tente com o seu xh e fivewin brother se nao funcionar significa que não é compativel ^^ caso contrario seu problema ta resolvido... faca um exe so de teste com o que os amigos do forum postou t+ [X]Harbour 1.1.0|Fwh 8.5|Bcc55|Pelles|MySQL ^^ http://www.redstarsoft.net Quote Link to comment Share on other sites More sharing options...
DonJuan Posted January 28, 2009 Author Report Share Posted January 28, 2009 citação:Por acaso não é essa?: http://www.brastek.com.br/index.php?area=produtos&linhas=&idcat=69&idprod=140 id=quote>id=quote>É ESSA SIM AMIGO!! ESSA ROTINA FUNCIONA PARA ESSE MODELO? FHW 805, XHB110, PELLESC, XDEV, SQLRDD Quote Link to comment Share on other sites More sharing options...
netsys Posted January 28, 2009 Report Share Posted January 28, 2009 Ola DonJuan Liguei lá na Welmy (S.Barbara D´Oeste - (19) 30262566) e falei com ODAIR do suporte técnico da W300. Ele me disse que essa balança tem conexão RS232 mas opera em 2400 ou 4800 bps. Quanto as demais configurações (paridade, etc), ele pediu para ligarmos no (19) 30262575 e falar direto com o Paulo (Engenheiro) que ele dará mais detalhes. Vc pode ligar da� Acho que é só colocar as configurações corretas no programa e vai funcionar. Abraços Alberto - SP Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.