473,225 Members | 449 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,225 software developers and data experts.

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 31281
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: ^CeFoS^ | last post by:
Hello to everybody, I've done an application that draws in a frame the trajectory of a robot. The robot position is readed through the serial port, and several commands are wrote through the...
1
by: ORC | last post by:
I have made a serial port class inspired bu the MTTTY example and the serial port class from OpenNETCF . below is the code from the readfile method in which there is a problem. The code calls the...
13
by: Al the programmer | last post by:
I need to access the serial ports on my webserver from an asp.net page. I have no problem accessing the serial ports from a windows form application, but the code doesn't work in asp.net. I have...
8
by: Vivek Menon | last post by:
Hi, I am using a C program to write/read from a serial port. The writing part is working perfectly fine. However, I am not able to read the values correctly and display them. To debug this issue I...
13
by: Rob | last post by:
Hi all, I am fairly new to python, but not programming and embedded. I am having an issue which I believe is related to the hardware, triggered by the software read I am doing in pySerial. I...
16
by: bloggsfred00 | last post by:
I need to read incoming bytes on a COM port but I do not want to have the script hang if there is nothing to read. Is there any way to have PHP interrogate a COM port buffer to see if there is...
0
by: RG | last post by:
I am trying to read from my serial port a 24 bit binary number. I was able to read this number as a HEX but I was getting errors as at times using the vBCrLf indicator. I also can read it as an...
9
by: Hal Vaughan | last post by:
I've done a fair amount of Googling for information on reading the serial port in C++ (and in Linux). Unfortunately, out of every 4 hits, 1 seems to be an unanswered question, 1 is someone saying,...
1
by: ghjk | last post by:
I'm trying to read sms from GSM modem using c#. my code is only working for at command. When I enter at+cmgr=1 it says"ERROR". but when i typr it hyperterminal. It is working.Could you please tell me...
6
by: anu29dolly | last post by:
Hello everyone... I have written a program to write and read data from serial port.... I am able to write 80(in binary)..and is expecting 1B but i am uable to read it... My code goes as...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.