Go to Post I'm not of the belief that this is the intent or purpose of Chief Delphi. It is a place for sharing knowledge and information, perspectives, and humor. In the process, it has created community. - JaneYoung [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 28-01-2014, 20:16
fovea1959's Avatar
fovea1959 fovea1959 is offline
Herder of programmers
AKA: Doug Wegscheid
FRC #3620 (The Average Joes)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2011
Location: St Joseph
Posts: 330
fovea1959 will become famous soon enough
How to identify cRIO?

Is there a way to identify the cRIO that Java is running on? Our robot code needs a little tweaking based on whether or not it's running on the competition bot, the practice bot, or the mule board....

In Labview we could get a bundle that had the name, serial #, and mac address, as I recall. I see the kRioSerialNum constant in com.ni.rio.NiRioConstants, but have no idea what method I would feed it to....

I know I can lay a file down on the cRIOs to identify them (either just for this, or as part of a Preferences object), but prefer something that I don't have to (remember to) redo after a cRIO format or reimage.
Reply With Quote
  #2   Spotlight this post!  
Unread 29-01-2014, 12:50
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 590
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: How to identify cRIO?

You can create a text file in the flash memory on the cRIO that says which robot it is. Then have the program open the file. An easier way might be to use the Preferences class and set it up once, then each time you start up check the preference settings.

This page shows how to use the Preferences with the Dashboard for setting the values which are stored on the robot. You can do that once for each robot then have your program read them at startup.

http://wpilib.screenstepslive.com/s/...smartdashboard
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Reply With Quote
  #3   Spotlight this post!  
Unread 29-01-2014, 13:06
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,567
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: How to identify cRIO?

We used the preferences class with Java. I agree that it is preferable to not have to remember to set the preference, although the only time that has caused us a problem is when we ran a practice robot at an offseason competition and had to reimage to change the team number at the competition. We made sure the default was competition.

In LabVIEW, we used the cRIO IP address, but couldn't figure out how to get that in Java.
Reply With Quote
  #4   Spotlight this post!  
Unread 09-02-2014, 09:54
fovea1959's Avatar
fovea1959 fovea1959 is offline
Herder of programmers
AKA: Doug Wegscheid
FRC #3620 (The Average Joes)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2011
Location: St Joseph
Posts: 330
fovea1959 will become famous soon enough
Re: How to identify cRIO?

yeah, this is finally rearing it's ugly head. Looks like we'll use the preferences object and assume it's the competition bot if the preferences aren't there, that way we just break the practice bot if we forget to set up the preferences after a reimage.

I'll dig into the kRioSerialNum after bag day and "catch up on sleep" day...
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 22:32.

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