Jump to content
Fivewin Brasil

Balança Toledo


Wellington Vieira

Recommended Posts

Veja se ajuda:

//-> Abertura da DLL da BALANCA PESADORA TOLEDO
STATIC XDLLB
	FUNCTION MAIN()
	    //-> Entrada
    XDLLB := LOADLIBRARY( "P05.DLL" )
	    DEFINE DIALOG...
    //
    //
    ACTIVAVATE DIALOG...
	    //-> Saida
    FREELIBRARY( XDLLB )
    XDLLB:=NIL
	RETURN NIL
	FUNCTION PEGA_PESO_TOLEDO()
	    LOCAL RETORNO, PESO := SPACE(05)
	    RETORNO := ABREPORTA( 1, 0, 0, 2 )
	    IF RETORNO # 1
	        MsgInfo( OemtoAnsi( "Erro na Abertura da Porta COM da Balan‡a!" ),    ;
                 OemtoAnsi( "Erro na Porta da Balan‡a Pesadora" ) )
	    ENDIF
	    RETORNO := PEGAPESO( 0, @PESO, "C:\" )
	    NQTDE   := VAL(PESO)
	    IF NQTDE<=0
	       MsgInfo( OemtoAnsi( "Erro na Leitura do peso da Balan‡a!" ),           ;
                OemtoAnsi( "BalcÆo - Erro na Leitura do Peso na Balan‡a" ) )
	    ENDIF
	    RETORNO := FECHAPORTA()
	RETURN( NQTDE )
	//---------------------------------------------------------------------------//
	//-> DECLARACAO DA DLL BALANCA PESADORA TOLEDO -> By Rossine.
	DLL32 Function AbrePorta( Porta AS LONG, BaudRate AS LONG, DataBits AS LONG, Paridade AS LONG ) AS LONG PASCAL lib xDllb
	DLL32 Function PegaPeso( OpcaoEscrita AS LONG, Peso AS STRING, Diretorio AS STRING ) AS LONG PASCAL lib xDllb
	DLL32 Function FechaPorta() AS LONG PASCAL lib xDllb
	//---------------------------------------------------------------------------//

Reagrds, saludos.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...