Example Code

Convert a Hex String to ASCII String & IEEE Float without changing values

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

This VI converts a displayed Hex String value to ASCII string characters as well as IEEE Float.

 

Description

Sometimes it maybe desirable to convert a String Hex Value to ASCII but not actually change its representation. For example, we may have the value 6C in hex and we want it in ASCII to also be 6C. This VI will do this conversion. It takes the Display Hex String and converts it into regular string characters. I eventually needed the IEEE Float value for that Hex String value, so the last part converts it to IEEE float.

 

Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Give the value of Hex Number Display Input (i.e. 3643 3133 3435)
  2. Run the VI and observe the outputs.

 

Additional Information or References

 

Front Panel

1.PNG

 

VI Snippet

2.png

 

 

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

Certified LabVIEW Developer
LabVIEW 7.1 - Present

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

Comments
shall12
Member
Member
on

Worked for me after I changed the type for the Unflatten From String to a U8.

GPeople
Member
Member
on

YES!  Actually I remember making a VI for each data type..I have them somewhere...if I find them I will upload each type.

If I had the time the thing to do would be to make this into a polymorphic VI so it would sense the data type and then execute the proper version.

Glad to see it helped someone!

Certified LabVIEW Developer
LabVIEW 7.1 - Present