What you need is to iterate the bytes in the array, use the Hex function to get the hexadecimal representation of each byte, and concatenate them into a legible string. You're getting a byte array, which as far as VBA is concerned, is indistinguishable from a string - that's the only reason Debug.Print buf isn't throwing a type mismatch error - because any other array simply has no way to represent itself as a string, so you can't debug-print an array. 'Use this to send data to the remote deviceĮxpected results: AA 00 00 22 00 03 00 00 03 2B 01 E1 35 'Use this to connect and set the port properties from the codeĭebug.Print StrokeReader1.ErrorDescription Private Sub StrokeReader1_CommEvent(ByVal Evt As StrokeReaderLib.Event, ByVal data As Variant)īuf = (StrokeReader1.Read(Text)) 'Use BINARY to receive a byte array I cannot get it to show anything in an excel cell either. I have tried some VBA extensions, but they were all paid for, have tried some terminal tools as well. I have tried various sets of tools, but none show me any results in Excel. The resultant input needs to be put in a cell in Excel, and converted to hex. I am pushing a set of bytes from an external device to a COM port.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |