Home | Reviews | GUIpedia | Forum | Fun500
jasonwoodland | Serial Data to keyboardHi all,
how can I send serial data (from a RS232 barcode scanner) to the keyboard buffer?
I am making a DOS EPoS Application and I need to support a serial scanner.
The software can work with a Keyboard wedge scanner (as it outputs data to the PS/2 port)
The scanner outputs data like F5018374320766
any adive most welcomed as I am a bit rusty on DOS programming.
Thanks for your advice
Andy | 2009-10-25 | 1:01 PM |
jasonwoodland | Re:Serial Data to keyboardi have used the keyboard circuit to make controllers, you read thr keyboard with INKEY$ | 2009-10-25 | 5:52 PM |
jasonwoodland | Re:Serial Data to keyboardWell what I would like to beable to support RS232 barcode readers on the DOS systems (the Window version has a control program that makes the Software think it is Keyboard data) | 2009-10-27 | 9:28 PM |
twilightsentry | Re:Serial Data to keyboardWell, if the scanner's output is actually PS/2, you can just use INKEY$. If it's RS-232, you'll need to do something like:
[code]
' See QB45 HELP: OPEN COM
' Example uses 300 baud, even parity, 8-bit bytes, 1 stop bit
OPEN "COM1:300,,8" FOR INPUT AS #1
' Read 5 bytes from the com port.
DATA$ = INPUT$(5, 1)
CLOSE #1
[/code]
You could support both PS/2 and RS-232 scanners just by changing the string fed to OPEN.
[code]
IF IsPs2 THEN
FILE$ = "KYBD:"
ELSE
FILE$ = "COM1:Blah"
END IF
OPEN FILE$ FOR INPUT AS #1
[/code] | 2009-10-30 | 7:09 AM |
BASIC Programming Help
2021 Brandon Cornell