Results 1 to 6 of 6

Thread: VB4 / VB5 / VB6 - Binary file to Intel HEX Encoder (pretty fast one,too)

Threaded View

  1. #1

    Thread Starter
    Member AndreiMhz's Avatar
    Join Date
    Dec 2010
    Location
    Romania
    Posts
    62

    VB4 / VB5 / VB6 - Binary file to Intel HEX Encoder (pretty fast one,too)

    This code will enable you to encode binary files to Intel HEX format, using I8HEX (8 Byte), I16HEX (16 Byte) or I32HEX (32 Byte).

    It also has a separate Checksum calculation function based on something i found here on the forum.

    To encode a HEX file, simply add this module to you project and call the function like so :

    Code:
    Bin2HexFile App.Path & "\printerimage.bmp", App.Path & "\hello.hex"
    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....
    Attached Files Attached Files
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width