jives Posted November 21, 2008 Report Share Posted November 21, 2008 Hello! Is there any way to automatically disable or enable specific LV code when building an application? Maybe with a conditional disable structure, or something like that. This would come in very handy, for example when using a relative path which changes when running code as an application or in the LV development environment. Or one could hide debug output which is useful in the LV environment, but not in a standalone application. Any help is greatly appreciated! Quote Link to comment
Francois Normandin Posted November 21, 2008 Report Share Posted November 21, 2008 QUOTE (jives @ Nov 20 2008, 03:04 PM) Hello!Is there any way to automatically disable or enable specific LV code when building an application? Maybe with a conditional disable structure, or something like that. This would come in very handy, for example when using a relative path which changes when running code as an application or in the LV development environment. Or one could hide debug output which is useful in the LV environment, but not in a standalone application. Any help is greatly appreciated! You could use conditional disable structure, but only to discriminate between CPUs, OS, Targets (Win, Mac, Linux, UNIX)... If you want to have a difference between Development System and RunTime Environment, you'll need to use Application.Kind Property Node and use cases in your code. I know there are threads asking for this specific differentiation in the App Builder, but I'm not sure there is anything available as of now. It's recurring so I wouldn't be surprised if NI worked on that for a future release. :2cents: http://lavag.org/old_files/monthly_11_2008/post-10515-1227212796.png' target="_blank"> Quote Link to comment
LAVA 1.0 Content Posted November 21, 2008 Report Share Posted November 21, 2008 QUOTE (jives @ Nov 20 2008, 09:04 PM) Hello!Is there any way to automatically disable or enable specific LV code when building an application? Maybe with a conditional disable structure, or something like that. This would come in very handy, for example when using a relative path which changes when running code as an application or in the LV development environment. Or one could hide debug output which is useful in the LV environment, but not in a standalone application. Any help is greatly appreciated! For this specific thing I would advice like normandinf has done. However it would be very usefull if we could set a specific 'Conditional disable' value for a specific build. It can currently be achieved through scripting (Sorry I can't find the code right now). Well I did find them. Ton Quote Link to comment
mje Posted November 22, 2008 Report Share Posted November 22, 2008 You can use any symbols you wish in the conditional disable structure, and you define them at the project level. See examples\general\disable structures\Conditional Disable Structure.lvproj for more info. However, you can't define them for a specific build, unfortunately. (Note an error in the screenshots, they may not work due to case sensitivity, but it gets the point across.) Combine this with the Application.Kind property and you can usually sort out what you need for target/debugging needs. I share Ton's wish though that the symbols could be defined on a per-build basis. Quote Link to comment
Dan DeFriese Posted November 22, 2008 Report Share Posted November 22, 2008 QUOTE (Ton @ Nov 20 2008, 03:24 PM) However it would be very usefull if we http://forums.lavag.org/Conditional-Disable-in-build-settings-t10592.html' target="_blank">could set a specific 'Conditional disable' value for a specific build. This is near the top of my on my wishlist, too! Actually, its a very close second to having the ability to designate pre and post-build VIs for each build spec. However, I'd be very happy in the near term if somebody could explain how to get the progress messages when performing programmatic builds. Quote Link to comment
jives Posted November 30, 2008 Author Report Share Posted November 30, 2008 Thank you all for your inputs, they were all very helpful (especially normandinfs post, because something like that was what I was looking for) Quote Link to comment
Mike Matthes Posted May 1, 2009 Report Share Posted May 1, 2009 Add my vote to the conditional disables being accessed by the build specifications. Ton - nice work hunting down the conditional disables programmatically. I don't believe any of your VIs access the project level of conditionals, do they? I tried hacking around the the project invokes and properties, but I don't know what value to give to the "Section" in the Project method "Get Item", which I'm guessing accesses it. I can see it clearly in the XML of the project under the same tag "CCSymbols" that you hacked. Any ideas? If you can access this via VIs then you have all the hooks you need to have a build vi that sets the conditionals and calls the .exe builder you want, or even the full sequence for a complete build. Sweet! Thanks, Mike Quote Link to comment
jdunham Posted May 2, 2009 Report Share Posted May 2, 2009 If you can access this via VIs then you have all the hooks you need to have a build vi that sets the conditionals and calls the .exe builder you want, or even the full sequence for a complete build. Sweet! You might want to check out this post (message#2) 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.