程序有两个串口来数据,分别是50Hz和25Hz的,但是每次接收数据后,
我测试了一下,每次串口来数据都堵塞了5秒左右的数据!!!
为什么啊??大家帮我看看代码有什么问题?
- '串口1
- RS232.PortName = "COM2"
- 'RS232.Encoding = Encoding.ASCII
- RS232.ReceivedBytesThreshold = 46
- RS232.ReadBufferSize = 1024
- RS232.BaudRate = 57600
- RS232.WriteTimeout = 1
- If Not RS232.IsOpen Then
- RS232.Open()
- End If
- '串口2
- ESN8H.PortName = "COM3"
- ESN8H.ReceivedBytesThreshold = 40
- ESN8H.ReadBufferSize = 1024
- ESN8H.BaudRate = 19200
- If Not ESN8H.IsOpen Then
- ESN8H.Open()
- End If
谢谢大家了!!