gclib 2.4.0
Galil Communications Library
Loading...
Searching...
No Matches
Memory

Manage controller firmware, program, and arrays. More...

Functions

gclib_result gclib_program (gclib_handle h, char *program, size_t len)
 Get the controller's current program.
gclib_result gclib_set_program (gclib_handle h, const char *program, const char *insert)
 Set the program on the controller.
gclib_result gclib_array (gclib_handle h, const char *name, char *buf, size_t len, size_t start, size_t end)
 Get an array from the controller.
gclib_result gclib_set_array (gclib_handle h, const char *name, const char *buf, size_t start, size_t end)
 Set an array on the controller.
gclib_result gclib_set_firmware (gclib_handle h, const char *file_path)
 Set the firmware on the controller.

Detailed Description

Manage controller firmware, program, and arrays.

Function Documentation

◆ gclib_program()

gclib_result gclib_program ( gclib_handle h,
char * program,
size_t len )

Get the controller's current program.

Parameters
hHandle to an open connection.
programOutput buffer for program.
lenLength of output buffer.
Returns
GCLIB_BUFFER_TOO_SMALL if program does not fit in buffer.

◆ gclib_set_program()

gclib_result gclib_set_program ( gclib_handle h,
const char * program,
const char * insert )

Set the program on the controller.

Parameters
hHandle to an open connection.
programProgram to write to controller memory. Lines may be separated by \r, \r\n, or \n.
insertEither a line number or a label name to start downloading from.
Returns
GCLIB_INVALID_ARGUMENT if program is not accepted by controller (for example, if a program is already running).

◆ gclib_array()

gclib_result gclib_array ( gclib_handle h,
const char * name,
char * buf,
size_t len,
size_t start,
size_t end )

Get an array from the controller.

Parameters
hHandle to an open connection.
nameArray name on controller.
bufOutput buffer for comma-separated array values.
lenLength of output buffer.
startIndex to start reading array.
endIndex to stop reading array.
Returns
GCLIB_INVALID_ARGUMENT if array does not exist on controller.

◆ gclib_set_array()

gclib_result gclib_set_array ( gclib_handle h,
const char * name,
const char * buf,
size_t start,
size_t end )

Set an array on the controller.

Array will be automatically dimensioned unless one of the following is true:

  • Start or end are nonzero
  • Controller is currently recording arrays
  • Modbus array write is enabled
Parameters
hHandle to open connection.
nameArray name on controller (will be dimensioned if not present).
bufArray buffer. Elements may be separated by ,, \r, or \r\n. Do not use spaces.
startIndex to start writing over an existing array. Leave 0 to
endIndex to stop writing over an existing array.
Returns
GCLIB_INVALID_ARGUMENT if array does not exist but cannot be automatically dimensioned, or start / end are invalid for array.

◆ gclib_set_firmware()

gclib_result gclib_set_firmware ( gclib_handle h,
const char * file_path )

Set the firmware on the controller.

Parameters
hHandle to open connection.
file_pathPath to firmware file.
Returns
GCLIB_INVALID_ARGUMENT if firmware file cannot be opened, or is rejected by the controller.