Hello Kronecker,
I understand that you currently have the numeric value, right?
So let's say
Dim HexValue As Integer = &HAEFF
Dim HexString As String = Hex(HexValue)
To convert from the Hex string to binary string, you could do this:
Dim BinaryString As String = ""
Dim t As Integer
For t = 1 To Len (HexString)
Select Case Strings.Mid(HexString,t,1)
Case "0"
BinaryString &="0000"
Case "1"
BinaryString &="0001"
Case "2"
BinaryString &="0010"
' ... and so on until F
End Select
Next
Best regards,
Martin
On 25.06.2008 15:38, wrote
kr*******@yahoo.co.uk:
I have a Hex number say AEFF that I need as a string for the serial
port. How to convert it?
Will (strCmd isa string)
strCmd=&AEFF
do the job or is it
strCmd="&AEFF"
or
strCmd=Cstr("&AEFF")
Also to do similar from binary is it
strCmd="10101011101011" etc
?
Thanks
K.