Log in

View Full Version : Get cRIO device name?


connor.worley
20-05-2012, 13:51
The imaging tool allows you to assign a name to a cRIO. Does anyone know how to access this name? Would gethostname be appropriate? I'm interested in discerning between the practice and competition bots.

Thanks.

mikets
20-05-2012, 16:45
Yes, you can get the host name by:

#include <hostlib.h>

char hostName[MAXHOSTNAMELEN];

gethostname(hostName, sizeof(hostName));
printf("Host: %s\n", hostName);

Joe Ross
21-05-2012, 20:05
We use the IP address to discern between practice and competition robots.

garyk
25-05-2012, 00:52
We've used a jumper on a Digital Input, to ground - present on one bot and absent on the other, reading 0 and 1, respectively.