19 int main(
int argc,
char * argv[])
28 cerr <<
"Incorrect number of arguments provided\n";
29 cerr <<
"Usage: ipassigner_example.exe <SERIAL #> <1 Byte Address>\n";
31 return GALIL_EXAMPLE_ERROR;
35 char* serial_num = argv[1];
39 int address = strtol(argv[2], &end, 10);
40 if (*end !=
'\0' || address < 0 || address > 255)
42 cerr <<
"Please enter a number between 0 and 255 for the address."
43 " This will be used as the last number in the IP Address\n"
44 "Usage: ipassigner_example.exe <SERIAL #> <1 Byte Address>\n";
45 return GALIL_EXAMPLE_ERROR;
55 return GALIL_EXAMPLE_ERROR;
59 return GALIL_EXAMPLE_OK;
int GReturn
Every function returns a value of type GReturn. See gclib_errors.h for possible values.
#define G_SMALL_BUFFER
Most reads from Galil are small. This value will easily hold most, e.g. TH, TZ, etc.
int main(int argc, char *argv[])
Main function for Commands Example.
GReturn ip_assigner(char *serial_num, int address)
Assigns controller an IP Adress given a serial number and a 1 byte address.
void error(GCon g, GReturn rc)
An example of error handling and debugging information.
int pause()
Pauses console apps for a user key stroke.