Thread: Keyboard port using other that a keyboard

  1. #1
    Registered User
    Join Date
    Jun 2008
    Posts
    1

    Keyboard port using other that a keyboard

    Hi everyone,

    First of all, this is not my style asking first and searching after. I have looked around but don't have a clue on what keyword to use, so here I am.

    I am new at C++ programmation but this won't last too long (I wish so) and I need to read information from a bar code reader on the keyboard input (the keyboard and the bar code reader is plugged on the same input). Everywhere I search about keyboard input, it is only covering the keyboard side of the input. The bar code reader hasn't any manual (book) or anything with it. If that can help to help me it is an IT3800 made by welchallyn.

    In fact, I would normally read my books until I found out how, but I need something to get me a little occupied.

    Anyone can tell me where to look?

    Thank you,

    Antoine

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    There is no specific standard to cover bar-code readers that connect to computers (whether they connect to the keyboard port or otherwise).

    If you write something like this:
    Code:
    #include <iostream>
    #include <iomanip>
    
    int main()
    {
        int x;
        do 
        {
            x = std::cin.get()
            std::cout << std::hex << x << std::endl;
        } while (x != '!');
    }
    and run the bar-code reader, what do you see on the display (you may need to hit enter after each bar-code reading).

    My guess would be that the bar-code reader generates numbers and perhaps a control code at the start and/or end.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by matsp View Post
    My guess would be that the bar-code reader generates numbers and perhaps a control code at the start and/or end.
    Indeed -- the entire point of having the BCS connect to the keyboard port is for easy interfacing to software that takes its input from the keyboard. If it used some weird protocol, it would have been hooked up over serial or USB.

    The times I've dealt with these things, the scanner will just return the digits followed by a carriage return.

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by brewbuck View Post
    Indeed -- the entire point of having the BCS connect to the keyboard port is for easy interfacing to software that takes its input from the keyboard. If it used some weird protocol, it would have been hooked up over serial or USB.

    The times I've dealt with these things, the scanner will just return the digits followed by a carriage return.
    Yes, that's what I would have guessed too.

    Of course, there's no telling what people will invent, so someone may well have come up with a different device that sends some strange (as in normally-unused[1]) scan-codes and then using special client software to read the scan codes and translate - that would tie the hardware to a specific software (or vice versa), which some vendors seem to like.

    [1] Not that there are particularly many unused scan-codes when you have 127 possibles, and the keyboard uses 102 different ones by itself, along with a few "prefix" codes added. But for 10 digits, it may be possible...

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #5
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    Everywhere I search about keyboard input, it is only covering the keyboard side of the input. The bar code reader hasn't any manual (book) or anything with it.
    That could be a BIG problem....

    I did a quick search for IT3800 and programming, and I did get hits. it3800.com has datasheets for various model variations (I didn't see any programing information in the datasheet).

    What kind of connector/interface does it have?

    If you are really lucky, it will plug directly into your keyboard port... maybe with an adapter that allows both the scanner and keyboard to be connected at the same time....

    If you are very unlucky, the thing only works with the manufacturer's software and they don't publish any driver-interface information. (I don't think this is the case... I think these things wor with a variety of software.)

    I assume that you are trying to do this on a Windows PC? The best case would be that you have a driver, a programming library (an add-on to your compiler), and a programming manual, all provided by the barcode-reader manufacturer.

    If you had enough details about the hardware, you could theoretically write your own driver... But, driver writing is not for beginners. And, if the manufacturer provides that much information, they usually provide the driver and the tools to use the driver...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. FTP program
    By jakemott in forum Linux Programming
    Replies: 14
    Last Post: 10-06-2008, 01:58 PM
  2. multiplexing
    By kaijuu in forum C Programming
    Replies: 0
    Last Post: 03-29-2008, 06:47 AM
  3. Replies: 3
    Last Post: 02-29-2008, 01:29 PM
  4. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 05:49 PM
  5. Segmentation Fault - Trying to access parallel port
    By tvsinesperanto in forum C Programming
    Replies: 3
    Last Post: 05-24-2006, 03:28 AM