SciSDK Library
SDK for SciCompiler projects
SciSDK_DLL.h File Reference
#include "scisdk_defines.h"
Include dependency graph for SciSDK_DLL.h:

Go to the source code of this file.

Macros

#define SCISDK_DLL_API   extern "C"
 

Functions

SCISDK_DLL_API void * SCISDK_InitLib ()
 Initialize the SciSDK handles accolating the resources. This function must be called before any other function. More...
 
SCISDK_DLL_API int SCISDK_FreeLib (void *handle)
 Release the SciSDK handles and free the resources. More...
 
SCISDK_DLL_API int SCISDK_AddNewDevice (char *DevicePath, char *DeviceModel, char *JSONFwFilePath, char *Name, void *handle)
 Connect to and hardware device. The function tries to connect to the device, decode the SciCompiler json file and build the tree of memory mapped resources defined in the JSON file. The function create a node for each resource and add it to the tree. A top node, with name specified in Name field, for the device is also created and added to the tree. All the nodes found in the json are added as children of the top node. More...
 
SCISDK_DLL_API int SCISDK_DetachDevice (char *name, void *handle)
 Remove a device from the tree of memory mapped resources. The function will call the device specific library disconnect function and will release the resources allocated by the library for the device. More...
 
SCISDK_DLL_API int SCISDK_SetParameterString (char *Path, char *value, void *handle)
 Set the value of a parameter for the specific SciCompiler Memory Mapped Component or route the value to external board library to set board specific parameters. This function accept a string as value. Please note that the behaviour of this function is different if the path is a SciSDK managed node or a device specific node managed by the external library. The SciSDK managed nodes perform a conversion of the string to the correct type and then set the value automatically. If the operation is routed to the external library (ie: ../felib/..) SciSDK has not the information reguarding the data type required by the external library indeed the che correct SetParamter function must be call in agreement with the external library required value type. More...
 
SCISDK_DLL_API int SCISDK_SetParameterInteger (char *Path, int value, void *handle)
 Set the value of a parameter for the specific SciCompiler Memory Mapped Component or route the value to external board library to set board specific parameters. This function accept a integer as value. Please note that the behaviour of this function is different if the path is a SciSDK managed node or a device specific node managed by the external library. The SciSDK managed nodes perform a conversion of the string to the correct type and then set the value automatically. If the operation is routed to the external library (ie: ../felib/..) SciSDK has not the information reguarding the data type required by the external library indeed the che correct SetParamter function must be call in agreement with the external library required value type. More...
 
SCISDK_DLL_API int SCISDK_SetParameterUInteger (char *Path, uint32_t value, void *handle)
 Set the value of a parameter for the specific SciCompiler Memory Mapped Component or route the value to external board library to set board specific parameters. This function accept a integer as value. Please note that the behaviour of this function is different if the path is a SciSDK managed node or a device specific node managed by the external library. The SciSDK managed nodes perform a conversion of the string to the correct type and then set the value automatically. If the operation is routed to the external library (ie: ../felib/..) SciSDK has not the information reguarding the data type required by the external library indeed the che correct SetParamter function must be call in agreement with the external library required value type. More...
 
SCISDK_DLL_API int SCISDK_SetParameterDouble (char *Path, double value, void *handle)
 Set the value of a parameter for the specific SciCompiler Memory Mapped Component or route the value to external board library to set board specific parameters. This function accept a double as value. Please note that the behaviour of this function is different if the path is a SciSDK managed node or a device specific node managed by the external library. The SciSDK managed nodes perform a conversion of the string to the correct type and then set the value automatically. If the operation is routed to the external library (ie: ../felib/..) SciSDK has not the information reguarding the data type required by the external library indeed the che correct SetParamter function must be call in agreement with the external library required value type. More...
 
SCISDK_DLL_API int SCISDK_GetParameterString (char *Path, char **value, void *handle)
 Get the value of a parameter for the specific SciCompiler Memory Mapped Component or route the value to external board library to set board specific parameters. This function return a string as value. Please note that the behaviour of this function is different if the path is a SciSDK managed node or a device specific node managed by the external library. The SciSDK managed nodes perform a conversion of the string to the correct type and then set the value automatically. If the operation is routed to the external library (ie: ../felib/..) SciSDK has not the information reguarding the data type required by the external library indeed the che correct GetParamter function must be call in agreement with the external library required value type. More...
 
SCISDK_DLL_API int SCISDK_GetParameterInteger (char *Path, int *value, void *handle)
 Get the value of a parameter for the specific SciCompiler Memory Mapped Component or route the value to external board library to set board specific parameters. This function return a integer as value. Please note that the behaviour of this function is different if the path is a SciSDK managed node or a device specific node managed by the external library. The SciSDK managed nodes perform a conversion of the string to the correct type and then set the value automatically. If the operation is routed to the external library (ie: ../felib/..) SciSDK has not the information reguarding the data type required by the external library indeed the che correct GetParamter function must be call in agreement with the external library required value type. More...
 
SCISDK_DLL_API int SCISDK_GetParameterUInteger (char *Path, uint32_t *value, void *handle)
 Get the value of a parameter for the specific SciCompiler Memory Mapped Component or route the value to external board library to set board specific parameters. This function return a integer as value. Please note that the behaviour of this function is different if the path is a SciSDK managed node or a device specific node managed by the external library. The SciSDK managed nodes perform a conversion of the string to the correct type and then set the value automatically. If the operation is routed to the external library (ie: ../felib/..) SciSDK has not the information reguarding the data type required by the external library indeed the che correct GetParamter function must be call in agreement with the external library required value type. More...
 
SCISDK_DLL_API int SCISDK_GetParameterDouble (char *Path, double *value, void *handle)
 Get the value of a parameter for the specific SciCompiler Memory Mapped Component or route the value to external board library to set board specific parameters. This function return a double as value. Please note that the behaviour of this function is different if the path is a SciSDK managed node or a device specific node managed by the external library. The SciSDK managed nodes perform a conversion of the string to the correct type and then set the value automatically. If the operation is routed to the external library (ie: ../felib/..) SciSDK has not the information reguarding the data type required by the external library indeed the che correct GetParamter function must be call in agreement with the external library required value type. More...
 
SCISDK_DLL_API int SCISDK_DecodeData (char *Path, void *buffer_in, void *buffer_out, void *handle)
 
SCISDK_DLL_API int SCISDK_AllocateBuffer (char *Path, T_BUFFER_TYPE buffer_type, void **buffer, void *handle)
 Allocate a buffer to be used to store data from the board for the specific Memory Mapped Componet (oscilloscope, spectrum, list) or of the board specific endpoint (scope, dpp). The buffer is allocated in function of the actual configuration of MMC/board endpoint. For example, if a 1024 point oscilloscope is configured the buffer will be allocated to store 1024 points (1 analog point + 4 digital point per sample). If the device driver to the MMC/board endpoint support both RAW and DECODED data, it is possible to specify the type of data to allocate the buffer for. More...
 
SCISDK_DLL_API int SCISDK_AllocateBufferSize (char *Path, T_BUFFER_TYPE buffer_type, void **buffer, void *handle, int size)
 Allocate a buffer to be used to store data from the board for the specific Memory Mapped Componet (list) or of the board specific endpoint (scope, dpp). The MMC operating in list mode does not have a maximum number of points to store, indeed an additional parameter (size) is required to allocated a buffer to store the data. The user will than use this buffer as temporany buffer for the readout and will store received data in a processing buffer or a file. More...
 
SCISDK_DLL_API int SCISDK_SetRegister (char *Path, uint32_t value, void *handle)
 Set the value of a register in the SciCompiler generated firmware. This function works only on Simple Register, not on Register File and Multichannel Register. The last two types of register are supported as Memory Mapped Component and they are set/get with Set/GetParameter. More...
 
SCISDK_DLL_API int SCISDK_GetRegister (char *Path, uint32_t *value, void *handle)
 Get the value of a register in the SciCompiler generated firmware. This function works only on Simple Register, not on Register File and Multichannel Register. The last two types of register are supported as Memory Mapped Component and they are set/get with Set/GetParameter. More...
 
SCISDK_DLL_API int SCISDK_FreeBuffer (char *Path, int buffer_type, void **buffer, void *handle)
 Release the memory allocated by SCISDK_AllocateBuffer() or SCISDK_AllocateBufferSize() More...
 
SCISDK_DLL_API int SCISDK_ReadData (char *Path, void *buffer, void *handle)
 Read data from the board for the specific Memory Mapped Componet (oscilloscope, spectrum, list) or of the board specific endpoint (scope, dpp). The function behavour depends on the configuration of the device driver of the Memory Mapped Component or board endpoint: More...
 
SCISDK_DLL_API int SCISDK_WriteData (char *Path, void *buffer, void *handle)
 Write data tothe board for the specific Memory Mapped Componet or of the board specific endpoint. More...
 
SCISDK_DLL_API int SCISDK_ReadStatus (char *Path, void *buffer, void *handle)
 Query the board for the specific Memory Mapped Componet (oscilloscope, spectrum, list) status using the MMC device driver The status is a structure, different for each MMC device driver, that contains the actual status of the MMC, (ie: running, stopped, run time, progress, number of samples in the spectrum, etc..) More...
 
SCISDK_DLL_API int SCISDK_s_error (int err_no, char **value, void *handle)
 Convert the returned error code in a human readable string explaining the error. More...
 
SCISDK_DLL_API int SCISDK_ExecuteCommand (char *Path, char *value, void *handle)
 Execute a command for the specific Memory Mapped Component device driver/endpoint. Typically the device drivers of the MMC do not directly support access to the hardware when a single Set/Get Paramter is called but wait for a configuration command to be executed. Refere to the specific Device Driver documentation for the list of supported commands and their usage. More...
 
SCISDK_DLL_API int SCISDK_GetComponentList (char *name, char *Type, char **ret, bool return_json, void *handle)
 Return the tree of: More...
 
SCISDK_DLL_API int SCISDK_GetAllParameters (char *Path, char **ret, void *handle)
 Return all configuration parameters for the specified node MMC/endpoint. More...
 
SCISDK_DLL_API int SCISDK_GetParameterDescription (char *Path, char **ret, void *handle)
 Return the description for a specific parameter. More...
 
SCISDK_DLL_API int SCISDK_GetParameterListOfValues (char *Path, char **ret, void *handle)
 If the parameter has a list of possible values, return the list of possible values otherwise return an empty string. More...
 
SCISDK_DLL_API int SCISDK_GetParameterMinimumValue (char *Path, double *re, void *handle)
 If the parameter is numeric, return the minimum acceptable value. More...
 
SCISDK_DLL_API int SCISDK_GetParameterMaximumValue (char *Path, double *ret, void *handle)
 If the parameter is numeric, return the maximum acceptable value. More...
 
SCISDK_DLL_API int SCISDK_GetParametersProperties (char *Path, char **ret, void *handle)
 Return a json with all the information about the parameter. More...
 
SCISDK_DLL_API int SCISDK_free_string (char *_str)
 Free a SciSDK allocated string. More...
 
SCISDK_DLL_API int SCISDK_GetAttachedDevicesList (char **ret, void *handle)
 Return a csv string with the list of attached devices. More...
 
SCISDK_DLL_API int SCISDK_GetLibraryVersion (char **ret, void *handle)
 Return a string with the current version of SciSDK library. More...
 

Macro Definition Documentation

◆ SCISDK_DLL_API

#define SCISDK_DLL_API   extern "C"

Function Documentation

◆ SCISDK_AddNewDevice()

SCISDK_DLL_API int SCISDK_AddNewDevice ( char *  DevicePath,
char *  DeviceModel,
char *  JSONFwFilePath,
char *  Name,
void *  handle 
)

Connect to and hardware device. The function tries to connect to the device, decode the SciCompiler json file and build the tree of memory mapped resources defined in the JSON file. The function create a node for each resource and add it to the tree. A top node, with name specified in Name field, for the device is also created and added to the tree. All the nodes found in the json are added as children of the top node.

The connection method is specified in the Device path field. To connect to a device connected to the USB port, the Device path field must be set to "usb:<pid>" where <pid> is the PID of the device. Please pay attention to the fact that some devices emulate ethernet on usb bus, so the connection must be done using the ethernet protocol.

To connect to a device connected to the ethernet port, the Device path field must be set to "<ip>:<port>" where the <ip> is the IP address of the device and <port> is the port number of the server listening on the device. If port is not specified, the default port for the specific device is used.

This function will load the dinamic library specified for the specific hardware device default path. If the library is found in the execution path of the user software, the library will be loaded Otherwise the library will be loaded searching into the system path. Please pay attention to the fact that the libraries must be compiled with the same architecture used by the user software.

Parameters
DevicePathDevice path to connect to. Must be in the format "usb:<pid>" or "<ip>:<port>"
DeviceModelString containing the device model. Must be one of the supported devices. The supported devices are: DT1260, R5560, R5560SE, DT5560, DT5550, DT5550W-CITIROC, DT5550W-PETIROC, V2740, V2745, DT2740, DT2745
JSONFwFilePathPath to the JSON file containing the firmware description.
NameName of the board. This name will be used to identify the device.
handleHandle to the SciSDK allocated by SCISDK_InitLib()
Returns
int error code defined in NIErrorCode.h

◆ SCISDK_AllocateBuffer()

SCISDK_DLL_API int SCISDK_AllocateBuffer ( char *  Path,
T_BUFFER_TYPE  buffer_type,
void **  buffer,
void *  handle 
)

Allocate a buffer to be used to store data from the board for the specific Memory Mapped Componet (oscilloscope, spectrum, list) or of the board specific endpoint (scope, dpp). The buffer is allocated in function of the actual configuration of MMC/board endpoint. For example, if a 1024 point oscilloscope is configured the buffer will be allocated to store 1024 points (1 analog point + 4 digital point per sample). If the device driver to the MMC/board endpoint support both RAW and DECODED data, it is possible to specify the type of data to allocate the buffer for.

The buffer parameter is a pointer to a data structure pointer. The function will allocate the structure in the buffer and all array inside the structure.

To release the memory allocated by this function the user must call SCISDK_FreeBuffer(). Do not use free to release the memory allocated by this function.

Parameters
PathThe path to the parameter to get. The path must be in the format <device name>:.../<resource name>
for example: /board0/MMCComponents/Oscilloscope_0
buffer_typeT_BUFFER_TYPE_RAW or T_BUFFER_TYPE_DECODED
bufferPointer to a non allocated struct (ie: SCISDK_OSCILLOSCOPE_DECODED_BUFFER) to be allocated
handleHandle to the SciSDK allocated by SCISDK_InitLib()
Returns
int error code defined in NIErrorCode.h

◆ SCISDK_AllocateBufferSize()

SCISDK_DLL_API int SCISDK_AllocateBufferSize ( char *  Path,
T_BUFFER_TYPE  buffer_type,
void **  buffer,
void *  handle,
int  size 
)

Allocate a buffer to be used to store data from the board for the specific Memory Mapped Componet (list) or of the board specific endpoint (scope, dpp). The MMC operating in list mode does not have a maximum number of points to store, indeed an additional parameter (size) is required to allocated a buffer to store the data. The user will than use this buffer as temporany buffer for the readout and will store received data in a processing buffer or a file.

The buffer parameter is a pointer to a data structure pointer. The function will allocate the structure in the buffer and all array inside the structure.

To release the memory allocated by this function the user must call SCISDK_FreeBuffer(). Do not use free to release the memory allocated by this function.

Parameters
PathThe path to the parameter to get. The path must be in the format <device name>:.../<resource name>
for example: /board0/MMCComponents/List_0
buffer_typeT_BUFFER_TYPE_RAW or T_BUFFER_TYPE_DECODED
bufferPointer to a non allocated struct (ie: SCISDK_LIST_RAW_BUFFER) to be allocated
handleHandle to the SciSDK allocated by SCISDK_InitLib()
sizeSize of the buffer to allocate. The size is specified in elements (ie: 1024 for a 1024 list word, where the list word can be 32/64/128.. bits wide, depending on the MMC configuration specified in SciCompiler when the list has been created)
Returns
int error code defined in NIErrorCode.h

◆ SCISDK_DecodeData()

SCISDK_DLL_API int SCISDK_DecodeData ( char *  Path,
void *  buffer_in,
void *  buffer_out,
void *  handle 
)

◆ SCISDK_DetachDevice()

SCISDK_DLL_API int SCISDK_DetachDevice ( char *  name,
void *  handle 
)

Remove a device from the tree of memory mapped resources. The function will call the device specific library disconnect function and will release the resources allocated by the library for the device.

Parameters
nameName of the board to remove.
handleHandle to the SciSDK allocated by SCISDK_InitLib()
Returns
int error code defined in NIErrorCode.h

◆ SCISDK_ExecuteCommand()

SCISDK_DLL_API int SCISDK_ExecuteCommand ( char *  Path,
char *  value,
void *  handle 
)

Execute a command for the specific Memory Mapped Component device driver/endpoint. Typically the device drivers of the MMC do not directly support access to the hardware when a single Set/Get Paramter is called but wait for a configuration command to be executed. Refere to the specific Device Driver documentation for the list of supported commands and their usage.

Parameters
PathThe path to the Memory Mapped component or board endpoint command <device name>:.../<resource name>.<command name>
for example: /board0/MMCComponents/TOF_0.start
valueAn optional argument for the command. It's type depends on the command
handleHandle to the SciSDK allocated by SCISDK_InitLib()
Returns
int error code defined in NIErrorCode.h

◆ SCISDK_free_string()

SCISDK_DLL_API int SCISDK_free_string ( char *  _str)

Free a SciSDK allocated string.

Parameters
_strPointer to the string to be freed
Returns
int error code defined in NIErrorCode.h

◆ SCISDK_FreeBuffer()

SCISDK_DLL_API int SCISDK_FreeBuffer ( char *  Path,
int  buffer_type,
void **  buffer,
void *  handle 
)

Release the memory allocated by SCISDK_AllocateBuffer() or SCISDK_AllocateBufferSize()

Parameters
PathThe path to the Memory Mapped component or board endpoint The path must be in the format <device name>:.../<resource name>
for example: /board0/MMCComponents/List_0
buffer_typeT_BUFFER_TYPE_RAW or T_BUFFER_TYPE_DECODED
bufferPointer to the buffer to be released
handleHandle to the SciSDK allocated by SCISDK_InitLib()
Returns
int error code defined in NIErrorCode.h

◆ SCISDK_FreeLib()

SCISDK_DLL_API int SCISDK_FreeLib ( void *  handle)

Release the SciSDK handles and free the resources.

Parameters
handlehandle to the SciSDK allocated by SCISDK_InitLib()
Returns
int error code defined in NIErrorCode.h

◆ SCISDK_GetAllParameters()

SCISDK_DLL_API int SCISDK_GetAllParameters ( char *  Path,
char **  ret,
void *  handle 
)

Return all configuration parameters for the specified node MMC/endpoint.

Parameters
PathThe path to the node MMC/endpoint <device name>:.../<resource name>
for example: /board0/MMCComponents/Oscilloscope_0
retPointer to the buffer to be filled with the tree. It's allocated by the SCISDK_GetParameterListOfValues function and must be freed by the caller using the SCISDK_free_string() function
handleHandle to the SciSDK allocated by SCISDK_InitLib()
Returns
int error code defined in NIErrorCode.h

◆ SCISDK_GetAttachedDevicesList()

SCISDK_DLL_API int SCISDK_GetAttachedDevicesList ( char **  ret,
void *  handle 
)

Return a csv string with the list of attached devices.

Parameters
retPointer to the buffer to be filled with the csv string. It's allocated by the SCISDK_GetAttachedDevicesList function and must be freed by the caller using the SCISDK_free_string() function
handle
Returns
int error code defined in NIErrorCode.h

◆ SCISDK_GetComponentList()

SCISDK_DLL_API int SCISDK_GetComponentList ( char *  name,
char *  Type,
char **  ret,
bool  return_json,
void *  handle 
)

Return the tree of:

  • Memory Mapped Components
  • registers
  • board endpoints
  • board device driver configuration parameters for the specified board

Please note that is not possible to get CaenFELib internal configuration parameters using this function. (will appera just /felib/** indicating that this routing point will pass the rest of the path to CaenFELib)

Parameters
nameThe name of the board
TypeThe type of resource to be returned. It can be:
  • registers
  • oscilloscope
  • wavedump
  • listmodule
  • fftmonitor
  • spectrum
  • custompacket
  • mcratemeter
  • citiroccfg
  • petiroccfg
  • registerfile
  • oscilloscopedual
  • tofspectrum
  • frametransfer
  • citirocframe
  • petirocframe

Left empty ("") to get all resources

Parameters
retPointer to the buffer to be filled with the tree. It's allocated by the SCISDK_GetParameterListOfValues function and must be freed by the caller using the SCISDK_free_string() function
return_jsonIf true the tree is returned in JSON format, otherwise in CSV format
handleHandle to the SciSDK allocated by SCISDK_InitLib()
Returns
int error code defined in NIErrorCode.h

◆ SCISDK_GetLibraryVersion()

SCISDK_DLL_API int SCISDK_GetLibraryVersion ( char **  ret,
void *  handle 
)

Return a string with the current version of SciSDK library.

Parameters
retPointer to the buffer to be filled with the version number string. It's allocated by the SCISDK_GetLibraryVersion function and must be freed by the caller using the SCISDK_free_string() function
handle
Returns
int error code defined in NIErrorCode.h

◆ SCISDK_GetParameterDescription()

SCISDK_DLL_API int SCISDK_GetParameterDescription ( char *  Path,
char **  ret,
void *  handle 
)

Return the description for a specific parameter.

Parameters
PathThe path to the paramter <device name>:.../<resource name>.<parameter name>
for example: /board0/MMCComponents/Oscilloscope_0.trigger_mode
retPointer to the buffer to be filled with the description. It's allocated by the SCISDK_GetParameterListOfValues function and must be freed by the caller using the SCISDK_free_string() function
handleHandle to the SciSDK allocated by SCISDK_InitLib()
Returns
int error code defined in NIErrorCode.h

◆ SCISDK_GetParameterDouble()

SCISDK_DLL_API int SCISDK_GetParameterDouble ( char *  Path,
double *  value,
void *  handle 
)

Get the value of a parameter for the specific SciCompiler Memory Mapped Component or route the value to external board library to set board specific parameters. This function return a double as value. Please note that the behaviour of this function is different if the path is a SciSDK managed node or a device specific node managed by the external library. The SciSDK managed nodes perform a conversion of the string to the correct type and then set the value automatically. If the operation is routed to the external library (ie: ../felib/..) SciSDK has not the information reguarding the data type required by the external library indeed the che correct GetParamter function must be call in agreement with the external library required value type.

Parameters
PathThe path to the parameter to get. The path must be in the format <device name>:.../<resource name>.<parameter name>
for example: /board0/MMCComponents/Oscilloscope_0.trigger_mode
ValuePointer to the allocated buffer to receive the value. The value will be a double. The buffer must be large enough to contain the value.
handleHandle to the SciSDK allocated by SCISDK_InitLib()
Returns
int error code defined in NIErrorCode.h

◆ SCISDK_GetParameterInteger()

SCISDK_DLL_API int SCISDK_GetParameterInteger ( char *  Path,
int *  value,
void *  handle 
)

Get the value of a parameter for the specific SciCompiler Memory Mapped Component or route the value to external board library to set board specific parameters. This function return a integer as value. Please note that the behaviour of this function is different if the path is a SciSDK managed node or a device specific node managed by the external library. The SciSDK managed nodes perform a conversion of the string to the correct type and then set the value automatically. If the operation is routed to the external library (ie: ../felib/..) SciSDK has not the information reguarding the data type required by the external library indeed the che correct GetParamter function must be call in agreement with the external library required value type.

Parameters
PathThe path to the parameter to get. The path must be in the format <device name>:.../<resource name>.<parameter name>
for example: /board0/MMCComponents/Oscilloscope_0.trigger_value
ValuePointer to the allocated buffer to receive the value. The value will be a integer. The buffer must be large enough to contain the value.
handleHandle to the SciSDK allocated by SCISDK_InitLib()
Returns
int error code defined in NIErrorCode.h

◆ SCISDK_GetParameterListOfValues()

SCISDK_DLL_API int SCISDK_GetParameterListOfValues ( char *  Path,
char **  ret,
void *  handle 
)

If the parameter has a list of possible values, return the list of possible values otherwise return an empty string.

Parameters
PathThe path to the paramter <device name>:.../<resource name>.<parameter name>
for example: /board0/MMCComponents/Oscilloscope_0.trigger_mode
retPointer to the buffer to be filled with the list of possible values. It's allocated by the SCISDK_GetParameterListOfValues function and must be freed by the caller using the SCISDK_free_string() function
handleHandle to the SciSDK allocated by SCISDK_InitLib()
Returns
int error code defined in NIErrorCode.h

◆ SCISDK_GetParameterMaximumValue()

SCISDK_DLL_API int SCISDK_GetParameterMaximumValue ( char *  Path,
double *  ret,
void *  handle 
)

If the parameter is numeric, return the maximum acceptable value.

Parameters
PathThe path to the paramter <device name>:.../<resource name>.<parameter name>
for example: /board0/MMCComponents/Oscilloscope_0.trigger_level
rePointer to the double-type variable to be filled with the maximum value.
handleHandle to the SciSDK allocated by SCISDK_InitLib()
Returns
int error code defined in NIErrorCode.h

◆ SCISDK_GetParameterMinimumValue()

SCISDK_DLL_API int SCISDK_GetParameterMinimumValue ( char *  Path,
double *  re,
void *  handle 
)

If the parameter is numeric, return the minimum acceptable value.

Parameters
PathThe path to the paramter <device name>:.../<resource name>.<parameter name>
for example: /board0/MMCComponents/Oscilloscope_0.trigger_level
rePointer to the double-type variable to be filled with the minimum value.
handleHandle to the SciSDK allocated by SCISDK_InitLib()
Returns
int error code defined in NIErrorCode.h

◆ SCISDK_GetParametersProperties()

SCISDK_DLL_API int SCISDK_GetParametersProperties ( char *  Path,
char **  ret,
void *  handle 
)

Return a json with all the information about the parameter.

Parameters
PathThe path to the paramter <device name>:.../<resource name>.<parameter name>
for example: /board0/MMCComponents/Oscilloscope_0.trigger_level
retPointer to the buffer to be filled with the json. It's allocated by the SCISDK_GetParametersProperties function and must be freed by the caller using the SCISDK_free_string() function
handle
Returns
int error code defined in NIErrorCode.h

◆ SCISDK_GetParameterString()

SCISDK_DLL_API int SCISDK_GetParameterString ( char *  Path,
char **  value,
void *  handle 
)

Get the value of a parameter for the specific SciCompiler Memory Mapped Component or route the value to external board library to set board specific parameters. This function return a string as value. Please note that the behaviour of this function is different if the path is a SciSDK managed node or a device specific node managed by the external library. The SciSDK managed nodes perform a conversion of the string to the correct type and then set the value automatically. If the operation is routed to the external library (ie: ../felib/..) SciSDK has not the information reguarding the data type required by the external library indeed the che correct GetParamter function must be call in agreement with the external library required value type.

Parameters
PathThe path to the parameter to get. The path must be in the format <device name>:.../<resource name>.<parameter name>
for example: /board0/MMCComponents/Oscilloscope_0.trigger_mode
ValuePointer to the allocated buffer to receive the value. The value will be a string. The buffer must be large enough to contain the value.
handleHandle to the SciSDK allocated by SCISDK_InitLib()
Returns
int error code defined in NIErrorCode.h

◆ SCISDK_GetParameterUInteger()

SCISDK_DLL_API int SCISDK_GetParameterUInteger ( char *  Path,
uint32_t *  value,
void *  handle 
)

Get the value of a parameter for the specific SciCompiler Memory Mapped Component or route the value to external board library to set board specific parameters. This function return a integer as value. Please note that the behaviour of this function is different if the path is a SciSDK managed node or a device specific node managed by the external library. The SciSDK managed nodes perform a conversion of the string to the correct type and then set the value automatically. If the operation is routed to the external library (ie: ../felib/..) SciSDK has not the information reguarding the data type required by the external library indeed the che correct GetParamter function must be call in agreement with the external library required value type.

Parameters
PathThe path to the parameter to get. The path must be in the format <device name>:.../<resource name>.<parameter name>
for example: /board0/MMCComponents/Oscilloscope_0.trigger_value
ValuePointer to the allocated buffer to receive the value. The value will be a uint32. The buffer must be large enough to contain the value.
handleHandle to the SciSDK allocated by SCISDK_InitLib()
Returns
int error code defined in NIErrorCode.h

◆ SCISDK_GetRegister()

SCISDK_DLL_API int SCISDK_GetRegister ( char *  Path,
uint32_t *  value,
void *  handle 
)

Get the value of a register in the SciCompiler generated firmware. This function works only on Simple Register, not on Register File and Multichannel Register. The last two types of register are supported as Memory Mapped Component and they are set/get with Set/GetParameter.

Parameters
PathThe path to the register <device name>:.../Registers/<register name>
for example: board0:/Registers/DELAY
valuePoiter to the variable to receive the value of the register
handleHandle to the SciSDK allocated by SCISDK_InitLib()
Returns
int error code defined in NIErrorCode.h

◆ SCISDK_InitLib()

SCISDK_DLL_API void* SCISDK_InitLib ( )

Initialize the SciSDK handles accolating the resources. This function must be called before any other function.

Returns
void* pointer to the SciSDK handle

◆ SCISDK_ReadData()

SCISDK_DLL_API int SCISDK_ReadData ( char *  Path,
void *  buffer,
void *  handle 
)

Read data from the board for the specific Memory Mapped Componet (oscilloscope, spectrum, list) or of the board specific endpoint (scope, dpp). The function behavour depends on the configuration of the device driver of the Memory Mapped Component or board endpoint:

  • if the device driver is configured to work in RAW mode, the function will read the RAW data from the board and store it in the buffer.
  • If the device driver is configured to work in DECODED mode, the function will read the DECODED data from the board and store it in the buffer.
  • If the divice driver is configured to operated in block mode, the function will wait all the data from the board to be available before returning (up to the specifed timeout).
  • If the device driver is configured to operate in non blocking mode, the function will return immediately with the data available in the MMC/endpoint buffers or return NI_NO_DATA_AVAILABLE.
  • If the device driver is configured to operate in thread mode, the function will not directly read the data from the board, but will return the data available in device driver internal buffers. A thread inside the driver periodically reads the data from the board and stores it in the internal buffers.
Parameters
PathThe path to the Memory Mapped component or board endpoint The path must be in the format <device name>:.../<resource name>
for example: /board0/MMCComponents/List_0
bufferPointer to the buffer to be filled with the data read from the board allocated with SCISDK_AllocateBuffer()
handleHandle to the SciSDK allocated by SCISDK_InitLib()
Returns
int error code defined in NIErrorCode.h

◆ SCISDK_ReadStatus()

SCISDK_DLL_API int SCISDK_ReadStatus ( char *  Path,
void *  buffer,
void *  handle 
)

Query the board for the specific Memory Mapped Componet (oscilloscope, spectrum, list) status using the MMC device driver The status is a structure, different for each MMC device driver, that contains the actual status of the MMC, (ie: running, stopped, run time, progress, number of samples in the spectrum, etc..)

Parameters
PathThe path to the Memory Mapped component or board endpoint
bufferPointer to the buffer to be filled with the status. The buffer must be allocated and must be in the correct format for the specific MMC device driver. For example the status buffer for the Spectrum device driver must be instantiated as SCISDK_SPECTRUM_STATUS_BUFFER
handleHandle to the SciSDK allocated by SCISDK_InitLib()
Returns
int error code defined in NIErrorCode.h

◆ SCISDK_s_error()

SCISDK_DLL_API int SCISDK_s_error ( int  err_no,
char **  value,
void *  handle 
)

Convert the returned error code in a human readable string explaining the error.

Parameters
err_noThe error code returned by the SciSDK functions
valuePointer to the buffer to be filled with the error string. It's allocated by the SCISDK_s_error function and must be freed by the caller using the SCISDK_free_string() function
handleHandle to the SciSDK allocated by SCISDK_InitLib()
Returns
The same error code of the parameter err_no

◆ SCISDK_SetParameterDouble()

SCISDK_DLL_API int SCISDK_SetParameterDouble ( char *  Path,
double  value,
void *  handle 
)

Set the value of a parameter for the specific SciCompiler Memory Mapped Component or route the value to external board library to set board specific parameters. This function accept a double as value. Please note that the behaviour of this function is different if the path is a SciSDK managed node or a device specific node managed by the external library. The SciSDK managed nodes perform a conversion of the string to the correct type and then set the value automatically. If the operation is routed to the external library (ie: ../felib/..) SciSDK has not the information reguarding the data type required by the external library indeed the che correct SetParamter function must be call in agreement with the external library required value type.

The SciSDK check that the value is in the correct range for the specific parameter. If the value is not in the correct range the function will return an error and the value will not be set.

Parameters
PathThe path to the parameter to set. The path must be in the format <device name>:.../<resource name>.<parameter name>
for example: /board0/MMCComponents/Oscilloscope_0.trigger_level
ValueThe value to set. The value must be a double.
handleHandle to the SciSDK allocated by SCISDK_InitLib()
Returns
int error code defined in NIErrorCode.h

◆ SCISDK_SetParameterInteger()

SCISDK_DLL_API int SCISDK_SetParameterInteger ( char *  Path,
int  value,
void *  handle 
)

Set the value of a parameter for the specific SciCompiler Memory Mapped Component or route the value to external board library to set board specific parameters. This function accept a integer as value. Please note that the behaviour of this function is different if the path is a SciSDK managed node or a device specific node managed by the external library. The SciSDK managed nodes perform a conversion of the string to the correct type and then set the value automatically. If the operation is routed to the external library (ie: ../felib/..) SciSDK has not the information reguarding the data type required by the external library indeed the che correct SetParamter function must be call in agreement with the external library required value type.

The SciSDK check that the value is in the correct range for the specific parameter. If the value is not in the correct range the function will return an error and the value will not be set.

Parameters
PathThe path to the parameter to set. The path must be in the format <device name>:.../<resource name>.<parameter name>
for example: /board0/MMCComponents/Oscilloscope_0.trigger_level
ValueThe value to set. The value must be a integer.
handleHandle to the SciSDK allocated by SCISDK_InitLib()
Returns
int error code defined in NIErrorCode.h

◆ SCISDK_SetParameterString()

SCISDK_DLL_API int SCISDK_SetParameterString ( char *  Path,
char *  value,
void *  handle 
)

Set the value of a parameter for the specific SciCompiler Memory Mapped Component or route the value to external board library to set board specific parameters. This function accept a string as value. Please note that the behaviour of this function is different if the path is a SciSDK managed node or a device specific node managed by the external library. The SciSDK managed nodes perform a conversion of the string to the correct type and then set the value automatically. If the operation is routed to the external library (ie: ../felib/..) SciSDK has not the information reguarding the data type required by the external library indeed the che correct SetParamter function must be call in agreement with the external library required value type.

The SciSDK check that the value is in the correct range or in the acceptance list for the specific parameter. If the value is not in the correct range or in the acceptance list, the function will return an error and the value will not be set.

Parameters
PathThe path to the parameter to set. The path must be in the format <device name>:.../<resource name>.<parameter name>
for example: /board0/MMCComponents/Oscilloscope_0.trigger_mode
ValueThe value to set. The value must be a string.
handleHandle to the SciSDK allocated by SCISDK_InitLib()
Returns
int error code defined in NIErrorCode.h

◆ SCISDK_SetParameterUInteger()

SCISDK_DLL_API int SCISDK_SetParameterUInteger ( char *  Path,
uint32_t  value,
void *  handle 
)

Set the value of a parameter for the specific SciCompiler Memory Mapped Component or route the value to external board library to set board specific parameters. This function accept a integer as value. Please note that the behaviour of this function is different if the path is a SciSDK managed node or a device specific node managed by the external library. The SciSDK managed nodes perform a conversion of the string to the correct type and then set the value automatically. If the operation is routed to the external library (ie: ../felib/..) SciSDK has not the information reguarding the data type required by the external library indeed the che correct SetParamter function must be call in agreement with the external library required value type.

The SciSDK check that the value is in the correct range for the specific parameter. If the value is not in the correct range the function will return an error and the value will not be set.

Parameters
PathThe path to the parameter to set. The path must be in the format <device name>:.../<resource name>.<parameter name>
for example: /board0/MMCComponents/Oscilloscope_0.trigger_level
ValueThe value to set. The value must be a uint32_t.
handleHandle to the SciSDK allocated by SCISDK_InitLib()
Returns
int error code defined in NIErrorCode.h

◆ SCISDK_SetRegister()

SCISDK_DLL_API int SCISDK_SetRegister ( char *  Path,
uint32_t  value,
void *  handle 
)

Set the value of a register in the SciCompiler generated firmware. This function works only on Simple Register, not on Register File and Multichannel Register. The last two types of register are supported as Memory Mapped Component and they are set/get with Set/GetParameter.

Parameters
PathThe path to the register <device name>:.../Registers/<register name>
for example: board0:/Registers/DELAY
valueThe value to set in the register
handleHandle to the SciSDK allocated by SCISDK_InitLib()
Returns
int error code defined in NIErrorCode.h

◆ SCISDK_WriteData()

SCISDK_DLL_API int SCISDK_WriteData ( char *  Path,
void *  buffer,
void *  handle 
)

Write data tothe board for the specific Memory Mapped Componet or of the board specific endpoint.

Parameters
PathThe path to the Memory Mapped component or board endpoint The path must be in the format <device name>:.../<resource name>
for example: /board0/boardapi/spectrum
bufferPointer to the buffer to be filled with the data read from the board allocated with SCISDK_AllocateBuffer()
handleHandle to the SciSDK allocated by SCISDK_InitLib()
Returns
int error code defined in NIErrorCode.h