LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can i read an hex value in a file.ini

i must read hexadecimal values in a file.ini and convert them to an array of bytes.
thanks
0 Kudos
Message 1 of 4
(5,393 Views)
Hi,
actually I don't know how built in functions read hex data from ini file, but if you don't want to make experiments with "Functions->File I/O->Configuration file VIs" I can advise you to follow the next steps:

1.Read the key from INI file as a STRING with the help of "Functions->File I/O->Configuration file VIs->Read Key.vi"

2.Convert this string to number with the help of "Functions->String->String/Number Conversion->Hexadecimal String to number.vi"

3. Extract bytes from your nuber with the help of "Functios->Advanced->Data Manipulatios->Type Cast.vi" by attaching of your number and U8 array constant to its inputs. Another solution is to use "Functios->Advanced->Data Manipulatios->Split Number.vi" to extract words and bytes from your number. In this case
you will need to build extracted bytes to array with "Buid array" function from "Array" palette.

Good luck.

oleg Chutko.
0 Kudos
Message 2 of 4
(5,393 Views)
When you say there are hexidecimal values in the ini file, what format are they in? Are the hex values themselves there, or are there strings of ascii charactrers that need to be interpretted as hex values (i.e. 1EF3459BC66A10FF4)?

It's probibly the latter, but if you post an example of what is in the ini file and I'll post you an example of how to read it...

Mike...

PS: What sort of array do you want these hex values broken down into? Integers? Floats? 16-bit? 32-bit?

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 4
(5,393 Views)
THANKS A LOT i've found the solution .
PIERRE
0 Kudos
Message 4 of 4
(5,393 Views)