MTM Posted June 29, 2007 Report Share Posted June 29, 2007 Hi, I just started to use Labview 8.2 here in last couple of weeks, and I was wondering if there is a good way to comment out parts of the block diagram you want to keep but not run. Any thoughts?? Regards, Mike Quote Link to comment
Ton Plomp Posted June 29, 2007 Report Share Posted June 29, 2007 QUOTE(MTM @ Jun 28 2007, 08:49 PM) Hi, I just started to use Labview 8.2 here in last couple of weeks, and I was wondering if there is a good way to comment out parts of the block diagram you want to keep but not run. Any thoughts?? Regards, Mike A (new) feature of 8.x is the http://zone.ni.com/reference/en-XX/help/371361B-01/glang/diagram_disable_structure/' target="_blank">diagram disable structure Located in the structures palette. Ton Quote Link to comment
orko Posted June 29, 2007 Report Share Posted June 29, 2007 QUOTE(tcplomp @ Jun 28 2007, 12:00 PM) A (new) feature of 8.x is the diagram disable structureLocated in the structures palette. Ton Another project specific structure I use frequently is the conditional disable structure, also located in the structures pallete. This one allows you to turn on and off behavior similar to #ifdef's in C by setting a variable in the project manager. An example is one that I use all the time: HARDWARE=TRUE/FALSE :thumbup: Makes development at my desk a much happier experience. Or another one I see frequently is: DEPLOY=TRUE/FALSE for enabling autoclose behavior or things that you just want to happen after you build the EXE. Quote Link to comment
Ton Plomp Posted July 1, 2007 Report Share Posted July 1, 2007 QUOTE(orko @ Jun 28 2007, 11:21 PM) Another project specific structure I use frequently is the http://zone.ni.com/reference/en-XX/help/371361B-01/glang/conditional_disable_structure/' target="_blank">conditional disable structure, also located in the structures pallete. This one allows you to turn on and off behavior similar to #ifdef's in C by setting a variable in the project manager. An example is one that I use all the time: HARDWARE=TRUE/FALSE :thumbup: Makes development at my desk a much happier experience.Or another one I see frequently is: DEPLOY=TRUE/FALSE for enabling autoclose behavior or things that you just want to happen after you build the EXE. DEBUG==TRUE Ton Quote Link to comment
Aristos Queue Posted July 10, 2007 Report Share Posted July 10, 2007 Prior to the diagram disable and conditional disable structures in 8.2, you could just drop a case structure and wire a constant to the ? input. This wasn't a complete commenting out -- if you had a broken wire inside the case structure, your VI was still broken, unlike the new diagram/conditional disable structures. But it did guarantee that code would not execute. That trick still works in 8.2, but the new strutures, as I mentioned, do a more thorough commenting out. Quote Link to comment
Yair Posted July 10, 2007 Report Share Posted July 10, 2007 QUOTE(Aristos Queue @ Jul 9 2007, 05:26 PM) That trick still works in 8.2, but the new strutures, as I mentioned, do a more thorough commenting out. Also, 8.2 and later now remove code like this when you build the application, so you can't use this to hold VIs in memory. I assume the same happens with the disable structures, but I'm not sure. Quote Link to comment
Aristos Queue Posted July 10, 2007 Report Share Posted July 10, 2007 QUOTE(yen @ Jul 9 2007, 12:43 PM) Also, 8.2 and later now remove code like this when you build the application, so you can't use this to hold VIs in memory. I assume the same happens with the disable structures, but I'm not sure. True. The diagram disable structures do not hold VIs in memory. If you need to hold subVIs in memory without invoking them, use the Static VI Reference node (found in the Programming>>Application Control palette). Quote Link to comment
Michael Aivaliotis Posted July 10, 2007 Report Share Posted July 10, 2007 QUOTE(Aristos Queue @ Jul 9 2007, 07:26 AM) Prior to the diagram disable and conditional disable structures in 8.2, you could just drop a case structure and wire a constant to the ? input. ... That trick still works in 8.2... Just for completeness, I want to remind people that if you use a case structure to comment out code AND you still want it to stay in memory, you now need to use a boolean control on the front panel set to false instead of a boolean constant. The LabVIEW compiler is smarter now and will not include code if it's inside a case structure with a boolean constant set to false. 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.