473,395 Members | 1,442 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,395 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 31313
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.