1.缓冲区不定字节读取(波特率很高也没问题) //Thread.sleep(1000);//处理事件这块可以加上延时确保不定数的数据可以全部收到缓冲后,才去读缓冲内容--单位:毫秒 byte[] data = new byte[serialPort1.BytesToRead]; //定义缓冲区,因为串口事件触发时有可能收到不止一个字节 serialPort1.Read(data, 0, data.Length);//读取指定长度 foreach (byte Member in data) //遍
CSV,逗号分开的文件,如果能快速的读取这些文件中的数据,无疑会帮助我们解决很多问题. 1. 只有数据的CSV文件,CSV file that includes only numbers. As an example, create a text file, named as 'data.csv' if you prefer, which includes the following data with any editor you like. 1, 2, 3, 4 5, 6, 7, 8 9,
Private serialPort As SerialPort '定义 Public Function CreateSerialPort() As String Dim strWeights As String = "" Dim strData As String = "" Dim bSetPointNum As Double = 0.0 If serialPort IsNot Nothing Then