Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Get cRIO device name? (http://www.chiefdelphi.com/forums/showthread.php?t=106556)

connor.worley 20-05-2012 13:51

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.

mikets 20-05-2012 16:45

Re: Get cRIO device name?
 
Yes, you can get the host name by:
Code:

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


Joe Ross 21-05-2012 20:05

Re: Get cRIO device name?
 
We use the IP address to discern between practice and competition robots.

garyk 25-05-2012 00:52

Re: Get cRIO device name?
 
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.


All times are GMT -5. The time now is 13:36.

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