Barcode Reader

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Samuel Shulman

    Barcode Reader

    I would like to add barcode functionality to my POS program

    How does one attach barcode reader is it usually USB port

    How can the program get the data read by the device

    Thank you,
    Samuel


  • Steven Nagy

    #2
    Re: Barcode Reader

    Hi

    There are many different types of barcode scanners. USB and PS2 are the
    most common.

    I have experience with PS2 scanners. Essentially they plug in to your
    PS2 keyboard port and act like any other keyboard device. When a
    barcode is scanned, it sends the characters through as if they were
    typed on a keyboard. So for example, if your win form has a textbox
    that has the focus, and you scan a barcode, the characters appear in
    the textbox.

    To program against this, the best way is to handle the keypress events
    native to a windows form or any other control. Usually a barcode will
    need to have a * at the front and back for the barcode scanner to pick
    it up, but this can be configured on most scanners as well. The * will
    be removed by the time it gets to your app so you don't need to account
    for it.

    Essnetially you can differentiate from the barcode scanned text and the
    keyboard typed text by checking the speed in which the characters come
    in. If they come in super fast, then most likely those chars were
    scanned, if they come in slower, then they were typed.

    You also need to consider what barcode font to use, and then ensure
    your barcode scanner supports that font. There are a few common ones,
    but its best to use one that supports alpha and numeric chars. You can
    get very cheap Code39 scanners and the font is freely available on teh
    web to download

    Hope this helps.

    Steven Nagy


    Samuel Shulman wrote:
    I would like to add barcode functionality to my POS program
    >
    How does one attach barcode reader is it usually USB port
    >
    How can the program get the data read by the device
    >
    Thank you,
    Samuel

    Comment

    • Theo Verweij

      #3
      Re: Barcode Reader

      The USB versions work as below (keyboard wedge) or as an emulated serial
      device, in which case, you can use the SerialPort from the toolbox to
      get the data of the scanner.


      Steven Nagy wrote:
      Hi
      >
      There are many different types of barcode scanners. USB and PS2 are the
      most common.
      >
      I have experience with PS2 scanners. Essentially they plug in to your
      PS2 keyboard port and act like any other keyboard device. When a
      barcode is scanned, it sends the characters through as if they were
      typed on a keyboard. So for example, if your win form has a textbox
      that has the focus, and you scan a barcode, the characters appear in
      the textbox.
      >
      To program against this, the best way is to handle the keypress events
      native to a windows form or any other control. Usually a barcode will
      need to have a * at the front and back for the barcode scanner to pick
      it up, but this can be configured on most scanners as well. The * will
      be removed by the time it gets to your app so you don't need to account
      for it.
      >
      Essnetially you can differentiate from the barcode scanned text and the
      keyboard typed text by checking the speed in which the characters come
      in. If they come in super fast, then most likely those chars were
      scanned, if they come in slower, then they were typed.
      >
      You also need to consider what barcode font to use, and then ensure
      your barcode scanner supports that font. There are a few common ones,
      but its best to use one that supports alpha and numeric chars. You can
      get very cheap Code39 scanners and the font is freely available on teh
      web to download
      >
      Hope this helps.
      >
      Steven Nagy
      >
      >
      Samuel Shulman wrote:
      >I would like to add barcode functionality to my POS program
      >>
      >How does one attach barcode reader is it usually USB port
      >>
      >How can the program get the data read by the device
      >>
      >Thank you,
      >Samuel
      >

      Comment

      • Brian Tkatch

        #4
        Re: Barcode Reader


        Hope this helps.
        >
        Steven Nagy
        >
        >
        Samuel Shulman wrote:
        I would like to add barcode functionality to my POS program

        How does one attach barcode reader is it usually USB port

        How can the program get the data read by the device

        Thank you,
        Samuel

        Steven Nagy wrote:
        Hi
        >
        There are many different types of barcode scanners. USB and PS2 are the
        most common.
        >
        I have experience with PS2 scanners. Essentially they plug in to your
        PS2 keyboard port and act like any other keyboard device. When a
        barcode is scanned, it sends the characters through as if they were
        typed on a keyboard. So for example, if your win form has a textbox
        that has the focus, and you scan a barcode, the characters appear in
        the textbox.
        Indeed. I was just playing with one of these last night.
        To program against this, the best way is to handle the keypress events
        native to a windows form or any other control. Usually a barcode will
        need to have a * at the front and back for the barcode scanner to pick
        it up, but this can be configured on most scanners as well. The * will
        be removed by the time it gets to your app so you don't need to account
        for it.
        If that so? I was scanning barcodes in with the PS/2 keyboard wedge and
        did not see any *s, whether in the console or in a textbox.
        Essnetially you can differentiate from the barcode scanned text and the
        keyboard typed text by checking the speed in which the characters come
        in. If they come in super fast, then most likely those chars were
        scanned, if they come in slower, then they were typed.
        Unless the user cut&pasted the text, in which it comes in very fast.
        You also need to consider what barcode font to use, and then ensure
        your barcode scanner supports that font. There are a few common ones,
        but its best to use one that supports alpha and numeric chars. You can
        get very cheap Code39 scanners and the font is freely available on teh
        web to download
        CueCat! :)

        B.

        Comment

        • Steven Nagy

          #5
          Re: Barcode Reader

          If that so? I was scanning barcodes in with the PS/2 keyboard wedge and
          did not see any *s, whether in the console or in a textbox.
          No the scanner removes the *'s before sending it down the line.
          This is configurable as well. Generally you can download a set of
          barcodes from teh manufacturer's website that, when scanned, setup the
          barcode scanner to different settings.
          Unless the user cut&pasted the text, in which it comes in very fast.
          In this case, the key's being pressed are CTRL + V which are what would
          be captured.
          NOT the actual string buffer that was copied originally. So it should
          still work.

          Comment

          • Brian Tkatch

            #6
            Re: Barcode Reader


            Steven Nagy wrote:
            If that so? I was scanning barcodes in with the PS/2 keyboard wedge and
            did not see any *s, whether in the console or in a textbox.
            >
            No the scanner removes the *'s before sending it down the line.
            This is configurable as well. Generally you can download a set of
            barcodes from teh manufacturer's website that, when scanned, setup the
            barcode scanner to different settings.
            Perhaps each scanner is different. I didn't install any drivers for
            this one.
            Unless the user cut&pasted the text, in which it comes in very fast.
            >
            In this case, the key's being pressed are CTRL + V which are what would
            be captured.
            NOT the actual string buffer that was copied originally. So it should
            still work.
            Or Shift-Insert.

            What if the past is effected programmaticall y, as through a
            right-click, or through sendkeys?

            B.

            Comment

            • Steven Nagy

              #7
              Re: Barcode Reader

              You'd really have to test it, but possibly the right-click -paste
              might cause the keypressed event to fire, but I still doubt it. I guess
              some tests are in order!
              I'll run some on the weekend.

              Comment

              Working...