Go to Post I want you to get the right answer no matter what. - Al Skierkiewicz [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #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
  #2   Spotlight this post!  
Unread 18-02-2010, 09:59
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
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
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 08:40.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi