hooovahh Posted April 6, 2011 Report Share Posted April 6, 2011 I did some searching and I couldn't find the function I needed. I wanted to know if my EXE (which was built on 32-bit LabVIEW) is running in a 64 Bit operating system. The Conditional Disabled structure has Bitness, but that reffers to the bitness of the code (is this being built on LabVIEW 32 or 64 bit), not what operating system am I running in. There is also a property node that is Application.TargetOS, but this also only returns the OS it was designed to run on. So I wrote a VI to do this, but I wanted to know if there was a better way, a more native way to tell if the operating system I am running in is 64 bit or 32 bit. Right now it reads the registry, and looks at environment variables which seems cheap to me. I'd like the solution to be universal among all operating systems, but my VI only works on Windows. It has been tested on Windows 7 32-bit, and 64-bit, and Windows XP 32-bit. I'd like to know if there are any issues with it running in XP 64-bit, and Vista 32 and 64. Is OS 64 Bit.vi Quote Link to comment
silmaril Posted April 6, 2011 Report Share Posted April 6, 2011 It seems to me that detecting the "Bitness" of the OS has to be OS dependant. So you would have to write individual code for each OS (eg. using a CDS). As long as NI does not provide such a property, your VI looks like a very usefull way to get this information (assuming we are on Windows, which is true in 100% of *my* use cases ). BTW: You are talking about "Application.TargetOS". I think "OS.DetailedName" is much closer to what you are looking for (but still not close enough, since it does not talk about Bitness). Quote Link to comment
ShaunR Posted April 6, 2011 Report Share Posted April 6, 2011 (edited) It seems to me that detecting the "Bitness" of the OS has to be OS dependant. So you would have to write individual code for each OS (eg. using a CDS). As long as NI does not provide such a property, your VI looks like a very usefull way to get this information (assuming we are on Windows, which is true in 100% of *my* use cases ). BTW: You are talking about "Application.TargetOS". I think "OS.DetailedName" is much closer to what you are looking for (but still not close enough, since it does not talk about Bitness). rolf posted a VI on this thread Determine 32 or 64 bit OS It's the same method used in other languages and uses win api calls. Edited April 6, 2011 by ShaunR Quote Link to comment
hooovahh Posted April 6, 2011 Author Report Share Posted April 6, 2011 rolf posted a VI on this thread Determine 32 or 64 bit OS It's the same method used in other languages and uses win api calls. Thanks, I did searching before posting but couldn't find that thread for some reason. I tested it on Windows 7 32 and 64 and it worked as expected. Quote Link to comment
ShaunR Posted April 6, 2011 Report Share Posted April 6, 2011 Thanks, I did searching before posting but couldn't find that thread for some reason. I tested it on Windows 7 32 and 64 and it worked as expected. I remembered the discussion, but had google it to find it again Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.