none
cannot read serial port RRS feed

  • Question

  • I am trying to read serial port from two machines:

    reading from first machine is good:

    #I34171    #I31505    
    #I33629    
    #I31231    
    #I34713    
    #I32339    
    #I32514    
    #I33177    
    #I32114    
    #I32101

    reading from second machine is bad:

    ????????????????
    ????????
    ????????
    ????????
    ????????
    ????????
    ????????
    ????????
    ????????
    ????????????????

    Why is second bad?

    Wednesday, November 29, 2017 4:02 PM

All replies

  • these are my serial port settings:

                //set up port parameters for port
                mySerialPort.BaudRate = 9600;
                mySerialPort.Parity = Parity.None;
                mySerialPort.StopBits = StopBits.One;
                mySerialPort.DataBits = 8;
                mySerialPort.Handshake = Handshake.None;
                mySerialPort.RtsEnable = true;
                mySerialPort.DtrEnable = true;
                mySerialPort.ReadTimeout = 2500;

    Wednesday, November 29, 2017 4:05 PM
  • Maybe reading is good, but writing is bad?

    Who sends the data and how the reader interprets and displays them?

    • Edited by Viorel_MVP Wednesday, November 29, 2017 6:17 PM
    Wednesday, November 29, 2017 6:15 PM
  • the sends data.

    it is read every 1/10 of a sec

    this a test configuration to set what is read:

      string path3 = @"C:\jordan AUTO GC2\HISTORY\test.txt";

     string indata = Convert.ToString(mySerialPort.ReadExisting());//reads port

     File.AppendAllText(path3, indata + "\r\n");//test configuration

    Wednesday, November 29, 2017 9:31 PM
  • Hi Jordan,

    The two machines are configured same? If not, check properties like StopBits.

    What's more, ???? means no data or wrong decoded data?

    Best Regards,

    Charles He


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    • Marked as answer by Jordanhal Friday, December 8, 2017 7:25 PM
    • Unmarked as answer by Jordanhal Friday, December 8, 2017 7:25 PM
    Thursday, December 7, 2017 2:34 AM