From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Converting ASCII to Same Value Hex to Floating Point

Code and Documents

Attachment

Overview

This example VI demonstrates the method to convert ASCII characters into the same value but in hex representation

 

Description

This example converts ASCII characters into the same value but in hex representation (ie 'A' = 0xA). The example also goes on to convert that hex value into a floating point number. To use, put in a string into the ASCI string control and press run. You can interact with the control after the VI is running as it is in a while loop. To stop the VI, press the stop button.

 

Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Download the attached folder to your computer
  2. Open the VI " Ascii hex string to float 2012 NIVerified.vi".
  3. Input an ASCII String.
  4. Run the VI.

 

Additional Information or References
VI Snippet

Block Diagram.PNG

 

 **This document has been updated to meet the current required format for the NI Code Exchange.**

 

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Gzimmer
Member
Member
on

Could you add an option for little endian? I'm trying to go from Hex to IEEE754 32bit float.