gclib 2.0.9
Communications API for Galil controllers and PLCs
 
Loading...
Searching...
No Matches
Motion_Complete.vb
Go to the documentation of this file.
2 Public Function Motion_Complete(gclib As Gclib)
3 Console.WriteLine("*************************************************************")
4 Console.WriteLine("Example GInterrupt() usage")
5 Console.WriteLine("*************************************************************")
6
7 'Simple check for appropriate communication bus
10
11 If gclib.GCommand("WH").Contains("IH") Then
13 End If
14
16 Console.WriteLine("No support on this bus")
17 Return GALIL_EXAMPLE_ERROR
18 End If
19
20 'Flush interrupts
21 gclib.GCommand("EI0,0") 'Turn off interrupts
22 gclib.GTimeout(0) 'Zero timeout
23
25 While (gclib.GInterrupt() > 0)
27
28 gclib.GTimeout(-1) 'Restore timeout
29
33
34 gclib.GCommand("SP 4000,4000") 'Set up speed
35 gclib.GCommand("AC 1280000, 1280000") 'acceleration
36 gclib.GCommand("DC 1280000, 1280000") 'deceleration
39
42 Check_Interrupts(gclib, "AB") 'Block until motion Is complete On axes A And B
45
46 Return GALIL_EXAMPLE_OK
48
49 Private Sub Check_Interrupts(gclib As Gclib, axes As String)
53
55 For i = 0 To axes.Length - 1
56
58 Select Case (axes(i))
59 Case "A"
62 Case "B"
65 Case "C"
68 Case "D"
71 Case "E"
74 Case "F"
77 Case "G"
80 Case "H"
84 Next
85
86 'send EI axis mask to set up interrupt events.
88
90
118 End Select
119 End While
120 End Sub
string GCommand(string Command, bool Trim=true)
Used for command-and-response transactions.
Definition gclib.cs:257
byte GInterrupt()
Provides access to PCI and UDP interrupts from the controller.
Definition gclib.cs:364
void GTimeout(Int16 timeout_ms)
Set the timeout of communication transactions. Use -1 to set the original timeout from GOpen().
Definition gclib.cs:604
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 GTimeout(GCon g, short timeout_ms)
Uses GUtility() and G_UTIL_TIMEOUT_OVERRIDE to set the library timeout.
Definition gclibo.c:65
GCLIB_DLL_EXPORTED GReturn GCALL GCommand(GCon g, GCStringIn command, GBufOut buffer, GSize buffer_len, GSize *bytes_returned)
Performs a command-and-response transaction on the connection.
GCLIB_DLL_EXPORTED GReturn GCALL GInterrupt(GCon g, GStatus *status_byte)
Provides access to PCI and UDP interrupts from the controller.
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