Get cRIO device name?

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.

Yes, you can get the host name by:


#include <hostlib.h>
 
char hostName[MAXHOSTNAMELEN];
 
gethostname(hostName, sizeof(hostName));
printf("Host: %s
", hostName);

We use the IP address to discern between practice and competition robots.

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.