473,969 Members | 2,340 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem using serialport in vb2005

Jan
Hello,

I want to send some simple strings to com1 using vb2005. I want to read
it
in Hyperterminal.
I succeeded to send some data en read it in Hyperterminal, only the data
I
received is not the data I send.

This is the code i used:

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
SendSerialData( )
End Sub

Sub SendSerialData( )
Dim data As String = "x"

' Send strings to a serial port.
Using com1 As IO.Ports.Serial Port =
My.Computer.Por ts.OpenSerialPo rt("COM1", 2400, IO.Ports.Parity .None, 8,
1)

com1.WriteLine( data)
End Using
End Sub

Is there something I forgot?
The settings of the serial port I also used for hyperterminal.

Thank you very much for even reading my question

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Dec 31 '05 #1
1 1627
Seb
Jan wrote:
Hello,

I want to send some simple strings to com1 using vb2005. I want to read
it
in Hyperterminal.


Maybe

Sub Com1Conn()

Using com1 As IO.Ports.Serial Port = _
My.Computer.Por ts.OpenSerialPo rt("COM1", 9600)
com1.DtrEnable = True
com1.Write("YOU R DATA" & vbCrLf)
' Insert code to transfer data to and from the com port.
End Using

End Sub
Jan 4 '06 #2

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

Similar topics

1
21408
by: Junior | last post by:
I keep receiving this "The type or namespace name 'CASsEventHandler' could not be found (are you missing a using directive or an assembly reference?)" message in two particular lines, and I've tried everything... Could anyone please paste this and tell me what I'm doing wrong ? I use SerialPort.zip, which can be downloaded at http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=b06e30f9-1301-4cc6-ac14-dfe325097c69 ...
1
1940
by: Jan | last post by:
Hello there, I'm looking for a code for using the serialport in vb2005. A want to send text to windows hyperterminal en read text from it. Just an example to get me started Thanx in advance
2
10539
by: Jan | last post by:
Hello there, I've got a strange problem using the readline method in vb2005 for reading the serial port. If I use the readchar method I can receive one character from serialport. This is the code I use: Function ReceiveSerialData() As String ' Receive strings from a serial port. Dim returnStr As String = ""
4
11077
by: Lonifasiko | last post by:
Hi, I've been able to communicate using HyperTerminal with my device via serial port COM1. I just send a command and device switches on. I just need that to start playing with it. This way, I understand device and serial communication work wihout problems. Now I want to do the same with C# code. As simple as that. I open the serial port with the configuration manufacturer gives me,
1
2486
by: Jan | last post by:
Hello, I want to send some simple strings to com1 using vb2005. I want to read it in Hyperterminal. I succeeded to send some data en read it in Hyperterminal, only the data I received is not the data I send. This is the code i used: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
3
15495
by: Mugunth | last post by:
Hi, I've a strange problem with serial port class of .NET Framework 2.0 I use com0com (Null Modem COM Port emulator) to emulate a virtual port. This application creates virtual com port pairs with starting with CNCA0 <-CNCB0 CNCA1<-CNCB1 etc., When I created a port with this name and try to open it using SerialPort.Open,
3
1785
by: ndtang | last post by:
Hi, I am trying to convert a legacy rs232 application to vb2005. The legacy app was written in pascal and runs in full DOS. I have successfully rewrote the app to communicate with the device using SerialPort component in .NET 2.0. It works wonderful with a desktop PC. When I installed the program to the laptop it fails, though the original DOS app works in the same configuration. Somehow, the data is
7
18892
by: trentrockport | last post by:
I have rewritten a faulty serial app that my company uses at several sites. In most cases, it works fine. At one site, it does not work. I know for certain the following: Port=COM1, Rate=9600bps, Framing=8+N+1, and Control Flow is either none or XON/XOFF. I am using a .NET SerialPort object to manage the port. To open the port, I do the following: serialPort.PortName = port; serialPort.BaudRate =...
9
6489
by: rajujrk | last post by:
hi, currently i am doing the project to send the sms from PC to Mobile and vice versa using GSM modem. I successfully done this process in Hyperterminal. First i connect the GSM modem in COM1 port then set the baud rate to 9600 and execute the AT commands in hyperterminal and its works fine.. But my problem is that to do the similar process in java..
0
10338
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
10149
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,...
1
11541
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10886
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
10056
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
8447
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
6531
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3740
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.