|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Conditional "Compile" Question
We are using a single, global boolean constant to switch blocks of code ... so we can have one labview project that will run on either our competition 'bot, or our prototype 'bot. (TRUE=CompBot, False=ProtoBot)
A student asked me a question the other day that I couldn't answer ... When we deploy our code to the bot, with (for example) the global boolean condition set to TRUE, does it still compile and send all of the code within the FALSE cases? If the boolean was a control, and not a constant, I could see where the compiler/builder would send all of the code to the bot ... but since it's a constant, and unchangeable during execution, I'd hope that the compile/build would simply ignore the unuseable code and not waste space on the cRIO. In the old days, I'd accomplish this by using something like an IFDEF for a conditional compile ... just wondering if Labview has an equivalent, or if it uses smarts during the build ... Thanks. |
|
#2
|
|||
|
|||
|
Re: Conditional "Compile" Question
LV has an equivalent of ifdef, called the conditional disable structure, and a special one for effectively commenting out code.
Those are relatively recent additions, and in fact LV also has constant folding, dead code elimination and other compiler optimizations which tend to eliminate code like you describe. Greg McKaskle |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Analog inputs not "working" — I only detect "noise" | keehun | Programming | 11 | 31-12-2008 19:01 |
| Championship Event - Where the "Random" Match Sorting Really "Shines" | Travis Hoffman | Championship Event | 57 | 19-04-2007 08:06 |
| On compile: "Coff file format for 'ifi_library.o' is out of date." | Ethulin | Programming | 11 | 17-01-2007 18:03 |
| New NEMO White Papers! "Creating a Killer Packet" and "25 Ways to Sponsor" | Jessica Boucher | Team Organization | 0 | 10-08-2005 10:55 |
| "Thunderbirds" Vs. "Team America" Which one will rule the box office? | Elgin Clock | Chit-Chat | 3 | 07-09-2004 19:53 |