Project Description
A tool with source code providing a simple set of conversions between data types often used for serial or byte level communication: UInt16, ushort, float
This project is intended to provide a simple set of conversions between data types often used for serial or byte level communication. The tool is helpful for acquiring a basic understanding of the BitConverter tool and the conversion between primitive data types like Integers to Bytes.

In it's initial incarnation the tool allows conversion to and from the following data types to bytes:
  • UInt16
  • UInt32
  • Single Precision Float

The tool has the capability to convert a byte formatted string into the above formats. In order to use the Byte to Primitive conversion, use a format similar to "FF-00" where the resulting UInt16 value would be 255.

Additionally, some protocols use different endianess or byte-swapping as part of their communication. The tool displays the endianess of the local machine and provides a checkbox to perform byte swapping of pairs of bytes in the byte array as part of the conversion. For example, if the user provided 11-22-33-44 for a straight conversion to a Single Precision Float, the resulting value would be 716.5323... but if the Byte Swap was checked, the byte pairs would first get swapped to 22-11-44-33 resulting in a value of 4.565039E-08.

Last edited Jun 25, 2014 at 4:21 PM by iamcanadian2222, version 3