datametsa Posted January 21, 2015 Share Posted January 21, 2015 Data coming from the comm port has hex header information(in blue) I need, and I only could retrieve my ASCII data(in red). How could I write a script to read this header data? ~\000\158\128\000\019\162\000@\194\248\020(\194$WIXDR,A,290.5,D,WNDA,w,2.0,N,WNDS*72\013\010 $WIMDA,29.8962,I,1.0124,B,20.1,C,,,,,,,,,,,,,,*3B\013\010 $YXXDR,C,,C,WCHR,C,,C,WCHT,C,,C,HINX,P,1.0124,B,STNP*4D\013\010 Link to comment Share on other sites More sharing options...
AzeoTech Posted January 27, 2015 Share Posted January 27, 2015 Use parse() to split the two by the $ character. The trick, of course, is if there is a $ in your binary data. Alternatively, if the binary data is fixed length, use left() and mid() to extract the appropriate parts. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.