gclib 2.0.9
Communications API for Galil controllers and PLCs
 
Loading...
Searching...
No Matches
IP_Assigner.vb
Go to the documentation of this file.
5
8
11
15 Loop While (requests.Count() < 1)
16
19
20 'Parameters are ordered as
21 '[Model #], [Serial #], [MAC Address], [Connection Name], [IP Address]
22
23 If (controller_params.Count() < 5) Then
24 Console.WriteLine("Unexpected controller format")
25 Return GALIL_EXAMPLE_ERROR
26 End If
27
30
35
37 Dim ip_bytes() As String = ip.Split(".")
38
40 Dim new_ip = $"{ip_bytes(0)}.{ip_bytes(1)}.{ip_bytes(2)}.{address}"
41
42 'Assign the New ip address to the controller
43 gclib.GAssign(new_ip, mac)
44
45 'Open a connection at the New ip address
46 gclib.GOpen(new_ip)
47
48 'Burns the newly assigned ip address to non-volatile EEPROM memory
49 gclib.GCommand("BN")
50
51 Console.WriteLine("IP Address assigned")
52
53 'Write the connection string to the console
54 Console.WriteLine(gclib.GInfo())
55
56 Exit For
57 End If
58 Next request
59
60 If Not controller_found Then
62 End If
63
64 Return GALIL_EXAMPLE_OK
65
66 End Function
67End Module
Provides a class that binds to gclib's unmanaged dll. Wraps each call and provides a more user-friend...
Definition gclib.cs:68
GCLIB_DLL_EXPORTED GReturn GCALL GIpRequests(GCStringOut requests, GSize requests_len)
Uses GUtility(), G_UTIL_GCAPS_IPREQUEST or G_UTIL_IPREQUEST to provide a list of all Galil controller...
Definition gclibo.c:106
GReturn vector(GCon g, char *file)
Puts controller into Vector Mode and accepts a file defining vector points.
Definition vector.cpp:36
partial Module Examples
Definition Commands.vb:4