Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C#4.0 SerialPorts
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 18:03pm
Edited 9-Nov-12 18:14pm
Richard MacCutchan at 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 490
1 Gihan Liyanage 338
2 ChauhanAjay 180
3 Vinay Mistry 160
4 Sergey Alexandrovich Kryukov 153
0 Sergey Alexandrovich Kryukov 9,011
1 OriginalGriff 7,941
2 CPallini 2,603
3 Richard MacCutchan 2,121
4 Abhinav S 1,928

Advertise | Privacy | Mobile
Web03 | 2.8.140827.1 | Last Updated 8 Jan 2013
Copyright © CodeProject, 1999-2014
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