Software Library API naibrd 2.24.0
See all documentation at naii.docs.com
General Module Info Functions

Functions

NAIBRDFUNC nai_status_t NAIAPI naibrd_GetModuleCount (int32_t cardIndex, int32_t *p_outmoduleCount)
 Retrieves the maximum number of modules that is available for the board.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_GetModuleName (int32_t cardIndex, int32_t module, uint32_t *p_outmodulename)
 Retrieves the module name or ID.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_GetModuleOffset (int32_t cardIndex, int32_t module, uint32_t *p_outoffset)
 Retrieves the offset address for the module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_GetModuleSize (int32_t cardIndex, int32_t module, uint32_t *p_outsize)
 Retrieves the size (in bytes) of the module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_GetModuleCapabilities (int32_t cardIndex, int32_t module, uint32_t *outCapabilityVal)
 Retrieves NAIBRD card structure to check if module is block and pack capable.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_GetModuleFPGARev (int32_t cardIndex, int32_t module, float64_t *p_outfpgaRevMajorMinor)
 Retrieves the module's FPGA revision, in terms of a floating point major/minor.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_GenModuleRev (int32_t cardIndex, int32_t module, float64_t *p_outprocRevMajorMinor, float64_t *p_outfpgaRevMajorMinor, int32_t *p_outintfHwRev, int32_t *p_outfuncHwRev, uint32_t *p_outintfSpecialCode, uint32_t *p_outfuncSpecialCode)
 Retrieves the module's revision information. The processor and FPGA revision is specified in terms of a major and minor revision.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_GenModuleRevRaw (int32_t cardIndex, int32_t module, uint32_t *p_outprocRawRev, uint32_t *p_outfpgaRawRev, int32_t *p_outintfHwRev, int32_t *p_outfuncHwRev, uint32_t *p_outintfSpecialCode, uint32_t *p_outfuncSpecialCode)
 Retrieves the module's revision information. The processor and FPGA revision is specified in terms of the raw value read from the revision register.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_GetModuleRevGen2_3 (int32_t cardIndex, int32_t module, uint32_t *p_outversion, uint32_t *p_outrevision, uint32_t *p_outprocRev, uint32_t *p_outfpgaRev, uint32_t *p_outspecialCode)
 Retrieves the module's revision information for Gen 2 and Gen 3 products.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_GetFloatingPointModeCapability (int32_t cardIndex, int32_t module, bool_t *p_outfloatingPointModeCapable)
 Retrieves the module's capability for floating point mode operation. In floating point mode operation, some of the module's registers will switch from integer values to single-precision floating point values. In this mode, the offset and gain settings specified for each channel will be applied to scale the value read or written to the register.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SetFloatingPointModeEnable (int32_t cardIndex, int32_t module, bool_t enable)
 Sets the module's register and naibrd library's (register shadow) floating point mode operation and blocks until the HW conversion is complete. When changing modes, the HW will convert all of the register's data that is affected by the change. Once all of the data has been converted, the HW will indicate its completion via the FLOATING_POINT_STATE register (NAI_GEN5_REG_FP_STATE_ADD).
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_GetFloatingPointModeEnable (int32_t cardIndex, int32_t module, bool_t *p_outenable)
 Retrieves the module's floating point mode operation (register), it does not indicate the locally shadowed state. In floating point mode operation, some of the module's registers will switch from integer values to single-precision floating point values. In this mode, the offset and gain settings specified for each channel will be applied to scale the value read or written to the register.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SetFloatingPointModeEnable_NonBlocking (int32_t cardIndex, int32_t module, bool_t enable)
 Sets the module's register and naibrd library's (register shadow) floating point mode operation and returns immediately. This API does not wait for the HW to confirm that the conversion is complete. Call naibrd_GetFloatingPointModeConversionComplete(). to get the conversion status.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_GetFloatingPointModeConversionComplete (int32_t cardIndex, int32_t module, bool_t *p_outconversionComplete)
 Indicate when the toggle of floating point mode operation (on or off) is complete. This API checks the FLOATING_POINT_CONVERSION_BUSY register and indicates its state. In floating point mode operation, some of the module's registers will switch from integer values to single-precision floating point values. In this mode, the offset and gain settings specified for each channel will be applied to scale the value read or written to the register. Use this function in conjunction with the naibrd_SetFloatingPointModeEnable_NonBlocking function to determine if all module's register data is in the correct data format.
 
nai_status_t NAIAPI naibrd_GetRunningInFloatingPointMode (int32_t cardIndex, int32_t module, bool_t *p_outfloatingPointEnabled)
 Retrieves the locally shadowed state of the floating point mode register. This API is meant to be used in custom applications. It will yeild a better performance over naibrd_GetFloatingPointModeEnable() since it does not read the FloatingPointModeEnable register directly (will be slower over ethernet). It refers to the locally shadowed state which is set on Open(), naibrd_SetFloatingPointModeEnable(), and naibrd_SetFloatingPointModeEnable_NonBlocking().
 

Detailed Description

Function Documentation

◆ naibrd_GenModuleRev()

NAIBRDFUNC nai_status_t NAIAPI naibrd_GenModuleRev ( int32_t cardIndex,
int32_t module,
float64_t * p_outprocRevMajorMinor,
float64_t * p_outfpgaRevMajorMinor,
int32_t * p_outintfHwRev,
int32_t * p_outfuncHwRev,
uint32_t * p_outintfSpecialCode,
uint32_t * p_outfuncSpecialCode )

Retrieves the module's revision information. The processor and FPGA revision is specified in terms of a major and minor revision.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
p_outprocRevMajorMinor: (Output) Module's processor major/minor revision.
p_outfpgaRevMajorMinor: (Output) Module's FPGA major/minor revision.
p_outintfHwRev: (Output) Module's interface board hardware revision.
p_outfuncHwRev: (Output) Module's function board hardware revision.
p_outintfSpecialCode: (Output) Module's interface board special code.
p_outfuncSpecialCode: (Output) Module's function board special code.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.

◆ naibrd_GenModuleRevRaw()

NAIBRDFUNC nai_status_t NAIAPI naibrd_GenModuleRevRaw ( int32_t cardIndex,
int32_t module,
uint32_t * p_outprocRawRev,
uint32_t * p_outfpgaRawRev,
int32_t * p_outintfHwRev,
int32_t * p_outfuncHwRev,
uint32_t * p_outintfSpecialCode,
uint32_t * p_outfuncSpecialCode )

Retrieves the module's revision information. The processor and FPGA revision is specified in terms of the raw value read from the revision register.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
p_outprocRawRev: (Output) Module's processor raw value revision.
p_outfpgaRawRev: (Output) Module's FPGA raw value revision.
p_outintfHwRev: (Output) Module's interface board hardware revision.
p_outfuncHwRev: (Output) Module's function board hardware revision.
p_outintfSpecialCode: (Output) Module's interface board special code.
p_outfuncSpecialCode: (Output) Module's function board special code.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.

◆ naibrd_GetFloatingPointModeCapability()

NAIBRDFUNC nai_status_t NAIAPI naibrd_GetFloatingPointModeCapability ( int32_t cardIndex,
int32_t module,
bool_t * p_outfloatingPointModeCapable )

Retrieves the module's capability for floating point mode operation. In floating point mode operation, some of the module's registers will switch from integer values to single-precision floating point values. In this mode, the offset and gain settings specified for each channel will be applied to scale the value read or written to the register.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
p_outfloatingPointModeCapable: (Output) NAI_TRUE if module capable of Floating Point Mode. NAI_FALSE otherwise.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.

◆ naibrd_GetFloatingPointModeConversionComplete()

NAIBRDFUNC nai_status_t NAIAPI naibrd_GetFloatingPointModeConversionComplete ( int32_t cardIndex,
int32_t module,
bool_t * p_outconversionComplete )

Indicate when the toggle of floating point mode operation (on or off) is complete. This API checks the FLOATING_POINT_CONVERSION_BUSY register and indicates its state. In floating point mode operation, some of the module's registers will switch from integer values to single-precision floating point values. In this mode, the offset and gain settings specified for each channel will be applied to scale the value read or written to the register. Use this function in conjunction with the naibrd_SetFloatingPointModeEnable_NonBlocking function to determine if all module's register data is in the correct data format.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
p_outconversionComplete: (Output) NAI_TRUE = conversion complete. NAI_FALSE = conversion busy in Integer mode.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.

◆ naibrd_GetFloatingPointModeEnable()

NAIBRDFUNC nai_status_t NAIAPI naibrd_GetFloatingPointModeEnable ( int32_t cardIndex,
int32_t module,
bool_t * p_outenable )

Retrieves the module's floating point mode operation (register), it does not indicate the locally shadowed state. In floating point mode operation, some of the module's registers will switch from integer values to single-precision floating point values. In this mode, the offset and gain settings specified for each channel will be applied to scale the value read or written to the register.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
p_outenable: (Output) NAI_TRUE to enable the module to operate in Floating Point Mode. NAI_FALSE to operate in Integer mode.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when H/W Floating Point is not supported.

◆ naibrd_GetModuleCapabilities()

NAIBRDFUNC nai_status_t NAIAPI naibrd_GetModuleCapabilities ( int32_t cardIndex,
int32_t module,
uint32_t * outCapabilityVal )

Retrieves NAIBRD card structure to check if module is block and pack capable.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) module number.
outCapabilityVal: (Output) Data packing options read from card structure.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_GetModuleCount()

NAIBRDFUNC nai_status_t NAIAPI naibrd_GetModuleCount ( int32_t cardIndex,
int32_t * p_outmoduleCount )

Retrieves the maximum number of modules that is available for the board.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
p_outmoduleCount: (Output) Maximum number of modules the board can hold.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.

◆ naibrd_GetModuleFPGARev()

NAIBRDFUNC nai_status_t NAIAPI naibrd_GetModuleFPGARev ( int32_t cardIndex,
int32_t module,
float64_t * p_outfpgaRevMajorMinor )

Retrieves the module's FPGA revision, in terms of a floating point major/minor.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
p_outfpgaRevMajorMinor: (Output) Module's FPGA major/minor revision.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.

◆ naibrd_GetModuleName()

NAIBRDFUNC nai_status_t NAIAPI naibrd_GetModuleName ( int32_t cardIndex,
int32_t module,
uint32_t * p_outmodulename )

Retrieves the module name or ID.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
p_outmodulename: (Output) Module Name.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.

◆ naibrd_GetModuleOffset()

NAIBRDFUNC nai_status_t NAIAPI naibrd_GetModuleOffset ( int32_t cardIndex,
int32_t module,
uint32_t * p_outoffset )

Retrieves the offset address for the module.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
p_outoffset: (Output) Module's offset address from the start of the board.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.

◆ naibrd_GetModuleRevGen2_3()

NAIBRDFUNC nai_status_t NAIAPI naibrd_GetModuleRevGen2_3 ( int32_t cardIndex,
int32_t module,
uint32_t * p_outversion,
uint32_t * p_outrevision,
uint32_t * p_outprocRev,
uint32_t * p_outfpgaRev,
uint32_t * p_outspecialCode )

Retrieves the module's revision information for Gen 2 and Gen 3 products.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
p_outversion: (Output) Module's version.
p_outrevision: (Output) Module's revision.
p_outprocRev: (Output) Module's processor revision.
p_outfpgaRev: (Output) Module's FPGA revision.
p_outspecialCode: (Output) Module's special code.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.

◆ naibrd_GetModuleSize()

NAIBRDFUNC nai_status_t NAIAPI naibrd_GetModuleSize ( int32_t cardIndex,
int32_t module,
uint32_t * p_outsize )

Retrieves the size (in bytes) of the module.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
p_outsize: (Output) Module's size in bytes.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.

◆ naibrd_GetRunningInFloatingPointMode()

nai_status_t NAIAPI naibrd_GetRunningInFloatingPointMode ( int32_t cardIndex,
int32_t module,
bool_t * p_outfloatingPointEnabled )

Retrieves the locally shadowed state of the floating point mode register. This API is meant to be used in custom applications. It will yeild a better performance over naibrd_GetFloatingPointModeEnable() since it does not read the FloatingPointModeEnable register directly (will be slower over ethernet). It refers to the locally shadowed state which is set on Open(), naibrd_SetFloatingPointModeEnable(), and naibrd_SetFloatingPointModeEnable_NonBlocking().

In floating point mode operation, some of the module's registers will switch from integer values to single-precision floating point values. In this mode, the offset and gain settings specified for each channel will be applied to scale the value read or written to the register.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
p_outfloatingPointEnabled: (Output) NAI_TRUE to enable the module to operate in Floating Point Mode. NAI_FALSE to operate in Integer mode.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.

◆ naibrd_SetFloatingPointModeEnable()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SetFloatingPointModeEnable ( int32_t cardIndex,
int32_t module,
bool_t enable )

Sets the module's register and naibrd library's (register shadow) floating point mode operation and blocks until the HW conversion is complete. When changing modes, the HW will convert all of the register's data that is affected by the change. Once all of the data has been converted, the HW will indicate its completion via the FLOATING_POINT_STATE register (NAI_GEN5_REG_FP_STATE_ADD).

This API does waits for the HW to confirm that the conversion is complete. If the conversion is not complete within 100ms, it will return with NAI_ERROR_TIMEOUT.

In floating point mode operation, some of the module's registers will switch from integer values to single-precision floating point values. In this mode, the offset and gain settings specified for each channel will be applied to scale the value read or written to the register.

Naibrd library shadows this register because accessing the local shadowed copy can be quicker (via ethernet) than accessing the register. This is needed to convert the register data correctly, which can slow down data acquisition (every time data is read, the data will either be in single precision floating point (floating point mode = ON), or it will need to be converted via software (floating point mode = OFF). If the FloatingPointModeEnable register is accessed every time data is acquired (to determine whether floating Point mode is ON or OFF) there will be a performance hit (significant hit via Ethernet). For this reason, the FloatingPointModeEnable register is read on Open() and shadowed locally).

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
enable: (Input) NAI_TRUE to enable the module to operate in Floating Point Mode. NAI_FALSE to operate in Integer mode.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when H/W Floating Point is not supported.

◆ naibrd_SetFloatingPointModeEnable_NonBlocking()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SetFloatingPointModeEnable_NonBlocking ( int32_t cardIndex,
int32_t module,
bool_t enable )

Sets the module's register and naibrd library's (register shadow) floating point mode operation and returns immediately. This API does not wait for the HW to confirm that the conversion is complete. Call naibrd_GetFloatingPointModeConversionComplete(). to get the conversion status.

In floating point mode operation, some of the module's registers will switch from integer values to single-precision floating point values. In this mode, the offset and gain settings specified for each channel will be applied to scale the value read or written to the register.

Naibrd library shadows this register because accessing the local shadowed copy is quicker (via ethernet) than accessing the register. This is needed to convert data correctly. Every time data is read from a hardware register, the data will either be in single precision floating point (floating point mode = ON), or it will need to be converted via software (floating point mode = OFF). If the FloatingPointModeEnable register is accessed every time data is acquired (to determine whether floating Point mode is ON or OFF) there will be a performance hit (significant hit via Ethernet). For this reason, the FloatingPointModeEnable register is read on Open() and shadowed locally).

NOTE: THIS API WILL SET THE INTERNAL COPY OF THE FloatingPointEnable REGISTER WITHOUT BLOCKING ON THE FloatingPointState REGISTER! This can lead to inaccurate data readings if the internal conversion is not complete and the user accesses data registers. For this reason, the user MUST call naibrd_GetFloatingPointModeConversionComplete() to ensure the internal data conversion is complete before accessing any data registers.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
enable: (Input) NAI_TRUE to enable the module to operate in FPoint Mode. NAI_FALSE to operate in Integer mode.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when H/W Floating Point is not supported.