Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
10 ratings:
 4.40 out of 5     Rate this Document

How Do I Convert a Boolean to a Double in LabVIEW?



Primary Software:
Primary Software Version: 7.1
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
How do I convert a Boolean to a Double in National Instruments LabVIEW?

Solution:
There are multiple methods of converting a Boolean to a double. Three of these methods are:
  • Use a Case Structure with a double constant '1' for the true case and a double constant '0' for the false case.
  • Use the Select Function to select a double constant '1' for true and a double constant '0' for false.
  • Convert the Boolean to a integer using the Boolean to (0,1) function then convert that integer to a double using the double to precision float function.
These methods can be seen in Figure 1 below:


Figure 1.
 Three methods of converting a Boolean to a double.


Related Links:
Data Structures in NI LabVIEW
Execution Structures in NI LabVIEW
LabVIEW 2013 Help: Case Structure

Attachments:
Bool_to_Double.vi




Report Date: 11/01/2004
Last Updated: 04/29/2014
Document ID: 3F0FI4Y7

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit