只要在01 02 03前面加&H即可。
Dim TestArray() As String = Split("01 02 03")
Dim hexBytes() As Byte
ReDim hexBytes(TestArray.Length - 1)
Dim i As Integer
For i = 0 To TestArray.Length - 1
hexBytes(i) = Val("&H" &TestArray(i))
Next
SerialPort.Write(hexBytes, 0, hexBytes.Length)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)