How do I use dataReceived event of the SerialPort Port Object in C#?

后端 未结 7 1747
無奈伤痛
無奈伤痛 2020-11-28 07:26

I am attempting to create a small application to collect data received from an external sensor attached to COM10. I have successfully created a small C# console object and

7条回答
  •  Happy的楠姐
    2020-11-28 07:43

    I was having the very same problem with a modem that had previously worked and then one day just stopped raising the DataReceived event.

    The solution in my case, very randomly, was to enable RTS e.g.

    sp.RtsEnable = true;
    

    No idea why that worked on this particular bit of kit (not a comms man at all really), nor why it had worked and then stopped but it may help somebody else one day so just posting it just in case...

提交回复
热议问题