libsmoco
Low-level interface library for Segment Motion Controller system
|
Functions | |
SMOCO_CTX | smoco_init (xlog_session_t logger) |
Initialize library and obtain resource handle. More... | |
SMOCO_STATUS | smoco_terminate (SMOCO_CTX ctx) |
Terminate session with libsmoco. More... | |
SMOCO_STATUS | smoco_set_iolog (SMOCO_CTX ctx, xlog_session_t iolog) |
Specify a low-level I/O logger. More... | |
SMOCO_STATUS | smoco_set_txlog (SMOCO_CTX ctx, xlog_session_t txlog) |
Specify a transaction logger. More... | |
SMOCO_STATUS | smoco_set_estop_flag (SMOCO_CTX ctx, int *p_estop) |
Set client flag for triggering emergency stop. More... | |
SMOCO_STATUS | smoco_set_async_cb_timer (SMOCO_CTX ctx, unsigned ms) |
Set time interval for SMOCO_TXEVT_TIMER_TICK events during async operations. More... | |
SMOCO_CTX smoco_init | ( | xlog_session_t | logger | ) |
Initialize library and obtain resource handle.
Allocates and initializes data structure for segment data. Call this function first to initiate a usage session, before any other use of libsmoco routines.
logger | Logging session handle from xLog, or NULL if logging is not needed. |
SMOCO_STATUS smoco_set_async_cb_timer | ( | SMOCO_CTX | ctx, |
unsigned | ms | ||
) |
Set time interval for SMOCO_TXEVT_TIMER_TICK events during async operations.
ctx | Context handle for this session |
ms | Desired interval in milliseconds |
SMOCO_STATUS smoco_set_estop_flag | ( | SMOCO_CTX | ctx, |
int * | p_estop | ||
) |
Set client flag for triggering emergency stop.
A client application can provide libsmoco with an int pointer, which will be watched for a nonzero value. When a nonzero value is found, a global emergency stop command will be issued to all connected SMOCO nodes.
ctx | Context handle for this session |
p_estop | Pointer to an integer value, to be monitored for nonzero value |
SMOCO_STATUS smoco_set_iolog | ( | SMOCO_CTX | ctx, |
xlog_session_t | iolog | ||
) |
Specify a low-level I/O logger.
A client application can specify an xLog session to which low-level SMOCO I/O will be logged, one message per line. The format of this data is tab-separated, so it's not recommended to reuse an xLog session that's being used for other outputs. Note in particular that this logging session should be distinct from that specified to smoco_init(). If this function is not called, low-level I/O logging will not be performed.
ctx | Context handle for this session |
iolog | xLog session handle |
SMOCO_STATUS smoco_set_txlog | ( | SMOCO_CTX | ctx, |
xlog_session_t | txlog | ||
) |
Specify a transaction logger.
A client application can specify an Xlog session to which "transaction" (long-running actuator movement) tracking logs will be written. The format of this data is tab-separated, so it's not recommended to reuse an Xlog session that's being used for other outputs. Note in particular that this logging session should be distinct from that specified to smoco_init(). If this function is not called, transaction logging will not be performed.
ctx | Context handle for this session |
txlog | Xlog session handle |
SMOCO_STATUS smoco_terminate | ( | SMOCO_CTX | ctx | ) |
Terminate session with libsmoco.
End any ongoing mechanical activity, disconnect network socket, terminate threads, clear memory buffer and deallocate.
ctx | Context handle for this session. |