LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically determine bitness (64bit or 32bit) of LabVIEW files (.vi, .ctl, .lvproj, .lvlib, .lvclass, .lvlibp)

Hi,

 

I'm looking for a way to programatically determine the  LabVIEW bitness used to compile and save the LabVIEW files .vi, .ctl, .lvproj, .lvlib, .lvclass, .lvlibp. 

 

I could get the LabVIEW version (2015, 2016, 2017 etc) using get methods below, but I don't find anywhere to get whether 64bit or 32bit LabVIEW used in these file types.  Does anyone know methods/properties to use to determine the file bitness?

 

Ajayvignesh_MV_0-1574241447941.png

 

Thanks,

Ajay

--
Ajay MV


0 Kudos
Message 1 of 5
(2,388 Views)

lvlib, lvclass and lvproj are simply XML files. There is no bitness whatsoever involved there. CTL files don't really contain compiled code so there is no bitness either there. VI files with separated object code also do not contain any bitness specific features anymore.

 

Remains only the lvlibp that is bitness specific as it contains the compiled code, just like a build EXE or DLL file. The only way to determine bitness of an EXE or DLL is by either looking at the PE (Portable Executable) header in the file or by trying to load it into a specific LabVIEW version and see if it fails. The lvlibp is most likely the same, except that it does not have a PE header and that you also need to make sure that it is a compatible LabVIEW version when trying to load it.

Rolf Kalbermatter
My Blog
Message 2 of 5
(2,354 Views)

Hi Rolf 

 

Thanks for your update.  I'm basically looking for the bitness on file level so that I don't mix-up the 64-bit file and 32-bit files.  Often I mix-up when I work between projects which are 32 and 64 bits.  So I'm trying to update this github code (https://github.com/digiajay/OpenInLabVIEWFileVersion) to support the bitness level of files.

 

Is there any specific XML tag in the lvlib, lvclass and lvproj files to determine last bitness it was saved?

 

Thanks,

-Ajay

--
Ajay MV


0 Kudos
Message 3 of 5
(2,293 Views)

I’m not aware of such tags and since they are not really bitness specific I don’t believe there should be.

 

But you can do a simple test yourself by saving the same file(s) from both versions and then do a simple diff comparison for instance with WinMerge. Some differences will be path related and can be disregarded.

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 5
(2,284 Views)

Rolf, yes you're correct.  There is no difference between 64/32bit .lvproj.  In-fact there is no asterisk (*) mark on project explorer if I open the same .lvproj file between 64 and 32 bit.

 

I'm curious if I can add some user tags to the .vi or .lvproj files at every time I save the files in LabVIEW.  May if possible with LabVIEW callbacks or VI scripting?  Then read back that tag to open the file in correct LabVIEW version.

 

Thanks,

Ajay.

--
Ajay MV


0 Kudos
Message 5 of 5
(2,271 Views)