|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Detecting if the code runs from the PC or the RoboRIO
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... |
|
#2
|
||||
|
||||
|
Re: Detecting if the code runs from the PC or the RoboRIO
I haven't ever done it, but I imagine it can be done using some kind of property node. (to LabVIEW documentation!) I would highly recommend removing any code only running in debugging mode from the final robot project to avoid any chance of the robot thinking it is in debug mode and to keep the robot from having to constantly check whether or not it is in debug mode.
Just my $0.02 |
|
#3
|
||||
|
||||
|
Re: Detecting if the code runs from the PC or the RoboRIO
Quote:
![]() Quote:
) |
|
#4
|
||||
|
||||
|
Re: Detecting if the code runs from the PC or the RoboRIO
Quote:
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. |
|
#5
|
|||
|
|||
|
Re: Detecting if the code runs from the PC or the RoboRIO
If you are asking about simulated versus running on the roboRIO, the Conditional Disable Structure is what you are looking for. An example of how to use it is shown in this VI vi.lib\Rock Robotics\SystemInterfaces\NetworkCommunication\Net Comm_UnloadCPPStartupProgram.vi
If you want to know if a debugging host is connected, I believe you want to use a Property Node to read the App.UserInterfaceAvailable property. Read the help and I think you will see that it does what you want. If not, please explain more of what you are looking for. Greg McKaskle |
|
#6
|
||||
|
||||
|
Re: Detecting if the code runs from the PC or the RoboRIO
Quote:
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. Last edited by Ari423 : 29-07-2015 at 15:37. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|