View Single Post
  #1   Spotlight this post!  
Unread 18-02-2010, 08:02
Ziaholic's Avatar
Ziaholic Ziaholic is offline
Elec/SW Mentor
AKA: Marc
FRC #1164 (Project NEO)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2002
Location: Las Cruces, NM
Posts: 194
Ziaholic is a jewel in the roughZiaholic is a jewel in the roughZiaholic is a jewel in the roughZiaholic is a jewel in the rough
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.
__________________
----
There are 10 types of people. Those who understand binary, and those that do not.
Team #1164 - Project NEO Robotics
Reply With Quote