11-12-2015 06:32 AM
Hi,
The attachment contains the vi. I am trying to read the serial port. But i have a window with time stamp display of Hex values. But it is not diplaying Response 2 string window. How to do it?
Solved! Go to Solution.
11-12-2015 07:30 AM
Response 2 looks like 8 bytes coming across as 4 U16 quantities (displayed in Hex). How do you want to treat them? Do you want to have an array of 4 U16 (or I16) numbers, displayed in Hex or in Decimal? Do you want 2 U32/I32, or a single U64/I64 number?
I am not sure why you are Type Casting a String to a U32. If I Type Cast the string "FF" to a U8, I don't get 255 (or FF in Hex), but 70, the numeric value for Ascii "F" (note that "FF", in hex, represents a single byte, but as characters, it takes two bytes, so I never "see" the second "F").
When converting to and from Strings, I personally prefer (and always use) Format Into String and Scan From String. Your input string "0104 03E8 0032 F1AF" can be Scanned with the Format "%x %x %x %x" (or 4 hex numbers separated by a space) to produce 4 U16 quantities. You can use Join Numbers to get two U32s, then another Join Numbers to get a U64 -- if you display the U64 in Hex, you will see "10403E80032F1AF" (the leading "0" is silent). Is this what you want?
Bob Schor
11-12-2015 08:31 AM
Hi,
I want the repsonse window to llok just like response 2 window with time stamp. How to do it?