Converting Binary Data to Decimal

Note: The features discussed in this article (Binary to Hex Filter and Math Expressions) are only available in the WinWedge Professional Edition.

If you have an instrument that transmits binary data and you would like to pass this data to another program as decimal data, you can use a combination of features available in WinWedge to perform this type of operation. Although WinWedge does not have a direct Binary to Decimal conversion function, it does allow you to select a “Binary To Hex” filter for each data field that you define and it also allows you to enter a “Hex to Decimal” function in the Math Expression for each field . If you apply the “Binary To Hex” filter to a data field, WinWedge will translate each ASCII character in the field to a two byte hexadecimal string. For example if you received an ASCII one followed by an ASCII 255 character, WinWedge would convert the two bytes to the four byte string “01FF”. If you also entered the math expression “&h(Field(n))” for the field (where n is the number of the field containing the data), WinWedge would convert the hex data to decimal. In this above example, you would end up with the number 511.

Contact Us