Results 1 to 7 of 7

Thread: Get scanner data

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    675

    Get scanner data

    Device: Motorola MC9090
    OS: Windows Mobile 5 Pocket PC
    Development: .NET Compact Edition

    I hope that is enough info for what I'm trying to do. I apologize as I'm not sure to ask for what I need. I'm very new to this development platform. I'll do my best.

    I have a form with a textbox. When I scan a barcode, it automatically puts the scanned data into the textbox. Is there any way I can get to the scanned data before it is put into the textbox?

    Alternately(or more simply), if I had a form with no textboxes and scanned a barcode, is there a way to get to the scanned data?

    Thanks
    VB.Net 2008
    .Net Framework 2.0

    "Must you breathe? 'Cause I need heaven..."

  2. #2
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    Re: Get scanner data

    Symbol have an SDK which should help.

    Why do you need the data before it hits the textbox?
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    675

    Re: Get scanner data

    A co-worker of mine is trying to work with barcodes to scan a part.
    For instance:
    #10 Flat Screw
    12" Heater Bar
    etc.

    The longest part name we have, currently, is 97 characters. This produces a barcode which is much too long for our scanners to read. So, we were thinking we could just print the ID from the database(no more than 7 characters) as a barcode. However, we'd also like to allow the user to manually type in the part name.

    Currently, he scans the part name, which puts the part name in the text box, and then runs queries based on that. You can also type and then press Enter to achieve the same result. However, we can't determine if the text that is in the textbox was typed manually or scanned.

    This is all done in the KeyUp event of the textbox. If there were a system variable of something to denote that the text is coming from the scanner or a way to just get to the scanned data, we could handle that and still allow them to type manually.
    VB.Net 2008
    .Net Framework 2.0

    "Must you breathe? 'Cause I need heaven..."

  4. #4
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    Re: Get scanner data

    Hi,
    I do something similar. Have a boolean called 'bKeyDown' then...

    Code:
    Private Sub txtStockItem_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtStockItem.KeyDown
            bkeyDown = True
        End Sub
    Code:
     Private Sub txtStockItem_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtStockItem.KeyUp
            If bkeyDown Then
                If e.KeyCode = Keys.Tab Or e.KeyCode = Keys.Return Or e.KeyCode = Keys.Enter Or e.KeyCode = Keys.F23 Then
                    bkeyDown = False
                    If Not Search_For_Stock_Item() Then
                        txtStockItem.ContextMenu = Nothing
                        Highlight_Field(txtStockItem)
                        e.Handled = True
                        Exit Sub
                    End If
                End If
            Else
                bkeyDown = False
            End If
        End Sub
    That should allow keying or scanning. i THINK the F23 is triggered by the scanner.

    Give that a try in a test form
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    675

    Re: Get scanner data

    My co-worker tried this and it didn't help. He actually had it print out every KeyCode for every KeyUp and KeyDown. When he scanned his password("ASDF"), all he saw in KeyUp and KeyDown were Shifts, those letters, and an Enter. We never saw an F23.

    Any other ideas?
    Thanks
    VB.Net 2008
    .Net Framework 2.0

    "Must you breathe? 'Cause I need heaven..."

  6. #6
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    Re: Get scanner data

    You looked at the Symbol SDK?

    The code I posted is working on an MC9090 without a problem taking scanner input or keyboard input.

    There are routines in the formload to turn on the scanner, and start reading, but these are all taken from the sample code in the SDK
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    675

    Re: Get scanner data

    Sorry, this topic has gotten a little cold as I was working on other things, but they asked me to look into it again today. The guy who downloaded the SDK isn't here today, so I can't speak with him. However, I just wanted to explain as simply as possible what we are trying to do in the hopes that we could get some help before he gets back tomorrow.

    If we have "ABCD" in a textbox and receive an Enter, can we determine if it was EITHER scanned OR typed manually by the user?

    We can currently scan and type data just fine, we'd just like to differentiate between scanning and typing.

    Thanks
    VB.Net 2008
    .Net Framework 2.0

    "Must you breathe? 'Cause I need heaven..."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width