LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

query regarding hex format in labview

hello,
 
I am getting hex data in labview in the format xxxx xxxx xxxx xxxx and i am trying to convert it into number format..so is this hex format valid or do i need to remove the spaces between them before conversion to a number?..any help would be appreciated...
 
 
-innovator81
0 Kudos
Message 1 of 5
(2,892 Views)
Hi innovator:
 
I have a question regarding your post. The data you're reading is 16 Hex Digits long or there are four values of 4 Hex Digits long?


Robst - CLD

Using LabVIEW since version 7.0


0 Kudos
Message 2 of 5
(2,884 Views)
This is the same question that in this post.
0 Kudos
Message 3 of 5
(2,882 Views)
If you are trying to convert the entire 16-digit Hex value to a number then you must parse out the spaces before conversion.  You will want to use the Hexadecimal String to Number function from the String/Number Conversion palette.  However if you want to get the four individual 4-digit Hex values converted you can pass the XXXX XXXX XXXX XXXX string to the Hexadecimal String to Number function and specify the offset you want to start the conversion at.  In the end it all comes down to what you want from what you've got.  Use the string parsing functions and the conversion to Hex function above to meet the needs of your application.
 
Happy programming!
0 Kudos
Message 4 of 5
(2,858 Views)
Innovator,
 
This can go on forever unless you are more specific (see also your other thread).
 
You need to distiguish what you see and what the underlying data is.
  1. If your string display is set to HEX display, you don't have any spaces and each pair of the letters 00-FF represent one byte in your raw string. LabVIEW displays it strucured with spaces to help the eyes, but your data does NOT contain any spaces. This is a purely cosmetic property of the text indicator if set to HEX display.
  2. If your string display is set to normal and you see data in the form XXXX XXXX XXXX ..., you real data is a humanly readable hex formatted ASCII string.

You need to understand the difference between these two cases!

Message 5 of 5
(2,848 Views)