473,386 Members | 1,706 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,386 software developers and data experts.

Newbe help. Sending serial data

ken
Hello everyone,
I'm new to visual VB and I am trying to setup communications to the
outside world. I found the example listed below in the help section of
Microsoft Visual Basic 2005 Express Edition. Using the Hyper Terminal
should I be able to see the string "Hello" or am I completely off base
here? Thank you in advance for all and any help.
Best regards, Ken

Sub SendSerialData(ByVal data As String)
' Send strings to a serial port.
Using com1 As IO.Ports.SerialPort = _
My.Computer.Ports.OpenSerialPort("COM1")
com1.WriteLine("Hello")
End Using
End Sub
Jan 13 '06 #1
12 2084
Only one computer can see a serial port at a time usually.
Sometimes you can find Serial Line Analysing tools that will
allow you to analyse and send at the same time,
however I've no idea how they work. I don't know
where you might find one that works with built in ports. I have used
some Moxa software that will allow you to do this, but it's hard to get
hold of.

The easier soloution is to have either 2 PC's where
you have the VB App sending on a Comm port
connected to a Comm port on the other PC running
Hyperterminal receiving the data.
OR
If your PC has 2 comm ports, connect one to the other
and You can then send on one with the VB App
and use Hyperterminal to receive on the other...

Hope this helps
Regards
Chris

Jan 13 '06 #2
Apologies that should read
Only one "Process" can use a serial port at a time usually
Your VB App would be that Process.

Jan 13 '06 #3
Here is the message you will get from HyperTerminal If
you try to read from a port that is sending
"Another program is using the selected Telephony Device
Try again after the program completes"

Jan 13 '06 #4
ken
Thank you theinvisibleGhost.
Jan 13 '06 #5
ken
Once again thank you for your help. I tried to connect my laptop to
the computer running my VB programming but, the Hyper terminal on my
laptop gets the message:
"Another program is using the selected Telephony Device
Try again after the program completes"
and I don't have anything connect to the laptop. Can you tell me how
to find out what program may be using it.
Regards, Ken
Jan 13 '06 #6
Intriguing! Usually you know when somethings using it!
I don't know if there is anyway of detecting what app may be using it.
Is the laptop running NT4?
I know there was some cases with certain older Dell Laptops getting
funny with comm ports. I remember we had one that would could
only be setup either for NT4, or for DOS but not both, through
some strange settings in the BIOS.
Hyperterminal would indicate your running 2k/xp?

All I can suggest is check that the Comm port is shown OK under
Device Manager, see if there are any IRQ Conflicts if you can.
I've just done a few searches and apparently some PCMCIA devices
do want to share IRQ's and cause problems..

I presume you've tried a restart to kill anything that may have been
running?

Failing all of that...
Have you got a floppy drive and an old dos boot disk lieing around?
If your confident you could boot your laptop into pure dos from the
floppy.
I've found some free software here:-
http://www.taltech.com/freesoftware/fs_sw.htm
called ComShow which by the look of it will do the same thing as
HyperTerminal which runs in DOS.
With Dos there's no worrying about drivers for serial comms, and it's
doubtful
that anything will conflict with them by default.
If on the other hand you've never touched DOS in your life that might
be a bit over the top,
in which case we'll try something else =)

Jan 14 '06 #7
Ah ha,
I have found a soloution for you!
http://www.sysinternals.com/utilities/portmon.html

This is acts like a serial line analyser.
You can run it on your VB comp to find out what your VB app is
outputing
on Comm1,
or you can run it on your Laptop and it might tell you which process is
using your
Comm Port =)
Hope that helps!
Regards
Chris (TiG).

Jan 14 '06 #8
ken
On 13 Jan 2006 16:16:14 -0800, "theinvisibleGhost"
<th***************@yahoo.com> wrote:
Intriguing! Usually you know when somethings using it!
I don't know if there is anyway of detecting what app may be using it.
Is the laptop running NT4?
I know there was some cases with certain older Dell Laptops getting
funny with comm ports. I remember we had one that would could
only be setup either for NT4, or for DOS but not both, through
some strange settings in the BIOS.
Hyperterminal would indicate your running 2k/xp?

All I can suggest is check that the Comm port is shown OK under
Device Manager, see if there are any IRQ Conflicts if you can.
I've just done a few searches and apparently some PCMCIA devices
do want to share IRQ's and cause problems..

I presume you've tried a restart to kill anything that may have been
running?

Failing all of that...
Have you got a floppy drive and an old dos boot disk lieing around?
If your confident you could boot your laptop into pure dos from the
floppy.
I've found some free software here:-
http://www.taltech.com/freesoftware/fs_sw.htm
called ComShow which by the look of it will do the same thing as
HyperTerminal which runs in DOS.
With Dos there's no worrying about drivers for serial comms, and it's
doubtful
that anything will conflict with them by default.
If on the other hand you've never touched DOS in your life that might
be a bit over the top,
in which case we'll try something else =)


Thanks for the reply,
I'm running XP on a HP and it was the modem on com3. I disable it and
my only options in Hyper Terminal were LPT and winsock, com3 wasn't
on the list anymore (strange). No cmom ports were listed. I checked
the device manager, no conflicts and the only port listed was LPT. Any
Ideas? I may have an old DOS disk around here somewhere but, I
wouldn't know were to begin to look. It's been years since I used DOS.
Mid 80's on my first 80386. I'll try the software from the link you
supplied and let you know how it works out. Regards, Ken
Jan 14 '06 #9
ken

Thanks for the reply,
I'm running XP on a HP and it was the modem on com3. I disable it and
my only options in Hyper Terminal were LPT and winsock, com3 wasn't
on the list anymore (strange). No cmom ports were listed. I checked
the device manager, no conflicts and the only port listed was LPT. Any
Ideas? I may have an old DOS disk around here somewhere but, I
wouldn't know were to begin to look. It's been years since I used DOS.
Mid 80's on my first 80386. I'll try the software from the link you
supplied and let you know how it works out. Regards, Ken
Jan 14 '06 #10
I suspect the Modem adds a comm port through the PCMCIA slot purely
for it's own means so theres no way you can use that one.
If theres no other comm ports shown in Device Manager, then I suspect
that it is disabled in the laptops BIOS. Have a poke around!
It should end up on Com1.

Jan 14 '06 #11
ken
Hi Chris,
Portmon (second link) for Windows NT/9x works great!!! Once again
thanks for all your help.
Best regards,
Ken

Jan 14 '06 #12
Your Welcome =)

Jan 14 '06 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ron | last post by:
Is this built into any of the python versions? Need it! Using 2.3.5 and doesn't seem to have it.Newbe needs help!email ron@nac.net Thanks Ron
2
by: Alray | last post by:
I need to send information through a USB port, so I can control certain machine on the other side. The data goes through a USB to serial cable, so I'm only interested in sending data (Though...
6
by: ken | last post by:
Hi all, I copied this code from the examples. "How to: Receive Strings From Serial Ports in Visual Basic" When I call the function and using the single step method it hangs at Dim Incoming As...
0
by: ken | last post by:
Hi, I'm trying to send information to a PIC. I have the PIC setup so when it receives the letter "A" it outputs a high to portB pin4. I know this works because when I send the character using a...
2
by: ken | last post by:
Hello everyone, I'm new to visual VB and I am trying to setup communications using the Function ReceiveSerialData() As String example found in the help section of Microsoft Visual Basic 2005...
17
by: Eric_Dexter | last post by:
def simplecsdtoorc(filename): file = open(filename,"r") alllines = file.read_until("</CsInstruments>") pattern1 = re.compile("</") orcfilename = filename + "orc" for line in alllines: if not...
1
by: cvschie | last post by:
Hi, I have a LED Sign with standard software to control messages (via serial port). Because the limitations of the software I want my own VB.net program. With a serial analyzer program, I see...
1
by: Rich | last post by:
Hello, I am working on a python library for sending and receiving data from a Subaru's ECU (the fuel injection computer) via the OBD-II port and an OBD to USB cable, with the Subaru Select Monitor...
0
by: Gabriel Genellina | last post by:
En Fri, 02 May 2008 16:50:46 -0300, Rich <richietommy@yahoo.comescribió: No, chr works as it should. The same thing can be written as ser.write("\x80\x10\xF0\x01\xBF\x40") Are you sure you're...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.