CAEN MCA  0.99.10
SDK for Hexagon
API

Application programming interface. More...

+ Collaboration diagram for API:

Modules

 Command masks
 To be used in CAEN_MCA_SendCommand()
 
 Data masks
 To be used in CAEN_MCA_GetData() and CAEN_MCA_SetData()
 

Functions

CAEN_MCA_HANDLE CAEN_MCA_OpenDevice (const char *path, int32_t *retcode, int32_t *index)
 
void CAEN_MCA_CloseDevice (CAEN_MCA_HANDLE handle)
 
CAEN_MCA_HANDLE CAEN_MCA_GetAncestorHandle (CAEN_MCA_HANDLE handle, CAEN_MCA_HandleType_t handleType)
 
CAEN_MCA_HANDLE CAEN_MCA_GetChildHandle (CAEN_MCA_HANDLE handle, CAEN_MCA_HandleType_t handleType, int32_t index)
 
CAEN_MCA_HANDLE CAEN_MCA_GetChildHandleByName (CAEN_MCA_HANDLE handle, CAEN_MCA_HandleType_t handleType, const char *name)
 
int32_t CAEN_MCA_GetData (CAEN_MCA_HANDLE handle, CAEN_MCA_DataType_t dataType, uint64_t dataMask,...)
 
int32_t CAEN_MCA_SetData (CAEN_MCA_HANDLE handle, CAEN_MCA_DataType_t dataType, uint64_t dataMask,...)
 
int32_t CAEN_MCA_SendCommand (CAEN_MCA_HANDLE handle, CAEN_MCA_CommandType_t cmdType, uint64_t cmdMaskIn, uint64_t cmdMaskOut,...)
 
int32_t CAEN_MCA_WaitEvent (CAEN_MCA_HANDLE handle, CAEN_MCA_HANDLE *eventHandle)
 

Detailed Description

Application programming interface.

Function Documentation

◆ CAEN_MCA_OpenDevice()

CAEN_MCA_HANDLE CAEN_MCA_OpenDevice ( const char *  path,
int32_t *  retcode,
int32_t *  index 
)

Connect to a device. The device should be closed using CAEN_MCA_CloseDevice().

Parameters
[in]pathURL to device in the form "\<scheme\>://\<domain\>[:\<port\>][/connection?\<parameters\>]":
  • scheme (required): can be "eth" (ethernet) "usb" (usb) and "opt" (optical)
  • domain (required): host to connect (can be IP address or hostname)
  • port (optional): port to use for connection. Default is 56342. Should be used only for Hexagon boards.
  • parameters (optional): list of parameters ampersand-separated. Supported parameters are "link=<number>", "conetnode=<number>", "vmeaddress=<number>" and "serial=<number>". The latter is supported only for Hexagon boards. Except for "eth" scheme, one and only one between "serial" and "link" must be specified.
[out]retcodeCAEN_MCA_RetCode_Success (0) in case of success. Error codes specified in CAEN_MCA_RetCode_t. Can be NULL.
[out]indexthe index of the opened device. Can be used as index to retrieve the returned handle later using CAEN_MCA_GetChildHandle(). Can be NULL.
Returns
Handle of the device. NULL in case of error.
Examples:
examples_board_control.c.

◆ CAEN_MCA_CloseDevice()

void CAEN_MCA_CloseDevice ( CAEN_MCA_HANDLE  handle)

Close the connection to the device opened with CAEN_MCA_OpenDevice(). Undefined behaviour when called twice on the same handle.

Parameters
[in]handlethe handle returned by CAEN_MCA_OpenDevice(). If NULL, no operation is performed.
Examples:
examples_board_control.c.

◆ CAEN_MCA_GetAncestorHandle()

CAEN_MCA_HANDLE CAEN_MCA_GetAncestorHandle ( CAEN_MCA_HANDLE  handle,
CAEN_MCA_HandleType_t  handleType 
)

Get an ancestor handle. Iterate over the ancestor of a given handle and return the first handle of the requested type.

Parameters
[in]handlethe handle.
[in]handleTypethe ancestor handle type.
See also
DATAMASK_HANDLE_TYPE
Returns
Handle of the ancestor. NULL in case of error.
Examples:
examples_handles.c.

◆ CAEN_MCA_GetChildHandle()

CAEN_MCA_HANDLE CAEN_MCA_GetChildHandle ( CAEN_MCA_HANDLE  handle,
CAEN_MCA_HandleType_t  handleType,
int32_t  index 
)

Get a child handle.

Parameters
[in]handlethe parent handle. Can be NULL if handleType is CAEN_MCA_HANDLE_LIBRARY or CAEN_MCA_HANDLE_DEVICE.
[in]handleTypethe child handle type.
See also
DATAMASK_HANDLE_TYPE
Parameters
[in]indexthe index of the child, except handleType is:
See also
DATAMASK_HANDLE_NAME
Returns
Handle of the child. NULL in case of error.
Examples:
examples_discovery.c, examples_handles.c, examples_hv.c, examples_mcs.c, examples_parameters.c, examples_roi.c, examples_spectrum.c, and examples_waveforms.c.

◆ CAEN_MCA_GetChildHandleByName()

CAEN_MCA_HANDLE CAEN_MCA_GetChildHandleByName ( CAEN_MCA_HANDLE  handle,
CAEN_MCA_HandleType_t  handleType,
const char *  name 
)

Get a child handle.

Parameters
[in]handlethe parent handle. Can be NULL if handleType is CAEN_MCA_HANDLE_LIBRARY or CAEN_MCA_HANDLE_DEVICE.
[in]handleTypethe child handle type. CAEN_MCA_HANDLE_COLLECTION not supported.
See also
DATAMASK_HANDLE_TYPE
Parameters
[in]namethe name of the child. It is the literal version of the index (e.g. string "1" for index 1), except handleType is:
See also
DATAMASK_HANDLE_NAME
Returns
Handle of the child. NULL in case of error.
Examples:
examples_acquisition_control.c, examples_handles.c, examples_hv.c, examples_mcs.c, examples_parameters.c, examples_roi.c, examples_spectrum.c, and examples_waveforms.c.

◆ CAEN_MCA_GetData()

int32_t CAEN_MCA_GetData ( CAEN_MCA_HANDLE  handle,
CAEN_MCA_DataType_t  dataType,
uint64_t  dataMask,
  ... 
)

Get Data. For the variable argument list version see CAEN_MCA_GetDataV().

Parameters
[in]handlethe handle.
[in]dataTypethe type of data.
[in]dataMaska bit mask for the given dataType. See also Data masks.
[out]...a pointer to variable for each bit set in dataMask, with the specified type. See also Variadic argument order and Variadic argument type.
Returns
CAEN_MCA_RetCode_Success (0) in case of success. Error codes specified in CAEN_MCA_RetCode_t.
See also
CAEN_MCA_SetData()
Examples:
examples_board_control.c, examples_discovery.c, examples_hv.c, examples_lists.c, examples_mcs.c, examples_parameters.c, examples_roi.c, examples_spectrum.c, and examples_waveforms.c.

◆ CAEN_MCA_SetData()

int32_t CAEN_MCA_SetData ( CAEN_MCA_HANDLE  handle,
CAEN_MCA_DataType_t  dataType,
uint64_t  dataMask,
  ... 
)

Set Data. For the variable argument list version see CAEN_MCA_SetDataV().

Parameters
[in]handlethe handle.
[in]dataTypethe type of data.
[in]dataMaska bit mask for the given dataType. See also Data masks.
[in]...a variable for each bit set in dataMask, with the specified type. See also Variadic argument order and Variadic argument type.
Returns
CAEN_MCA_RetCode_Success (0) in case of success. Error codes specified in CAEN_MCA_RetCode_t.
See also
CAEN_MCA_GetData()
Examples:
examples_acquisition_control.c, examples_discovery.c, examples_lists.c, examples_mcs.c, examples_parameters.c, examples_roi.c, examples_spectrum.c, and examples_waveforms.c.

◆ CAEN_MCA_SendCommand()

int32_t CAEN_MCA_SendCommand ( CAEN_MCA_HANDLE  handle,
CAEN_MCA_CommandType_t  cmdType,
uint64_t  cmdMaskIn,
uint64_t  cmdMaskOut,
  ... 
)

Send Command. For the variable argument list version see CAEN_MCA_SendCommandV().

Parameters
[in]handlethe handle.
[in]cmdTypethe type of command.
[in]cmdMaskIna bit mask of input variables for the given cmdType. See also Command masks.
[in]cmdMaskOuta bit mask of output variables for the given cmdType. See also Command masks.
[in,out]...a variable for each bit set first in cmdMaskIn and then cmdMaskOut, with the specified type. See also Variadic argument order and Variadic argument type.
Returns
CAEN_MCA_RetCode_Success (0) in case of success. Error codes specified in CAEN_MCA_RetCode_t.
Examples:
examples_acquisition_control.c, examples_board_control.c, examples_hv.c, examples_mcs.c, and examples_spectrum.c.

◆ CAEN_MCA_WaitEvent()

int32_t CAEN_MCA_WaitEvent ( CAEN_MCA_HANDLE  handle,
CAEN_MCA_HANDLE eventHandle 
)

Wait for events.

Warning
Not yet implemented.
Parameters
[in]handlethe handle.
[out]eventHandlethe type of command.
Returns
CAEN_MCA_RetCode_Success (0) in case of success. Error codes specified in CAEN_MCA_RetCode_t.