LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Newbie Question: Reading, Converting and Displaying ASCII Hex file data...

I have a ASCII Hex file with data formated as shown.  (The real file has hundres of lines)

 

$00FCBA005C00003F363A352D386E

$00FCB7005900003F393938FE3B7A

$00FCBD005A00003F3B793A853E8A

$00FCBA005A00003F3F383F194195

$00FCC3005B00003F42F74227450A

$00FCF6005D00003F46B644714815

$00FD04005900003F483648424B1C

 

I need to seperate each line into groups of bytes like this:

$  00  FD04  0059  00003F  4836  4842  4B1C

 

Then convert each group into decimal and display in charts, gauges, etc.

 

Any help and/or examples would be appreciated.  Also where can I find more info (and examples) on this process in the Help section of Labview?

 

Thanks,

Chris

0 Kudos
Message 1 of 6
(5,187 Views)
Try the Scan from String function like in the attached. (LV 8.5)  This would be part of a loop after each line is read from the file.
Message 2 of 6
(5,177 Views)
Ravens Fan, With a little tweeking that worked. Thanks for your help. Chris
0 Kudos
Message 3 of 6
(5,124 Views)
I am trying to read a binary file that contains hex data. As far as I can tell, the Read From Binary File function does not support a data type specifically to read hex data. I can read it in as a text file but it simply spits out the ASCII junk. Format Into String and Scan From File does not seem to work either. Any suggestions? I am working in LabVIEW 8.0. Thanks in advance.
Message Edited by MonstorBak on 11-13-2008 07:39 AM
Message Edited by MonstorBak on 11-13-2008 07:40 AM
0 Kudos
Message 4 of 6
(5,016 Views)
While fundamentally an ASCII file and a binary file are essentially the same (they're both just a series of bytes), an ASCII file contains characters that can be interpreted as numbers, while a binary file contains pure values. Thus, "hex" values has no meaning, and that's why there's no special hex data type for the Read from Binary File. You read in a set of numbers (integers in your case). They can be 8-bit, 16-bit, 32-bit, or 64-bit, depending on what was written. A number is a number is a number, whether you look at it as decimal, hex, octal, binary, whatever. Thus, you need to read in the binary file as a set (array) of integers and set the display format of your indicator to whatever format you want.
0 Kudos
Message 5 of 6
(4,999 Views)
smercurio, Thanks for the Hex, ASCII, binary description. I aprreciate the help. Chris
0 Kudos
Message 6 of 6
(4,976 Views)