LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a work around for not having access to conditional symbols in build?

Solved!
Go to solution

http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Conditional-Disable-Symbols-settable-in-Application-Bu...

 

This idea relates to a very common IDE feature that allows you to set symbols per build. Strangely, Labview only allows you to have one project configuration you must manually change, unlike say Visual Studio. It does produce different builds. But it doesn't connect the two by allowing you to specify project symbols in the build.

 

There apparently was a work around in this idea exchange above, but it both doesn't seem to exist anymore and according to one user doesn't work post 2013. Does anyone have a new work around for this, perhaps with pre-build actions? Seems like you'd have to use a VI to clone the project and update the symbols in the new project. Run the project and run the build. I dunno, seems cumbersome. We have 10 or so symbols each with 2-3 values so manually updating them is not optimal, especially since the conditional symbols don't use a drop down to select. You have to manually type their values. I'm using 2016 at the moment.

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

have you tried

...\National Instruments\LabVIEW 20XX\resource\plugins\Utility\IfDef.llb\SetSymbols.vi

 

in Pre-Build Action.vi?

 

 

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

https://forums.ni.com/t5/LabVIEW-Idea-Exchange/In-building-executables-allow-Pre-Build-Action-to-mod...

Evidently, even if I did have access (which I don't, since the Pre and Post Build actions happen outside of the context of the application), I wouldn't be able to do anything about it (because the build configuration has already been loaded and isn't malleable at that point). It seems like the solution to this is not to use the Project Window, and use the separate Build VIs. In essence, duplicate the Project Window functionality to suit your needs. Dunno if I wanna do this but I'll consider it going forward.

0 Kudos
Message 3 of 5
(2,619 Views)
Solution
Accepted by majoris

You can change the symbols before the build. The vi will be compiled with the new symbols during the build.

Message 4 of 5
(2,601 Views)

Wow. So I guess that link was wrong and you can change the project (unless this has somehow changed since the idea was submitted). I hadn't tried the VI scripting nodes to access the Project (I assumed it would result in the same issue). This is real smart. Overall, this is quite helpful thank you!

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