CodePudding user response:
No parity check some Settings, communication process is very simple,CodePudding user response:
Have a ready-made controls may be used,CodePudding user response:
I use is SerialPort controls, but encountered in receiving data is A little problem, is about A serial port interface A synchronous asynchronous delegate part of the above, my communication is sending instructions after A few seconds to return to the test results, this code can be?Private Sub SerialPort1_DataReceived (ByVal sender As Object, ByVal e the As System. IO, Ports, SerialDataReceivedEventArgs) Handles SerialPort1. Method DataReceived
Dim n As Integer
Dim rxdata (2) the As Byte
SerialPort1. PortName="COM9"
N=Me. SerialPort1. BytesToRead
If (n & gt; 0) Then ReDim rxdata (n - 1)
Me. SerialPort1. Read (rxdata, 0, n)
SerialPort1. Close ()
End Sub
CodePudding user response:
VB.NET 2008 serial port engineeringCodePudding user response:
SerialPort1. Close ()Closed,
Data may not arrive at a time,
CodePudding user response:
Mscomm control adopts event trigger mechanism, then data parsing