Home > Software engineering > Using VB to get hexadecimal array to a serial port communication, how to deal with it
Using VB to get hexadecimal array to a serial port communication, how to deal with it
Time:10-09
Such as use MSCOMM communication after get a hexadecimal values such as "41 0 c 0 f A0," how can handle to turn it into a normal engine speed? The specific procedures, thank you
CodePudding user response:
Are you sure you received is a string (do you use comInputModeText mode, or is not set an InputMode=comInputModeBinary)? Are you sure is to use a space between each two characters separated? What is you want to convert the rotational speed of numerical data type, is Long? Both Dim strData
As String, lngData As Long
0 c 0 f A0 strData="https://bbs.csdn.net/topics/41" StrData=https://bbs.csdn.net/topics/Replace (strData, ""," ") LngData=https://bbs.csdn.net/topics/CLng (" & amp; H "& amp; StrData)
CodePudding user response:
Received a hexadecimal array, using hexadecimal model, numerical type Long and integer should speed can be, what I want is "how to use VB to handle a use MSCOMM communication receive hexadecimal array, convert him to Long or integer type" such a program code, can you help me?