Manage controller memory, such as program and arrays.
More...
|
| GCLIB_DEPRECATED GReturn | GProgramDownload (GCon g, GCStringIn program, GCStringIn preprocessor) |
| | Downloads a program to the controller's program buffer.
|
| GCLIB_DEPRECATED GReturn | GProgramUpload (GCon g, GBufOut buffer, GSize buffer_len) |
| | Uploads a program from the controller's program buffer.
|
| GCLIB_DEPRECATED GReturn | 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.
|
| GCLIB_DEPRECATED GReturn | 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.
|
| GCLIB_DEPRECATED GReturn | GFirmwareDownload (GCon g, GCStringIn filepath) |
| | Upgrade firmware.
|
| GCLIB_DEPRECATED GReturn | GProgramDownloadFile (GCon g, GCStringIn file_path, GCStringIn preprocessor) |
| | Program download from file.
|
| GCLIB_DEPRECATED GReturn | GProgramUploadFile (GCon g, GCStringIn file_path) |
| | Program upload to file.
|
| GCLIB_DEPRECATED GReturn | GArrayDownloadFile (GCon g, GCStringIn file_path) |
| | Array download from file.
|
| GCLIB_DEPRECATED GReturn | GArrayUploadFile (GCon g, GCStringIn file_path, GCStringIn names) |
| | Array upload to file.
|
| GCLIB_DEPRECATED GReturn | GSetupDownloadFile (GCon g, GCStringIn file_path, GOption options, GCStringOut info, GSize info_len) |
| | Download a saved controller configuration from a file.
|
Manage controller memory, such as program and arrays.
◆ GProgramDownload()
Downloads a program to the controller's program buffer.
- Deprecated
- This function is part of the deprecated C (Legacy) API, which will be removed in a future release. Use gclib_set_program() instead.
- Parameters
-
| g | Connection's handle. |
| program | Null-terminated program for download. |
| preprocessor | Options string for preprocessing the program before sending it to the controller. Null allows the library to use defaults for the download. See the Program Preprocessor documentation for options. |
- Returns
- The success status or error code of the function. See gclib_errors.h for possible values.
◆ GProgramUpload()
Uploads a program from the controller's program buffer.
- Deprecated
- This function is part of the deprecated C (Legacy) API, which will be removed in a future release. Use gclib_program() instead.
- Parameters
-
| g | Connection's handle. |
| buffer | Buffer to receive the controller's program. The data will be null terminated unless function returns G_BAD_LOST_DATA due to the buffer being too small to hold the data. |
| buffer_len | The length of the receive buffer. |
- Returns
- The success status or error code of the function. See gclib_errors.h for possible values.
◆ GArrayDownload()
Downloads array data to a pre-dimensioned array in the controller's array table.
- Deprecated
- This function is part of the deprecated C (Legacy) API, which will be removed in a future release. Use gclib_set_array() instead.
- Warning
- The array must already exist on the controller and be sufficient dimension to hold the desired array data, e.g. via DM.
- Parameters
-
| g | Connection's handle. |
| array_name | Null-terminated string containing the name of the array to download. Must match the array name used in DM. |
| first | The first element of the array for sub-array downloads. G_BOUNDS to omit. |
| last | The last element of the array for sub-array downloads. G_BOUNDS to omit. |
| buffer | Buffer containing the null-terminated data to be sent to the controller. The array data may be separated with carriage return, carriage return + line feed, or a comma. No spaces. |
- Returns
- The success status or error code of the function. See gclib_errors.h for possible values.
◆ GArrayUpload()
Uploads array data from the controller's array table.
- Deprecated
- This function is part of the deprecated C (Legacy) API, which will be removed in a future release. Use gclib_array() instead.
- Parameters
-
| g | Connection's handle. |
| array_name | Null-terminated string containing the name of the array to upload. |
| first | The first element of the array for sub-array uploads. G_BOUNDS to omit. |
| last | The last element of the array for sub-array uploads. G_BOUNDS to omit. |
| delim | Sets the delimeter between array elements in the returned data, G_CR specifies carriage return, G_COMMA specifies comma. |
| buffer | Buffer to receive the uploaded data. The data will be null terminated unless function returns G_BAD_LOST_DATA due to the buffer being too small to hold the data. |
| buffer_len | The length of the receive buffer. |
- Returns
- The success status or error code of the function. See gclib_errors.h for possible values.
◆ GFirmwareDownload()
◆ GProgramDownloadFile()
Program download from file.
- Deprecated
- This function is part of the deprecated C (Legacy) API, which will be removed in a future release.
- Parameters
-
| g | Connection's handle. |
| file_path | Null-terminated string containing the path to the program file. |
| preprocessor | Options string for preprocessing the program before sending it to the controller. See GProgramDownload(). |
- Returns
- The success status or error code of the function. See gclib_errors.h for possible values.
◆ GProgramUploadFile()
Program upload to file.
- Deprecated
- This function is part of the deprecated C (Legacy) API, which will be removed in a future release.
- Parameters
-
| g | Connection's handle. |
| file_path | Null-terminated string containing the path to the program file, file will be overwritten if it exists. |
- Returns
- The success status or error code of the function. See gclib_errors.h for possible values.
◆ GArrayDownloadFile()
Array download from file.
- Deprecated
- This function is part of the deprecated C (Legacy) API, which will be removed in a future release.
Downloads a csv file containing array data at file_path. If the arrays don't exist, they will be dimensioned.
- Parameters
-
| g | Connection's handle. |
| file_path | Null-terminated string containing the path to the array file. |
- Returns
- The success status or error code of the function. See gclib_errors.h for possible values.
◆ GArrayUploadFile()
Array upload to file.
- Deprecated
- This function is part of the deprecated C (Legacy) API, which will be removed in a future release.
Uploads the entire controller array table or a subset and saves the data as a csv file specified by file_path.
- Parameters
-
| g | Connection's handle. |
| file_path | Null-terminated string containing the path to the array file, file will be overwritten if it exists. |
| names | Null-terminated string containing the arrays to upload, delimited with space. "" or null uploads all arrays listed in LA. |
- Returns
- The success status or error code of the function. See gclib_errors.h for possible values.
◆ GSetupDownloadFile()
Download a saved controller configuration from a file.
- Deprecated
- This function is part of the deprecated C (Legacy) API, which will be removed in a future release.
- Parameters
-
| g | Connection's handle. |
| file_path | Null-terminated string containing the path to the gcb file. |
| options | Bit mask to determine what configuration data to download. See below for all options. |
| info | Optional pointer to a buffer to store the controller info. If no info is needed, specify as NULL. |
| info_len | Length of optional info buffer. If no info is needed, specify as NULL. |
- Returns
- The success status or error code of the function. If the options parameter is set to 0, the return value will be a bit mask indicating which sectors in the specified GCB are not empty. Otherwise, see gclib_errors.h for possible error values.
- Note
- By default, GSetupDownloadFile() will stop immediately if an error is encountered downloading data. This can be overridden in the options parameter. For example, you may want to override the error if you have a backup from an 8-axis controller and want to restore the parameters for the first 4 axes to a 4-axis controller.
If both info and info_len are not NULL, the controller information will be provided regardless of the options parameter.
The options parameter is a bit mask. If options is set to 0, GSetupDownloadFile() will return a bit mask indicating which sectors in the specified GCB are not empty. The following contains a list of all currently available options:
| Bit | Value | Function | Description |
| 1 | 0x0002 | Restore parameters | KPA, KIA, KDA, etc... |
| 3 | 0x0008 | Restore variables | Variables are listed by the LV command |
| 4 | 0x0010 | Restore arrays | Arrays are listed by the LA command |
| 5 | 0x0020 | Restore program | The program is listed by the LS command |
| 31 | 0x8000 | Ignore errors | Ignore invalid parameter errors and continue restoring data. GSetupDownloadFile() will still stop immediately if a connection issue or other fatal error is encountered |
Usage example:
printf("Info:\n\n%s", info);
free(info);
return rc;
int GReturn
Every function returns a value of type GReturn. See gclib_errors.h for possible values.
int GOption
Option integer for various formatting, etc.
unsigned int GSize
Size of buffers, etc.
struct Context * GCon
Connection handle. Unique for each connection in process. Assigned a non-zero value in GOpen().
char * GCStringOut
C-string output from the library. Implies null-termination.
GCLIB_DEPRECATED GReturn GClose(GCon g)
Closes a connection to a Galil Controller.
GCLIB_DEPRECATED GReturn GSetupDownloadFile(GCon g, GCStringIn file_path, GOption options, GCStringOut info, GSize info_len)
Download a saved controller configuration from a file.