473,405 Members | 2,262 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,405 software developers and data experts.

writing ASCII data with the SerialPort component

Hello, I am using Visual Studio .Net 2005 beta. I have my computer's two
comm ports connected with a serial cable (and null modem). I'm trying to
write the letter 'a' out on comm port 1 with the C# program and see it appear
in a Hyperterminal window open on comm port 2. Hyperterminal is configured
with the same settings that the port 1 is opened with (see below), but I do
not get an 'a', I get some funky ASCII character that looks like a spade with
a little block after it. What do I need to do differently?

public String commPortStr = "COM1";
public SerialPort commPort;

commPort = new SerialPort(commPortStr, 19200, Parity.None, 8, StopBits.One);
commPort.Open();
char[] test = new char[1];
test = 'a';
commPort.Write(test, 0, 1);
Thanks,
Don

Nov 17 '05 #1
1 8427
Doh! Nevermind. I had forgotten to change the baud rate in another part of
the code where the SerialPort component was created. Dopey me.

Don

"Don Tucker" wrote:
Hello, I am using Visual Studio .Net 2005 beta. I have my computer's two
comm ports connected with a serial cable (and null modem). I'm trying to
write the letter 'a' out on comm port 1 with the C# program and see it appear
in a Hyperterminal window open on comm port 2. Hyperterminal is configured
with the same settings that the port 1 is opened with (see below), but I do
not get an 'a', I get some funky ASCII character that looks like a spade with
a little block after it. What do I need to do differently?

public String commPortStr = "COM1";
public SerialPort commPort;

commPort = new SerialPort(commPortStr, 19200, Parity.None, 8, StopBits.One);
commPort.Open();
char[] test = new char[1];
test = 'a';
commPort.Write(test, 0, 1);
Thanks,
Don

Nov 17 '05 #2

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

Similar topics

7
by: Tamir.D | last post by:
is there a way to embed the System.IO.Ports.SerialPort object in my html . so that the client can access to a device connected to his SerialCOM ? i tried to wrap the System.IO.Ports.SerialPort in...
0
by: ricolee99 | last post by:
Hi Everyone, I'm using the System.IO.Ports.SerialPort component to attempt to kill an existing component opened by another application. I use the following code: SerialPort serialPort = new...
0
by: nmsreddi | last post by:
Hi friends I am working on serialport in c# ,i am using C#2005 i have successfully done the serial communication with GSM modem and able to send and receive data , the main problem ,the serial...
2
by: emilyhf | last post by:
This C# program is use to convert decimal to hex and send through serial port in ASCII characters. For example: I try to send a string variable in Hex format which i need to convert to a standart...
3
by: Adriano | last post by:
Hello, I'm developing an application in VB.NET 2005 that communicates with a device through RS232, and need to send the following sequence of hexadecimal data to the device: 0xFF, 0x01, 0xC3,...
2
by: egress | last post by:
Forgive me for stupid questions for I am new to serial IO programming. I am developing an app that will need to communicate with a device via RS232 protocol using a standard 9 pin serial cable. ...
2
by: Nasif | last post by:
Currently I am writing a program which sends and receives messages through serial port to a device. I am using C# and Microsoft Visual studio 2005 for windows program. But my problem is when i try...
10
by: sklett | last post by:
I'm trying to send some printer commands (ZPLII) to an attached USB printer using the SerialPort component. I didn't get very far at all. In fact I haven't gotten anywhere. The first problem I...
9
by: jensa | last post by:
Hi, I am currently writing a simple form application in C# that uses the SerialPort class (C# 3.5). But I have put my head in the wall several times to solve a simple problem. I have a...
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
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
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,...
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
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...
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
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...

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.