473,700 Members | 2,781 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Serial Port = _
My.Computer.Por ts.OpenSerialPo rt("COM1")
com1.WriteLine( "Hello")
End Using
End Sub
Jan 13 '06 #1
12 2119
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 theinvisibleGho st.
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, "theinvisibleGh ost"
<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.
Hypertermina l 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
HyperTermina l 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

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

Similar topics

1
1780
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
2190
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 knowing how to receive it, is always a plus!). The thing is I've been searching for a USB API for VC++, and I can't seen to find any functions or libraries that might get the job done. I've read some things about creating a driver for the device I'm...
6
1488
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 String = com1.ReadLine(). I don't have anything connect to Comm1. Does anyone know why this is happening? Thanks for the help. Regards, Ken Function ReceiveSerialData() As String ' Receive strings from a serial port.
0
892
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 terminal the pin sets and the LED lights. My problem is when I try to send using VB the LED flashes momentarily. I think that VB is sending extraneous information and causing the port to go low again. I think I might solve this problem by sending...
2
2533
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 Express Edition. Sample Code: Function ReceiveSerialData() As String ' Receive strings from a serial port. Dim returnStr As String = ""
17
2711
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 pattern1 print >>orcfilename, line I am pretty sure my code isn't close to what I want. I need to be able
1
1616
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 all the data that the standard program is sending to de LED sign. With my ownprogram I send the same, and it works fine... except: If I send a string to the LED Sign with a length of upto 16 chars it works fine, but if the lengthe is 17 chars or...
1
15080
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 protocol. There are a few open source programs that do this already (http://romraider.com/ , http://jdash.sourceforge.net/ , http://tari.co.za/downloads/software/source/ ), but they are written in Java or C++. I have never done anything with serial...
0
1361
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 talking to the right device, /dev/ttyUSB0? Are the comm parameters correct? (BTW, if you get more than a single character per loop, the print statement will fail - try with ser.read(1))
0
8714
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8641
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9060
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7797
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6557
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5897
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4650
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2379
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.