Read Weigh and barcode scanner of an NCR 7878 Scale/Scanner,

327 Views Asked by At

I'm trying to read data sent through a serial port by an NCR 7878 scanner/scale.

I'm using Visual Basic .NET, I can get the barcode data just fine, using the serial port ReadExisting function. so with the scanner I'm good, the problem is that in order to get the weigh value, I must send some value to the scale, so it knows when to send the weigh value back, (I have no idea what value, i have googling a lot trying to find a library or something, no luck) please if you have some experience with this or know about a library that I can Use.

The Code I use to read, just in the testing is pretty simple:

Private Sub SerialPort1_DataReceived(sender As Object, e As SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
        Try
            Dim sp As SerialPort = sender

            _DataReaded4 = sp.BytesToRead
            _DataReaded2 = sp.ReadByte()
            _DataReaded3 = sp.ReadChar()
            _DataReaded = sp.ReadExisting()

            '  SerialPort1.Read("", 0, 5)
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub
1

There are 1 best solutions below