469,270 Members | 1,086 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,270 developers. It's quick & easy.

Reading serial port

Using qbasic, the following accepts input from com1, and prints its output :
OPEN "com1:9600,n,8,1,CD0,CS0,DS0,RS" FOR INPUT AS #1
WHILE INKEY$ <> " "
INPUT #1, a$
PRINT a$
WEND

What would the same set of commands look like in VB. I am reading the
output from Welch Allyn barcode scanner.

I am a newbie to VB,

regards
Simon

Jul 17 '05 #1
3 30898
Look up the MSCOMM control in VB help. In 32 bit Windows, you either use the
APIs or a control like MSCOMM to talk to the hardware.
"Simon" <si***********@blahblahbtinternet.com> wrote:
Using qbasic, the following accepts input from com1, and prints its output :
OPEN "com1:9600,n,8,1,CD0,CS0,DS0,RS" FOR INPUT AS #1
WHILE INKEY$ <> " "
INPUT #1, a$
PRINT a$
WEND

What would the same set of commands look like in VB. I am reading the
output from Welch Allyn barcode scanner.

I am a newbie to VB,

regards
Simon


More about me: http://thelabwiz.home.mindspring.com/
VB3 source code: http://thelabwiz.home.mindspring.com/vbsource.html
VB6 source code: http://thelabwiz.home.mindspring.com/vb6source.html
VB6 - MySQL how to: http://thelabwiz.home.mindspring.com/mysql.html
My newest language - NSBasic for the Palm PDA: http://thelabwiz.home.mindspring.com/nsbsource.html
Drivers for Pablo graphics tablet and JamCam cameras: http://home.earthlink.net/~mwbt/
johnecarter atat mindspring dotdot com. Fix the obvious to reply by email.
Jul 17 '05 #2
There is no OPEN COM statement in VB and instead you need to use the
MSComm ActiveX control to do serial I/O (or write more complex code
using the Windows API)
A quick and easy solution would be to use a third party tool like
BC-Wedge or WinWedge from TAL Technologies. Both programs run in the
background and feed serial data to other programs by stuffing the data
through the keyboard buffer so that the bar code data would appear as
keyboard input. The WinWedge program also supports DDE so you can feed
data directly to a textbox ia VB program (or any other DDE client)
without having to go through the keyboard buffer. With WinWedge, you
simply set a few properties for a standard textbox and whenever you
scan a bar code, the data goes directly to the textbox automatically
and you also get a change event in the textbox each time you scan a
bar code.
For more info visit: http://www.taltech.com
On Thu, 24 Jul 2003 20:36:59 +0000 (UTC), "Simon"
<si***********@blahblahbtinternet.com> wrote:
Using qbasic, the following accepts input from com1, and prints its output :
OPEN "com1:9600,n,8,1,CD0,CS0,DS0,RS" FOR INPUT AS #1
WHILE INKEY$ <> " "
INPUT #1, a$
PRINT a$
WEND

What would the same set of commands look like in VB. I am reading the
output from Welch Allyn barcode scanner.

I am a newbie to VB,

regards
Simon


Jul 17 '05 #3
Thanks Thomas

"Thomas Lutz" <to*@taltech.com> wrote in message
news:3f***************@news.bellatlantic.net...
There is no OPEN COM statement in VB and instead you need to use the
MSComm ActiveX control to do serial I/O (or write more complex code
using the Windows API)
A quick and easy solution would be to use a third party tool like
BC-Wedge or WinWedge from TAL Technologies. Both programs run in the
background and feed serial data to other programs by stuffing the data
through the keyboard buffer so that the bar code data would appear as
keyboard input. The WinWedge program also supports DDE so you can feed
data directly to a textbox ia VB program (or any other DDE client)
without having to go through the keyboard buffer. With WinWedge, you
simply set a few properties for a standard textbox and whenever you
scan a bar code, the data goes directly to the textbox automatically
and you also get a change event in the textbox each time you scan a
bar code.
For more info visit: http://www.taltech.com
On Thu, 24 Jul 2003 20:36:59 +0000 (UTC), "Simon"
<si***********@blahblahbtinternet.com> wrote:
Using qbasic, the following accepts input from com1, and prints its output :

OPEN "com1:9600,n,8,1,CD0,CS0,DS0,RS" FOR INPUT AS #1
WHILE INKEY$ <> " "
INPUT #1, a$
PRINT a$
WEND

What would the same set of commands look like in VB. I am reading the
output from Welch Allyn barcode scanner.

I am a newbie to VB,

regards
Simon

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by ^CeFoS^ | last post: by
1 post views Thread by ORC | last post: by
13 posts views Thread by Al the programmer | last post: by
13 posts views Thread by Rob | last post: by
16 posts views Thread by bloggsfred00 | last post: by
9 posts views Thread by Hal Vaughan | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.