Example Code

Convert Refnum to Numeric Using LabVIEW

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 an input Refnum to a I32 number and output this number.

 
Description

Many LabVIEW users have had trouble displaying the numeric data of the refnum datatype for debugging purposes. This example shows how using typecasting can be used to covert the refnum datatype into a readable form. Typically, when you create a control or indicator for the refnum datatype you will get an icon representation on the front pannel; this example shows how to display the refnum in a numeric indicator.


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. You can change the way this number is displayed to the hexadecimal format by right clicking on the Numeric Indicator»Properties»Display Format»Type(hexadecimal).
  2. Run the VI, this will give you a numeric 32-bit integer representation of the refnum.

 

Additional Information or References
VI Snippet

003.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.