FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Uso de un scanner Magellan 2200VS
Posts: 1054
Joined: Sun Oct 09, 2005 10:41 PM
Uso de un scanner Magellan 2200VS
Posted: Fri Nov 04, 2016 12:35 AM

Hola amigos,
Alguno tiene experiencia con el scanner Magellan 2200VS ?? tiene conexión serial
Salu2

Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: Uso de un scanner Magellan 2200VS
Posted: Fri Nov 04, 2016 03:43 AM

Hola Mister:

Parece más sencillo que quitarle su dinero a una borracha :)

Hasta donde entiendo es un lector de códigos de barras y como tal
lo único que te devuelve son los número contenidos en el código de
barras y tu lo recibes en un GET tal como si el usuario lo hubiera registrado.

Mira estos videos

https://www.youtube.com/watch?v=pHvH6k0wVBM

https://www.youtube.com/watch?v=Zhj2Dk40FDA

https://www.youtube.com/watch?v=iUcN8CVZMPA

Espero que esto sea lo que buscas.

Saludos al crío

SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: Uso de un scanner Magellan 2200VS
Posted: Fri Nov 04, 2016 08:01 AM
I use this
Code (fw): Select all Collapse
//==============================================================================================
 METHOD OpenCom( cComm ) CLASS TouchScreen
    LOCAL  cDcb

    BEGIN SEQUENCE
        nComm = OPENCOMM( cComm , 16384, 16384 )

        IF nComm < 0
            //? "Errore di apertura della porta di comunicazione."
            ? "Error opening the communication port"
            BREAK
        ENDIF

        BUILDCOMMDCB( cComm +  ":9600,N,8,1", @cDcb )

        IF !  SETCOMMSTATE( nComm, cDcb )
            //? "Errore di impostazione della porta di comunicazione."
            ? "Setting error of the communication port"
            BREAK
        ENDIF

        ::oDlg:bCommNotify = { | nComm | ::ConnectLaser( ),;
                                       EnableCommNotification( nComm, ::oDlg:hWnd, 1, -1 ) }

        IF ! ENABLECOMMNOTIFICATION( nComm, ::oDlg:hWnd, 1, -1 )
            //? "Errore di abilitazione della notifica."
            ? "Enabling error notification"
            BREAK
        ENDIF

        // Abilita lo scanner 
        // Enable the scanner
        
        SENDSTR( Hex2Str(  "45" ) )   //  ENABLE

    RECOVER
        nComm = -1
    END SEQUENCE

 RETURN nComm
 
 

//==============================================================================================
METHOD ConnectLaser() CLASS TouchScreen

    LOCAL cStr
    Local lOk := FALSE
    Local lReturn := .f.

    Local  VAR0
    
    ENABLECOMMNOTIFICATION( nComm, 0, 1, -1 )
    
    //da controllare
    waitseconds(0.1)
    cStr = RECEIVESTR( )


    // check if barcode
    IF ASC(substr(cStr,len(alltrim(cstr)),1)) == 10
       lOk := TRUE
    ENDIF
    IF  ASC(substr(cStr,len(alltrim(cstr)),1)) == 13
      lOk := TRUE
    ENDIF


    IF lOk

        lReturn  := Function find the barcode for your product
        
        IF lReturn
        
            SENDSTR(  Hex2Str(  "07" ) )  //BEEP

        ELSE

            SENDSTR(  Hex2Str(  "42" ) )  //BEEP
            INKEY(0.1)   // 1 Secondo
            SENDSTR(  Hex2Str(  "42" ) )  //BEEP

            ? "Product not found"
            
            // lock the scanner 
            SENDSTR(  Hex2Str(  "44" ) )  //lock 
            
            //SENDSTR(  Hex2Str(  "52" ) )   //  reset
            //SENDSTR(  Hex2Str(  "44" ) )   //  DISABLE
            //SENDSTR(  Hex2Str(  "45" ) )   //  ENABLE

        ENDIF
        
     ENDIF
    RETURN NIL

STATIC FUNCTION SENDSTR(  cString )

    LOCAL nBytes := WRITECOMM( nComm, cString )

    RETURN nBytes = LEN( cString )

STATIC FUNCTION RECEIVESTR( )

    LOCAL cBuf := SPACE( 1000 )    //1000
RETURN LEFT( cBuf, READCOMM( nComm, @cBuf ) )


Maurizio
www.nipeservice.com

Continue the discussion