LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial raw data

Solved!
Go to solution

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?

Download All
0 Kudos
Message 1 of 3
(3,401 Views)

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

0 Kudos
Message 2 of 3
(3,373 Views)
Solution
Accepted by topic author jay0909

Hi,

 

           I want the repsonse window to llok just like response 2 window with time stamp. How to do it?

0 Kudos
Message 3 of 3
(3,352 Views)