Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   how to identify roboRIO (http://www.chiefdelphi.com/forums/showthread.php?t=133115)

fovea1959 18-01-2015 09:40

how to identify roboRIO
 
We have a need to determine the unique roboRIO our code is running on; our test robot does not have a PCM, so we don't want to enable pneumatics if it's running on the test box so we don't flood the console with the CAN timeout errors?

Has anyone hit on a good way to determine the identity of the roboRIO (serial #, or name?)

We're working off the MAC addresses of the network interfaces right now, which is fine, but was curious if anyone had done it a different way.

SuperBK 18-01-2015 11:01

Re: how to identify roboRIO
 
I think I would put a switch on a digital input, or just a pigtail of wire that connects the input to ground. If it reads a false, then its execute code accordingly.

fovea1959 18-01-2015 11:34

Re: how to identify roboRIO
 
That's a better idea than our thought of going off the roboRIO id. Doing it your way, if we have to swap roboRIOs, then we don't need to touch code, just make sure the "I am a test chassis" jumper is NOT in place. When I read this, I first thought of putting a "I am the competition chassis" jumper in place, but if the jumper got lost, then we'd lose time making up one at a competition, so "I am a test chassis" it is. I suspect we'll have enough DIO to get us by....

My curiousity *is* piqued, though, so if anyone has a way to do it, I'm interested. I remember that it was possible to pull the serial number from LabVIEW. I suspect they never put the appropriate 'hook' into wpilibj to expose that functionality, though I suspect a clever person with the right documentation could pull it off using HALUtil and friends....

Joe Ross 18-01-2015 20:53

Re: how to identify roboRIO
 
You can use the team number to differentiate. http://wpilib.screenstepslive.com/s/...015#TeamNumber

ThomasClark 18-01-2015 22:06

Re: how to identify roboRIO
 
You could also just use the Preferences class with an enablePcm boolean variable.

fovea1959 19-01-2015 09:20

Re: how to identify roboRIO
 
Joe, Thomas, thanks...


All times are GMT -5. The time now is 22:23.

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