TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Reuven Sabi
NA
1
0
Serial Port Problem
Aug 7 2008 9:58 AM
I am getting Exceptions while trying to Connect/Reconnect from the port using Microsoft Dot Net 2.0 Serial Port Component.
The Following Settings are used:
1.Parity-None
2.Stop Bits-One
3.Baud Rate-9600
4.Handshake-None
When i said Connect/Reconnect I literally mean connect and Disconnect serial port (plug in and plug out).
I am getting the System.IO.Ports.SerialErrorReceivedEventArgs exception
with following properties
base: {System.IO.Ports.SerialErrorReceivedEventArgs}
EventType : Frame
Code Example:
SerialPort serialPort = new SerialPort();
serialPort.ErrorReceived += HabndleError;
serialPort.DataReceived += HandleDataReceived;
serialPort.PortName = "COM1"
serialPort.Parity = Parity.None;
serialPort.StopBits = StopBits.One;
serialPort.DataBits = 8;
serialPort.BaudRate = 9600;
serialPort.Open();
private void HandleDataReceived(object sender, SerialDataReceivedEventArgs e)
{
//Do Something
}
private void HabndleError(object sender, SerialErrorReceivedEventArgs e)
{
MessageBox.Show(e.ToString());
}
Thanks in advance
Reply
Answers (
0
)
VB6 to C# conversion
Problem in building Email interface using AutoComplete Extender