10-14-2016 05:13 PM
Is there any way I can set the data type of the function, 'Read From Binary File' so it is outputting in Hex format?
Solved! Go to Solution.
10-14-2016 05:29 PM
Do you know what it means to "Read from Binary File"? It means (among other things) that there is no such thing as "format" -- you are reading binary, the sequence of bits that are in the file into a series of memory locations on the PC. If the data are stored as strings, your memory will have (typically) 16-bit Ascii characters. If it is double-precision Floats, it will have 64-bit numeric data largely uninterpretable unless you read it into a Float variable. If it is a complex mixture of data representing various data types, you will need to know exactly the type of data that was written to the file so that you can read back in the same type of data.
Once you have the data back in memory as one or more variables, you are free to represent the value of those variables in whatever format you choose.
Bob Schor
10-14-2016 05:31 PM
If you want to represent the contents of a Binary file as though it were Hex, simply read the file as an Array of U8 (single bytes), U16, U32, or U64 and output it in the appropriate Hex representation as 2, 4, 8, 16, or 32 Hex characters each.
[If that was what you were asking, I apologize for not understanding the question].
Bob Schor
10-14-2016 05:54 PM
Read it as a plain string and set the string indicator to hex display.
10-17-2016 07:06 AM
@AndreaD wrote:Is there any way I can set the data type of the function, 'Read From Binary File' so it is outputting in Hex format?
Same question I have with a lot of people who are dealing with serial communications: What exactly do you mean by "Hex format". Is the data in the file raw binary data that you just want to be able to view as hexidecimal? Or is the data in a human readable (ASCII) format that just has hex digits (0-9,A-F) (I call this ASCII Hex)?
10-17-2016 09:52 AM
Maybe I should clarify ... in the "Read from Binary File", I'd like the info from "data" (or an equivalent output) to be in Hex format. I tried setting the data type to hex, but I don't think it's done correctly
Thanks,
Andrea
10-17-2016 10:47 AM
Change the display mode of your array indicator called "data" to hex.
10-17-2016 12:52 PM
Where would I go to change this? ... I tried right clicking, but couldn't find the option
10-17-2016 12:53 PM
Front panel. Right Click. Display Format.