LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to programmatically determine the use of 64 bit machine?

Solved!
Go to solution

I need to work with files located in path C:\Program Files\[...].  However, when I run my LV application on a 64 bit machine, the path is C:\Program Files (x86)\[...].  Is there a way to automatically determine if the application is running on a 64 bit system?  I'm using LV v.2012 SP2.

 

Thanks,

 

DJ

0 Kudos
Message 1 of 7
(4,570 Views)

Use a conditional disable structure. There is an entry for target bitness. Just create two cases.

 


@dj143 wrote:

I'm using LV v.2012 SP2.


There is no 2012 SP2, not even a SP1. Could it be that you have 2012f2, for example?

0 Kudos
Message 2 of 7
(4,568 Views)

@altenbach wrote:

Use a conditional disable structure. There is an entry for target bitness. Just create two cases.


My little test shows that that does not work.  I have a Win7 64-bit machine running LabVIEW 32-bit and the diagram disable shows me as running in 32-bit.  The TARGET_BITNESS is a compile time variable.  So this variable is only about the bitness of your compiled code.  It will not tell you the bitness of the machine it is running on.

 

I'm not finding any other tibits or properties to help.  My advice would be to see if the "C:\Program Files (x86)" directory exists.  If it does, use it.  If it doesn't, use "C:\Program Files".


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 7
(4,552 Views)

Yes, you are right. I misunderstood the question.

 

(I use the conditional disable structure to select the proper FORTRAN dll (32bit or 64bit), depending on which LabVIEW bitness I am using at the moment. ;))

 

So that poses the question what the OP actually needs to do. It seems to be easier to simply use relative paths (relative to the install location of the built application) and everything will fall in place.

 

0 Kudos
Message 4 of 7
(4,542 Views)

Take a look at rolfk solution over on LAVA

 

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

 

 

Message 5 of 7
(4,510 Views)
Solution
Accepted by topic author dj143

@dj143 wrote:

I need to work with files located in path C:\Program Files\[...].  However, when I run my LV application on a 64 bit machine, the path is C:\Program Files (x86)\[...].  Is there a way to automatically determine if the application is running on a 64 bit system?  I'm using LV v.2012 SP2.


If you want the correct folder, the OS bitness will not really help you. What if windows is installed id X:\Program files...."??

 

Have a look at "get system directory". In particular use the input "application files". See if this suits your needs.

 

Message 6 of 7
(4,479 Views)

Thank you all for your responses.  Getting the directory makes sense because of its flexibility to various directory situations.  I apologize for messing up the LV version.  I had service packs on the mind when I was thinking of my DS2 software suite but that's not appropriate either.  I have v.12.0f3.

 

Thanks,


Dave

0 Kudos
Message 7 of 7
(4,433 Views)