View Single Post
  #5   Spotlight this post!  
Unread 29-07-2015, 15:12
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 323
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: Detecting if the code runs from the PC or the RoboRIO

Quote:
Originally Posted by Jonathan L. View Post
I have not tested this with a FRC robot yet but I think this is what you're looking for. See this video at 18 min 15 sec and 21 min 30 sec. http://www.ni.com/webcast/3798/en/

The Conditional Disable Structure...
Unfortunately I do not think the conditional disable structure will work the way that you want without some extra effort.

The only time RUN_TIME_ENGINE is FALSE will be if you are running the code on your host machine. This works if you are using the simulator vs the actual robot, but once you run it on the robot as you describe it will be TRUE. Target_Type and OS will give you the same issue.

You can create a conditional that is project wide, and manually change it when you build, but that is tedious and more importantly is error prone.

You may be able to play around with the build specification, maybe with the pre/post build actions combined with the project wide build specification, but this is not something I have never tried.

You may be better of with the suggestion from Ari423 unless you have a good reason to prevent the code block from compiling in the first place.
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -
Reply With Quote