Go to Post Many people follow that advice, as if Ohio is Mordor or something. - Travis Hoffman [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 29-07-2015, 15:34
Ari423's Avatar
Ari423 Ari423 is online now
LabVIEW aficionado and robot addict
AKA: The guy with the yellow hat
FRC #5987 (Galaxia)
Team Role: Mentor
 
Join Date: Mar 2015
Rookie Year: 2012
Location: Haifa, Israel
Posts: 585
Ari423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant futureAri423 has a brilliant future
Re: Detecting if the code runs from the PC or the RoboRIO

Quote:
Originally Posted by wt200999 View Post
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.
I just had an idea. When you get the file path of Robot Main in Robot Main, if it is built and running in the robot project the second to last string in the file path will be projectName.exe, whereas if you were running it in debug mode (manually running Robot Main) the second to last string in the file path will be the folder the project is in. You should be able to get the file path, strip it twice, and search the second stripped string for ".exe". If you are running a build the index will be greater than 0 (it exists somewhere in the string). If it is running in debug mode, the index will be -1 (search string isn't in source string). You can then save this bool as a global, carry it into teleop and/or periodic, or do whatever you want with it. Let me know if this works.

EDIT: I think this is what you are looking for without using any complicated property nodes. There may be other ways to do the same thing using property nodes or otherwise, and you should feel free to use whichever you feel is easier. My original suggestion about removing this code from the final project still stands.
__________________
2017-present: Mentor FRC 5987
2017-present: CSA for FIRST in Israel
2012-2016: Member FRC 423
2013: Programmer
2014: Head Programmer, Wiring
2015: Head Programmer, Wiring
2016: Captain, Head Programmer, Wiring, Manipulator, Chassis, CAD, Business, Outreach (basically everything)



Last edited by Ari423 : 29-07-2015 at 15:37.
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


All times are GMT -5. The time now is 10:25.

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