Runtime Control

Once an xTDC4 device is configured, the following functions can be used to control the behavior of it.

These functions return quickly with very little overhead. However, they are not guaranteed to be thread safe.

int xtdc4_start_capture(xtdc4_device *device)

Start data acquisition.

Note

xtdc4_start_capture() will reset the memory buffer.

If you wish to stop recording data and resume later without clearing the buffer, use xtdc4_pause_capture() and xtdc4_continue_capture().

Parameters:
  • device – Pointer to an xTDC4 device.

Returns:

Status code: XTDC4_OK, XTDC4_INVALID_DEVICE, XTDC4_CRONO_INTERNAL_ERROR, XTDC4_HARDWARE_FAILURE, or XTDC4_WRONG_STATE.

int xtdc4_pause_capture(xtdc4_device *device)

Pause data acquisition.

xtdc4_pause_capture() and xtdc4_continue_capture() have less overhead than xtdc4_start_capture() and xtdc4_stop_capture(), but do not allow for a configuration change.

Parameters:
  • device – Pointer to an xTDC4 device.

Returns:

Status code: XTDC4_OK, XTDC4_INVALID_DEVICE, XTDC4_WRONG_STATE.

int xtdc4_continue_capture(xtdc4_device *device)

Continue data acquisition.

xtdc4_pause_capture() and xtdc4_continue_capture() have less overhead than xtdc4_start_capture() and xtdc4_stop_capture(), but do not allow for a configuration change.

Parameters:
  • device – Pointer to an xTDC4 device.

Returns:

Status code: XTDC4_OK, XTDC4_INVALID_DEVICE, XTDC4_WRONG_STATE.

int xtdc4_stop_capture(xtdc4_device *device)

Stop data acquisition.

Parameters:
  • device – Pointer to an xTDC4 device.

Returns:

Status code: XTDC4_OK, or XTDC4_INVALID_DEVICE.

int xtdc4_start_tiger(xtdc4_device *device)

Start the Timing Generator (TiGer)

This can be done independently of the state of the data acquisition.

Parameters:
  • device – Pointer to an xTDC4 device.

Returns:

Status code: XTDC4_OK, XTDC4_INVALID_DEVICE, or XTDC4_WRONG_STATE.

int xtdc4_stop_tiger(xtdc4_device *device)

Stop the Timing Generator (TiGer)

This can be done independently of the state of the data acquisition.

Parameters:
  • device – Pointer to an xTDC4 device.

Returns:

Status code: XTDC4_OK or XTDC4_INVALID_DEVICE.