Click here to Skip to main content
11,920,772 members (56,738 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# C#4.0 serialport
HI Friends,
i am going to read machine Data using COM Port but failed to read. when i read data from other computer using com port then my program work fine but whenever i read data from machine then its not working. Hyper Terminal shows data perfectly and hyper Terminal setting's are
Port= COM3 , Baud Rate=9600, Parity=None, StopBits=One, DataBits=8. My Program is
SerialPort mySerialPort = new SerialPort();
        mySerialPort.PortName = Console.ReadLine();
        mySerialPort.BaudRate = 9600;
        mySerialPort.Parity = Parity.None;
        mySerialPort.StopBits = StopBits.One;
        mySerialPort.DataBits = 8;
        mySerialPort.ReceivedBytesThreshold = 1;
        mySerialPort.Handshake = Handshake.None;
        mySerialPort.RtsEnable = true;
        mySerialPort.ReadBufferSize = 2048;
        mySerialPort.WriteBufferSize = 2048;
        if (!mySerialPort.IsOpen)
        while (true)
            string indata = mySerialPort.ReadLine();
            Console.WriteLine("Data Received:");
Please help Me to solve this Problem...
Thank you
Posted 9-Nov-12 19:03pm
Edited 9-Nov-12 19:14pm
Richard MacCutchan 10-Nov-12 6:01am
What is the data that you receive on the com port?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

mySerialPort.RtsEnable = true;
Which transmision control mode do you setup (None, XOF/XON, RTS+CTS)?
How many wires are in transmission cable?
Maybe you should to disable RTS? I don't know - you have the machine Smile | :)


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 415
1 phil.o 170
2 Dave Kreskowiak 155
3 KrunalRohit 134
4 F-ES Sitecore 130
0 OriginalGriff 6,778
1 KrunalRohit 4,530
2 Sergey Alexandrovich Kryukov 3,203
3 George Jonsson 2,815
4 Suvendu Shekhar Giri 2,181

Advertise | Privacy | Mobile
Web04 | 2.8.151120.1 | Last Updated 8 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100