Example Code

Windows 64-Bit Identifier 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 is to programmatically check the bitness of Windows that are currently being run. If the operating system is 64-bit, the VI will return TRUE.

 

Description

This VI makes use of registry functions and Windows commands to determine whether or not the operating system the VI is run on is 64-bit. This is usually difficult to achieve in LabVIEW, which can only return the bit type of the runtime engine that is running.

 

Requirements

  •  LabVIEW 2013 (or compatible)
  • Windows Operating System

 

Steps to Implement or Execute Code 

  1. Place the subVI on your block diagram
  2. Wire output "64-bit" (Boolean) to the desired target
  3. Wire output "Error Out" to the desired target

 

Additional Information or References

VI Snippet

Windows Bit.png

 

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

Matt H
Applications Engineer
National Instruments UK

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

Comments
D*
Member
Member
on

You can also use the TARGET_BITNESS symbol with a conditional disable :

http://zone.ni.com/reference/en-XX/help/371361K-01/lvhowto/creating_cond_disable_struc/

MHutch
NI Employee (retired)
on

Hi D*

The Target_Bitness is a compile time variable that only returns the bitness of the compiled code. It will not tell you the bitness of the operating system you are running on.

Kind regards,

Matt

Matt H
Applications Engineer
National Instruments UK
Hooovahh
Proven Zealot Proven Zealot
Proven Zealot
on

Over on LAVA a way was posted that doesn't rely on the registry, the command line, or the spelling of Program Files (x86).

http://lavag.org/topic/14002-determine-32-or-64bit-os-windows/#entry84338