gclib 2.2.1
Galil Communications Library
Loading...
Searching...
No Matches
gclib Class Reference

Provides a class that binds to gclib's unmanaged dll. More...

Public Member Functions

string[] GAddresses ()
 Return a string array of available connection addresses.
 
void GArrayDownload (string array_name, ref List< double > data, Int16 first=-1, Int16 last=-1)
 Downloads array data to a pre-dimensioned array in the controller's array table.
 
void GArrayDownloadFile (string Path)
 Allows downloading of a program array file to the controller.
 
List< double > GArrayUpload (string array_name, Int16 first=-1, Int16 last=-1)
 Uploads array data from the controller's array table.
 
void GArrayUploadFile (string Path, string Names)
 Allows uploading of a program array file from the controller to an array CSV file.
 
void GAssign (string ip, string mac)
 Assigns IP address over the Ethernet to a controller at a given MAC address.
 
void GClose ()
 Used to close a connection to Galil hardware.
 
string GCommand (string Command, bool Trim=true)
 Used for command-and-response transactions.
 
Int16 GCmdI (string Command)
 Used for command-and-response transactions.
 
double GCmdD (string Command)
 Used for command-and-response transactions.
 
void GFirmwareDownload (string filepath)
 Upgrade firmware.
 
string GInfo ()
 Provides a useful connection string.
 
byte GInterrupt ()
 Provides access to PCI and UDP interrupts from the controller.
 
string[] GIpRequests ()
 Provides a list of all Galil controllers requesting IP addresses via BOOT-P or DHCP.
 
string GMessage ()
 Provides access to unsolicited messages.
 
void GMotionComplete (string axes)
 Blocking call that returns once all axes specified have completed their motion.
 
void GOpen (string address)
 Used to open a connection to Galil hardware.
 
void GProgramDownload (string program, string preprocessor="")
 Allows downloading of a DMC program from a string buffer.
 
void GProgramDownloadFile (string file_path, string preprocessor="")
 Allows downloading of a DMC program from file.
 
string GProgramUpload ()
 Allows uploading of a DMC program to a string.
 
void GProgramUploadFile (string file_path)
 Allows uploading of a DMC program to a file.
 
byte[] GRead ()
 Performs a read on the connection.
 
GRecord< T > (bool async)
 Used for retrieving data records from the controller.
 
void GRecordRate (double period_ms)
 Sets the asynchronous data record to a user-specified period via DR.
 
void GTimeout (Int16 timeout_ms)
 Set the timeout of communication transactions.
 
string GVersion ()
 Used to get the gclib version.
 
void GWrite (string buffer)
 Performs a write on the connection.
 
string[] GSetupDownloadFile (string path, Int32 options)
 Allows downloading of a Galil compressed backup (gcb) file to the controller.
 
void GSetServer (string server_name)
 Connects gclib to a new gcaps server.
 
string GServerStatus ()
 Retrieves the name of your local gcaps server and whether or not it is currently published.
 
string[] GListServers ()
 Retrieves a list of gcaps servers that are advertising themselves on the local network.
 
void GPublishServer (string server_name, bool publish, bool save)
 Publishes or removes local gcaps server from the network.
 
string[] GRemoteConnections ()
 Returns a list of IP Addresses that currently have an open connection to your hardware.
 

Public Attributes

 argtypes
 
 restype
 

Protected Attributes

 _gclib = WinDLL(os.environ["GCLIB_ROOT"] + '/dll/x64/gclib.dll')
 
 _gclibo = WinDLL(os.environ["GCLIB_ROOT"] + '/dll/x64/gclibo.dll')
 
str _gclib_path = '/Applications/gclib/dylib/gclib.0.dylib'
 
str _gclibo_path = '/Applications/gclib/dylib/gclibo.0.dylib'
 
 _GReturn = c_int
 
 _GCon = c_void_p
 
 _GCon_ptr = POINTER(_GCon)
 
 _GSize = c_ulong
 
 _GSize_ptr = POINTER(_GSize)
 
 _GCStringIn = c_char_p
 
 _GCStringOut = c_char_p
 
 _GOption = c_int
 
 _GStatus = c_ubyte
 
 _GStatus_ptr = POINTER(_GStatus)
 
str _enc = "ASCII"
 
int _buf_size = 500000
 
 _error_buf = create_string_buffer(128)
 

Detailed Description

Provides a class that binds to gclib's unmanaged dll.

Wraps each call and provides a more user-friendly interface for use in C#.

The Gclib class assumes the default installation of gclib, "C:\Program Files (x86)\Galil\gclib\". If the dlls are elsewhere, change the path strings GclibDllPath_, and GcliboDllPath_.

Definition at line 58 of file gclib.cs.

Member Function Documentation

◆ GRead()

byte[] gclib.GRead ( )
inline

Performs a read on the connection.

Returns
String containing the read data, or a nullstring if nothing was read or an error occured.

Wrapper around gclib GRead(), http://www.galil.com/sw/pub/all/doc/gclib/html/gclib_8h.html#adab6ec79b7e1bc7f0266684dd3434923

Definition at line 534 of file gclib.cs.

◆ GWrite()

void gclib.GWrite ( string buffer)
inline

Performs a write on the connection.

Parameters
bufferThe user's write buffer. To send a Galil command, a terminating carriage return is usually required.

Wrapper around gclib GWrite(), http://www.galil.com/sw/pub/all/doc/gclib/html/gclib_8h.html#abe28ebaecd5b3940adf4e145d40e5456

Exceptions
System.ExceptionWill throw an exception if anything other than G_NO_ERROR is received from gclib.

Definition at line 637 of file gclib.cs.

Member Data Documentation

◆ _gclib

gclib._gclib = WinDLL(os.environ["GCLIB_ROOT"] + '/dll/x64/gclib.dll')
protected

Definition at line 31 of file gclib.py.

◆ _gclibo

gclib._gclibo = WinDLL(os.environ["GCLIB_ROOT"] + '/dll/x64/gclibo.dll')
protected

Definition at line 32 of file gclib.py.

◆ _gclib_path

str gclib._gclib_path = '/Applications/gclib/dylib/gclib.0.dylib'
protected

Definition at line 78 of file gclib.py.

◆ _gclibo_path

str gclib._gclibo_path = '/Applications/gclib/dylib/gclibo.0.dylib'
protected

Definition at line 79 of file gclib.py.

◆ _GReturn

gclib._GReturn = c_int
protected

Definition at line 88 of file gclib.py.

◆ _GCon

gclib._GCon = c_void_p
protected

Definition at line 89 of file gclib.py.

◆ _GCon_ptr

gclib._GCon_ptr = POINTER(_GCon)
protected

Definition at line 90 of file gclib.py.

◆ _GSize

gclib._GSize = c_ulong
protected

Definition at line 91 of file gclib.py.

◆ _GSize_ptr

gclib._GSize_ptr = POINTER(_GSize)
protected

Definition at line 92 of file gclib.py.

◆ _GCStringIn

gclib._GCStringIn = c_char_p
protected

Definition at line 93 of file gclib.py.

◆ _GCStringOut

gclib._GCStringOut = c_char_p
protected

Definition at line 94 of file gclib.py.

◆ _GOption

gclib._GOption = c_int
protected

Definition at line 95 of file gclib.py.

◆ _GStatus

gclib._GStatus = c_ubyte
protected

Definition at line 96 of file gclib.py.

◆ _GStatus_ptr

gclib._GStatus_ptr = POINTER(_GStatus)
protected

Definition at line 97 of file gclib.py.

◆ argtypes

gclib.argtypes

Definition at line 101 of file gclib.py.

◆ restype

gclib.restype

Definition at line 117 of file gclib.py.

◆ _enc

str gclib._enc = "ASCII"
protected

Definition at line 135 of file gclib.py.

◆ _buf_size

int gclib._buf_size = 500000
protected

Definition at line 136 of file gclib.py.

◆ _error_buf

gclib._error_buf = create_string_buffer(128)
protected

Definition at line 137 of file gclib.py.


The documentation for this class was generated from the following files: