| gclib 2.0.7 Communications API for Galil controllers and PLCs |

gclib.vb
Go to the documentation of this file.
1 Imports System
2 Imports System.Text 'StringBuilder
3 Imports System.Runtime.InteropServices 'DLL import
4 Imports System.IO 'File.Exists
5
6 Imports UB = System.Byte
7 Imports UW = System.UInt16
8 Imports SW = System.Int16
9 Imports SL = System.Int32
10 Imports UL = System.UInt32
11
12 #If PLATFORM = "x86" Then
13 Imports GReturn = System.Int32
14 Imports GCon = System.IntPtr
15 Imports GSize = System.UInt32
16 Imports GOption = System.Int32
17 Imports GCStringOut = System.Text.StringBuilder
18 Imports GCStringIn = System.String
19 Imports GBufOut = System.Text.StringBuilder
20 Imports GBufIn = System.String
21 Imports GStatus = System.Byte
22 ' IMPORTANT! Be sure that the paths below are correct
23 Public Module LibraryPath
24 Public Const GclibDllPath_ As String = "C:\Program Files (x86)\Galil\gclib\dll\x86\gclib.dll"
25 Public Const GcliboDllPath_ As String = "C:\Program Files (x86)\Galil\gclib\dll\x86\gclibo.dll"
26 End Module
27
28 #ElseIf PLATFORM = "x64" Then
29 Imports GReturn = System.Int32
30 Imports GCon = System.IntPtr
31 Imports GSize = System.UInt32
32 Imports GOption = System.Int32
33 Imports GCStringOut = System.Text.StringBuilder
34 Imports GCStringIn = System.String
35 Imports GBufOut = System.Text.StringBuilder
36 Imports GBufIn = System.String
37 Imports GStatus = System.Byte
38 ' IMPORTANT! Be sure that the paths below are correct
39 Public Module LibraryPath
40 Public Const GclibDllPath_ As String = "C:\Program Files (x86)\Galil\gclib\dll\x64\gclib.dll"
41 Public Const GcliboDllPath_ As String = "C:\Program Files (x86)\Galil\gclib\dll\x64\gclibo.dll"
42 End Module
43 #End If
44
45 ''' <summary>
46 ''' Provides a class that binds to gclib's unmanaged dll. Wraps each call and provides a more user-friendly interface for use in Visual Basic.
47 ''' </summary>
48 ''' <remarks>
49 ''' The Gclib class assumes the default installation of gclib, "C:\Program Files (x86)\Galil\gclib\".
50 ''' If the dlls are elsewhere, change the path strings GclibDllPath_, and GcliboDllPath_.
51 ''' </remarks>
52 Public Class Gclib
53
54 #Region "VB wrappers of gclib C calls"
55
56 #Region "Private properties"
57 Private Const BufferSize_ As Integer = 500000 'size of "char *" buffer. Big enough to fit entire 4000 program via UL/LS, or 24000 elements of array data.
58 Private Buffer_ As New System.Text.StringBuilder(BufferSize_) 'used to pass a "char *" to gclib.
59 Private ByteArray_(512) As Byte 'byte array to hold data record and response to GRead
60 Private ConnectionHandle_ As GCon 'keep track of the gclib connection handle.
61 Private ConnectionStatus_ As Boolean 'keep track of the status of gclib's connection.
62 #End Region
63
64 ''' <summary>
65 ''' Constructor of the gclib wrapper class.
66 ''' </summary>
67 ''' <remarks>Checks to ensure gclib dlls are in the correct location.</remarks>
68 ''' <exception cref="System.Exception">Will throw an exception if either dll isn't found.</exception>
69 Public Sub New()
70 If Not File.Exists(GclibDllPath_) Then
71 Throw New System.Exception("Could not find gclib dll at " & GclibDllPath_)
72 End If
73
74 If Not File.Exists(GcliboDllPath_) Then
75 Throw New System.Exception("Could not find gclibo dll at " & GcliboDllPath_)
76 End If
77 End Sub
78
79 ''' <summary>
80 ''' Return a string array of available connection addresses.
81 ''' </summary>
82 ''' <returns>String array containing all available Galil Ethernet controllers, PCI controllers, and COM ports.</returns>
83 ''' <remarks>Wrapper around gclib GAddresses(),
84 ''' http://www.galil.com/sw/pub/all/doc/gclib/html/gclibo_8h.html#a6a6114683ed5749519b64f19512c24d6
85 ''' An empty array is returned on error.</remarks>
86 Public Function GAddresses() As String()
87 Dim rc As GReturn = DllGAddresses(Buffer_, BufferSize_)
88 If rc = G_NO_ERROR Then
89 Return Buffer_.ToString().Split({vbCr, vbLf}, System.StringSplitOptions.RemoveEmptyEntries)
90 Else
91 Return New String() {}
92 End If
93 End Function
94
95 ''' <summary>
96 ''' Downloads array data to a pre-dimensioned array in the controller's array table.
97 ''' </summary>
98 ''' <param name="array_name">String containing the name of the array to download. Must match the array name used in DM.</param>
99 ''' <param name="data">A list of doubles, to be downloaded.</param>
100 ''' <param name="first">The first element of the array for sub-array downloads.</param>
101 ''' <param name="last">The last element of the array for sub-array downloads.</param>
102 ''' <remarks>Wrapper around gclib GArrayDownload(),
103 ''' http://www.galil.com/sw/pub/all/doc/gclib/html/gclib_8h.html#a6ea5ae6d167675e4c27ccfaf2f240f8a
104 ''' The array must already exist on the controller, see DM and LA.</remarks>
105 ''' <exception cref="System.Exception">Will throw an exception if anything other than G_NO_ERROR is received from gclib.</exception>
106 Public Sub GArrayDownload(array_name As String, ByRef data As List(Of Double), Optional first As Int16 = -1, Optional last As Int16 = -1)
107 Dim ArrayData As New System.Text.StringBuilder(BufferSize_) 'for converting to ASCII
108 Dim len As Integer = data.Count()
109 For i As Integer = 0 To len - 1
110 ArrayData.Append(data(i).ToString("F4")) 'format to fixed point
111 If i < len - 1 Then
112 ArrayData.Append(",") 'delimiter
113 End If
114 Next
115 Dim rc As GReturn = DllGArrayDownload(ConnectionHandle_, array_name, first, last, ArrayData.ToString())
116 If Not rc = G_NO_ERROR Then
117 Throw New System.Exception(GError(rc))
118 End If
119 End Sub
120
121 ''' <summary>
122 ''' Allows downloading of a program array file to the controller.
123 ''' </summary>
124 ''' <param name="Path">The full filepath of the array csv file.</param>
125 ''' <remarks>Wrapper around gclib GArrayDownload(),
126 ''' http://www.galil.com/sw/pub/all/doc/gclib/html/gclibo_8h.html#a14b448ab8c7e6cf495865af301be398e
127 ''' </remarks>
128 ''' <exception cref="System.Exception">Will throw an exception if anything other than G_NO_ERROR is received from gclib.</exception>
129 Public Sub GArrayDownloadFile(Path As String)
130 Dim rc As GReturn = DllGArrayDownloadFile(ConnectionHandle_, Path)
131 If rc <> G_NO_ERROR Then
132 Throw New System.Exception(GError(rc))
133 End If
134 End Sub
135
136 ''' <summary>
137 ''' Uploads array data from the controller's array table.
138 ''' </summary>
139 ''' <param name="array_name">String containing the name of the array to upload.</param>
140 ''' <param name="first">The first element of the array for sub-array uploads.</param>
141 ''' <param name="last">The last element of the array for sub-array uploads.</param>
142 ''' <returns>The desired array as a list of doubles.</returns>
143 ''' <remarks>Wrapper around gclib GArrayUpload(),
144 ''' http://www.galil.com/sw/pub/all/doc/gclib/html/gclib_8h.html#af215806ec26ba06ed3f174ebeeafa7a7
145 ''' </remarks>
146 ''' <exception cref="System.Exception">Will throw an exception if anything other than G_NO_ERROR is received from gclib.</exception>
147 Public Function GArrayUpload(array_name As String, Optional first As Int16 = -1, Optional last As Int16 = -1) As List(Of Double)
148 Dim array As New List(Of Double)
149 Dim rc As GReturn = DllGArrayUpload(ConnectionHandle_, array_name, first, last, 1, Buffer_, BufferSize_) '1 = comma delim
150 If Not rc = G_NO_ERROR Then
151 Throw New System.Exception(GError(rc))
152 End If
153 Dim tokens As String() = Buffer_.ToString.Split({","}, System.StringSplitOptions.RemoveEmptyEntries)
154 Dim value As Double
155 For Each s As String In tokens
156 If Not Double.TryParse(s, value) Then
157 Throw New System.Exception("Could not parse " & s & " into double")
158 End If
159 array.Add(value)
160 Next
161 Return array
162 End Function
163
164 ''' <summary>
165 ''' Allows uploading of a program array file from the controller to an array CSV file.
166 ''' </summary>
167 ''' <param name="Path">The full filepath of the array csv file to save.</param>
168 ''' <param name="Names">A space separated list of the array names to upload. A null string uploads all arrays in the array table (LA).</param>
169 ''' <remarks>Wrapper around gclib GArrayUpload().
170 ''' http://www.galil.com/sw/pub/all/doc/gclib/html/gclib_8h.html#af215806ec26ba06ed3f174ebeeafa7a7
171 ''' </remarks>
172 ''' <exception cref="System.Exception">Will throw an exception if anything other than G_NO_ERROR is received from gclib.</exception>
173 Public Sub GArrayUploadFile(Path As String, Names As String)
174 Dim rc As GReturn = DllGArrayUploadFile(ConnectionHandle_, Path, Names)
175 If rc <> G_NO_ERROR Then
176 Throw New System.Exception(GError(rc))
177 End If
178 End Sub
179
180 ''' <summary>
181 ''' Assigns IP address over the Ethernet to a controller at a given MAC address.
182 ''' </summary>
183 ''' <param name="ip">The ip address to assign. The hardware should not yet have an IP address. </param>
184 ''' <param name="mac">The MAC address of the hardware.</param>
185 ''' <remarks>Wrapper around gclib GAssign(),
186 ''' http://www.galil.com/sw/pub/all/doc/gclib/html/gclibo_8h.html#acc996b7c22cfed8e5573d096ef1ab759
187 ''' </remarks>
188 ''' <exception cref="System.Exception">Will throw an exception if anything other than G_NO_ERROR is received from gclib.</exception>
189 Public Sub GAssign(ip As String, mac As String)
190 Dim rc As GReturn = DllGAssign(ip, mac)
191 If Not rc = G_NO_ERROR Then
192 Throw New System.Exception(GError(rc))
193 End If
194 End Sub
195
196 ''' <summary>
197 ''' Used to close a connection to Galil hardware.
198 ''' </summary>
199 ''' <remarks>Wrapper around gclib GClose(),
200 ''' http://www.galil.com/sw/pub/all/doc/gclib/html/gclib_8h.html#a24a437bcde9637b0db4b94176563a052
201 ''' Be sure to call GClose() whenever a connection is finished.</remarks>
202 Public Sub GClose()
203 If ConnectionStatus_ Then
204 DllGClose(ConnectionHandle_)
205 End If
206
207 ConnectionStatus_ = False
208 End Sub
209
210 ''' <summary>
211 ''' Used for command-and-response transactions.
212 ''' </summary>
213 ''' <param name="Command">The command to send to the controller. Do not append a carriage return. Use only ASCII-based commmands.</param>
214 ''' <param name="Trim">If true, the response will be trimmed of the trailing colon and any leading or trailing whitespace.</param>
215 ''' <returns>The command's response.</returns>
216 ''' <remarks>Wrapper around gclib GCommand(),
217 ''' http://www.galil.com/sw/pub/all/doc/gclib/html/gclib_8h.html#a5ac031e76efc965affdd73a1bec084a8
218 ''' </remarks>
219 ''' <exception cref="System.Exception">Will throw an exception if anything other than G_NO_ERROR is received from gclib.</exception>
220 Public Function GCommand(Command As String, Optional Trim As Boolean = True) As String
221 Dim rc As GReturn = DllGCommand(ConnectionHandle_, Command, Buffer_, BufferSize_, 0)
222 If rc <> G_NO_ERROR Then
223 Throw New System.Exception(GError(rc))
224 End If
225 If Trim Then
226 Dim r As String = Buffer_.ToString()
227 If r(r.Count() - 1) = ":" Then
228 r = r.Substring(0, r.Count() - 1)
229 End If
230 Return r.Trim()
231 Else
232 Return Buffer_.ToString()
233 End If
234 End Function
235
236
237 ''' <summary>
238 ''' Used for command-And-response transactions.
239 ''' </summary>
240 ''' <param name="Command">The command to send to the controller. Do Not append a carriage return. Use only ASCII-based commmands.</param>
241 ''' <returns>The command's response parsed as an integer.</returns>
242 ''' <remarks>Wrapper around gclib GCmdI(),
243 ''' http://www.galil.com/sw/pub/all/doc/gclib/html/gclib_8h.html#a5ac031e76efc965affdd73a1bec084a8
244 ''' </remarks>
245 Public Function GCmdI(Command As String) As Int16
246 Return Convert.ToInt16(Convert.ToDouble(GCommand(Command)))
247 End Function
248
249 ''' <summary>
250 ''' Used for command-And-response transactions.
251 ''' </summary>
252 ''' <param name="Command">The command to send to the controller. Do Not append a carriage return. Use only ASCII-based commmands.</param>
253 ''' <returns>The command's response parsed as a double.</returns>
254 ''' <remarks>Wrapper around gclib GCmdD(),
255 ''' http://www.galil.com/sw/pub/all/doc/gclib/html/gclib_8h.html#a5ac031e76efc965affdd73a1bec084a8
256 ''' </remarks>
257 Public Function GCmdD(Command As String) As Double
258 Return Convert.ToDouble(GCommand(Command))
259 End Function
260
261 ''' <summary>
262 ''' Provides a human-readable error message from a gclib error code.
263 ''' </summary>
264 ''' <param name="ErrorCode">The gclib error code, as returned from a call to the gclib.</param>
265 ''' <returns>Error message string.</returns>
266 ''' <remarks>
267 ''' Wrapper around gclib GError(),
268 ''' http://www.galil.com/sw/pub/all/doc/gclib/html/gclibo_8h.html#afef1bed615bd72134f3df6d3a5723cba
269 ''' This function is private, all public calls that throw errors use this command for setting the exception message.
270 ''' </remarks>
271 Private Function GError(ErrorCode As GReturn) As String
272 DllGError(ErrorCode, Buffer_, BufferSize_)
273 Return ErrorCode.ToString & " " & Buffer_.ToString() & vbCrLf
274 End Function
275
276 ''' <summary>
277 ''' Upgrade firmware.
278 ''' </summary>
279 ''' <param name="filepath ">The full filepath of the firmware hex file.</param>
280 ''' <remarks>Wrapper around gclib GFirmwareDownload(),
281 ''' http://www.galil.com/sw/pub/all/doc/gclib/html/gclib_8h.html#a1878a2285ff17897fa4fb20182ba6fdf
282 ''' </remarks>
283 ''' <exception cref="System.Exception">Will throw an exception if anything other than G_NO_ERROR is received from gclib.</exception>
284 Public Sub GFirmwareDownload(filepath As String)
285 Dim rc As GReturn = DllGFirmwareDownload(ConnectionHandle_, filepath)
286 If rc <> G_NO_ERROR Then
287 Throw New System.Exception(GError(rc))
288 End If
289 End Sub
290
291 ''' <summary>Provides a useful connection string.</summary>
292 ''' <remarks>Wrapper around gclib GInfo(),
293 ''' http://www.galil.com/sw/pub/all/doc/gclib/html/gclibo_8h.html#a08abfcff8a1a85a01987859473167518
294 ''' </remarks>
295 ''' <returns>String containing connection information, e.g. "192.168.0.43, DMC4020 Rev 1.2c, 291". A null string indicates an error was returned from the library.</returns>
296 Public Function GInfo() As String
297 Dim rc As GReturn = DllGInfo(ConnectionHandle_, Buffer_, BufferSize_)
298 If rc = G_NO_ERROR Then
299 Return Buffer_.ToString()
300 Else
301 Return ""
302 End If
303 End Function
304
305 ''' <summary>
306 ''' Provides access to PCI and UDP interrupts from the controller.
307 ''' </summary>
308 ''' <returns>The status byte from the controller. Zero will be returned if a status byte is not read.</returns>
309 ''' <remarks>Wrapper around gclib GInterrupt(),
310 ''' http://www.galil.com/sw/pub/all/doc/gclib/html/gclib_8h.html#a5bcf802404a96343e7593d247b67f132
311 ''' -s ALL or -s EI must be specified in the address argument of GOpen() to receive interrupts.</remarks>
312 Public Function GInterrupt() As Byte
313 Dim StatusByte As Byte = 0
314 Dim rc As GReturn = DllGInterrupt(ConnectionHandle_, StatusByte)
315 If rc = G_NO_ERROR Then
316 Return StatusByte
317 Else
318 Return 0
319 End If
320 End Function
321
322 ''' <summary>
323 ''' Provides a list of all Galil controllers requesting IP addresses via BOOT-P or DHCP.
324 ''' </summary>
325 ''' <returns>Each line of the returned data will be of the form "model, serial_number, mac". </returns>
326 ''' <remarks>Wrapper around gclib GIpRequests(),
327 ''' http://www.galil.com/sw/pub/all/doc/gclib/html/gclibo_8h.html#a0afb4c82642a4ef86f997c39a5518952
328 ''' An empty array is returned on error.
329 ''' Call will take roughly 5 seconds to return.</remarks>
330 Public Function GIpRequests() As String()
331 Dim rc As GReturn = DllGIpRequests(Buffer_, BufferSize_)
332 If rc = G_NO_ERROR Then
333 Return Buffer_.ToString().Split({vbCr, vbLf}, System.StringSplitOptions.RemoveEmptyEntries)
334 Else
335 Return New String() {}
336 End If
337 End Function
338
339 ''' <summary>
340 ''' Provides access to unsolicited messages.
341 ''' </summary>
342 ''' <returns>String containing all messages received by controller.</returns>
343 ''' <remarks>Wrapper around gclib GMessage(),
344 ''' http://www.galil.com/sw/pub/all/doc/gclib/html/gclib_8h.html#aabc5eaa09ddeca55ab8ee048b916cbcd
345 '''An empty string is returned on error.
346 ''' -s ALL or -s MG must be specified in the address argument of GOpen() to receive messages.</remarks>
347 Public Function GMessage() As String
348 Dim rc As GReturn = DllGMessage(ConnectionHandle_, Buffer_, BufferSize_)
349 If rc = G_NO_ERROR Then
350 Return Buffer_.ToString
351 Else
352 Return ""
353 End If
354 End Function
355
356 ''' <summary>
357 ''' Blocking call that returns once all axes specified have completed their motion.
358 ''' </summary>
359 ''' <param name="axes">A string containing a multiple-axes mask. Every character in the string should be a valid argument to MG_BGm, i.e. XYZWABCDEFGHST.</param>
360 ''' <remarks>Wrapper around gclib GMotionComplete(),
361 ''' http://www.galil.com/sw/pub/all/doc/gclib/html/gclibo_8h.html#a19c220879442987970706444197f397a
362 ''' </remarks>
363 ''' <exception cref="System.Exception">Will throw an exception if anything other than G_NO_ERROR is received from gclib.</exception>
364 Public Sub GMotionComplete(axes As String)
365 Dim rc As GReturn = DllGMotionComplete(ConnectionHandle_, axes)
366 If Not rc = G_NO_ERROR Then
367 Throw New System.Exception(GError(rc))
368 End If
369 End Sub
370
371 ''' <summary>
372 ''' Used to open a connection to Galil hardware.
373 ''' </summary>
374 ''' <param name="address">Address string including any connection switches. See gclib documentation for GOpen().</param>
375 ''' <remarks>Wrapper around gclib GOpen(),
376 ''' http://www.galil.com/sw/pub/all/doc/gclib/html/gclib_8h.html#aef4aec8a85630eed029b7a46aea7db54
377 ''' </remarks>
378 ''' <exception cref="System.Exception">Will throw an exception if anything other than G_NO_ERROR is received from gclib.</exception>
379 Public Sub GOpen(address As String)
380 Dim rc As GReturn = DllGOpen(address, ConnectionHandle_)
381 If rc <> G_NO_ERROR Then
382 Throw New System.Exception(GError(rc))
383 Else
384 ConnectionStatus_ = True
385 End If
386 End Sub
387
388 ''' <summary>
389 ''' Allows downloading of a DMC program from a string buffer.
390 ''' </summary>
391 ''' <param name="program">The program to download.</param>
392 ''' <param name="preprocessor">Preprocessor directives. Use nullstring for none.</param>
393 ''' <remarks>Wrapper around gclib GProgramDownload(),
394 ''' http://www.galil.com/sw/pub/all/doc/gclib/html/gclib_8h.html#acafe19b2dd0537ff458e3c8afe3acfeb
395 ''' </remarks>
396 ''' <exception cref="System.Exception">Will throw an exception if anything other than G_NO_ERROR is received from gclib.</exception>
397 Public Sub GProgramDownload(ByRef program As String, Optional preprocessor As String = "")
398 Dim rc As GReturn = DllGProgramDownload(ConnectionHandle_, program, preprocessor)
399 If rc <> G_NO_ERROR Then
400 Throw New System.Exception(GError(rc))
401 End If
402 End Sub
403
404 ''' <summary>
405 ''' Allows downloading of a DMC program from file.
406 ''' </summary>
407 ''' <param name="file_path">The full filepath of the DMC file.</param>
408 ''' <param name="preprocessor">Preprocessor directives. Use nullstring for none.</param>
409 ''' <remarks>Wrapper around gclib GProgramDownloadFile(),
410 ''' http://www.galil.com/sw/pub/all/doc/gclib/html/gclibo_8h.html#a8e44e2e321df9e7b8c538bf2d640633f
411 ''' </remarks>
412 ''' <exception cref="System.Exception">Will throw an exception if anything other than G_NO_ERROR is received from gclib.</exception>
413 Public Sub GProgramDownloadFile(file_path As String, Optional preprocessor As String = "")
414 Dim rc As GReturn = DllGProgramDownloadFile(ConnectionHandle_, file_path, preprocessor)
415 If rc <> G_NO_ERROR Then
416 Throw New System.Exception(GError(rc))
417 End If
418 End Sub
419
420 ''' <summary>
421 ''' Allows uploading of a DMC program to a string.
422 ''' </summary>
423 ''' <remarks>Wrapper around gclib GProgramUpload(),
424 ''' http://www.galil.com/sw/pub/all/doc/gclib/html/gclib_8h.html#a80a653ce387a2bd16bde2793c6de77e9
425 ''' </remarks>
426 ''' <exception cref="System.Exception">Will throw an exception if anything other than G_NO_ERROR is received from gclib.</exception>
427 Public Function GProgramUpload() As String
428 Dim rc As GReturn = DllGProgramUpload(ConnectionHandle_, Buffer_, BufferSize_)
429 If rc <> G_NO_ERROR Then
430 Throw New System.Exception(GError(rc))
431 Else
432 Return Buffer_.ToString()
433 End If
434 End Function
435
436 ''' <summary>
437 ''' Allows uploading of a DMC program to a file.
438 ''' </summary>
439 ''' <param name="file_path">The full filepath of the DMC file to save.</param>
440 ''' <remarks>Wrapper around gclib GProgramUploadFile(),
441 ''' http://www.galil.com/sw/pub/all/doc/gclib/html/gclibo_8h.html#a38c5565afc11762fa19d37fbaa3c9aa3
442 ''' </remarks>
443 ''' <exception cref="System.Exception">Will throw an exception if anything other than G_NO_ERROR is received from gclib.</exception>
444 Public Sub GProgramUploadFile(file_path As String)
445 Dim rc As GReturn = DllGProgramUploadFile(ConnectionHandle_, file_path)
446 If rc <> G_NO_ERROR Then
447 Throw New System.Exception(GError(rc))
448 End If
449 End Sub
450
451 ''' <summary>
452 ''' Performs a read on the connection.
453 ''' </summary>
454 ''' <returns>String containing the read data, or a nullstring if nothing was read or an error occured.</returns>
455 ''' <remarks>Wrapper around gclib GRead(),
456 ''' http://www.galil.com/sw/pub/all/doc/gclib/html/gclib_8h.html#adab6ec79b7e1bc7f0266684dd3434923
457 ''' </remarks>
458 Public Function GRead() As Byte()
459 Dim read As UInteger
460 Dim rc As GReturn = DllGRead(ConnectionHandle_, ByteArray_, ByteArray_.Length, read)
461 If rc = G_NO_ERROR Then
462 Dim ReturnData(read - 1) As Byte 'create an array of the correct size
463 For i As Integer = 0 To read - 1
464 ReturnData(i) = ByteArray_(i) 'copy over the data
465 Next
466 Return ReturnData
467 Else
468 Return Nothing
469 End If
470 End Function
471
472 ''' <summary>
473 ''' Used for retrieving data records from the controller.
474 ''' </summary>
475 ''' <returns>A struct containing the information of the retrieved data record.</returns>
476 ''' <param name="async">False to user QR, True to use DR.</param>
477 ''' <remarks>Wrapper around gclib GRecord(),
478 ''' http://www.galil.com/sw/pub/all/doc/gclib/html/gclib_8h.html#a1f39cd57dcfa55d065c972a020b1f8ee
479 ''' To use async, -s ALL or -s DR must be specified in the address argument of GOpen(),
480 ''' and the records must be started via DR or RecordRate().
481 ''' </remarks>
482 ''' <exception cref="System.Exception">Will throw an exception if anything other than G_NO_ERROR is received from gclib.</exception>
483 Public Function GRecord(Of T As GDataRecord)(async As Boolean) As T
484 Dim method As UShort = 0 'QR mode
485 If async Then
486 method = 1 'DR mode
487 End If
488
489 Dim rc As GReturn = DllGRecord(ConnectionHandle_, ByteArray_, method)
490 If rc <> G_NO_ERROR Then
491 Throw New System.Exception(GError(rc))
492 End If
493 Return ByteArrayToDataRecord(Of T)(ByteArray_)
494 End Function
495
496 ''' <summary>
497 ''' Sets the asynchronous data record to a user-specified period via DR.
498 ''' </summary>
499 ''' <param name="period_ms">Period, in milliseconds, to set up for the asynchronous data record.</param>
500 ''' <remarks>Wrapper around gclib GRecordRate(),
501 ''' http://www.galil.com/sw/pub/all/doc/gclib/html/gclibo_8h.html#ada86dc9d33ac961412583881963a1b8a
502 ''' Takes TM and product type into account and sets the DR period to the period requested by the user, if possible.</remarks>
503 ''' <exception cref="System.Exception">Will throw an exception if anything other than G_NO_ERROR is received from gclib.</exception>
504 Public Sub GRecordRate(period_ms As Double)
505 Dim rc As GReturn = DllGRecordRate(ConnectionHandle_, period_ms)
506 If Not rc = G_NO_ERROR Then
507 Throw New System.Exception(GError(rc))
508 End If
509 End Sub
510
511 ''' <summary>
512 ''' Set the timeout of communication transactions. Use -1 to set the original timeout from GOpen().
513 ''' </summary>
514 ''' <param name="timeout_ms ">New timeout in miliseconds.</param>
515 ''' <remarks>Wrapper around gclib GTimeout(),
516 ''' http://www.galil.com/sw/pub/all/doc/gclib/html/gclibo_8h.html#a179aa2d1b8e2227944cc06a7ceaf5640
517 ''' </remarks>
518 Public Sub GTimeout(timeout_ms As Int16)
519 DllGTimeout(ConnectionHandle_, timeout_ms)
520 End Sub
521
522 ''' <summary>Used to get the gclib version.</summary>
523 ''' <returns>The library version, e.g. "104.73.179". A null string indicates an error was returned from the library.</returns>
524 ''' <remarks>Wrapper around gclib GVersion(),
525 ''' http://www.galil.com/sw/pub/all/doc/gclib/html/gclibo_8h.html#a1784b39416b77af20efc98a05f8ce475
526 ''' </remarks>
527 Public Function GVersion() As String
528 Dim rc As GReturn = DllGVersion(Buffer_, BufferSize_)
529 If rc = G_NO_ERROR Then
530 Return Buffer_.ToString()
531 Else
532 Return ""
533 End If
534 End Function
535
536 ''' <summary>
537 ''' Performs a write on the connection.
538 ''' </summary>
539 ''' <param name="buffer">The user's write buffer. To send a Galil command, a terminating carriage return is usually required. </param>
540 ''' <remarks>Wrapper around gclib GWrite(),
541 ''' http://www.galil.com/sw/pub/all/doc/gclib/html/gclib_8h.html#abe28ebaecd5b3940adf4e145d40e5456
542 ''' </remarks>
543 ''' <exception cref="System.Exception">Will throw an exception if anything other than G_NO_ERROR is received from gclib.</exception>
544 Public Sub GWrite(ByRef buffer As String)
545 Dim rc As GReturn = DllGWrite(ConnectionHandle_, buffer, buffer.Length())
546 If Not rc = G_NO_ERROR Then
547 Throw New System.Exception(GError(rc))
548 End If
549 End Sub
550
551 ''' <summary>
552 ''' Allows downloading of a Galil compressed backup (gcb) file to the controller.
553 ''' </summary>
554 ''' <param name="Path">The full filepath of the gcb file.</param>
555 ''' <param name="Options">A bit mask indicating which sectors of the gcb file to restore to the controller.</param>
556 ''' <returns>The controller information stored in the gcb file.</returns>
557 ''' <remarks>Wrapper around gclib GSetupDownloadFile(),
558 '''
559 ''' If options is specified as 0, the return string will have a number appended corresponding to a bit mask of the available gcb sectors
560 ''' </remarks>
561 ''' <exception cref="System.Exception">Will throw an exception if anything other than G_NO_ERROR is received from gclib.</exception>
562 Public Function GSetupDownloadFile(Path As String, Options As Int32) As String()
563 'Dim _info As New System.Text.StringBuilder(BufferSize_)
564 Dim rc As GReturn = DllGSetupDownloadFile(ConnectionHandle_, Path, Options, Buffer_, BufferSize_)
565 Dim ret_buf As String = Buffer_.ToString()
566 ret_buf = Replace(ret_buf, vbCrLf, ", ")
567
568 If Not Options = 0 Then
569 If rc <> G_NO_ERROR Then
570 Throw New System.Exception(GError(rc))
571 End If
572 Else
573 ret_buf += """options""" + "," + rc.ToString() + vbLf
574 End If
575
576 Return ret_buf.Split({vbLf}, System.StringSplitOptions.RemoveEmptyEntries)
577 End Function
578
579 ''' <summary>
580 ''' Connects gclib to a New gcaps server
581 ''' </summary>
582 ''' <param name="server_name">Name of the server to connect.</param>
583 ''' <remarks>Wrapper around gclib GSetServer(),
584 ''' Call GSetServer("Local") to connect gclib back to local gcaps server
585 ''' </remarks>
586 ''' <exception cref="System.Exception">Will throw an exception if anything other than G_NO_ERROR Is received from gclib.</exception>
587 Public Sub GSetServer(server_name As String)
588 Dim rc As GReturn = DllGSetServer(server_name)
589
590 If Not rc = G_NO_ERROR Then
591 Throw New System.Exception(GError(rc))
592 End If
593 End Sub
594
595 ''' <summary>
596 ''' Retrieves the name of your local gcaps server And whether Or Not it Is currently published
597 ''' </summary>
598 ''' <returns>A string in the form "<server_name>, <isPublished>"</returns>
599 ''' <exception cref="System.Exception">Will throw an exception if anything other than G_NO_ERROR Is received from gclib.</exception>
600 Public Function GServerStatus() As String
601 Dim rc As GReturn = DllGServerStatus(Buffer_, BufferSize_)
602
603 If Not rc = G_NO_ERROR Then
604 Throw New System.Exception(GError(rc))
605 End If
606
607 Return Buffer_.ToString()
608 End Function
609
610 ''' <summary>
611 ''' Retrieves a list of gcaps servers that are advertising themselves on the local network
612 ''' </summary>
613 ''' <returns>A list of available gcaps server names</returns>
614 ''' <exception cref="System.Exception">Will throw an exception if anything other than G_NO_ERROR Is received from gclib.</exception>
615 Public Function GListServers() As String()
616 Dim rc As GReturn = DllGListServers(Buffer_, BufferSize_)
617
618 If Not rc = G_NO_ERROR Then
619 Throw New System.Exception(GError(rc))
620 End If
621
622 Dim delimiters As Char() = New Char() {vbLf, vbNewLine}
623 Return Buffer_.ToString().Split(delimiters, System.StringSplitOptions.RemoveEmptyEntries)
624 End Function
625
626 ''' <summary>
627 ''' Publishes Or removes local gcaps server from the network
628 ''' </summary>
629 ''' <param name="server_name">Name to publish server under.</param>
630 ''' <param name="publish">True=publish server, False=remove server.</param>
631 ''' <param name="save">Save this configuration for future server reboots.</param>
632 ''' <exception cref="System.Exception">Will throw an exception if anything other than G_NO_ERROR Is received from gclib.</exception>
633 Public Sub GPublishServer(server_name As String, publish As Boolean, save As Boolean)
634 Dim rc As GReturn = DllGPublishServer(server_name, Convert.ToInt16(publish), Convert.ToInt16(save))
635
636 If Not rc = G_NO_ERROR Then
637 Throw New System.Exception(GError(rc))
638 End If
639 End Sub
640
641 ''' <summary>
642 ''' Returns a list of IP Addresses that currently have an open connection to your hardware.
643 ''' </summary>
644 ''' <returns>Returns a list of IP Addresses that currently have an open connection to your hardware.</returns>
645 ''' <exception cref="System.Exception">Will throw an exception if anything other than G_NO_ERROR Is received from gclib.</exception>
646 Public Function GRemoteConnections() As String()
647 Dim rc As GReturn = DllGRemoteConnections(Buffer_, BufferSize_)
648
649 If Not rc = G_NO_ERROR Then
650 Throw New System.Exception(GError(rc))
651 End If
652
653 Dim delimiters As Char() = New Char() {vbLf, vbNewLine}
654 Return Buffer_.ToString().Split(delimiters, System.StringSplitOptions.RemoveEmptyEntries)
655 End Function
656
657 #End Region
658
659 #Region "DLL Imports"
660
661 'Import declarations for gclib functions. Functions are private to this class and are prefixed with "Dll" to distinguish from VB functions.
662
663 #Region "Error Codes"
664 ''' <summary>Functions are checked for G_NO_ERROR.</summary>
665 ''' <remarks>Some functions throw exceptions if G_NO_ERROR is not returned.</remarks>
666 Private Const G_NO_ERROR As Integer = 0
667 #End Region
668
669 <DllImport(GcliboDllPath_, EntryPoint:="GAddresses", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
670 Private Shared Function DllGAddresses(addresses As GCStringOut, addresses_len As GSize) As GReturn
671 End Function
672
673 <DllImport(GclibDllPath_, EntryPoint:="GArrayDownload", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
674 Private Shared Function DllGArrayDownload(g As GCon, array_name As GCStringIn, first As GOption,
675 last As GOption, buffer As GCStringIn) As GReturn
676 End Function
677
678 <DllImport(GcliboDllPath_, EntryPoint:="GArrayDownloadFile", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
679 Private Shared Function DllGArrayDownloadFile(g As GCon, path As GCStringIn) As GReturn
680 End Function
681
682 <DllImport(GclibDllPath_, EntryPoint:="GArrayUpload", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
683 Private Shared Function DllGArrayUpload(g As GCon, array_name As GCStringIn, first As GOption,
684 last As GOption, delim As GOption, buffer As GCStringOut, bufferLength As GSize) As GReturn
685 End Function
686
687 <DllImport(GcliboDllPath_, EntryPoint:="GArrayUploadFile", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
688 Private Shared Function DllGArrayUploadFile(g As GCon, path As GCStringIn, names As GCStringIn) As GReturn
689 End Function
690
691 <DllImport(GcliboDllPath_, EntryPoint:="GAssign", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
692 Private Shared Function DllGAssign(ip As GCStringIn, mac As GCStringIn) As GReturn
693 End Function
694
695 <DllImport(GclibDllPath_, EntryPoint:="GClose", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
696 Private Shared Function DllGClose(g As GCon) As GReturn
697 End Function
698
699 <DllImport(GclibDllPath_, EntryPoint:="GCommand", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
700 Private Shared Function DllGCommand(g As GCon, command As GCStringIn, buffer As GCStringOut,
701 bufferLength As GSize, ByRef bytesReturned As GSize) As GReturn
702 End Function
703
704 <DllImport(GcliboDllPath_, EntryPoint:="GError", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
705 Private Shared Sub DllGError(error_code As GReturn, errorbuf As GCStringOut, error_len As GSize)
706 End Sub
707
708 <DllImport(GclibDllPath_, EntryPoint:="GFirmwareDownload", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
709 Private Shared Function DllGFirmwareDownload(g As GCon, path As GCStringIn) As GReturn
710 End Function
711
712 <DllImport(GcliboDllPath_, EntryPoint:="GInfo", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
713 Private Shared Function DllGInfo(g As GCon, info As GCStringOut, infoLength As GSize) As GReturn
714 End Function
715
716 <DllImport(GclibDllPath_, EntryPoint:="GInterrupt", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
717 Private Shared Function DllGInterrupt(g As GCon, ByRef status_byte As GStatus) As GReturn
718 End Function
719
720 <DllImport(GcliboDllPath_, EntryPoint:="GIpRequests", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
721 Private Shared Function DllGIpRequests(requests As GCStringOut, requests_len As GSize) As GReturn
722 End Function
723
724 <DllImport(GclibDllPath_, EntryPoint:="GMessage", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
725 Private Shared Function DllGMessage(g As GCon, buffer As GCStringOut, bufferLength As GSize) As GReturn
726 End Function
727
728 <DllImport(GcliboDllPath_, EntryPoint:="GMotionComplete", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
729 Private Shared Function DllGMotionComplete(g As GCon, axes As GCStringIn) As GReturn
730 End Function
731
732 <DllImport(GclibDllPath_, EntryPoint:="GOpen", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
733 Private Shared Function DllGOpen(address As GCStringIn, ByRef g As GCon) As GReturn
734 End Function
735
736 <DllImport(GclibDllPath_, EntryPoint:="GProgramDownload", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
737 Private Shared Function DllGProgramDownload(g As GCon, program As GCStringIn, preprocessor As GCStringIn) As GReturn
738 End Function
739
740 <DllImport(GcliboDllPath_, EntryPoint:="GProgramDownloadFile", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
741 Private Shared Function DllGProgramDownloadFile(g As GCon, path As GCStringIn, preprocessor As GCStringIn) As GReturn
742 End Function
743
744 <DllImport(GclibDllPath_, EntryPoint:="GProgramUpload", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
745 Private Shared Function DllGProgramUpload(g As GCon, buffer As GCStringOut, bufferLength As GSize) As GReturn
746 End Function
747
748 <DllImport(GcliboDllPath_, EntryPoint:="GProgramUploadFile", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
749 Private Shared Function DllGProgramUploadFile(g As GCon, path As GCStringIn) As GReturn
750 End Function
751
752 <DllImport(GclibDllPath_, EntryPoint:="GRead", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
753 Private Shared Function DllGRead(g As GCon, buffer As Byte(), buffer_len As GSize, ByRef bytes_read As GSize) As GReturn
754 End Function
755
756 <DllImport(GclibDllPath_, EntryPoint:="GRecord", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
757 Private Shared Function DllGRecord(g As GCon, record As Byte(), method As GOption) As GReturn
758 End Function
759
760 <DllImport(GcliboDllPath_, EntryPoint:="GRecordRate", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
761 Private Shared Function DllGRecordRate(g As GCon, period_ms As Double) As GReturn
762 End Function
763
764 <DllImport(GcliboDllPath_, EntryPoint:="GTimeout", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
765 Private Shared Sub DllGTimeout(g As GCon, timeoutMs As Short)
766 End Sub
767
768 <DllImport(GcliboDllPath_, EntryPoint:="GVersion", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
769 Private Shared Function DllGVersion(ver As GCStringOut, ver_len As GSize) As GReturn
770 End Function
771
772 <DllImport(GclibDllPath_, EntryPoint:="GWrite", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
773 Private Shared Function DllGWrite(g As GCon, buffer As GCStringIn, buffer_len As GSize) As GReturn
774 End Function
775
776 <DllImport(GcliboDllPath_, EntryPoint:="GSetupDownloadFile", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
777 Private Shared Function DllGSetupDownloadFile(g As GCon, path As GCStringIn, options As GOption, info As GCStringOut, info_len As GSize) As GReturn
778 End Function
779
780 <DllImport(GcliboDllPath_, EntryPoint:="GSetServer", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
781 Private Shared Function DllGSetServer(server_name As GCStringIn) As GReturn
782 End Function
783
784 <DllImport(GcliboDllPath_, EntryPoint:="GServerStatus", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
785 Private Shared Function DllGServerStatus(status As GCStringOut, status_len As GSize) As GReturn
786 End Function
787
788 <DllImport(GcliboDllPath_, EntryPoint:="GListServers", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
789 Private Shared Function DllGListServers(servers As GCStringOut, servers_len As GSize) As GReturn
790 End Function
791
792 <DllImport(GcliboDllPath_, EntryPoint:="GPublishServer", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
793 Private Shared Function DllGPublishServer(server_name As GCStringIn, publish As GOption, save As GOption) As GReturn
794 End Function
795
796 <DllImport(GcliboDllPath_, EntryPoint:="GRemoteConnections", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)>
797 Private Shared Function DllGRemoteConnections(connections As GCStringOut, connections_len As GSize) As GReturn
798 End Function
799
800 #End Region
801
802 #Region "Data Record"
803
804 Private Function ByteArrayToDataRecord(Of T As GDataRecord)(array As Byte()) As T
805 Dim handle As GCHandle = GCHandle.Alloc(array, GCHandleType.Pinned)
806 Try
807 Return Marshal.PtrToStructure(Of T)(handle.AddrOfPinnedObject())
808 Finally
809 handle.Free()
810 End Try
811 End Function
812
813 Public Interface GDataRecord
814 Function byte_array() As Byte()
815 End Interface
816
817 Private Shared Function StructToByteArray(record As GDataRecord)
818 Dim size As Integer = Marshal.SizeOf(record)
819 Dim arr(size) As Byte
820
821 Dim ptr As IntPtr = Marshal.AllocHGlobal(size)
822 Marshal.StructureToPtr(record, ptr, True)
823 Marshal.Copy(ptr, arr, 0, size)
824 Marshal.FreeHGlobal(ptr)
825 Return arr
826 End Function
827
828 ' Data record struct for DMC-4000 controllers, including 4000, 4200, 4103, And 500x0.
829 <StructLayout(LayoutKind.Sequential, Pack:=1)>
830 Public Structure GDataRecord4000
831 Implements GDataRecord
832
833 Public header_0 As UB '/*00*/ 1st Byte of Header.
834 Public header_1 As UB '/*01*/ 2nd Byte of Header.
835 Public header_2 As UB '/*02*/ 3rd Byte of Header.
836 Public header_3 As UB '/*03*/ 4th Byte of Header.
837
838 Public sample_number As UW '/*04-05*/ sample number.
839
840 Public input_bank_0 As UB '/*06*/ general input bank 0 (inputs 1-8).
841 Public input_bank_1 As UB '/*07*/ general input bank 1 (inputs 9-16).
842 Public input_bank_2 As UB '/*08*/ general input bank 2 (inputs 17-24).
843 Public input_bank_3 As UB '/*09*/ general input bank 3 (inputs 25-32).
844 Public input_bank_4 As UB '/*10*/ general input bank 4 (inputs 33-40).
845 Public input_bank_5 As UB '/*11*/ general input bank 5 (inputs 41-48).
846 Public input_bank_6 As UB '/*12*/ general input bank 6 (inputs 49-56).
847 Public input_bank_7 As UB '/*13*/ general input bank 7 (inputs 57-64).
848 Public input_bank_8 As UB '/*14*/ general input bank 8 (inputs 65-72).
849 Public input_bank_9 As UB '/*15*/ general input bank 9 (inputs 73-80).
850
851 Public output_bank_0 As UB '/*16*/ general output bank 0 (outputs 1-8).
852 Public output_bank_1 As UB '/*17*/ general output bank 1 (outputs 9-16).
853 Public output_bank_2 As UB '/*18*/ general output bank 2 (outputs 17-24).
854 Public output_bank_3 As UB '/*19*/ general output bank 3 (outputs 25-32).
855 Public output_bank_4 As UB '/*20*/ general output bank 4 (outputs 33-40).
856 Public output_bank_5 As UB '/*21*/ general output bank 5 (outputs 41-48).
857 Public output_bank_6 As UB '/*22*/ general output bank 6 (outputs 49-56).
858 Public output_bank_7 As UB '/*23*/ general output bank 7 (outputs 57-64).
859 Public output_bank_8 As UB '/*24*/ general output bank 8 (outputs 65-72).
860 Public output_bank_9 As UB '/*25*/ general output bank 9 (outputs 73-80).
861
862 Public reserved_0 As SW '/*26-27*/ Reserved.
863 Public reserved_2 As SW '/*28-29*/ Reserved.
864 Public reserved_4 As SW '/*30-31*/ Reserved.
865 Public reserved_6 As SW '/*32-33*/ Reserved.
866 Public reserved_8 As SW '/*34-35*/ Reserved.
867 Public reserved_10 As SW '/*36-37*/ Reserved.
868 Public reserved_12 As SW '/*38-39*/ Reserved.
869 Public reserved_14 As SW '/*40-41*/ Reserved.
870
871 Public ethernet_status_a As UB '/*42*/ Ethernet Handle A Status.
872 Public ethernet_status_b As UB '/*43*/ Ethernet Handle B Status.
873 Public ethernet_status_c As UB '/*44*/ Ethernet Handle C Status.
874 Public ethernet_status_d As UB '/*45*/ Ethernet Handle D Status.
875 Public ethernet_status_e As UB '/*46*/ Ethernet Handle E Status.
876 Public ethernet_status_f As UB '/*47*/ Ethernet Handle F Status.
877 Public ethernet_status_g As UB '/*48*/ Ethernet Handle G Status.
878 Public ethernet_status_h As UB '/*49*/ Ethernet Handle H Status.
879
880 Public error_code As UB '/*50*/ error code.
881 Public thread_status As UB '/*51*/ thread status
882 Public amplifier_status As UL '/*52-55*/ Amplifier Status.
883
884 Public contour_segment_count As UL '/*56-59*/ Segment Count for Contour Mode.
885 Public contour_buffer_available As UW '/*60-61*/ Buffer space remaining, Contour Mode.
886
887 Public s_plane_segment_count As UW '/*62-63*/ segment count of coordinated move for S plane.
888 Public s_plane_move_status As UW '/*64-65*/ coordinated move status for S plane.
889 Public s_distance As SL '/*66-69*/ distance traveled in coordinated move for S plane.
890 Public s_plane_buffer_available As UW '/*70-71*/ Buffer space remaining, S Plane.
891
892 Public t_plane_segment_count As UW '/*72-73*/ segment count of coordinated move for T plane.
893 Public t_plane_move_status As UW '/*74-75*/ Coordinated move status for T plane.
894 Public t_distance As SL '/*76-79*/ distance traveled in coordinated move for T plane.
895 Public t_plane_buffer_available As UW '/*80-81*/ Buffer space remaining, T Plane.
896
897 Public axis_a_status As UW '/*82-83*/ A axis status.
898 Public axis_a_switches As UB '/*84*/ A axis switches.
899 Public axis_a_stop_code As UB '/*85*/ A axis stop code.
900 Public axis_a_reference_position As SL '/*86-89*/ A axis reference position.
901 Public axis_a_motor_position As SL '/*90-93*/ A axis motor position.
902 Public axis_a_position_error As SL '/*94-97*/ A axis position error.
903 Public axis_a_aux_position As SL '/*98-101*/ A axis auxiliary position.
904 Public axis_a_velocity As SL '/*102-105*/ A axis velocity.
905 Public axis_a_torque As SL '/*106-109*/ A axis torque.
906 Public axis_a_analog_in As UW '/*110-111*/ A axis analog input.
907 Public axis_a_halls As UB '/*112*/ A Hall Input Status.
908 Public axis_a_reserved As UB '/*113*/ Reserved.
909 Public axis_a_variable As SL '/*114-117*/ A User-defined variable (ZA).
910
911 Public axis_b_status As UW '/*118-119*/ B axis status.
912 Public axis_b_switches As UB '/*120*/ B axis switches.
913 Public axis_b_stop_code As UB '/*121*/ B axis stop code.
914 Public axis_b_reference_position As SL '/*122-125*/ B axis reference position.
915 Public axis_b_motor_position As SL '/*126-129*/ B axis motor position.
916 Public axis_b_position_error As SL '/*130-133*/ B axis position error.
917 Public axis_b_aux_position As SL '/*134-137*/ B axis auxiliary position.
918 Public axis_b_velocity As SL '/*138-141*/ B axis velocity.
919 Public axis_b_torque As SL '/*142-145*/ B axis torque.
920 Public axis_b_analog_in As UW '/*146-147*/ B axis analog input.
921 Public axis_b_halls As UB '/*148*/ B Hall Input Status.
922 Public axis_b_reserved As UB '/*149*/ Reserved.
923 Public axis_b_variable As SL '/*150-153*/ B User-defined variable (ZA).
924
925 Public axis_c_status As UW '/*154-155*/ C axis status.
926 Public axis_c_switches As UB '/*156*/ C axis switches.
927 Public axis_c_stop_code As UB '/*157*/ C axis stop code.
928 Public axis_c_reference_position As SL '/*158-161*/ C axis reference position.
929 Public axis_c_motor_position As SL '/*162-165*/ C axis motor position.
930 Public axis_c_position_error As SL '/*166-169*/ C axis position error.
931 Public axis_c_aux_position As SL '/*170-173*/ C axis auxiliary position.
932 Public axis_c_velocity As SL '/*174-177*/ C axis velocity.
933 Public axis_c_torque As SL '/*178-181*/ C axis torque.
934 Public axis_c_analog_in As UW '/*182-183*/ C axis analog input.
935 Public axis_c_halls As UB '/*184*/ C Hall Input Status.
936 Public axis_c_reserved As UB '/*185*/ Reserved.
937 Public axis_c_variable As SL '/*186-189*/ C User-defined variable (ZA).
938
939 Public axis_d_status As UW '/*190-191*/ D axis status.
940 Public axis_d_switches As UB '/*192*/ D axis switches.
941 Public axis_d_stop_code As UB '/*193*/ D axis stop code.
942 Public axis_d_reference_position As SL '/*194-197*/ D axis reference position.
943 Public axis_d_motor_position As SL '/*198-201*/ D axis motor position.
944 Public axis_d_position_error As SL '/*202-205*/ D axis position error.
945 Public axis_d_aux_position As SL '/*206-209*/ D axis auxiliary position.
946 Public axis_d_velocity As SL '/*210-213*/ D axis velocity.
947 Public axis_d_torque As SL '/*214-217*/ D axis torque.
948 Public axis_d_analog_in As UW '/*218-219*/ D axis analog input.
949 Public axis_d_halls As UB '/*220*/ D Hall Input Status.
950 Public axis_d_reserved As UB '/*221*/ Reserved.
951 Public axis_d_variable As SL '/*222-225*/ D User-defined variable (ZA).
952
953 Public axis_e_status As UW '/*226-227*/ E axis status.
954 Public axis_e_switches As UB '/*228*/ E axis switches.
955 Public axis_e_stop_code As UB '/*229*/ E axis stop code.
956 Public axis_e_reference_position As SL '/*230-233*/ E axis reference position.
957 Public axis_e_motor_position As SL '/*234-237*/ E axis motor position.
958 Public axis_e_position_error As SL '/*238-241*/ E axis position error.
959 Public axis_e_aux_position As SL '/*242-245*/ E axis auxiliary position.
960 Public axis_e_velocity As SL '/*246-249*/ E axis velocity.
961 Public axis_e_torque As SL '/*250-253*/ E axis torque.
962 Public axis_e_analog_in As UW '/*254-255*/ E axis analog input.
963 Public axis_e_halls As UB '/*256*/ E Hall Input Status.
964 Public axis_e_reserved As UB '/*257*/ Reserved.
965 Public axis_e_variable As SL '/*258-261*/ E User-defined variable (ZA).
966
967 Public axis_f_status As UW '/*262-263*/ F axis status.
968 Public axis_f_switches As UB '/*264*/ F axis switches.
969 Public axis_f_stop_code As UB '/*265*/ F axis stop code.
970 Public axis_f_reference_position As SL '/*266-269*/ F axis reference position.
971 Public axis_f_motor_position As SL '/*270-273*/ F axis motor position.
972 Public axis_f_position_error As SL '/*274-277*/ F axis position error.
973 Public axis_f_aux_position As SL '/*278-281*/ F axis auxiliary position.
974 Public axis_f_velocity As SL '/*282-285*/ F axis velocity.
975 Public axis_f_torque As SL '/*286-289*/ F axis torque.
976 Public axis_f_analog_in As UW '/*290-291*/ F axis analog input.
977 Public axis_f_halls As UB '/*292*/ F Hall Input Status.
978 Public axis_f_reserved As UB '/*293*/ Reserved.
979 Public axis_f_variable As SL '/*294-297*/ F User-defined variable (ZA).
980
981 Public axis_g_status As UW '/*298-299*/ G axis status.
982 Public axis_g_switches As UB '/*300*/ G axis switches.
983 Public axis_g_stop_code As UB '/*301*/ G axis stop code.
984 Public axis_g_reference_position As SL '/*302-305*/ G axis reference position.
985 Public axis_g_motor_position As SL '/*306-309*/ G axis motor position.
986 Public axis_g_position_error As SL '/*310-313*/ G axis position error.
987 Public axis_g_aux_position As SL '/*314-317*/ G axis auxiliary position.
988 Public axis_g_velocity As SL '/*318-321*/ G axis velocity.
989 Public axis_g_torque As SL '/*322-325*/ G axis torque.
990 Public axis_g_analog_in As UW '/*326-327*/ G axis analog input.
991 Public axis_g_halls As UB '/*328*/ G Hall Input Status.
992 Public axis_g_reserved As UB '/*329*/ Reserved.
993 Public axis_g_variable As SL '/*330-333*/ G User-defined variable (ZA).
994
995 Public axis_h_status As UW '/*334-335*/ H axis status.
996 Public axis_h_switches As UB '/*336*/ H axis switches.
997 Public axis_h_stop_code As UB '/*337*/ H axis stop code.
998 Public axis_h_reference_position As SL '/*338-341*/ H axis reference position.
999 Public axis_h_motor_position As SL '/*342-345*/ H axis motor position.
1000 Public axis_h_position_error As SL '/*346-349*/ H axis position error.
1001 Public axis_h_aux_position As SL '/*350-353*/ H axis auxiliary position.
1002 Public axis_h_velocity As SL '/*354-357*/ H axis velocity.
1003 Public axis_h_torque As SL '/*358-361*/ H axis torque.
1004 Public axis_h_analog_in As UW '/*362-363*/ H axis analog input.
1005 Public axis_h_halls As UB '/*364*/ H Hall Input Status.
1006 Public axis_h_reserved As UB '/*365*/ Reserved.
1007 Public axis_h_variable As SL '/*366-369*/ H User-defined variable (ZA).
1008
1009 Public Function byte_array() As Byte() Implements GDataRecord.byte_array
1010 Return StructToByteArray(Me)
1011 End Function
1012 End Structure
1013
1014 ' Data record struct for DMC-52000 controller. Same as DMC-4000, with bank indicator added at byte 40.
1015 <StructLayout(LayoutKind.Sequential, Pack:=1)>
1016 Public Structure GDataRecord52000
1017 Implements GDataRecord
1018
1019 Public header_0 As UB '/*00*/ 1st Byte of Header.
1020 Public header_1 As UB '/*01*/ 2nd Byte of Header.
1021 Public header_2 As UB '/*02*/ 3rd Byte of Header.
1022 Public header_3 As UB '/*03*/ 4th Byte of Header.
1023
1024 Public sample_number As UW '/*04-05*/ sample number.
1025
1026 Public input_bank_0 As UB '/*06*/ general input bank 0 (inputs 1-8).
1027 Public input_bank_1 As UB '/*07*/ general input bank 1 (inputs 9-16).
1028 Public input_bank_2 As UB '/*08*/ general input bank 2 (inputs 17-24).
1029 Public input_bank_3 As UB '/*09*/ general input bank 3 (inputs 25-32).
1030 Public input_bank_4 As UB '/*10*/ general input bank 4 (inputs 33-40).
1031 Public input_bank_5 As UB '/*11*/ general input bank 5 (inputs 41-48).
1032 Public input_bank_6 As UB '/*12*/ general input bank 6 (inputs 49-56).
1033 Public input_bank_7 As UB '/*13*/ general input bank 7 (inputs 57-64).
1034 Public input_bank_8 As UB '/*14*/ general input bank 8 (inputs 65-72).
1035 Public input_bank_9 As UB '/*15*/ general input bank 9 (inputs 73-80).
1036
1037 Public output_bank_0 As UB '/*16*/ general output bank 0 (outputs 1-8).
1038 Public output_bank_1 As UB '/*17*/ general output bank 1 (outputs 9-16).
1039 Public output_bank_2 As UB '/*18*/ general output bank 2 (outputs 17-24).
1040 Public output_bank_3 As UB '/*19*/ general output bank 3 (outputs 25-32).
1041 Public output_bank_4 As UB '/*20*/ general output bank 4 (outputs 33-40).
1042 Public output_bank_5 As UB '/*21*/ general output bank 5 (outputs 41-48).
1043 Public output_bank_6 As UB '/*22*/ general output bank 6 (outputs 49-56).
1044 Public output_bank_7 As UB '/*23*/ general output bank 7 (outputs 57-64).
1045 Public output_bank_8 As UB '/*24*/ general output bank 8 (outputs 65-72).
1046 Public output_bank_9 As UB '/*25*/ general output bank 9 (outputs 73-80).
1047
1048 Public reserved_0 As SW '/*26-27*/ Reserved.
1049 Public reserved_2 As SW '/*28-29*/ Reserved.
1050 Public reserved_4 As SW '/*30-31*/ Reserved.
1051 Public reserved_6 As SW '/*32-33*/ Reserved.
1052 Public reserved_8 As SW '/*34-35*/ Reserved.
1053 Public reserved_10 As SW '/*36-37*/ Reserved.
1054 Public reserved_12 As SW '/*38-39*/ Reserved.
1055 Public ethercat_bank As UB '/*40*/ EtherCAT Bank Indicator.
1056 Public reserved_14 As UB '/*41*/ Reserved.
1057
1058 Public ethernet_status_a As UB '/*42*/ Ethernet Handle A Status.
1059 Public ethernet_status_b As UB '/*43*/ Ethernet Handle B Status.
1060 Public ethernet_status_c As UB '/*44*/ Ethernet Handle C Status.
1061 Public ethernet_status_d As UB '/*45*/ Ethernet Handle D Status.
1062 Public ethernet_status_e As UB '/*46*/ Ethernet Handle E Status.
1063 Public ethernet_status_f As UB '/*47*/ Ethernet Handle F Status.
1064 Public ethernet_status_g As UB '/*48*/ Ethernet Handle G Status.
1065 Public ethernet_status_h As UB '/*49*/ Ethernet Handle H Status.
1066
1067 Public error_code As UB '/*50*/ error code.
1068 Public thread_status As UB '/*51*/ thread status
1069 Public amplifier_status As UL '/*52-55*/ Amplifier Status.
1070
1071 Public contour_segment_count As UL '/*56-59*/ Segment Count for Contour Mode.
1072 Public contour_buffer_available As UW '/*60-61*/ Buffer space remaining, Contour Mode.
1073
1074 Public s_plane_segment_count As UW '/*62-63*/ segment count of coordinated move for S plane.
1075 Public s_plane_move_status As UW '/*64-65*/ coordinated move status for S plane.
1076 Public s_distance As SL '/*66-69*/ distance traveled in coordinated move for S plane.
1077 Public s_plane_buffer_available As UW '/*70-71*/ Buffer space remaining, S Plane.
1078
1079 Public t_plane_segment_count As UW '/*72-73*/ segment count of coordinated move for T plane.
1080 Public t_plane_move_status As UW '/*74-75*/ Coordinated move status for T plane.
1081 Public t_distance As SL '/*76-79*/ distance traveled in coordinated move for T plane.
1082 Public t_plane_buffer_available As UW '/*80-81*/ Buffer space remaining, T Plane.
1083
1084 Public axis_a_status As UW '/*82-83*/ A axis status.
1085 Public axis_a_switches As UB '/*84*/ A axis switches.
1086 Public axis_a_stop_code As UB '/*85*/ A axis stop code.
1087 Public axis_a_reference_position As SL '/*86-89*/ A axis reference position.
1088 Public axis_a_motor_position As SL '/*90-93*/ A axis motor position.
1089 Public axis_a_position_error As SL '/*94-97*/ A axis position error.
1090 Public axis_a_aux_position As SL '/*98-101*/ A axis auxiliary position.
1091 Public axis_a_velocity As SL '/*102-105*/ A axis velocity.
1092 Public axis_a_torque As SL '/*106-109*/ A axis torque.
1093 Public axis_a_analog_in As UW '/*110-111*/ A axis analog input.
1094 Public axis_a_halls As UB '/*112*/ A Hall Input Status.
1095 Public axis_a_reserved As UB '/*113*/ Reserved.
1096 Public axis_a_variable As SL '/*114-117*/ A User-defined variable (ZA).
1097
1098 Public axis_b_status As UW '/*118-119*/ B axis status.
1099 Public axis_b_switches As UB '/*120*/ B axis switches.
1100 Public axis_b_stop_code As UB '/*121*/ B axis stop code.
1101 Public axis_b_reference_position As SL '/*122-125*/ B axis reference position.
1102 Public axis_b_motor_position As SL '/*126-129*/ B axis motor position.
1103 Public axis_b_position_error As SL '/*130-133*/ B axis position error.
1104 Public axis_b_aux_position As SL '/*134-137*/ B axis auxiliary position.
1105 Public axis_b_velocity As SL '/*138-141*/ B axis velocity.
1106 Public axis_b_torque As SL '/*142-145*/ B axis torque.
1107 Public axis_b_analog_in As UW '/*146-147*/ B axis analog input.
1108 Public axis_b_halls As UB '/*148*/ B Hall Input Status.
1109 Public axis_b_reserved As UB '/*149*/ Reserved.
1110 Public axis_b_variable As SL '/*150-153*/ B User-defined variable (ZA).
1111
1112 Public axis_c_status As UW '/*154-155*/ C axis status.
1113 Public axis_c_switches As UB '/*156*/ C axis switches.
1114 Public axis_c_stop_code As UB '/*157*/ C axis stop code.
1115 Public axis_c_reference_position As SL '/*158-161*/ C axis reference position.
1116 Public axis_c_motor_position As SL '/*162-165*/ C axis motor position.
1117 Public axis_c_position_error As SL '/*166-169*/ C axis position error.
1118 Public axis_c_aux_position As SL '/*170-173*/ C axis auxiliary position.
1119 Public axis_c_velocity As SL '/*174-177*/ C axis velocity.
1120 Public axis_c_torque As SL '/*178-181*/ C axis torque.
1121 Public axis_c_analog_in As UW '/*182-183*/ C axis analog input.
1122 Public axis_c_halls As UB '/*184*/ C Hall Input Status.
1123 Public axis_c_reserved As UB '/*185*/ Reserved.
1124 Public axis_c_variable As SL '/*186-189*/ C User-defined variable (ZA).
1125
1126 Public axis_d_status As UW '/*190-191*/ D axis status.
1127 Public axis_d_switches As UB '/*192*/ D axis switches.
1128 Public axis_d_stop_code As UB '/*193*/ D axis stop code.
1129 Public axis_d_reference_position As SL '/*194-197*/ D axis reference position.
1130 Public axis_d_motor_position As SL '/*198-201*/ D axis motor position.
1131 Public axis_d_position_error As SL '/*202-205*/ D axis position error.
1132 Public axis_d_aux_position As SL '/*206-209*/ D axis auxiliary position.
1133 Public axis_d_velocity As SL '/*210-213*/ D axis velocity.
1134 Public axis_d_torque As SL '/*214-217*/ D axis torque.
1135 Public axis_d_analog_in As UW '/*218-219*/ D axis analog input.
1136 Public axis_d_halls As UB '/*220*/ D Hall Input Status.
1137 Public axis_d_reserved As UB '/*221*/ Reserved.
1138 Public axis_d_variable As SL '/*222-225*/ D User-defined variable (ZA).
1139
1140 Public axis_e_status As UW '/*226-227*/ E axis status.
1141 Public axis_e_switches As UB '/*228*/ E axis switches.
1142 Public axis_e_stop_code As UB '/*229*/ E axis stop code.
1143 Public axis_e_reference_position As SL '/*230-233*/ E axis reference position.
1144 Public axis_e_motor_position As SL '/*234-237*/ E axis motor position.
1145 Public axis_e_position_error As SL '/*238-241*/ E axis position error.
1146 Public axis_e_aux_position As SL '/*242-245*/ E axis auxiliary position.
1147 Public axis_e_velocity As SL '/*246-249*/ E axis velocity.
1148 Public axis_e_torque As SL '/*250-253*/ E axis torque.
1149 Public axis_e_analog_in As UW '/*254-255*/ E axis analog input.
1150 Public axis_e_halls As UB '/*256*/ E Hall Input Status.
1151 Public axis_e_reserved As UB '/*257*/ Reserved.
1152 Public axis_e_variable As SL '/*258-261*/ E User-defined variable (ZA).
1153
1154 Public axis_f_status As UW '/*262-263*/ F axis status.
1155 Public axis_f_switches As UB '/*264*/ F axis switches.
1156 Public axis_f_stop_code As UB '/*265*/ F axis stop code.
1157 Public axis_f_reference_position As SL '/*266-269*/ F axis reference position.
1158 Public axis_f_motor_position As SL '/*270-273*/ F axis motor position.
1159 Public axis_f_position_error As SL '/*274-277*/ F axis position error.
1160 Public axis_f_aux_position As SL '/*278-281*/ F axis auxiliary position.
1161 Public axis_f_velocity As SL '/*282-285*/ F axis velocity.
1162 Public axis_f_torque As SL '/*286-289*/ F axis torque.
1163 Public axis_f_analog_in As UW '/*290-291*/ F axis analog input.
1164 Public axis_f_halls As UB '/*292*/ F Hall Input Status.
1165 Public axis_f_reserved As UB '/*293*/ Reserved.
1166 Public axis_f_variable As SL '/*294-297*/ F User-defined variable (ZA).
1167
1168 Public axis_g_status As UW '/*298-299*/ G axis status.
1169 Public axis_g_switches As UB '/*300*/ G axis switches.
1170 Public axis_g_stop_code As UB '/*301*/ G axis stop code.
1171 Public axis_g_reference_position As SL '/*302-305*/ G axis reference position.
1172 Public axis_g_motor_position As SL '/*306-309*/ G axis motor position.
1173 Public axis_g_position_error As SL '/*310-313*/ G axis position error.
1174 Public axis_g_aux_position As SL '/*314-317*/ G axis auxiliary position.
1175 Public axis_g_velocity As SL '/*318-321*/ G axis velocity.
1176 Public axis_g_torque As SL '/*322-325*/ G axis torque.
1177 Public axis_g_analog_in As UW '/*326-327*/ G axis analog input.
1178 Public axis_g_halls As UB '/*328*/ G Hall Input Status.
1179 Public axis_g_reserved As UB '/*329*/ Reserved.
1180 Public axis_g_variable As SL '/*330-333*/ G User-defined variable (ZA).
1181
1182 Public axis_h_status As UW '/*334-335*/ H axis status.
1183 Public axis_h_switches As UB '/*336*/ H axis switches.
1184 Public axis_h_stop_code As UB '/*337*/ H axis stop code.
1185 Public axis_h_reference_position As SL '/*338-341*/ H axis reference position.
1186 Public axis_h_motor_position As SL '/*342-345*/ H axis motor position.
1187 Public axis_h_position_error As SL '/*346-349*/ H axis position error.
1188 Public axis_h_aux_position As SL '/*350-353*/ H axis auxiliary position.
1189 Public axis_h_velocity As SL '/*354-357*/ H axis velocity.
1190 Public axis_h_torque As SL '/*358-361*/ H axis torque.
1191 Public axis_h_analog_in As UW '/*362-363*/ H axis analog input.
1192 Public axis_h_halls As UB '/*364*/ H Hall Input Status.
1193 Public axis_h_reserved As UB '/*365*/ Reserved.
1194 Public axis_h_variable As SL '/*366-369*/ H User-defined variable (ZA).
1195
1196 Public Function byte_array() As Byte() Implements GDataRecord.byte_array
1197 Return StructToByteArray(Me)
1198 End Function
1199 End Structure
1200
1201
1202 'Data record struct for DMC-1806 controller.
1203 '
1204 'The 18x6 Data record Is the same as 4000 except the following.
1205 '-# No header bytes. Firmware strips it in DR. Software removes it from QR.
1206 '-# No Ethernet status (bytes 42-49).
1207 '-# No amplfifier status (bytes 52-55).
1208 '-# No axis-specific hall input status.
1209 <StructLayout(LayoutKind.Sequential, Pack:=1)>
1210 Public Structure GDataRecord1806
1211 Implements GDataRecord
1212
1213 Public sample_number As UW '/*00-01*/ sample number.
1214
1215 Public input_bank_0 As UB '/*02*/ general input bank 0 (inputs 1-8).
1216 Public input_bank_1 As UB '/*03*/ general input bank 1 (inputs 9-16).
1217 Public input_bank_2 As UB '/*04*/ general input bank 2 (inputs 17-24).
1218 Public input_bank_3 As UB '/*05*/ general input bank 3 (inputs 25-32).
1219 Public input_bank_4 As UB '/*06*/ general input bank 4 (inputs 33-40).
1220 Public input_bank_5 As UB '/*07*/ general input bank 5 (inputs 41-48).
1221 Public input_bank_6 As UB '/*08*/ general input bank 6 (inputs 49-56).
1222 Public input_bank_7 As UB '/*09*/ general input bank 7 (inputs 57-64).
1223 Public input_bank_8 As UB '/*10*/ general input bank 8 (inputs 65-72).
1224 Public input_bank_9 As UB '/*11*/ general input bank 9 (inputs 73-80).
1225
1226 Public output_bank_0 As UB '/*12*/ general output bank 0 (outputs 1-8).
1227 Public output_bank_1 As UB '/*13*/ general output bank 1 (outputs 9-16).
1228 Public output_bank_2 As UB '/*14*/ general output bank 2 (outputs 17-24).
1229 Public output_bank_3 As UB '/*15*/ general output bank 3 (outputs 25-32).
1230 Public output_bank_4 As UB '/*16*/ general output bank 4 (outputs 33-40).
1231 Public output_bank_5 As UB '/*17*/ general output bank 5 (outputs 41-48).
1232 Public output_bank_6 As UB '/*18*/ general output bank 6 (outputs 49-56).
1233 Public output_bank_7 As UB '/*19*/ general output bank 7 (outputs 57-64).
1234 Public output_bank_8 As UB '/*20*/ general output bank 8 (outputs 65-72).
1235 Public output_bank_9 As UB '/*21*/ general output bank 9 (outputs 73-80).
1236
1237 Public reserved_0 As SW '/*22-23*/ Reserved.
1238 Public reserved_2 As SW '/*24-25*/ Reserved.
1239 Public reserved_4 As SW '/*26-27*/ Reserved.
1240 Public reserved_6 As SW '/*28-29*/ Reserved.
1241 Public reserved_8 As SW '/*30-31*/ Reserved.
1242 Public reserved_10 As SW '/*32-33*/ Reserved.
1243 Public reserved_12 As SW '/*34-35*/ Reserved.
1244 Public reserved_14 As SW '/*36-37*/ Reserved.
1245
1246 Public reserved_16 As UB '/*38*/ Reserved.
1247 Public reserved_17 As UB '/*39*/ Reserved.
1248 Public reserved_18 As UB '/*40*/ Reserved.
1249 Public reserved_19 As UB '/*41*/ Reserved.
1250 Public reserved_20 As UB '/*42*/ Reserved.
1251 Public reserved_21 As UB '/*43*/ Reserved.
1252 Public reserved_22 As UB '/*44*/ Reserved.
1253 Public reserved_23 As UB '/*45*/ Reserved.
1254
1255 Public error_code As UB '/*46*/ error code.
1256 Public thread_status As UB '/*47*/ thread status.
1257 Public reserved_24 As UL '/*48-51*/ Reserved.
1258
1259 Public contour_segment_count As UL '/*52-55*/ Segment Count for Contour Mode.
1260 Public contour_buffer_available As UW '/*56-57*/ Buffer space remaining, Contour Mode.
1261
1262 Public s_plane_segment_count As UW '/*58-59*/ segment count of coordinated move for S plane.
1263 Public s_plane_move_status As UW '/*60-61*/ coordinated move status for S plane.
1264 Public s_distance As SL '/*62-65*/ distance traveled in coordinated move for S plane.
1265 Public s_plane_buffer_available As UW '/*66-67*/ Buffer space remaining, S Plane.
1266
1267 Public t_plane_segment_count As UW '/*68-69*/ segment count of coordinated move for T plane.
1268 Public t_plane_move_status As UW '/*70-71*/ Coordinated move status for T plane.
1269 Public t_distance As SL '/*72-75*/ distance traveled in coordinated move for T plane.
1270 Public t_plane_buffer_available As UW '/*76-77*/ Buffer space remaining, T Plane.
1271
1272 Public axis_a_status As UW '/*78-79*/ A axis status.
1273 Public axis_a_switches As UB '/*80*/ A axis switches.
1274 Public axis_a_stop_code As UB '/*81*/ A axis stop code.
1275 Public axis_a_reference_position As SL '/*82-85*/ A axis reference position.
1276 Public axis_a_motor_position As SL '/*86-89*/ A axis motor position.
1277 Public axis_a_position_error As SL '/*90-93*/ A axis position error.
1278 Public axis_a_aux_position As SL '/*94-97*/ A axis auxiliary position.
1279 Public axis_a_velocity As SL '/*98-101*/ A axis velocity.
1280 Public axis_a_torque As SL '/*102-105*/ A axis torque.
1281 Public axis_a_analog_in As UW '/*106-107*/ A axis analog input.
1282 Public axis_a_reserved_0 As UB '/*108*/ Reserved.
1283 Public axis_a_reserved_1 As UB '/*109*/ Reserved.
1284 Public axis_a_variable As SL '/*110-113*/ A User-defined variable (ZA).
1285
1286 Public axis_b_status As UW '/*114-115*/ B axis status.
1287 Public axis_b_switches As UB '/*116*/ B axis switches.
1288 Public axis_b_stop_code As UB '/*117*/ B axis stop code.
1289 Public axis_b_reference_position As SL '/*118-121*/ B axis reference position.
1290 Public axis_b_motor_position As SL '/*122-125*/ B axis motor position.
1291 Public axis_b_position_error As SL '/*126-129*/ B axis position error.
1292 Public axis_b_aux_position As SL '/*130-133*/ B axis auxiliary position.
1293 Public axis_b_velocity As SL '/*134-137*/ B axis velocity.
1294 Public axis_b_torque As SL '/*138-141*/ B axis torque.
1295 Public axis_b_analog_in As UW '/*142-143*/ B axis analog input.
1296 Public axis_b_reserved_0 As UB '/*144*/ Reserved.
1297 Public axis_b_reserved_1 As UB '/*145*/ Reserved.
1298 Public axis_b_variable As SL '/*146-149*/ B User-defined variable (ZA).
1299
1300 Public axis_c_status As UW '/*150-151*/ C axis status.
1301 Public axis_c_switches As UB '/*152*/ C axis switches.
1302 Public axis_c_stop_code As UB '/*153*/ C axis stop code.
1303 Public axis_c_reference_position As SL '/*154-157*/ C axis reference position.
1304 Public axis_c_motor_position As SL '/*158-161*/ C axis motor position.
1305 Public axis_c_position_error As SL '/*162-165*/ C axis position error.
1306 Public axis_c_aux_position As SL '/*166-169*/ C axis auxiliary position.
1307 Public axis_c_velocity As SL '/*170-173*/ C axis velocity.
1308 Public axis_c_torque As SL '/*174-177*/ C axis torque.
1309 Public axis_c_analog_in As UW '/*178-179*/ C axis analog input.
1310 Public axis_c_reserved_0 As UB '/*180*/ Reserved.
1311 Public axis_c_reserved_1 As UB '/*181*/ Reserved.
1312 Public axis_c_variable As SL '/*182-185*/ C User-defined variable (ZA).
1313
1314 Public axis_d_status As UW '/*186-187*/ D axis status.
1315 Public axis_d_switches As UB '/*188*/ D axis switches.
1316 Public axis_d_stop_code As UB '/*189*/ D axis stop code.
1317 Public axis_d_reference_position As SL '/*190-193*/ D axis reference position.
1318 Public axis_d_motor_position As SL '/*194-197*/ D axis motor position.
1319 Public axis_d_position_error As SL '/*198-201*/ D axis position error.
1320 Public axis_d_aux_position As SL '/*202-205*/ D axis auxiliary position.
1321 Public axis_d_velocity As SL '/*206-209*/ D axis velocity.
1322 Public axis_d_torque As SL '/*210-213*/ D axis torque.
1323 Public axis_d_analog_in As UW '/*214-215*/ D axis analog input.
1324 Public axis_d_reserved_0 As UB '/*216*/ Reserved.
1325 Public axis_d_reserved_1 As UB '/*217*/ Reserved.
1326 Public axis_d_variable As SL '/*218-221*/ D User-defined variable (ZA).
1327
1328 Public axis_e_status As UW '/*222-223*/ E axis status.
1329 Public axis_e_switches As UB '/*224*/ E axis switches.
1330 Public axis_e_stop_code As UB '/*225*/ E axis stop code.
1331 Public axis_e_reference_position As SL '/*226-229*/ E axis reference position.
1332 Public axis_e_motor_position As SL '/*230-233*/ E axis motor position.
1333 Public axis_e_position_error As SL '/*234-237*/ E axis position error.
1334 Public axis_e_aux_position As SL '/*238-241*/ E axis auxiliary position.
1335 Public axis_e_velocity As SL '/*242-245*/ E axis velocity.
1336 Public axis_e_torque As SL '/*256-249*/ E axis torque.
1337 Public axis_e_analog_in As UW '/*250-251*/ E axis analog input.
1338 Public axis_e_reserved_0 As UB '/*252*/ Reserved.
1339 Public axis_e_reserved_1 As UB '/*253*/ Reserved.
1340 Public axis_e_variable As SL '/*254-257*/ E User-defined variable (ZA).
1341
1342 Public axis_f_status As UW '/*258-259*/ F axis status.
1343 Public axis_f_switches As UB '/*260*/ F axis switches.
1344 Public axis_f_stop_code As UB '/*261*/ F axis stop code.
1345 Public axis_f_reference_position As SL '/*262-265*/ F axis reference position.
1346 Public axis_f_motor_position As SL '/*266-269*/ F axis motor position.
1347 Public axis_f_position_error As SL '/*270-273*/ F axis position error.
1348 Public axis_f_aux_position As SL '/*274-277*/ F axis auxiliary position.
1349 Public axis_f_velocity As SL '/*278-281*/ F axis velocity.
1350 Public axis_f_torque As SL '/*282-285*/ F axis torque.
1351 Public axis_f_analog_in As UW '/*286-287*/ F axis analog input.
1352 Public axis_f_reserved_0 As UB '/*288*/ Reserved.
1353 Public axis_f_reserved_1 As UB '/*289*/ Reserved.
1354 Public axis_f_variable As SL '/*290-293*/ F User-defined variable (ZA).
1355
1356 Public axis_g_status As UW '/*294-295*/ G axis status.
1357 Public axis_g_switches As UB '/*296*/ G axis switches.
1358 Public axis_g_stop_code As UB '/*297*/ G axis stop code.
1359 Public axis_g_reference_position As SL '/*298-301*/ G axis reference position.
1360 Public axis_g_motor_position As SL '/*302-305*/ G axis motor position.
1361 Public axis_g_position_error As SL '/*306-309*/ G axis position error.
1362 Public axis_g_aux_position As SL '/*310-313*/ G axis auxiliary position.
1363 Public axis_g_velocity As SL '/*314-317*/ G axis velocity.
1364 Public axis_g_torque As SL '/*318-321*/ G axis torque.
1365 Public axis_g_analog_in As UW '/*322-323*/ G axis analog input.
1366 Public axis_g_reserved_0 As UB '/*324*/ Reserved.
1367 Public axis_g_reserved_1 As UB '/*325*/ Reserved.
1368 Public axis_g_variable As SL '/*326-329*/ G User-defined variable (ZA).
1369
1370 Public axis_h_status As UW '/*330-331*/ H axis status.
1371 Public axis_h_switches As UB '/*332*/ H axis switches.
1372 Public axis_h_stop_code As UB '/*333*/ H axis stop code.
1373 Public axis_h_reference_position As SL '/*334-337*/ H axis reference position.
1374 Public axis_h_motor_position As SL '/*338-341*/ H axis motor position.
1375 Public axis_h_position_error As SL '/*342-345*/ H axis position error.
1376 Public axis_h_aux_position As SL '/*346-349*/ H axis auxiliary position.
1377 Public axis_h_velocity As SL '/*350-353*/ H axis velocity.
1378 Public axis_h_torque As SL '/*354-357*/ H axis torque.
1379 Public axis_h_analog_in As UW '/*358-359*/ H axis analog input.
1380 Public axis_h_reserved_0 As UB '/*360*/ Reserved.
1381 Public axis_h_reserved_1 As UB '/*361*/ Reserved.
1382 Public axis_h_variable As SL '/*362-365*/ H User-defined variable (ZA).
1383
1384 Public Function byte_array() As Byte() Implements GDataRecord.byte_array
1385 Return StructToByteArray(Me)
1386 End Function
1387 End Structure
1388
1389 ' Data record struct for DMC-2103 controllers.
1390 <StructLayout(LayoutKind.Sequential, Pack:=1)>
1391 Public Structure GDataRecord2103
1392 Implements GDataRecord
1393
1394 Public header_0 As UB '/*00*/ 1st Byte of Header.
1395 Public header_1 As UB '/*01*/ 2nd Byte of Header.
1396 Public header_2 As UB '/*02*/ 3rd Byte of Header.
1397 Public header_3 As UB '/*03*/ 4th Byte of Header.
1398
1399 Public sample_number As UW '/*04-05*/ sample number.
1400
1401 Public input_bank_0 As UB '/*06*/ general input bank 0 (inputs 1-8).
1402 Public input_bank_1 As UB '/*07*/ general input bank 1 (inputs 9-16).
1403 Public input_bank_2 As UB '/*08*/ general input bank 2 (inputs 17-24).
1404 Public input_bank_3 As UB '/*09*/ general input bank 3 (inputs 25-32).
1405 Public input_bank_4 As UB '/*10*/ general input bank 4 (inputs 33-40).
1406 Public input_bank_5 As UB '/*11*/ general input bank 5 (inputs 41-48).
1407 Public input_bank_6 As UB '/*12*/ general input bank 6 (inputs 49-56).
1408 Public input_bank_7 As UB '/*13*/ general input bank 7 (inputs 57-64).
1409 Public input_bank_8 As UB '/*14*/ general input bank 8 (inputs 65-72).
1410 Public input_bank_9 As UB '/*15*/ general input bank 9 (inputs 73-80).
1411
1412 Public output_bank_0 As UB '/*16*/ general output bank 0 (outputs 1-8).
1413 Public output_bank_1 As UB '/*17*/ general output bank 1 (outputs 9-16).
1414 Public output_bank_2 As UB '/*18*/ general output bank 2 (outputs 17-24).
1415 Public output_bank_3 As UB '/*19*/ general output bank 3 (outputs 25-32).
1416 Public output_bank_4 As UB '/*20*/ general output bank 4 (outputs 33-40).
1417 Public output_bank_5 As UB '/*21*/ general output bank 5 (outputs 41-48).
1418 Public output_bank_6 As UB '/*22*/ general output bank 6 (outputs 49-56).
1419 Public output_bank_7 As UB '/*23*/ general output bank 7 (outputs 57-64).
1420 Public output_bank_8 As UB '/*24*/ general output bank 8 (outputs 65-72).
1421 Public output_bank_9 As UB '/*25*/ general output bank 9 (outputs 73-80).
1422
1423 Public error_code As UB '/*26*/ error code.
1424 Public general_status As UB '/*27*/ general status
1425
1426 Public s_plane_segment_count As UW '/*28-29*/ segment count of coordinated move for S plane.
1427 Public s_plane_move_status As UW '/*30-31*/ coordinated move status for S plane.
1428 Public s_distance As SL '/*32-35*/ distance traveled in coordinated move for S plane.
1429
1430 Public t_plane_segment_count As UW '/*36-37*/ segment count of coordinated move for T plane.
1431 Public t_plane_move_status As UW '/*38-39*/ Coordinated move status for T plane.
1432 Public t_distance As SL '/*40-43*/ distance traveled in coordinated move for T plane.
1433
1434 Public axis_a_status As UW '/*44-45*/ A axis status.
1435 Public axis_a_switches As UB '/*46*/ A axis switches.
1436 Public axis_a_stop_code As UB '/*47*/ A axis stop code.
1437 Public axis_a_reference_position As SL '/*48-51*/ A axis reference position.
1438 Public axis_a_motor_position As SL '/*52-55*/ A axis motor position.
1439 Public axis_a_position_error As SL '/*56-59*/ A axis position error.
1440 Public axis_a_aux_position As SL '/*60-63*/ A axis auxiliary position.
1441 Public axis_a_velocity As SL '/*64-67*/ A axis velocity.
1442 Public axis_a_torque As SW '/*68-69*/ A axis torque.
1443 Public axis_a_analog_in As UW '/*70-71*/ A axis analog input.
1444
1445 Public axis_b_status As UW '/*72-73*/ B axis status.
1446 Public axis_b_switches As UB '/*74*/ B axis switches.
1447 Public axis_b_stop_code As UB '/*75*/ B axis stop code.
1448 Public axis_b_reference_position As SL '/*76-79*/ B axis reference position.
1449 Public axis_b_motor_position As SL '/*80-83*/ B axis motor position.
1450 Public axis_b_position_error As SL '/*84-87*/ B axis position error.
1451 Public axis_b_aux_position As SL '/*88-91*/ B axis auxiliary position.
1452 Public axis_b_velocity As SL '/*92-95*/ B axis velocity.
1453 Public axis_b_torque As SW '/*96-97*/ B axis torque.
1454 Public axis_b_analog_in As UW '/*98-99*/ B axis analog input.
1455
1456 Public axis_c_status As UW '/*100-101*/ C axis status.
1457 Public axis_c_switches As UB '/*102*/ C axis switches.
1458 Public axis_c_stop_code As UB '/*103*/ C axis stop code.
1459 Public axis_c_reference_position As SL '/*104-107*/ C axis reference position.
1460 Public axis_c_motor_position As SL '/*108-111*/ C axis motor position.
1461 Public axis_c_position_error As SL '/*112-115*/ C axis position error.
1462 Public axis_c_aux_position As SL '/*116-119*/ C axis auxiliary position.
1463 Public axis_c_velocity As SL '/*120-123*/ C axis velocity.
1464 Public axis_c_torque As SW '/*124-125*/ C axis torque.
1465 Public axis_c_analog_in As UW '/*126-127*/ C axis analog input.
1466
1467 Public axis_d_status As UW '/*128-129*/ D axis status.
1468 Public axis_d_switches As UB '/*130*/ D axis switches.
1469 Public axis_d_stop_code As UB '/*131*/ D axis stop code.
1470 Public axis_d_reference_position As SL '/*132-135*/ D axis reference position.
1471 Public axis_d_motor_position As SL '/*136-139*/ D axis motor position.
1472 Public axis_d_position_error As SL '/*140-143*/ D axis position error.
1473 Public axis_d_aux_position As SL '/*144-147*/ D axis auxiliary position.
1474 Public axis_d_velocity As SL '/*148-151*/ D axis velocity.
1475 Public axis_d_torque As SW '/*152-153*/ D axis torque.
1476 Public axis_d_analog_in As UW '/*154-155*/ D axis analog input.
1477
1478 Public axis_e_status As UW '/*156-157*/ E axis status.
1479 Public axis_e_switches As UB '/*158*/ E axis switches.
1480 Public axis_e_stop_code As UB '/*159*/ E axis stop code.
1481 Public axis_e_reference_position As SL '/*160-163*/ E axis reference position.
1482 Public axis_e_motor_position As SL '/*164-167*/ E axis motor position.
1483 Public axis_e_position_error As SL '/*168-171*/ E axis position error.
1484 Public axis_e_aux_position As SL '/*172-175*/ E axis auxiliary position.
1485 Public axis_e_velocity As SL '/*176-179*/ E axis velocity.
1486 Public axis_e_torque As SW '/*180-181*/ E axis torque.
1487 Public axis_e_analog_in As UW '/*182-183*/ E axis analog input.
1488
1489 Public axis_f_status As UW '/*184-185*/ F axis status.
1490 Public axis_f_switches As UB '/*186*/ F axis switches.
1491 Public axis_f_stop_code As UB '/*187*/ F axis stop code.
1492 Public axis_f_reference_position As SL '/*188-191*/ F axis reference position.
1493 Public axis_f_motor_position As SL '/*192-195*/ F axis motor position.
1494 Public axis_f_position_error As SL '/*196-199*/ F axis position error.
1495 Public axis_f_aux_position As SL '/*200-203*/ F axis auxiliary position.
1496 Public axis_f_velocity As SL '/*204-207*/ F axis velocity.
1497 Public axis_f_torque As SW '/*208-209*/ F axis torque.
1498 Public axis_f_analog_in As UW '/*210-211*/ F axis analog input.
1499
1500 Public axis_g_status As UW '/*212-213*/ G axis status.
1501 Public axis_g_switches As UB '/*214*/ G axis switches.
1502 Public axis_g_stop_code As UB '/*215*/ G axis stop code.
1503 Public axis_g_reference_position As SL '/*216-219*/ G axis reference position.
1504 Public axis_g_motor_position As SL '/*220-223*/ G axis motor position.
1505 Public axis_g_position_error As SL '/*224-227*/ G axis position error.
1506 Public axis_g_aux_position As SL '/*228-231*/ G axis auxiliary position.
1507 Public axis_g_velocity As SL '/*232-235*/ G axis velocity.
1508 Public axis_g_torque As SW '/*236-237*/ G axis torque.
1509 Public axis_g_analog_in As UW '/*238-239*/ G axis analog input.
1510
1511 Public axis_h_status As UW '/*240-241*/ H axis status.
1512 Public axis_h_switches As UB '/*242*/ H axis switches.
1513 Public axis_h_stop_code As UB '/*243*/ H axis stop code.
1514 Public axis_h_reference_position As SL '/*244-247*/ H axis reference position.
1515 Public axis_h_motor_position As SL '/*248-251*/ H axis motor position.
1516 Public axis_h_position_error As SL '/*252-255*/ H axis position error.
1517 Public axis_h_aux_position As SL '/*256-259*/ H axis auxiliary position.
1518 Public axis_h_velocity As SL '/*260-263*/ H axis velocity.
1519 Public axis_h_torque As SW '/*264-265*/ H axis torque.
1520 Public axis_h_analog_in As UW '/*266-267*/ H axis analog input.
1521
1522 Public Function byte_array() As Byte() Implements GDataRecord.byte_array
1523 Return StructToByteArray(Me)
1524 End Function
1525 End Structure
1526
1527 ' Data record struct for DMC-1802 controllers.
1528 '
1529 'The 18x2 Data record Is the Same as 2103 except the following.
1530 '-# No header bytes. Software removes it from QR.
1531 '-# No analog in axis data.
1532 <StructLayout(LayoutKind.Sequential, Pack:=1)>
1533 Public Structure GDataRecord1802
1534 Implements GDataRecord
1535
1536 Public sample_number As UW '/*00-01*/ sample number.
1537
1538 Public input_bank_0 As UB '/*02*/ general input bank 0 (inputs 1-8).
1539 Public input_bank_1 As UB '/*03*/ general input bank 1 (inputs 9-16).
1540 Public input_bank_2 As UB '/*04*/ general input bank 2 (inputs 17-24).
1541 Public input_bank_3 As UB '/*05*/ general input bank 3 (inputs 25-32).
1542 Public input_bank_4 As UB '/*06*/ general input bank 4 (inputs 33-40).
1543 Public input_bank_5 As UB '/*07*/ general input bank 5 (inputs 41-48).
1544 Public input_bank_6 As UB '/*08*/ general input bank 6 (inputs 49-56).
1545 Public input_bank_7 As UB '/*09*/ general input bank 7 (inputs 57-64).
1546 Public input_bank_8 As UB '/*10*/ general input bank 8 (inputs 65-72).
1547 Public input_bank_9 As UB '/*11*/ general input bank 9 (inputs 73-80).
1548
1549 Public output_bank_0 As UB '/*12*/ general output bank 0 (outputs 1-8).
1550 Public output_bank_1 As UB '/*13*/ general output bank 1 (outputs 9-16).
1551 Public output_bank_2 As UB '/*14*/ general output bank 2 (outputs 17-24).
1552 Public output_bank_3 As UB '/*15*/ general output bank 3 (outputs 25-32).
1553 Public output_bank_4 As UB '/*16*/ general output bank 4 (outputs 33-40).
1554 Public output_bank_5 As UB '/*17*/ general output bank 5 (outputs 41-48).
1555 Public output_bank_6 As UB '/*18*/ general output bank 6 (outputs 49-56).
1556 Public output_bank_7 As UB '/*19*/ general output bank 7 (outputs 57-64).
1557 Public output_bank_8 As UB '/*20*/ general output bank 8 (outputs 65-72).
1558 Public output_bank_9 As UB '/*21*/ general output bank 9 (outputs 73-80).
1559
1560 Public error_code As UB '/*22*/ error code.
1561 Public general_status As UB '/*23*/ general status
1562
1563 Public s_plane_segment_count As UW '/*24-25*/ segment count of coordinated move for S plane.
1564 Public s_plane_move_status As UW '/*26-27*/ coordinated move status for S plane.
1565 Public s_distance As SL '/*28-31*/ distance traveled in coordinated move for S plane.
1566
1567 Public t_plane_segment_count As UW '/*32-33*/ segment count of coordinated move for T plane.
1568 Public t_plane_move_status As UW '/*34-35*/ Coordinated move status for T plane.
1569 Public t_distance As SL '/*36-39*/ distance traveled in coordinated move for T plane.
1570
1571 Public axis_a_status As UW '/*40-41*/ A axis status.
1572 Public axis_a_switches As UB '/*42*/ A axis switches.
1573 Public axis_a_stop_code As UB '/*43*/ A axis stop code.
1574 Public axis_a_reference_position As SL '/*44-47*/ A axis reference position.
1575 Public axis_a_motor_position As SL '/*48-51*/ A axis motor position.
1576 Public axis_a_position_error As SL '/*52-55*/ A axis position error.
1577 Public axis_a_aux_position As SL '/*56-59*/ A axis auxiliary position.
1578 Public axis_a_velocity As SL '/*60-63*/ A axis velocity.
1579 Public axis_a_torque As SW '/*64-65*/ A axis torque.
1580 Public axis_a_reserved_0 As UB '/*66*/ Reserved.
1581 Public axis_a_reserved_1 As UB '/*67*/ Reserved.
1582
1583 Public axis_b_status As UW '/*68-69*/ B axis status.
1584 Public axis_b_switches As UB '/*70*/ B axis switches.
1585 Public axis_b_stop_code As UB '/*71*/ B axis stop code.
1586 Public axis_b_reference_position As SL '/*72-75*/ B axis reference position.
1587 Public axis_b_motor_position As SL '/*76-79*/ B axis motor position.
1588 Public axis_b_position_error As SL '/*80-83*/ B axis position error.
1589 Public axis_b_aux_position As SL '/*84-87*/ B axis auxiliary position.
1590 Public axis_b_velocity As SL '/*88-91*/ B axis velocity.
1591 Public axis_b_torque As SW '/*92-93*/ B axis torque.
1592 Public axis_b_reserved_0 As UB '/*94*/ Reserved.
1593 Public axis_b_reserved_1 As UB '/*95*/ Reserved.
1594
1595 Public axis_c_status As UW '/*96-97*/ C axis status.
1596 Public axis_c_switches As UB '/*98*/ C axis switches.
1597 Public axis_c_stop_code As UB '/*99*/ C axis stop code.
1598 Public axis_c_reference_position As SL '/*100-103*/ C axis reference position.
1599 Public axis_c_motor_position As SL '/*104-107*/ C axis motor position.
1600 Public axis_c_position_error As SL '/*108-111*/ C axis position error.
1601 Public axis_c_aux_position As SL '/*112-115*/ C axis auxiliary position.
1602 Public axis_c_velocity As SL '/*116-119*/ C axis velocity.
1603 Public axis_c_torque As SW '/*120-121*/ C axis torque.
1604 Public axis_c_reserved_0 As UB '/*122*/ Reserved.
1605 Public axis_c_reserved_1 As UB '/*123*/ Reserved.
1606
1607 Public axis_d_status As UW '/*124-125*/ D axis status.
1608 Public axis_d_switches As UB '/*126*/ D axis switches.
1609 Public axis_d_stop_code As UB '/*127*/ D axis stop code.
1610 Public axis_d_reference_position As SL '/*128-131*/ D axis reference position.
1611 Public axis_d_motor_position As SL '/*132-135*/ D axis motor position.
1612 Public axis_d_position_error As SL '/*136-139*/ D axis position error.
1613 Public axis_d_aux_position As SL '/*140-143*/ D axis auxiliary position.
1614 Public axis_d_velocity As SL '/*144-147*/ D axis velocity.
1615 Public axis_d_torque As SW '/*148-149*/ D axis torque.
1616 Public axis_d_reserved_0 As UB '/*150*/ Reserved.
1617 Public axis_d_reserved_1 As UB '/*151*/ Reserved.
1618
1619 Public Function byte_array() As Byte() Implements GDataRecord.byte_array
1620 Return StructToByteArray(Me)
1621 End Function
1622 End Structure
1623
1624 ' Data record struct for DMC-30010 controllers.
1625 <StructLayout(LayoutKind.Sequential, Pack:=1)>
1626 Public Structure GDataRecord30000
1627 Implements GDataRecord
1628
1629 Public header_0 As UB '/*00*/ 1st Byte of Header.
1630 Public header_1 As UB '/*01*/ 2nd Byte of Header.
1631 Public header_2 As UB '/*02*/ 3rd Byte of Header.
1632 Public header_3 As UB '/*03*/ 4th Byte of Header.
1633
1634 Public sample_number As UW '/*04-05*/ sample number.
1635
1636 Public input_bank_0 As UB '/*06*/ general input bank 0 (inputs 1-8).
1637 Public input_bank_1 As UB '/*07*/ general input bank 1 (inputs 9-16).
1638
1639 Public output_bank_0 As UB '/*08*/ general output bank 0 (outputs 1-8).
1640 Public output_bank_1 As UB '/*09*/ general output bank 1 (outputs 9-16).
1641
1642 Public error_code As UB '/*10*/ error code.
1643 Public thread_status As UB '/*11*/ thread status.
1644
1645 Public input_analog_2 As UW '/*12-13*/ Analog input 2. 1 is in axis data, see axis_a_analog_in.
1646
1647 Public output_analog_1 As UW '/*14-15*/ Analog output 1.
1648 Public output_analog_2 As UW '/*16-17*/ Analog output 2.
1649
1650 Public amplifier_status As UL '/*18-21*/ Amplifier Status.
1651
1652 Public contour_segment_count As UL '/*22-25*/ Segment Count for Contour Mode.
1653 Public contour_buffer_available As UW '/*26-27*/ Buffer space remaining, Contour Mode.
1654
1655 Public s_plane_segment_count As UW '/*28-29*/ segment count of coordinated move for S plane.
1656 Public s_plane_move_status As UW '/*30-31*/ coordinated move status for S plane.
1657 Public s_distance As SL '/*32-35*/ distance traveled in coordinated move for S plane.
1658 Public s_plane_buffer_available As UW '/*36-37*/ Buffer space remaining, S Plane.
1659
1660 Public axis_a_status As UW '/*38-39*/ A axis status.
1661 Public axis_a_switches As UB '/*40*/ A axis switches.
1662 Public axis_a_stop_code As UB '/*41*/ A axis stop code.
1663 Public axis_a_reference_position As SL '/*42-45*/ A axis reference position.
1664 Public axis_a_motor_position As SL '/*46-49*/ A axis motor position.
1665 Public axis_a_position_error As SL '/*50-53*/ A axis position error.
1666 Public axis_a_aux_position As SL '/*54-57*/ A axis auxiliary position.
1667 Public axis_a_velocity As SL '/*58-61*/ A axis velocity.
1668 Public axis_a_torque As SL '/*62-65*/ A axis torque.
1669 Public axis_a_analog_in As UW '/*66-67*/ A axis analog input.
1670 Public axis_a_halls As UB '/*68*/ A Hall Input Status.
1671 Public axis_a_reserved As UB '/*69*/ Reserved.
1672 Public axis_a_variable As SL '/*70-73*/ A User-defined variable (ZA).
1673
1674 Public Function byte_array() As Byte() Implements GDataRecord.byte_array
1675 Return StructToByteArray(Me)
1676 End Function
1677 End Structure
1678
1679 ' Data record struct for RIO-471xx and RIO-472xx PLCs. Includes encoder fields.
1680 <StructLayout(LayoutKind.Sequential, Pack:=1)>
1681 Public Structure GDataRecord47000_ENC
1682 Implements GDataRecord
1683
1684 Public header_0 As UB '/*00*/ 1st Byte of Header.
1685 Public header_1 As UB '/*01*/ 2nd Byte of Header.
1686 Public header_2 As UB '/*02*/ 3rd Byte of Header.
1687 Public header_3 As UB '/*03*/ 4th Byte of Header.
1688
1689 Public sample_number As UW '/*04-05*/ Sample number.
1690 Public error_code As UB '/*06*/ Error code.
1691 Public general_status As UB '/*07*/ General status.
1692
1693 Public output_analog_0 As UW '/*08-09*/ Analog output 0.
1694 Public output_analog_1 As UW '/*10-11*/ Analog output 1.
1695 Public output_analog_2 As UW '/*12-13*/ Analog output 2.
1696 Public output_analog_3 As UW '/*14-15*/ Analog output 3.
1697 Public output_analog_4 As UW '/*16-17*/ Analog output 4.
1698 Public output_analog_5 As UW '/*18-19*/ Analog output 5.
1699 Public output_analog_6 As UW '/*20-21*/ Analog output 6.
1700 Public output_analog_7 As UW '/*22-23*/ Analog output 7.
1701
1702 Public input_analog_0 As UW '/*24-25*/ Analog input 0.
1703 Public input_analog_1 As UW '/*26-27*/ Analog input 1.
1704 Public input_analog_2 As UW '/*28-29*/ Analog input 2.
1705 Public input_analog_3 As UW '/*30-31*/ Analog input 3.
1706 Public input_analog_4 As UW '/*32-33*/ Analog input 4.
1707 Public input_analog_5 As UW '/*34-35*/ Analog input 5.
1708 Public input_analog_6 As UW '/*36-37*/ Analog input 6.
1709 Public input_analog_7 As UW '/*38-39*/ Analog input 7.
1710
1711 Public output_bank_0 As UW '/*40-41*/ Digital outputs 0-15;
1712
1713 Public input_bank_0 As UW '/*42-43*/ Digital inputs 0-15;
1714
1715 Public pulse_count_0 As UL '/*44-47*/ Pulse counter (see PC).
1716 Public zc_variable As SL '/*48-51*/ ZC User-defined variable (see ZC).
1717 Public zd_variable As SL '/*52-55*/ ZD User-defined variable (see ZD).
1718
1719 Public encoder_0 As SL '/*56-59*/ Encoder channel 0. Data only valid for parts with -BISS, -QUAD, or -SSI.
1720 Public encoder_1 As SL '/*60-63*/ Encoder channel 1. Data only valid for parts with -BISS, -QUAD, or -SSI.
1721 Public encoder_2 As SL '/*64-67*/ Encoder channel 2. Data only valid for parts with -BISS, -QUAD, or -SSI.
1722 Public encoder_3 As SL '/*68-71*/ Encoder channel 3. Data only valid for parts with -BISS, -QUAD, or -SSI.
1723
1724 Public Function byte_array() As Byte() Implements GDataRecord.byte_array
1725 Return StructToByteArray(Me)
1726 End Function
1727 End Structure
1728
1729 ' Data record struct for RIO-47300. Includes encoder fields.
1730 <StructLayout(LayoutKind.Sequential, Pack:=1)>
1731 Public Structure GDataRecord47300_ENC
1732 Implements GDataRecord
1733
1734 Public header_0 As UB '/*00*/ 1st Byte of Header.
1735 Public header_1 As UB '/*01*/ 2nd Byte of Header.
1736 Public header_2 As UB '/*02*/ 3rd Byte of Header.
1737 Public header_3 As UB '/*03*/ 4th Byte of Header.
1738
1739 Public sample_number As UW '/*04-05*/ Sample number.
1740 Public error_code As UB '/*06*/ Error code.
1741 Public general_status As UB '/*07*/ General status.
1742
1743 Public output_analog_0 As UW '/*08-09*/ Analog output 0.
1744 Public output_analog_1 As UW '/*10-11*/ Analog output 1.
1745 Public output_analog_2 As UW '/*12-13*/ Analog output 2.
1746 Public output_analog_3 As UW '/*14-15*/ Analog output 3.
1747 Public output_analog_4 As UW '/*16-17*/ Analog output 4.
1748 Public output_analog_5 As UW '/*18-19*/ Analog output 5.
1749 Public output_analog_6 As UW '/*20-21*/ Analog output 6.
1750 Public output_analog_7 As UW '/*22-23*/ Analog output 7.
1751
1752 Public input_analog_0 As UW '/*24-25*/ Analog input 0.
1753 Public input_analog_1 As UW '/*26-27*/ Analog input 1.
1754 Public input_analog_2 As UW '/*28-29*/ Analog input 2.
1755 Public input_analog_3 As UW '/*30-31*/ Analog input 3.
1756 Public input_analog_4 As UW '/*32-33*/ Analog input 4.
1757 Public input_analog_5 As UW '/*34-35*/ Analog input 5.
1758 Public input_analog_6 As UW '/*36-37*/ Analog input 6.
1759 Public input_analog_7 As UW '/*38-39*/ Analog input 7.
1760
1761 Public output_bank_0 As UW '/*40-41*/ Digital outputs 0-15;
1762 Public output_bank_1 As UW '/*42-43*/ Digital outputs 16-23;
1763
1764 Public input_bank_0 As UW '/*44-45*/ Digital inputs 0-15;
1765 Public input_bank_1 As UW '/*46-47*/ Digital inputs 16-23;
1766
1767 Public pulse_count_0 As UL '/*48-51*/ Pulse counter (see PC).
1768 Public zc_variable As SL '/*52-55*/ ZC User-defined variable (see ZC).
1769 Public zd_variable As SL '/*56-59*/ ZD User-defined variable (see ZD).
1770
1771 Public encoder_0 As SL '/*60-63*/ Encoder channel 0. Data only valid for parts with -BISS, -QUAD, or -SSI.
1772 Public encoder_1 As SL '/*64-67*/ Encoder channel 1. Data only valid for parts with -BISS, -QUAD, or -SSI.
1773 Public encoder_2 As SL '/*68-71*/ Encoder channel 2. Data only valid for parts with -BISS, -QUAD, or -SSI.
1774 Public encoder_3 As SL '/*72-75*/ Encoder channel 3. Data only valid for parts with -BISS, -QUAD, or -SSI.
1775
1776 Public Function byte_array() As Byte() Implements GDataRecord.byte_array
1777 Return StructToByteArray(Me)
1778 End Function
1779 End Structure
1780
1781 ' Data record struct for RIO-47300 with 24EX I/O daughter board.
1782 <StructLayout(LayoutKind.Sequential, Pack:=1)>
1783 Public Structure GDataRecord47300_24EX
1784 Implements GDataRecord
1785
1786 Public header_0 As UB '/*00*/ 1st Byte of Header.
1787 Public header_1 As UB '/*01*/ 2nd Byte of Header.
1788 Public header_2 As UB '/*02*/ 3rd Byte of Header.
1789 Public header_3 As UB '/*03*/ 4th Byte of Header.
1790
1791 Public sample_number As UW '/*04-05*/ Sample number.
1792 Public error_code As UB '/*06*/ Error code.
1793 Public general_status As UB '/*07*/ General status.
1794
1795 Public output_analog_0 As UW '/*08-09*/ Analog output 0.
1796 Public output_analog_1 As UW '/*10-11*/ Analog output 1.
1797 Public output_analog_2 As UW '/*12-13*/ Analog output 2.
1798 Public output_analog_3 As UW '/*14-15*/ Analog output 3.
1799 Public output_analog_4 As UW '/*16-17*/ Analog output 4.
1800 Public output_analog_5 As UW '/*18-19*/ Analog output 5.
1801 Public output_analog_6 As UW '/*20-21*/ Analog output 6.
1802 Public output_analog_7 As UW '/*22-23*/ Analog output 7.
1803
1804 Public input_analog_0 As UW '/*24-25*/ Analog input 0.
1805 Public input_analog_1 As UW '/*26-27*/ Analog input 1.
1806 Public input_analog_2 As UW '/*28-29*/ Analog input 2.
1807 Public input_analog_3 As UW '/*30-31*/ Analog input 3.
1808 Public input_analog_4 As UW '/*32-33*/ Analog input 4.
1809 Public input_analog_5 As UW '/*34-35*/ Analog input 5.
1810 Public input_analog_6 As UW '/*36-37*/ Analog input 6.
1811 Public input_analog_7 As UW '/*38-39*/ Analog input 7.
1812
1813 Public output_bank_0 As UW '/*40-41*/ Digital outputs 0-15.
1814 Public output_bank_1 As UW '/*42-43*/ Digital outputs 16-23.
1815
1816 Public input_bank_0 As UW '/*44-45*/ Digital inputs 0-15.
1817 Public input_bank_1 As UW '/*46-47*/ Digital inputs 16-23.
1818
1819 Public pulse_count_0 As UL '/*48-51*/ Pulse counter (see PC)8.
1820 Public zc_variable As SL '/*52-55*/ ZC User-defined variable (see ZC).
1821 Public zd_variable As SL '/*56-59*/ ZD User-defined variable (see ZD).
1822
1823 Public output_bank_2 As UW '/*60-61*/ Digital outputs 24-39. Data only valid for parts with 24EXOUT.
1824 Public output_back_3 As UW '/*62-63*/ Digital outputs 40-47. Data only valid for parts with 24EXOUT.
1825
1826 Public input_bank_2 As UW '/*64-65*/ Digital inputs 24-39. Data only valid for parts with 24EXIN.
1827 Public input_bank_3 As UW '/*66-67*/ Digital inputs 40-47. Data only valid for parts with 24EXIN.
1828
1829 Public Function byte_array() As Byte() Implements GDataRecord.byte_array
1830 Return StructToByteArray(Me)
1831 End Function
1832 End Structure
1833
1834 'Data record struct for RIO-47162.
1835 <StructLayout(LayoutKind.Sequential, Pack:=1)>
1836 Public Structure GDataRecord47162
1837 Implements GDataRecord
1838
1839 Public header_0 As UB '/*00*/ 1st Byte of Header.
1840 Public header_1 As UB '/*01*/ 2nd Byte of Header.
1841 Public header_2 As UB '/*02*/ 3rd Byte of Header.
1842 Public header_3 As UB '/*03*/ 4th Byte of Header.
1843
1844 Public sample_number As UW '/*04-05*/ Sample number.
1845 Public error_code As UB '/*06*/ Error code.
1846 Public general_status As UB '/*07*/ General status.
1847
1848 Public output_analog_0 As UW '/*08-09*/ Analog output 0.
1849 Public output_analog_1 As UW '/*10-11*/ Analog output 1.
1850 Public output_analog_2 As UW '/*12-13*/ Analog output 2.
1851 Public output_analog_3 As UW '/*14-15*/ Analog output 3.
1852 Public output_analog_4 As UW '/*16-17*/ Analog output 4.
1853 Public output_analog_5 As UW '/*18-19*/ Analog output 5.
1854 Public output_analog_6 As UW '/*20-21*/ Analog output 6.
1855 Public output_analog_7 As UW '/*22-23*/ Analog output 7.
1856
1857 Public input_analog_0 As UW '/*24-25*/ Analog input 0.
1858 Public input_analog_1 As UW '/*26-27*/ Analog input 1.
1859 Public input_analog_2 As UW '/*28-29*/ Analog input 2.
1860 Public input_analog_3 As UW '/*30-31*/ Analog input 3.
1861 Public input_analog_4 As UW '/*32-33*/ Analog input 4.
1862 Public input_analog_5 As UW '/*34-35*/ Analog input 5.
1863 Public input_analog_6 As UW '/*36-37*/ Analog input 6.
1864 Public input_analog_7 As UW '/*38-39*/ Analog input 7.
1865
1866 Public output_byte_0 As UB '/*40*/ Digital outputs 0-7.
1867 Public output_byte_1 As UB '/*41*/ Digital outputs 8-15.
1868 Public output_byte_2 As UB '/*42*/ Digital outputs 16-23.
1869
1870 Public input_byte_0 As UB '/*43*/ Digital inputs 0-7.
1871 Public input_byte_1 As UB '/*44*/ Digital inputs 8-15.
1872 Public input_byte_2 As UB '/*45*/ Digital inputs 16-23.
1873 Public input_byte_3 As UB '/*46*/ Digital inputs 24-31.
1874 Public input_byte_4 As UB '/*47*/ Digital inputs 32-39.
1875
1876 Public pulse_count_0 As UL '/*48-51*/ Pulse counter (see PC).
1877 Public zc_variable As SL '/*52-55*/ ZC User-defined variable (see ZC).
1878 Public zd_variable As SL '/*56-59*/ ZD User-defined variable (see ZD).
1879
1880 Public encoder_0 As SL '/*60-63*/ Encoder channel 0. Data only valid for parts with -BISS, -QUAD, or -SSI.
1881 Public encoder_1 As SL '/*64-67*/ Encoder channel 1. Data only valid for parts with -BISS, -QUAD, or -SSI.
1882 Public encoder_2 As SL '/*68-71*/ Encoder channel 2. Data only valid for parts with -BISS, -QUAD, or -SSI.
1883 Public encoder_3 As SL '/*72-75*/ Encoder channel 3. Data only valid for parts with -BISS, -QUAD, or -SSI.
1884
1885 Public Function byte_array() As Byte() Implements GDataRecord.byte_array
1886 Return StructToByteArray(Me)
1887 End Function
1888 End Structure
1889 #End Region
1890
1891 End Class
Galil
Definition: Galil.h:26
gclib
Provides a class that binds to gclib's unmanaged dll. Wraps each call and provides a more user-friend...
Definition: gclib.cs:68
vb.Gclib
Provides a class that binds to gclib's unmanaged dll. Wraps each call and provides a more user-friend...
Definition: gclib.vb:45
GMotionComplete
GCLIB_DLL_EXPORTED GReturn GCALL GMotionComplete(GCon g, GCStringIn axes)
Blocking call that returns once all axes specified have completed their motion.
Definition: gclibo.c:300
GPublishServer
GCLIB_DLL_EXPORTED GReturn GCALL GPublishServer(GCStringIn name, GOption publish, GOption save)
Uses GUtility(), G_UTIL_GCAPS_PUBLISH_SERVER to publish local gcaps server to the local network.
Definition: gclibo.c:189
GArrayDownloadFile
GCLIB_DLL_EXPORTED GReturn GCALL GArrayDownloadFile(GCon g, GCStringIn file_path)
Array download from file.
Definition: arrays.c:380
GFirmwareDownload
GCLIB_DLL_EXPORTED GReturn GCALL GFirmwareDownload(GCon g, GCStringIn filepath)
Upgrade firmware.
GRecord
GCLIB_DLL_EXPORTED GReturn GCALL GRecord(GCon g, union GDataRecord *record, GOption method)
Provides a fresh copy of the controller's data record. Data is cast into a union, GDataRecord.
GAssign
GCLIB_DLL_EXPORTED GReturn GCALL GAssign(GCStringIn ip, GCStringIn mac)
Uses GUtility(), G_UTIL_GCAPS_ASSIGN or G_UTIL_ASSIGN to assign an IP address over the Ethernet to a ...
Definition: gclibo.c:70
GArrayUploadFile
GCLIB_DLL_EXPORTED GReturn GCALL GArrayUploadFile(GCon g, GCStringIn file_path, GCStringIn names)
Array upload to file.
Definition: arrays.c:408
GClose
GCLIB_DLL_EXPORTED GReturn GCALL GClose(GCon g)
Closes a connection to a Galil Controller.
GProgramDownloadFile
GCLIB_DLL_EXPORTED GReturn GCALL GProgramDownloadFile(GCon g, GCStringIn file_path, GCStringIn preprocessor)
Program download from file.
Definition: gclibo.c:387
GIpRequests
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
GTimeout
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
GListServers
GCLIB_DLL_EXPORTED GReturn GCALL GListServers(GCStringOut servers, GSize servers_len)
Uses GUtility(), G_UTIL_GCAPS_LIST_SERVERS to provide a list of all available gcaps services on the l...
Definition: gclibo.c:169
GSetupDownloadFile
GCLIB_DLL_EXPORTED GReturn GCALL GSetupDownloadFile(GCon g, GCStringIn file_path, GOption options, GCStringOut info, GSize info_len)
Download a saved controller configuration from a file.
Definition: arrays.c:476
GVersion
GCLIB_DLL_EXPORTED GReturn GCALL GVersion(GCStringOut ver, GSize ver_len)
Uses GUtility(), G_UTIL_VERSION and G_UTIL_GCAPS_VERSION to provide the library and gcaps version num...
Definition: gclibo.c:29
GCommand
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.
GInterrupt
GCLIB_DLL_EXPORTED GReturn GCALL GInterrupt(GCon g, GStatus *status_byte)
Provides access to PCI and UDP interrupts from the controller.
GRemoteConnections
GCLIB_DLL_EXPORTED GReturn GCALL GRemoteConnections(GCStringOut connections, GSize connections_length)
Uses GUtility(), G_UTIL_GCAPS_REMOTE_CONNECTIONS to get a list of remote addresses connected to the l...
Definition: gclibo.c:217
GWrite
GCLIB_DLL_EXPORTED GReturn GCALL GWrite(GCon g, GBufIn buffer, GSize buffer_len)
Performs a write on the connection.
GArrayDownload
GCLIB_DLL_EXPORTED GReturn GCALL GArrayDownload(GCon g, const GCStringIn array_name, GOption first, GOption last, GCStringIn buffer)
Downloads array data to a pre-dimensioned array in the controller's array table.
GProgramUpload
GCLIB_DLL_EXPORTED GReturn GCALL GProgramUpload(GCon g, GBufOut buffer, GSize buffer_len)
Uploads a program from the controller's program buffer.
GError
GCLIB_DLL_EXPORTED void GCALL GError(GReturn rc, GCStringOut error, GSize error_len)
Provides a human-readable description string for return codes.
Definition: gclibo.c:459
GProgramUploadFile
GCLIB_DLL_EXPORTED GReturn GCALL GProgramUploadFile(GCon g, GCStringIn file_path)
Program upload to file.
Definition: gclibo.c:430
GMessage
GCLIB_DLL_EXPORTED GReturn GCALL GMessage(GCon g, GCStringOut buffer, GSize buffer_len)
Provides access to unsolicited messages from the controller.
GRecordRate
GCLIB_DLL_EXPORTED GReturn GCALL GRecordRate(GCon g, double period_ms)
Sets the asynchronous data record to a user-specified period via DR.
Definition: gclibo.c:342
GCmdI
GCLIB_DLL_EXPORTED GReturn GCALL GCmdI(GCon g, GCStringIn command, int *value)
Wrapper around GCommand that provides the return value of a command parsed into an int.
Definition: gclibo.c:278
GServerStatus
GCLIB_DLL_EXPORTED GReturn GCALL GServerStatus(GCStringOut status, GSize status_len)
Uses GUtility(), G_UTIL_GCAPS_SERVER_STATUS to get information on the local server name and if it is ...
Definition: gclibo.c:149
GProgramDownload
GCLIB_DLL_EXPORTED GReturn GCALL GProgramDownload(GCon g, GCStringIn program, GCStringIn preprocessor)
Downloads a program to the controller's program buffer.
GInfo
GCLIB_DLL_EXPORTED GReturn GCALL GInfo(GCon g, GCStringOut info, GSize info_len)
Uses GUtility() and G_UTIL_INFO to provide a useful connection string.
Definition: gclibo.c:49
GSetServer
GCLIB_DLL_EXPORTED GReturn GCALL GSetServer(GCStringIn server_name)
Uses GUtility(), G_UTIL_GCAPS_SET_SERVER to set the new active server.
Definition: gclibo.c:128
GCmdD
GCLIB_DLL_EXPORTED GReturn GCALL GCmdD(GCon g, GCStringIn command, double *value)
Wrapper around GCommand that provides the return value of a command parsed into a double.
Definition: gclibo.c:289
GRead
GCLIB_DLL_EXPORTED GReturn GCALL GRead(GCon g, GBufOut buffer, GSize buffer_len, GSize *bytes_read)
Performs a read on the connection.
GAddresses
GCLIB_DLL_EXPORTED GReturn GCALL GAddresses(GCStringOut addresses, GSize addresses_len)
Uses GUtility(), G_UTIL_GCAPS_ADDRESSES or G_UTIL_ADDRESSES to provide a listing of all available con...
Definition: gclibo.c:54
GOpen
GCLIB_DLL_EXPORTED GReturn GCALL GOpen(GCStringIn address, GCon *g)
Open a connection to a Galil Controller.
GArrayUpload
GCLIB_DLL_EXPORTED GReturn GCALL GArrayUpload(GCon g, const GCStringIn array_name, GOption first, GOption last, GOption delim, GBufOut buffer, GSize buffer_len)
Uploads array data from the controller's array table.
GOption
int GOption
Option integer for various formatting, etc.
Definition: gclib.h:96
G_NO_ERROR
#define G_NO_ERROR
Return value if function succeeded.
Definition: gclib_errors.h:13
e
void e(GReturn rc)
A trivial, C++ style return code check used in Galil's examples and demos.
Definition: examples.h:33
message
GReturn message(GCon g)
Demonstrates how to receive messages from the controller and detect differences in Trace and crashed ...
Definition: message.cpp:14
error
void error(GCon g, GReturn rc)
An example of error handling and debugging information.
Definition: examples.h:40
vb.Gclib.GDataRecord
Definition: gclib.vb:468
vb.Gclib.GDataRecord1802
Definition: gclib.vb:1078
vb.Gclib.GDataRecord2103
Definition: gclib.vb:960
vb.Gclib.GDataRecord30000
Definition: gclib.vb:1156
vb.Gclib.GDataRecord4000
Definition: gclib.vb:474
vb.Gclib.GDataRecord47000_ENC
Definition: gclib.vb:1195
vb.Gclib.GDataRecord47162
Definition: gclib.vb:1310
vb.Gclib.GDataRecord47300_24EX
Definition: gclib.vb:1271
vb.Gclib.GDataRecord47300_ENC
Definition: gclib.vb:1232
vb.Gclib.GDataRecord52000
Definition: gclib.vb:637