04-23-2015 03:43 AM - edited 04-23-2015 03:59 AM
I'm trying to open a file and view the hex.
When I open the file some of the hex values are replaced with 'FF' (I viewed the file using a hex viewer so I know what values should be).
I've tried opening the file as binary or string, the same thing happens.
I also tried changing the file type to a raw, bin and txt , none of which worked.
Any ideas what I am doing wrong ?
Thanks.
Solved! Go to Solution.
04-23-2015 03:46 AM
Hi Eddie,
two comments:
1: Can you attach your binary file (or a part of it) as ZIP file for us to check the data?
2: Have you checked the right-click options of the ReadTextFile function? By default it will convert EOL chars…
04-23-2015 04:04 AM
Hi,
Thanks for the reply, I've attached the Image file in the post.
I tried changing the right click options of the ReadTextFile function still no luck.
04-23-2015 04:08 AM
04-23-2015 04:14 AM
Hi,
Yeah I edited the post so there should be a zip callled 'image.zip'.
I'll attach It here as well.
04-23-2015 04:21 AM - edited 04-23-2015 04:24 AM
Hi Eddie,
didn't notice your edit (and using the term "image" is quite ambiguous when you attached only images/pictures before).
Anyway, both file read functions give the same output from your file (tested with LV2011):
Note: I deselected "Convert EOL" in the ReadText function!
04-23-2015 04:59 AM
Hi,
I agree, sorry about that.
I've copied your example and It works, until I split the data using the 'search/split string' function, after which the 'FF' appear's again.
any idea why?
I've attached a print screen below' spiltString'.
Thanks again for the help.
04-23-2015 05:58 AM
04-24-2015 04:20 AM
Hi,
The value 'FF' only appears when opening in labview. When I open the same file in a hexidecimal converter (I'm using notepad++) it shows them as other values.
I think this could be because labview may not convert using the extended ASCII table. Therefore whenver a value is over 127 in the ASCII table it becomes a 'FF' which is not the value.
Kind regards,
Eddie.
attached is a sample of the Hex in a Hex viewer.
04-24-2015 04:36 AM - edited 04-24-2015 04:38 AM
Hi Eddie,
I never had any problems using LabVIEW file read functions. And I never had any problems with conversion from U8 array to string regarding magically changing data.
Infact I trust LabVIEW more than that HexEditor plugin of Notepad++!
When LabVIEW shows those $FF in your data then there are $FF in the data…
As a cross check you can verify LabVIEW by using this website: http://www.onlinehexeditor.com ! (Guess what: it shows the very same $FF as LabVIEW does…)