To verify the HEX files created, google for HEX2BIN (freeware). I had initially attached it in the ZIP, but forum policies here advise against this kind of practice, so it's better to download a converter yourself.
This is useful when uploading binary files (bitmaps, wave files, etc.) to microcontrollers, memories or other types of electronic devices. Maximum file size to encode is about 64KiB, as there are a total of 65535 addresses available.
If you have 16 bytes / address, divide 65535/16 and you get ~4096 addresses of 16 bytes each.
Intermec PD42 printers make use of this format to receive pictures, for example...
Use this code however you wish, i claim absolutely NO copyright over it.
Enjoy !
PS: This works for VB4 - VB6 and is optimised for speed, not for small and efficient code. You may find some optimisations are possible....
Last edited by AndreiMhz; Dec 27th, 2010 at 11:55 AM.
Reason: Removed EXE File
If this post solved your problem, please mark your thread as [SOLVED] and rate the post. It's a good way to show appreciation.
Re: VB4 / VB5 / VB6 - Binary file to Intel HEX Encoder (pretty fast one,too)
It is a short code, not a fast one.
A quick summary for issues regarding speed include use of the variant version of Mid instead of string version Mid$, Val and conversion of numeric data to string to numeric, ReDim Preserve in a tight loop for each new item, and finally IIf which is one of the worst performing language structures in VB as it is very much just a regular function that can be custom written in VB and it'll be faster – even as a Variant version. The biggest issue is that because it is just a regular function it runs both True and False cases no matter what is the result, so it always does work that doesn't need to be done.
But. I guess this procedure always deals so small amount of data that it won't really matter to make it faster.
Re: VB4 / VB5 / VB6 - Binary file to Intel HEX Encoder (pretty fast one,too)
[QUOTE=Merri;3933867]It is a short code, not a fast one.
QUOTE]
You are right... it's not the fastest one that could be done, but it's not the shortest one either. A lot of improvements can be made, in both directions : be it size or be it speed.
But, for 64Kbyte files... as you said. Maybe it's not worth the trouble
If this post solved your problem, please mark your thread as [SOLVED] and rate the post. It's a good way to show appreciation.