Greetings,
Any ideas how to make this more elegant? It works but ...
An example of Full_CommandString would be "BEEF030600BAD2010000600100"
For ByteCounter = 1 To Len(Full_CommandString) - 1 Step 2
OutputCommand = OutputCommand & Chr(CByte("&H" & Mid(Full_CommandString, ByteCounter, 2)))
Next
MSComm1.Output = OutputCommand
Delay50ms
ResponseStatusCode = ""
ResponseStatusString = ""
ResponseStatusCode = MSComm1.Input
For ByteCounter = 1 To Len(ResponseStatusCode)
ResponseStatusString = ResponseStatusString & CStr(Hex(Val(Asc(Mid(ResponseStatusCode, ByteCounter, 1)))))
Next
Thanks.
Any ideas how to make this more elegant? It works but ...
An example of Full_CommandString would be "BEEF030600BAD2010000600100"
For ByteCounter = 1 To Len(Full_CommandString) - 1 Step 2
OutputCommand = OutputCommand & Chr(CByte("&H" & Mid(Full_CommandString, ByteCounter, 2)))
Next
MSComm1.Output = OutputCommand
Delay50ms
ResponseStatusCode = ""
ResponseStatusString = ""
ResponseStatusCode = MSComm1.Input
For ByteCounter = 1 To Len(ResponseStatusCode)
ResponseStatusString = ResponseStatusString & CStr(Hex(Val(Asc(Mid(ResponseStatusCode, ByteCounter, 1)))))
Next
Thanks.