![]() |
gclib 2.0.10
Galil Communications Library
|
Manage controller memory, such as program and arrays More...
Functions | |
| GCLIB_DLL_EXPORTED GReturn GCALL | GProgramDownload (GCon g, GCStringIn program, GCStringIn preprocessor) |
| Downloads a program to the controller's program buffer. | |
| GCLIB_DLL_EXPORTED GReturn GCALL | GProgramUpload (GCon g, GBufOut buffer, GSize buffer_len) |
| Uploads a program from the controller's program buffer. | |
| 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. | |
| 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. | |
| GCLIB_DLL_EXPORTED GReturn GCALL | GFirmwareDownload (GCon g, GCStringIn filepath) |
| Upgrade firmware. | |
| GCLIB_DLL_EXPORTED GReturn GCALL | GProgramDownloadFile (GCon g, GCStringIn file_path, GCStringIn preprocessor) |
| Program download from file. | |
| GCLIB_DLL_EXPORTED GReturn GCALL | GProgramUploadFile (GCon g, GCStringIn file_path) |
| Program upload to file. | |
| GCLIB_DLL_EXPORTED GReturn GCALL | GArrayDownloadFile (GCon g, GCStringIn file_path) |
| Array download from file. | |
| GCLIB_DLL_EXPORTED GReturn GCALL | GArrayUploadFile (GCon g, GCStringIn file_path, GCStringIn names) |
| Array upload to file. | |
| 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. | |
| GCLIB_DLL_EXPORTED GReturn GCALL GProgramDownload | ( | GCon | g, |
| GCStringIn | program, | ||
| GCStringIn | preprocessor ) |
Downloads a program to the controller's program buffer.
| 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. |
See x_programs.cpp for an example.
Uploads a program from the controller's program buffer.
| 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. |
See x_programs.cpp for an example.
| 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.
DM.| 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. |
See x_arrays.cpp for an example.
| 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.
| 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. |
See x_arrays.cpp for an example.
| GCLIB_DLL_EXPORTED GReturn GCALL GFirmwareDownload | ( | GCon | g, |
| GCStringIn | filepath ) |
Upgrade firmware.
| g | Connection's handle. |
| filepath | The full file path to the Galil-supplied firmware hex file. See http://www.galil.com/downloads/firmware |
| GCLIB_DLL_EXPORTED GReturn GCALL GProgramDownloadFile | ( | GCon | g, |
| GCStringIn | file_path, | ||
| GCStringIn | preprocessor ) |
Program download from file.
| 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(). |
See x_programs.cpp for an example.
| GCLIB_DLL_EXPORTED GReturn GCALL GProgramUploadFile | ( | GCon | g, |
| GCStringIn | file_path ) |
Program upload to file.
| g | Connection's handle. |
| file_path | Null-terminated string containing the path to the program file, file will be overwritten if it exists. |
See x_programs.cpp for an example.
| GCLIB_DLL_EXPORTED GReturn GCALL GArrayDownloadFile | ( | GCon | g, |
| GCStringIn | file_path ) |
Array download from file.
Downloads a csv file containing array data at file_path. If the arrays don't exist, they will be dimensioned.
| g | Connection's handle. |
| file_path | Null-terminated string containing the path to the array file. |
See x_arrays.cpp for an example.
| GCLIB_DLL_EXPORTED GReturn GCALL GArrayUploadFile | ( | GCon | g, |
| GCStringIn | file_path, | ||
| GCStringIn | names ) |
Array upload to file.
Uploads the entire controller array table or a subset and saves the data as a csv file specified by file_path.
| 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. |
See x_arrays.cpp for an example.
| 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.
| 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. |
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: