I have to convert an ASCII hex string eg "0100BBFF060A" to actual hex to send out of the serial port
I can do this via this function below
Dim i As Integer
Dim strTemp As String
Dim ConvertedValue As String
'For each hex value do
For i = 1 To (Len(value)) Step 2
'Get the next hex value
strTemp = Mid$(value, i, 2)
'Convert the hex value to ascii and append it to the string
ConvertedValue = ConvertedValue & Chr(CInt(Val("&H" & strTemp)))
'hex strings are 2 characters thats why 2 characters are taken at a time and why
This works fine but if a hex value of "00" comes throught the ascii character for it is null, so nothing is added to the string.
Does anyone know how to get around this?