LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"get build specification VI" works if I run it in a VI. However, if I build that VI into an executable it no longer works.

Solved!
Go to solution

When I use the "get build specification VI" in a VI it works as intended providing the Major, minor, fix and build number of what ever project it is pointing at, However, when I buuild that VI into an exicutible, and run that exicutable it always returns 0 for all for fields.

 

Does anyone know why it would do that?

 

Running on windows 7 Enterprize

Labview 15 Professional Development System

0 Kudos
Message 1 of 5
(3,508 Views)

The included LabVIEW Help has some excellent advice on how to build an executable - and what to watch out for.  Especially about things like what you are experienceing.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 5
(3,479 Views)
Solution
Accepted by topic author SteveV45

I think the reason it doesn't work in an Executable is because ... it is not supposed to work in an Executable.  It is designed to retrieve the Build Spec from the Project (.lvproj) file, which generally is not available at Run Time.

 

However, there is another function, FileVersionInfo (found in the Hidden Gems that you can find in the LabVIEW Tools Network using VIPM).  When you build an Executable, the Version information is placed wherever Microsoft wants this to be saved, and the LabVIEW function will retrieve it for you, along with the Executable's Program Name.  Here is a Snippet from my Program and Version utility:

Program and Version.png

Works like a charm.  However, don't get me started in trying to use Set Build Specification as part of the Pre-Build Action (I'm currently having a "discussion" with NI, which I am clearly losing, about what "Pre-Build" means ...).

 

Bob Schor

Message 3 of 5
(3,455 Views)

Thanks for the post, worked like a charm!

 

 

0 Kudos
Message 4 of 5
(3,412 Views)

 

RE: bilko

Thanks for the post. I checked it out a little today. I don't think I'm fluent enough in "meathods" and "properties" to understand their disclaimer about how some VI's won't work properly in a  run time envernment. 

0 Kudos
Message 5 of 5
(3,409 Views)