Connecting Tech Pros Worldwide Forums | Help | Site Map

Reading serial port

Simon
Guest
 
Posts: n/a
#1: Jul 17 '05
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






the Wiz
Guest
 
Posts: n/a
#2: Jul 17 '05

re: Reading serial port


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" <simon.gregson@blahblahbtinternet.com> wrote:
[color=blue]
>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
>
>
>
>[/color]

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.
Thomas Lutz
Guest
 
Posts: n/a
#3: Jul 17 '05

re: Reading serial port


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"
<simon.gregson@blahblahbtinternet.com> wrote:
[color=blue]
>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
>
>
>
>[/color]

Simon
Guest
 
Posts: n/a
#4: Jul 17 '05

re: Reading serial port


Thanks Thomas

"Thomas Lutz" <tom@taltech.com> wrote in message
news:3f258742.27493958@news.bellatlantic.net...[color=blue]
> 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"
> <simon.gregson@blahblahbtinternet.com> wrote:
>[color=green]
> >Using qbasic, the following accepts input from com1, and prints its[/color][/color]
output :[color=blue][color=green]
> >
> >
> >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
> >
> >
> >
> >[/color]
>[/color]


Closed Thread