.NET SerialPort DataReceived event not firing

前端 未结 9 671
忘掉有多难
忘掉有多难 2020-12-09 22:52

I have a WPF test app for evaluating event-based serial port communication (vs. polling the serial port). The problem is that the DataReceived event doesn\'t seem to be fir

相关标签:
9条回答
  • 2020-12-09 23:46

    I can only surmise that the problem was indeed with the Virtual Serial Port Emulator program. this is NOT to say there is a problem with that software: VSPE has worked very well for me so far. But there was some conflict between my code and how I had set up the VSPE connector.

    0 讨论(0)
  • 2020-12-09 23:47

    I can't say for sure, but there could be a threading issue. WPF handles threading differently, and the polling of the virtual port is asynchronous, I believe. Have you tried this with a Windows Forms or console application to prove that it can work at all?

    0 讨论(0)
  • 2020-12-09 23:50

    I use VSPE too! It does work wonderfully.. I was having this same problem and the way I fixed it was to make the two com ports a PAIR in VSPE instead of just creating two virtual com ports

    0 讨论(0)
提交回复
热议问题