Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Trouble with reading from c# #954

    VrIgHtEr
    Member

    I have also figured out why it used to receive some data and then stop. It seems that it’s the driver that takes care of the serial buffer, not the individual programs, so if DTR is enabled (for example by running rngcapture) and I open the serial port from c#, there is still some data in the buffer and the c# program receives that.

    I have confirmed this by first running my program with DTR on and then stopping it. Then if I run the program with DTR set to off, I receive some data and then the stream stops (data still in the serial buffer). If I run the program again after that with DTR still off, the program receives absolutely nothing (as the serial buffer had been emptied by the previous run of the program). I then turn DTR back on and I start getting data again.

    • This reply was modified 9 years, 7 months ago by  VrIgHtEr.
    in reply to: Trouble with reading from c# #953

    VrIgHtEr
    Member

    Thanks a lot for the reply. You hit the nail right on the head.

    It was the DTR that was the problem. In this case all I had to do was simply add the following line before opening the port:

    port.DtrEnable = true;

    That has solved my problem. Thank you

Viewing 2 posts - 1 through 2 (of 2 total)