LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there an easy way to have a version number that the VI code has access to, and that is used as the version number for the executable and installer builds?

Solved!
Go to solution

Is there an easy way to have a version number that the VI code has access to, and that is used as the version number for the executable and installer builds? Right now every time I update my software I have to change the global variable where I store the version number, and then when I build I have to manually open the properties and change the version number for both the executable and the installer. Is there some easy way to make these all match automatically?

0 Kudos
Message 1 of 11
(3,120 Views)

Thanks. I did search, but didn't find anything. Not sure what I did wrong.

0 Kudos
Message 3 of 11
(3,096 Views)

Check out this example:

 

http://decibel.ni.com/content/docs/DOC-3733

 

Placing the above functions in your VI should retrieve the version for you. Make sure you read the note:

 

"Cut and Paste this code into your block diagram just before you build the executable. If you try and run this code section during development, you will get an error"

National Instruments
0 Kudos
Message 4 of 11
(3,036 Views)

Thanks Aaron. I ended up using FileVersionInfo.VI from vi.lib\Platform\fileVersionInfo.llb instead. (I saw it recommended here as superior to using the .net property nodes.) I enclosed it in a conditional disable structure with condition RUN_TIME_ENGINE==TRUE, which seems like a better way of handling code that only works in the run time engine. It's working fine.

 

Thanks for the help!

0 Kudos
Message 5 of 11
(3,027 Views)

Glad you found a solution.

 

Cheers,

Aaron

National Instruments
0 Kudos
Message 6 of 11
(3,019 Views)

In case anyone reading this is interested, I ended up writing a subVI, shown in the snippet below. When called, this subVI retrieves the version number from the executable and appends it to the calling VI's window title.

 

 

 

Append version to title.png

0 Kudos
Message 7 of 11
(3,018 Views)

LaserEngineer,

Could you provide the VI or an explanation?  I am unfamiliar with some of the terminals used in the diagram.

 

Thanks.

0 Kudos
Message 8 of 11
(2,926 Views)

You should close the reference that you opened in your subVI. Closing references you opened is generally the recoemended practice.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 9 of 11
(2,911 Views)

TimTech: the image above is a VI snippet. If you are using LabView 2010 on Windows or Mac you can load the code from the image:

 

-Save the image to disk (usually you can do this by right clicking on it and selecting "Save image as...").

-Open the folder containing the image file.

-Create a new blank VI in LabView and open the block diagram.

-Drag the image file from the folder on your hard drive to the block diagram.

-Labview magically gets executable code from the image.

-Save the new VI to disk and it is ready to use.

 

Message 10 of 11
(2,898 Views)