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

Number to Boolean String in 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 example converts a Number to Boolean/Binary String

 

Description

The LabVIEW String/Number Conversion Palette contains many functions to convert a number to a Decimal, Hex, Octal, Fractional, Exponential and Engineering Strings.  However there is one missing: The Number to Boolean/Binary String.  This can be replicated very easily with the attached code.

 

Requirements

LabVIEW Base Development System 2012 or compatible

 

Steps to Implement or Execute Code 

  1. Enter the Number to be converted to Boolean string
  2. Enter the Minimum width, If width is larger than needed, zeros are added on the left. If width is inadequate, decimal integer string is as large as necessary.
  3. Run the VI

 

 

Additional Information or References

VI Block Diagram

5782.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
Knight of NI
Knight of NI
on

See here for a simplified version.

David_L
Active Participant
Active Participant
on

Wow I did not know that function existed.  I changed the example to be much simpler.  Thanks for the help!