35 public static int Main(
string[] args)
44 Console.WriteLine(
"Incorrect number of arguments provided");
45 Console.WriteLine(
"Usage: ip_assigner_example.exe <SERIAL #> <1 Byte Address>");
47 Console.Write(
"\nPress any key to close the example");
52 string serial_num = args[0];
53 bool ok = Byte.TryParse(args[1], out
byte address);
55 if(!ok || address < 0 || address > 255)
57 Console.WriteLine(
"Please enter a number between 0 and 255 for the address.\n" +
58 " This will be used as the last number in the IP Address\n" +
59 "Usage: ip_assigner_example.exe <SERIAL #> <1 Byte Address>");
61 Console.Write(
"\nPress any key to close the example");
79 Console.Write(
"\nPress any key to close the example");
static void PrintError(gclib gclib, Exception ex)
Prints the exception to the console and queries the controller for the most recent error message.
Provides a class of shared constants and methods for gclib's example projects.
const int GALIL_EXAMPLE_OK
Examples success code.
const int GALIL_EXAMPLE_ERROR
Examples error code.
static int Main(string[] args)
Main function for the IP Assigner example.
Assigns controller an IP Adress given a serial number and a 1 byte address.
void GClose()
Used to close a connection to Galil hardware.
Provides a class that binds to gclib's unmanaged dll. Wraps each call and provides a more user-friend...
static int IP_Assigner(gclib gclib, string serial_num, byte address)
Assigns controller an IP Adress given a serial number and a 1 byte address.