Software Library API naibrd 1.62
See all documentation at naii.docs.com
naibrd_da.c File Reference
#include <stdlib.h>
#include "functions/naibrd_modCommon.h"
#include "functions/naibrd_da.h"
#include "maps/nai_map_modCommon.h"
#include "maps/nai_map_da.h"
#include "advanced/naibrd_adv.h"
#include "naibrd_config.h"
#include "naibrd.h"
#include "../../include/boards/naibrd_gen5.h"

Macros

#define NAI_DA_GEN3_REG_CAL_CHAN_ADD   0x3A8u
 
#define NAI_DA_GEN3_REG_CAL_TYPE_ADD   0x3AAu
 
#define NAI_DA_GEN3_REG_CAL_VALUE_ADD   0x3ACu
 
#define NAI_DA_GEN3_CURRENT_LSB_AMP   0.0001 /* Amp (0.1 mA) */
 
#define NAI_DA_GEN5_DA1_CURRENT_READING_LSB_AMP   (0.030/32768) /* Amp (~915 nA) */
 
#define NAI_DA_GEN5_DA1_VOLTAGE_READING_LSB_VOLT   0.0000763 /* !(Verify number based on uni/bipolar = (0.0763 V) to replace "lsb = 10V(maxrange)/7FFF" calculation in GetWrapVoltage() */
 
#define NAI_DA_GEN5_DA1_VOLT_WRAP_RANGE_PRE_FPGA_0x300   10.0 /* Voltage Wrap Range Pre-FPGA Rev 0x0300 */
 
#define NAI_DA_GEN5_DA1_VOLT_WRAP_RANGE   13.0 /* Expanded Voltage Wrap Range FPGA Rev 0x0300 and later */
 
#define NAI_DA_GEN5_DA1_VOLT_WRAP_LSB_PRE_FPGA_0x300   (NAI_DA_GEN5_DA1_VOLT_WRAP_RANGE_PRE_FPGA_0x300/0x7FFF)
 
#define NAI_DA_GEN5_DA1_VOLT_WRAP_LSB   (NAI_DA_GEN5_DA1_VOLT_WRAP_RANGE/0x7FFF)
 
#define NAI_DA_GEN5_DA2_CURRENT_BIPOLAR_WRAP_LSB_AMP   (.010/0x7FFF) /* 10mA range, bipolar, 16bits*/
 
#define NAI_DA_GEN5_DA3_CURRENT_BIPOLAR_WRAP_LSB   (0.100/0x7FFF) /* 100mA range, bipolar, 16 bits */
 
#define NAI_DA_GEN5_DA3_VOLTAGE_BIPOLAR_WRAP_LSB   (40.0/0x7FFF) /* 40V range, bipolar, 16 bits */
 
#define NAI_DA_GEN5_DA4_CURRENT_BIPOLAR_WRAP_LSB   (0.010/0x7FFF) /* 10mA range, bipolar, 16 bits */
 
#define NAI_DA_GEN5_DA4_VOLTAGE_BIPOLAR_WRAP_LSB   (100.0/0x7FFF) /* 100V range, bipolar, 16 bits */
 
#define NAI_DA_GEN5_DA5_VOLTAGE_LSB   (.001) /* 1mV */
 
#define NAI_DA_GEN5_DA5_CURRENT_LSB   (.001) /* 1mA */
 
#define NAI_DA_GEN5_CMEFG_CURRENT_BIPOLAR_WRAP_LSB_AMP   (.010/0x7FFF) /* 10mA range, bipolar, 16bits*/
 
#define NAI_DA_GEN5_WATCHDOG_STATUS_MASK   0x80000000u
 
#define NAI_DA_GEN5_WATCHDOG_STATUS_SHIFT   31
 
#define NAI_DA_GEN5_MODULE_POWER_RESET_COUNT   8
 
#define NAI_DA_GEN5_MB_COMMON_MODULE_NUM   0
 
#define NAI_DA_GEN3_F5_POWER_SUPPLY_LSB_VOLT   0.182
 
#define NAI_DA1_MAX_CHANNELS   12
 
#define NAI_DA2_MAX_CHANNELS   16
 
#define NAI_DA3_MAX_CHANNELS   4
 
#define NAI_DA4_MAX_CHANNELS   4
 
#define NAI_DA5_MAX_CHANNELS   4
 
#define NAI_CF1_MAX_CHANNELS   4
 
#define NAI_CMEFG_MAX_CHANNELS   8
 

Functions

NAIBRDFUNC int32_t NAIAPI naibrd_DA_GetChannelCount (uint32_t modId)
 Returns the number of channels for the specified D/A Module ID.
 
NAIBRDFUNC int32_t NAIAPI naibrd_DA_GetMaxFIFOSize (uint32_t modId)
 Returns the max size of FIFO for the specified D/A Module ID.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetData (int32_t cardIndex, int32_t module, int32_t channel, nai_da_data_type_t type, float64_t data)
 Sets the output voltage or current depending on the channel's operation mode for the specified D/A channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetData (int32_t cardIndex, int32_t module, int32_t channel, nai_da_data_type_t type, float64_t *outdata)
 Retrieves the output voltage or current depending on the channel's operation mode for the specified D/A channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetWrapVoltage (int32_t cardIndex, int32_t module, int32_t channel, float64_t *outvoltage)
 Retrieves the wrap-around voltage for the specified D/A channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetCurrentMeasurement (int32_t cardIndex, int32_t module, int32_t channel, float64_t *outcurrent)
 Retrieves the measured current from the specified D/A channel data register.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetAllData (int32_t cardIndex, int32_t module, nai_da_data_type_t type, int32_t arraysize, float64_t outdata[])
 Retrieves all the output voltages or current based for all the channels of the specified D/A module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetAllWrapVoltages (int32_t cardIndex, int32_t module, int32_t arraysize, float64_t outvoltages[])
 Retrieves the all the wrap-around voltages for all the channels of the specified D/A module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetAllCurrentMeasurements (int32_t cardIndex, int32_t module, int32_t arraysize, float64_t outcurrents[])
 Retrieves the all the measured current for all the channels of the specified D/A module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetStatus (int32_t cardIndex, int32_t module, int32_t channel, nai_da_status_type_t type, nai_status_bit_t *outstatusBit)
 Retrieves the D/A BIT or Overcurrent Status for the specified D/A channel. Reading any status bit will unlatch the entire register. BIT Status and Overcurrent Status is part of the background testing and the status register may be checked or polled at any given time.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_ClearStatus (int32_t cardIndex, int32_t module, int32_t channel, nai_da_status_type_t type)
 Clears the latched status for the specified DA channel and status type.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_ResetToZero (int32_t cardIndex, int32_t module)
 Sets all channel outputs for the specified D/A module to 0V output. When a "1" is written to the Reset to Zero register, the module's channels outputs will be set to 0V. The module clears this registers when after it sets the outputs to zero.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_ReinitToZeroCal (int32_t cardIndex, int32_t module)
 Sets all calibration registers to the default values. This DOES NOT overwrite, or modify the calibration file in any way. The default values will be used until a power cycle occurs. At that time the D/A will re-initialize itself with the values in the calibration file.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetPowerSupplyEnable (int32_t cardIndex, int32_t module, nai_da_powersupply_ctrl_t enable)
 Enables the power supply for the module. When NAI_DA_POWERSUPPLY_CTRL_ENABLE is written to the power Supply enable register, the module's power supply will be on.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetPowerSupplyEnable (int32_t cardIndex, int32_t module, nai_da_powersupply_ctrl_t *outenable)
 returns whether the power supply for the module is enabled (NAI_DA_POWERSUPPLY_CTRL_ENABLE) or disabled (NAI_DA_POWERSUPPLY_CTRL_DISABLE).
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetChannelPowerSupplyEnable (int32_t cardIndex, int32_t module, int32_t channel, nai_da_powersupply_ctrl_t enable)
 Enables the power supply for the channel. When NAI_DA_POWERSUPPLY_CTRL_ENABLE is written to the power Supply enable register, the channel's power supply will be on.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetChannelPowerSupplyEnable (int32_t cardIndex, int32_t module, int32_t channel, nai_da_powersupply_ctrl_t *outenable)
 returns whether the power supply for the channel is enabled (NAI_DA_POWERSUPPLY_CTRL_ENABLE) or disabled (NAI_DA_POWERSUPPLY_CTRL_DISABLE).
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetOutputEnable (int32_t cardIndex, int32_t module, int32_t channel, nai_da_output_enable_t enable)
 Sets the channels enable output bit in the enable output register. Allows channel to output. This function is for DA2 only.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetOutputEnable (int32_t cardIndex, int32_t module, int32_t channel, nai_da_output_enable_t *outenable)
 Gets the channels enable output bit in the enable output register. Shows if channel can output. This function is for DA2 only.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetInternalVoltage (int32_t cardIndex, int32_t module, int32_t channel, float64_t *internalVoltage)
 Gets the internal voltage reading off the channel. This function is only for DA2.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetChanStatusEnable (int32_t cardIndex, int32_t module, int32_t channel, bool_t enable)
 Enables/disables status reporting for the specified D/A channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetChanStatusEnable (int32_t cardIndex, int32_t module, int32_t channel, bool_t *outenable)
 Retrieves the enabled/disabled state of status reporting for the specified D/A channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetRange (int32_t cardIndex, int32_t module, int32_t channel, nai_da_data_type_t type, nai_da_range_mode_t mode, float64_t range)
 Sets the range and polarity for the specified D/A channel. There is no current mode for DA2.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetRange (int32_t cardIndex, int32_t module, int32_t channel, nai_da_data_type_t type, nai_da_range_mode_t *outmode, float64_t *outrange)
 Retrieves the range and polarity for the specified D/A channel. There is no current mode for DA2.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetOutputTrigger (int32_t cardIndex, int32_t module, int32_t channel, uint32_t trigger)
 Sets the output data trigger for the specified D/A channel. DA output voltages can be programmed to change only with a synchronizing trigger, or constantly update based on the D/A Data register. This control is on a channel-by-channel basis. The whole system (not just the module) has two trigger lines that are shared and can be used for any D/A channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetOutputTrigger (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outtrigger)
 Retrieves the output data trigger for the specified D/A channel. DA output voltages can be programmed to change only with a synchronizing trigger, or constantly update based on the D/A Data register. This control is on a channel-by-channel basis. The whole system (not just the module) has two trigger lines that are shared and can be used for any D/A channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetSignalModeSelect (int32_t cardIndex, int32_t module, int32_t channel, nai_da_signal_mode_t mode)
 Sets the Single Ended or Differential mode configuration for the specified D/A channel. When in single ended mode, the pair of channels operate independently of each other. When in differential mode, the respective channels act as a pair with the output centered around zero (in bi-polar mode) or centered around half of full scale (in uni-polar mode). Feature available only on F5 modules.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetSignalModeSelect (int32_t cardIndex, int32_t module, int32_t channel, nai_da_signal_mode_t *outmode)
 Retrieves the Single Ended or Differential mode configuration for the specified D/A channel. When in single ended mode, the pair of channels operate independently of each other. When in differential mode, the respective channels act as a pair with the output centered around zero (in bi-polar mode) or centered around half of full scale (in uni-polar mode). Feature available only on F5 modules.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetOpMode (int32_t cardIndex, int32_t module, int32_t channel, nai_da_data_type_t opmode)
 Sets the specified channel on the D/A into Voltage, or Current mode. Voltage mode is the standard and default operating mode. Current mode allows the user to specify a FIXED current output which will vary the voltage as necessary to maintain this output current. Feature available only on DA1 and DA3 modules.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetOpMode (int32_t cardIndex, int32_t module, int32_t channel, nai_da_data_type_t *outopmode)
 Retrieves the mode set on the specified channel on the D/A (Voltage Mode, or Current Mode). Voltage mode is the standard and default operating mode. Current mode allows the user to specify a FIXED current output which will vary the voltage as necessary to maintain this output current. Feature available only on DA1 and DA3 modules.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetBandwidthSelect (int32_t cardIndex, int32_t module, int32_t channel, nai_da_bandwidth_t bandwidth)
 Sets the bandwidth of the specified channel on the D/A.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetBandwidthSelect (int32_t cardIndex, int32_t module, int32_t channel, nai_da_bandwidth_t *outbandwidth)
 Retrieves the bandwidth of the specified channel on the D/A.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetFloatingPointOffset (int32_t cardIndex, int32_t module, int32_t channel, float64_t offset)
 Sets the HW floating point offset for the specified D/A channel. This feature is only applicable when the HW floating point conversion mode is enabled (See naibrd_SetFloatingPointModeEnable()). Not all modules support HW floating point conversions, please refer to the module's HW specification for details.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetFloatingPointOffset (int32_t cardIndex, int32_t module, int32_t channel, float64_t *outoffset)
 Retrieves the HW floating point offset for the specified D/A channel. This feature is only applicable when the HW floating point conversion mode is enabled (See naibrd_SetFloatingPointModeEnable()). Not all modules support HW floating point conversions, please refer to the module's HW specification for details.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetFloatingPointScaleFactor (int32_t cardIndex, int32_t module, int32_t channel, float64_t scaleFactor)
 Sets the HW floating point scale factor for the specified D/A channel. This feature is only applicable when the HW floating point conversion mode is enabled (See naibrd_SetFloatingPointModeEnable()). Not all modules support HW floating point conversions, please refer to the module's HW specification for details.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetFloatingPointScaleFactor (int32_t cardIndex, int32_t module, int32_t channel, float64_t *outscaleFactor)
 Retrieves the HW floating point scale factor for the specified D/A channel. This feature is only applicable when the HW floating point conversion mode is enabled (See naibrd_SetFloatingPointModeEnable()). Not all modules support HW floating point conversions, please refer to the module's HW specification for details.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_RetryOverload (int32_t cardIndex, int32_t module, bool_t enable)
 When Retry Overload is enabled, the module will attempt to recover from an over-current condition once a second. While the over-current conditions exist, the channel will be set to zero output.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_ResetOverload (int32_t cardIndex, int32_t module)
 Note: This is the 'Reset Overcurrent' API for DA2,DA3 and DA4 Resets all D/A channels on the specified module that had been disabled following an over-load condition. When the reset process is complete, the processor will write a "0" back to the Reset Overload register when all over-current conditions are removed and all outputs are enabled.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_OvercurrentOverride (int32_t cardIndex, int32_t module, bool_t enable)
 When Over Current Override is set to "1" the over-current protection is turned off. By default, the value is set to "0" to enable over-current protection. Note, disabling the over-current protection should only be used for a short time period. Extended periods of over-current exposure will damage the D/A circuit.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetTestEnable (int32_t cardIndex, int32_t module, nai_da_test_type_t type, bool_t enable)
 Sets the D/A D2 or D3 BIT Test Enable state for the specified D/A module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetTestEnable (int32_t cardIndex, int32_t module, nai_da_test_type_t type, bool_t *outenable)
 Retrieves the D/A D2 or D3 BIT Test Enable state for the specified D/A module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_CheckD2TestVerify (int32_t cardIndex, int32_t module)
 Checks the D2 Test Verify register for the value of 0x55. When the D2 Test is enabled, the board will write 0x55 to the D2 Test Verify register. This register can be cleared to 0x00 and then read again, after approximately one second, to verify that background BIT testing is activated.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_ClearD2TestVerify (int32_t cardIndex, int32_t module)
 Clears the D2 Test Verify register. When the D2 Test is enabled, the board will write 0x55 to the D2 Test Verify register. After this register is cleared to 0x00, after approximately one second, call naibrd_DA_CheckD2TestVerify to verify that the board wrote 0x55 to the D2 Test Verify register, verifying that background BIT testing is activated.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetModuleBITEnable (int32_t cardIndex, int32_t module, nai_da_test_type_t type, bool_t bitEnable)
 Enables/Disables the BIT test specified by the type parameter. BITs are described as follows:
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetModuleBITEnable (int32_t cardIndex, int32_t module, nai_da_test_type_t type, bool_t *p_outbitEnable)
 Retrieves the state (Enabled or disabled) of the BIT test specified by the type parameter. BITs are described as follows:
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_CheckPowerOnBITComplete (int32_t cardIndex, int32_t module, bool_t *p_outpbitComplete)
 Retrieves the Power-On BIT (PBIT) status (complete or incomplete) for the specified module. The PBIT result will be in the BIT status register.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetModuleBITErrorThreshold (int32_t cardIndex, int32_t module, uint32_t threshold)
 Sets the BIT Error Threshold for continuous BIT conditions. The Error Threshold is a scalar for the internal BIT +2/-1 counter. To filter our momentary or intermittent anomalies in background BIT errors, this value can be increased to allow the error the "come and go" before the BIT status is flagged.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetModuleBITErrorThreshold (int32_t cardIndex, int32_t module, uint32_t *p_outthreshold)
 Retrieves the BIT Error Threshold for continuous BIT conditions. The Error Threshold is a scalar for the internal BIT +2/-1 counter. To filter our momentary or intermittent anomalies in background BIT errors, this value can be increased to allow the error the "come and go" before the BIT status is flagged.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_ClearModuleBITLogic (int32_t cardIndex, int32_t module, int32_t channel)
 Resets the Continuous BIT internal circuitry and counter mechanism for the specified channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetModuleSyncMode (int32_t cardIndex, int32_t module, naibrd_module_sync_config_type_t syncConfigType, naibrd_module_sync_mode_type_t syncMode, int32_t syncConfigModule)
 Sets the Synchronization mode for the module specified. Sample clocks and FIFO triggers can be synchronized between modules via a shared internal GPIO (shared between modules on the same board). Boards can share (synchronize) clocks and FIFO triggers between each other via an external I/O connection (front or rear I/O). This API sets the board mapping of a clock/trigger source (module or external) to all/any slave modules that sync off that signal.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetModuleSyncMode (int32_t cardIndex, int32_t module, naibrd_module_sync_config_type_t syncConfigType, naibrd_module_sync_mode_type_t *outsyncMode, int32_t *outsyncConfigModule)
 Retrieves the Synchronization mode for the module specified. Sample clocks and FIFO triggers can be synchronized between modules via a shared internal GPIO (shared between modules on the same board). Boards can share (synchronize) clocks and FIFO triggers between each other via an external I/O connection (front or rear I/O). This API sets the board mapping of a clock/trigger source (module or external) to all/any slave modules that sync off that signal.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetModuleSyncDecimation (int32_t cardIndex, int32_t module, uint32_t decimation)
 Sets decimation (oversampling) rate of the User Supplied Signal for the Master Module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetModuleSyncDecimation (int32_t cardIndex, int32_t module, uint32_t *outdecimation)
 Retrieves decimation (oversampling) rate of the User Supplied Signal for the Master Module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetInterruptEnable (int32_t cardIndex, int32_t module, int32_t channel, nai_da_status_type_t type, bool_t enable)
 Sets the D/A BIT or Overcurrent Status Interrupt Enable state for the specified D/A channel. BIT Status and Overcurrent Status is part of the background testing. When the interrupt is enabled, a non-compliant channel will trigger an interrupt. By default, interrupts are disabled.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetInterruptEnable (int32_t cardIndex, int32_t module, int32_t channel, nai_da_status_type_t type, bool_t *outenable)
 Retrieves the D/A BIT or Overcurrent Status Interrupt Enable state for the specified D/A channel. BIT Status and Overcurrent Status is part of the background testing. When the interrupt is enabled, a non-compliant channel will trigger an interrupt. By default, interrupts are disabled.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetInterruptVector (int32_t cardIndex, int32_t module, nai_da_status_type_t type, uint32_t vector)
 Sets the Interrupt Vector associated with a Status Type for the specified D/A module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetInterruptVector (int32_t cardIndex, int32_t module, nai_da_status_type_t type, uint32_t *outvector)
 Retrieves a Interrupt Vector associated with a Status Type for the specified D/A module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetInterruptSteering (int32_t cardIndex, int32_t module, nai_da_status_type_t type, naibrd_int_steering_t steering)
 Sets the Interrupt Steering which indicates the interrupt direction for the specified channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetInterruptSteering (int32_t cardIndex, int32_t module, nai_da_status_type_t type, naibrd_int_steering_t *outsteering)
 Retrieves the Interrupt Steering which indicates the interrupt direction for the specified channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetInterruptEdgeLevel (int32_t cardIndex, int32_t module, nai_da_status_type_t type, uint32_t edgeLevel)
 Sets the Interrupt Edge/Level register value for the specified DA channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetInterruptEdgeLevel (int32_t cardIndex, int32_t module, nai_da_status_type_t type, uint32_t *outEdgeLevel)
 Retrieves the Interrupt Edge/Level register value for the specified DA channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetFIFOCount (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outcount)
 Retrieves the FIFO counter registers that indicate the number of data elements in the D/A channel's FIFO buffer. Each time a read operation is made to the D/A channel's FIFO Buffer, the corresponding FIFO counter register is decremented by one. The maximum number of items that can be stored in each D/A channel's FIFO is 26,213 (0x6665) for Gen3, DA1, DA3 and 1000000 DA2.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetFIFORaw32 (int32_t cardIndex, int32_t module, int32_t channel, uint32_t count, uint32_t data[], uint32_t *outwrite)
 Loads raw data elements in the D/A channel's FIFO buffer. The data is presented in two's complement format. For bipolar mode; 0x00007FFF equals Positive Full Scale, 0xFFFF8000 equals Negative Full Scale. For unipolar mode, the range is from 0x00000000 to 0x0000FFFF where 0x0000FFFF equals Full Scale.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetFIFO32 (int32_t cardIndex, int32_t module, int32_t channel, uint32_t count, float32_t data[], uint32_t *outwrite)
 Loads single precision floating-point data elements in the D/A channel's FIFO buffer.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetFIFORaw16 (int32_t cardIndex, int32_t module, int32_t channel, uint32_t count, uint16_t data[], uint32_t *outwrite)
 Loads data elements in the D/A channel's FIFO buffer. The data is presented in two's complement format. For bipolar mode; 0x7FFF equals Positive Full Scale, 0x8000 equals Negative Full Scale. For unipolar mode, the range is from 0x0000 to 0xFFFF where 0xFFFF equals Full Scale. Performs a 16bit write if the board is Gen2 or 3 and a 32bit write if the board is Gen5. NOTE: For performance reasons, Gen5 modules should use naibrd_DA_SetFIFORaw32 instead of this API.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetFIFOAlmostEmptyThreshold (int32_t cardIndex, int32_t module, int32_t channel, uint32_t threshold)
 Sets the Almost Empty level to use to set or reset the D/A channel's FIFO Status "Almost Empty" bit. When the D/A channel's FIFO counter is less than or equal to the Almost Empty level, the "Almost Empty" bit will be set. When the D/A channel's FIFO counter is greater than the Almost Empty level, the "Almost Empty" bit will be reset.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetFIFOAlmostEmptyThreshold (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outthreshold)
 Retrieves the Almost Empty level to use to set or reset the D/A channel's FIFO Status "Almost Empty" bit. When the D/A channel's FIFO counter is less than or equal to the Almost Empty level, the "Almost Empty" bit will be set. When the D/A channel's FIFO counter is greater than the Almost Empty level, the "Almost Empty" bit will be reset.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetFIFOAlmostFullThreshold (int32_t cardIndex, int32_t module, int32_t channel, uint32_t threshold)
 Sets the Almost Full level to use to set or reset the D/A channel's FIFO Status "Almost Full" bit. When the D/A channel's FIFO counter is greater than or equal to the Almost Full level, the "Almost Full" bit will be set. When the D/A channel's FIFO counter is less than the Almost Full level, the "Almost Full" bit will be reset.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetFIFOAlmostFullThreshold (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outthreshold)
 Retrieves the Almost Full level to use to set or reset the D/A channel's FIFO Status "Almost Full" bit. When the D/A channel's FIFO counter is greater than or equal to the Almost Full level, the "Almost Full" bit will be set. When the D/A channel's FIFO counter is less than the Almost Full level, the "Almost Full" bit will be reset.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetFIFOLoThreshold (int32_t cardIndex, int32_t module, int32_t channel, uint32_t threshold)
 Sets the low threshold level to use to set or reset the D/A channel's FIFO Status "Low Limit" bit. When the D/A channel's FIFO counter is less than or equal to the low threshold level, the "Low Limit" bit will be set. When the D/A channel's FIFO counter is greater than the low threshold level, the "Low Limit" bit will be reset.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetFIFOLoThreshold (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outthreshold)
 Retrieves the low threshold level to use to set or reset the D/A channel's FIFO Status "Low Limit" bit. When the D/A channel's FIFO counter is less than or equal to the low threshold level, the "Low Limit" bit will be set. When the D/A channel's FIFO counter is greater than the low threshold level, the "Low Limit" bit will be reset.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetFIFOHiThreshold (int32_t cardIndex, int32_t module, int32_t channel, uint32_t threshold)
 Sets the high threshold level to use to set or reset the D/A channel's FIFO Status "High Limit" bit. When the D/A channel's FIFO counter is greater than or equal to the high threshold level, the "High Limit" bit will be set. When the D/A channel's FIFO counter is less than the high threshold level, the "High Limit" bit will be reset.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetFIFOHiThreshold (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outthreshold)
 Retrieves the high threshold level to use to set or reset the D/A channel's FIFO Status "High Limit" bit. When the D/A channel's FIFO counter is greater than or equal to the high threshold level, the "High Limit" bit will be set. When the D/A channel's FIFO counter is less than the high threshold level, the "High Limit" bit will be reset.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetFIFODelay (int32_t cardIndex, int32_t module, int32_t channel, uint32_t delay)
 Sets the number of delay samples before the actual FIFO data is "outputted" after a trigger is initiated. This sets a delay time after trigger prior to "outputting" the data.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetFIFODelay (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outdelay)
 Retrieves the number of delay samples before the actual FIFO data is "outputted" after a trigger is initiated. This sets a delay time after trigger prior to "outputting" the data.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetFIFOSize (int32_t cardIndex, int32_t module, int32_t channel, uint32_t size)
 Sets the size of the FIFO buffer. The largest size that a FIFO buffer can be is 26,213 (0x6665).
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetFIFOSize (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outsize)
 Retrieves the size of the FIFO buffer. The largest size that a FIFO buffer can be is (26,213 (0x6665) for Gen3 and 26,213 (0x6665) for Gen5) .
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetFIFORate (int32_t cardIndex, int32_t module, int32_t channel, uint32_t rate)
 Sets the sampling rate for the D/A channel's FIFO buffer.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetFIFORate (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outrate)
 Gets the sampling rate for the D/A channel's FIFO buffer.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetFIFOCtrl (int32_t cardIndex, int32_t module, int32_t channel, nai_da_fifo_ctrl_t ctrl)
 Sets the Buffer Operation Modes for the D/A channel's FIFO buffer.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetFIFOCtrl (int32_t cardIndex, int32_t module, int32_t channel, nai_da_fifo_ctrl_t *outctrl)
 Retrieves the Buffer Operation Modes for the D/A channel's FIFO buffer.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_ClearFIFO (int32_t cardIndex, int32_t module, int32_t channel)
 Clears the channel's data FIFO.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetFIFOTrigCtrl (int32_t cardIndex, int32_t module, int32_t channel, nai_da_fifo_trig_t ctrl)
 Sets the D/A channel's FIFO buffer trigger control configuration.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetFIFOTrigCtrl (int32_t cardIndex, int32_t module, int32_t channel, nai_da_fifo_trig_t *outctrl)
 Retrieves the D/A channel's FIFO buffer trigger control configuration.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SoftwareTrigger (int32_t cardIndex, int32_t module)
 Sets the D/A module's FIFO Buffer Software Trigger register to 1. The Software trigger is used to kick start the FIFO buffer and the output of data. The Trigger Control Configuration for each D/A channel's FIFO must be set up properly before invoking this routine. Setting the Software Trigger will start FIFO data output for all D/A channels.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SoftwareTriggerByChannel (int32_t cardIndex, int32_t module, int32_t channel)
 Sets the FIFO Buffer Software Trigger register for the DA module and channel specified to 1. The Software trigger is used to kick start the FIFO buffer and the output of data. DA5 Only*- the channel parameter is a bitmap of the channels that are to be triggered where the B0 (LSB) is channel 1, B1 is channel 2, B2 is channel 3, ...
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetFIFOStatus (int32_t cardIndex, int32_t module, int32_t channel, nai_da_fifo_status_type_t type, nai_da_fifo_status_t *outstatus)
 Retrieves the D/A channel's FIFO Buffer Status.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_ClearFIFOLatchedStatus (int32_t cardIndex, int32_t module, int32_t channel, uint32_t bit)
 Clears the D/A Buffer Fifo Latched Status for the specified channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetFIFOInterruptEnable (int32_t cardIndex, int32_t module, int32_t channel, nai_da_fifo_status_t mask)
 Sets the D/A Interrupt Enable setting for the specified D/A channel's FIFO Buffer.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetFIFOInterruptEnable (int32_t cardIndex, int32_t module, int32_t channel, nai_da_fifo_status_t *outmask)
 Retrieves the D/A Interrupt Enable setting for the specified D/A channel's FIFO Buffer.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetFIFOInterruptVector (int32_t cardIndex, int32_t module, int32_t channel, uint16_t vector)
 Sets the Interrupt Vector for the specified D/A channel's FIFO Buffer.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetFIFOInterruptVector (int32_t cardIndex, int32_t module, int32_t channel, uint16_t *outvector)
 Retrieves the Interrupt Vector for the specified D/A channel's FIFO Buffer.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetFIFOInterruptSteering (int32_t cardIndex, int32_t module, int32_t channel, naibrd_int_steering_t steering)
 Sets the steering for FIFO Interrupts on the specified channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetFIFOInterruptSteering (int32_t cardIndex, int32_t module, int32_t channel, naibrd_int_steering_t *outsteering)
 Gets the steering for FIFO Interrupts on the specified channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_ConvertToData32 (uint32_t modId, nai_da_data_type_t type, nai_da_range_mode_t mode, nai_da_range_t range, uint32_t rawdata, float64_t *outdata)
 Calculates the voltage in volts, or current in mA, for the given mode, range and raw data.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_ConvertToDataRaw32 (uint32_t modId, nai_da_data_type_t type, nai_da_range_mode_t mode, nai_da_range_t range, float64_t data, uint32_t *outrawdata)
 Calculates the raw data for the given mode, range and voltage/current.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_ConvertToRange (int32_t cardIndex, int32_t module, nai_da_data_type_t type, uint32_t rawdata, nai_da_range_mode_t *outmode, float64_t *outrange)
 Returns the unipolar/bipolar mode and voltage range associated with the D/A Module ID and raw data code.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_ConvertToRangeRaw (int32_t cardIndex, int32_t module, nai_da_data_type_t type, nai_da_range_mode_t mode, float64_t range, uint32_t *outrawdata)
 Returns the raw data code associated with the D/A Module ID and the unipolar/bipolar mode and voltage range.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetRaw (int32_t cardIndex, int32_t module, nai_da_raw_t type, uint32_t rawdata)
 Sets the raw data value in the register associated to the register type specified.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetRaw (int32_t cardIndex, int32_t module, nai_da_raw_t type, uint32_t *outrawdata)
 Retrieves the raw data value in the register associated to the register type specified.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetChannelRaw (int32_t cardIndex, int32_t module, int32_t channel, nai_da_channel_raw_t type, uint32_t rawdata)
 Sets the raw data value in the register associated to the channel and channel register type specified.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetChannelRaw (int32_t cardIndex, int32_t module, int32_t channel, nai_da_channel_raw_t type, uint32_t *outrawdata)
 Retrieves the raw data value in the register associated to the channel and channel register type specified.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetStatusRaw (int32_t cardIndex, int32_t module, nai_da_status_type_t type, uint32_t *outstatusRaw)
 Retrieves the status of the specified type. The status of a channel is flagged and latched. For Generation 3 DA modules status is latched until read. Reading any status bit will cause that bit to be unlatched. For Generation 5 DA modules status is latched until cleared. Writing a "1" to the bit will clear the latched status.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_ClearStatusRaw (int32_t cardIndex, int32_t module, nai_da_status_type_t type, uint32_t statusRaw)
 Clears the status of the specified type. For Generation 5 DA modules, the status of a channel is flagged and latched until a "1" is written to the bit. Writing a "1" to the status bit will cause that bit to be unlatched.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetPatternGen_BurstNum (int32_t cardIndex, int32_t module, int32_t channel, uint32_t burstNum)
 Sets the number of cycles to output in the PatternGen burst mode for the specified D/A module. The set value is applicable for enhanced IO PatternGen burst mode.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetPatternGen_BurstNum (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outburstNum)
 Retrieves the number of cycles set to output in the PatternGen burst mode for the specified Discrete module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetPatternGenData (int32_t cardIndex, int32_t module, int32_t channel, uint32_t dataPatternLen, float64_t *dataPattern)
 Sets the pattern for RAM Pattern Generator using floating point data.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetPatternGenDataRaw (int32_t cardIndex, int32_t module, int32_t channel, uint32_t dataPatternLen, uint32_t *dataPattern)
 Sets the pattern for RAM Pattern Generator using raw data.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetPatternGenStartAddr (int32_t cardIndex, int32_t module, int32_t channel, uint32_t startaddress)
 Sets the starting address to look at for RAM Pattern Generator.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetPatternGenStartAddr (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outstartAddress)
 Gets the starting address to look at for RAM Pattern Generator.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetPatternGenEndAddr (int32_t cardIndex, int32_t module, int32_t channel, uint32_t endAddress)
 Sets the Ending address to look at for RAM Pattern Generator.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetPatternGenEndAddr (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outendAddress)
 Gets the Ending address to look at for RAM Pattern Generator.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetPatternGenCtrl (int32_t cardIndex, int32_t module, int32_t channel, nai_da_pattern_ctrl_t patternControl, nai_da_enable_t controlState)
 Sets the state for the RAM Pattern Generator for the selected control bit on the module. Options are enable and disable.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetPatternGenCtrl (int32_t cardIndex, int32_t module, int32_t channel, nai_da_pattern_ctrl_t patternControl, nai_da_enable_t *outcontrolState)
 Gets the state for the RAM Pattern Generator for the selected control bit on the module. Options are enable and disable.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetPatternGenCtrlRaw (int32_t cardIndex, int32_t module, int32_t channel, uint32_t controlRaw)
 Sets the control bits for RAM Pattern Generator.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetPatternGenCtrlRaw (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outcontrolRaw)
 Retrieves the control bits for RAM Pattern Generator.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetWatchdogQuietTime (int32_t cardIndex, int32_t module, uint32_t quietTime)
 Sets the quiet time duration for the watchdog timer. The watchdog timer is comprised of two parts: quiet time, and window. The quiet time is the time where a strobe is NOT expected to occur, and the window is the time where a SINGLE strobe is expected. A strobe is made by the application by calling naibrd_DA_WatchdogStrobe().
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetWatchdogQuietTime (int32_t cardIndex, int32_t module, uint32_t *outquietTime)
 Sets the quiet time duration for the watchdog timer. The watchdog timer is comprised of two parts: quiet time, and window. The quiet time is the time where a strobe is NOT expected to occur, and the window is the time where a SINGLE strobe is expected. A strobe is made by the application by calling naibrd_DA_WatchdogStrobe().
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetWatchdogWindow (int32_t cardIndex, int32_t module, uint32_t window)
 Sets the window that a call to naibrd_DA_WatchdogStrobe() will be made. If a call to naibrd_DA_WatchdogStrobe() is not made by the application within the 'window' ('quiet time' + 'window'), the Watchdog Timer Fault will occur.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetWatchdogWindow (int32_t cardIndex, int32_t module, uint32_t *outwindow)
 Retrieves the window that a call to naibrd_DA_WatchdogStrobe() will be made. If a call to naibrd_DA_WatchdogStrobe() is not made by the application within the 'window' ('quiet time' + 'window'), the Watchdog Timer Fault will occur.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_WatchdogStrobe (int32_t cardIndex, int32_t module)
 Strobes the Watchdog Timer. A SINGLE call to this function MUST be made by the application within the 'window' or a Watchdog Timer Fault will occur.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetModulePowerResetStatus (int32_t cardIndex, int32_t module, nai_da_module_power_reset_status_type_t modulePowerResetStatusType, bool_t *p_outmodulePowerResetStatusBit)
 Retrieves the bit specified by the module power reset status type from the module power reset status register for the specified D/A module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_ClearModulePowerResetStatus (int32_t cardIndex, int32_t module, nai_da_module_power_reset_status_type_t modulePowerResetStatusType)
 Clears the bit specified by the module power reset status type in the module power reset status register for the specified D/A module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetModulePowerReset (int32_t cardIndex, int32_t module, nai_da_module_power_reset_type_t modulePowerResetType, bool_t modulePowerResetBit)
 Sets the bit specified by the module power reset type in the module power reset register for the specified D/A module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetModulePowerReset (int32_t cardIndex, int32_t module, nai_da_module_power_reset_type_t modulePowerResetType, bool_t *p_outmodulePowerResetBit)
 Retrieves the bit specified by the module power reset type from the module power reset register for the specified D/A module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetUseMemory (int32_t cardIndex, int32_t module, int32_t channel, bool_t usememory)
 Sets the use memory setting for the DA module and channel specified. The use memory register is bitmapped per channel, with the LSB corresponding to channel 1, and the MSB corresponding to the max channel. Writing a �1� to Use Memory will allow the DAC output to come from the memory. Writing a �0� to Use Memory will not utilize the memory space and the DAC output will reflect the value written in DAC Value.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetUseMemory (int32_t cardIndex, int32_t module, int32_t channel, bool_t *outusememory)
 Retrieves the use memory setting for the DA module and channel specified. The use memory register is bitmapped per channel, with the LSB corresponding to channel 1, and the MSB corresponding to the max channel. Writing a �1� to Use Memory will allow the DAC output to come from the memory. Writing a �0� to Use Memory will not utilize the memory space and the DAC output will reflect the value written in DAC Value.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetRAMFIFOMode (int32_t cardIndex, int32_t module, int32_t channel, bool_t ramfifomode)
 Sets the RAM/FIFO Mode setting for the DA module and channel specified. The RAM/FIFO Mode register is bitmapped per channel, with the LSB corresponding to channel 1, and the MSB corresponding to the max channel. If a �1� is written in the RAM/FIFO Mode register, the memory will be used as a FIFO; otherwise it is used as RAM.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetRAMFIFOMode (int32_t cardIndex, int32_t module, int32_t channel, bool_t *outramfifomode)
 Retrieves the RAM/FIFO Mode setting for the DA module and channel specified. The RAM/FIFO Mode register is bitmapped per channel, with the LSB corresponding to channel 1, and the MSB corresponding to the max channel. If a �1� is written in the RAM/FIFO Mode register, the memory will be used as a FIFO; otherwise it is used as RAM.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetUseFifo (int32_t cardIndex, int32_t module, int32_t channel, bool_t usefifo)
 Sets the channels bit in the using fifo register to 1(true) or 0(false). This function is only for DA2. When set to true the fifo for that channel is active. When set to false it is not.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetUseFifo (int32_t cardIndex, int32_t module, int32_t channel, bool_t *outusefifo)
 Gets the channels bit in the using fifo register to 1(true) or 0(false). This function is only for DA2. When set to true the fifo for that channel is active. When set to false it is not.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetFifoLoopMode (int32_t cardIndex, int32_t module, int32_t channel, uint32_t loopmode)
 Sets the channel's bit in the fifo loop mode register to 1(true) or 0(false). This function is only for DA2. When set to true, the fifo for that channel is in loop mode. When set to false it is not.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetFifoLoopMode (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outloopmode)
 Retrieves the channel's bit in the fifo loop mode register (1 = true, 0 = false). This function is only for DA2. When set to true, the fifo for that channel is in loop mode. When set to false it is not.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetExtPowerMeasurement (int32_t cardIndex, int32_t module, int32_t channel, nai_da_extpwr_measure_t measType, float64_t *outmeasurement)
 Retrieves the external power supply's measurement for the type and channel specified.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetCurrentLimit (int32_t cardIndex, int32_t module, int32_t channel, float64_t currentLimit)
 Set the channel's current limit (mAmps) for the overcurrent status. An overcurrent status will be set when the channel's current exceeds this limit.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetCurrentLimit (int32_t cardIndex, int32_t module, int32_t channel, float64_t *outcurrentLimit)
 Retrieves the channel's current limit (mAmps) for the overcurrent status. An overcurrent status will be set when the channel's current exceeds this limit.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetFullBridgeMode (int32_t cardIndex, int32_t module, int32_t channel, bool_t fullBridgeMode)
 Sets Full-Bridge mode on the DA5. Half-Bridge is set by default where each channel works independently. Full-Bridge pairs two channels together and the output is the differential between them. Full-Bridge pairs an odd and even channel together, using the odd channels controls to control the output. For example, setting Full-Bridge mode on channel 1 bridges channel 1 and channel 2 together where the output is the differential between channels 1 and 2 and controlled by channel 1.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetFullBridgeMode (int32_t cardIndex, int32_t module, int32_t channel, bool_t *outfullBridgeMode)
 Retrieves the Full-Bridge mode for the channel. Half-Bridge is set by default where each channel works independently. Full-Bridge pairs two channels together and the output is the differential between them. Full-Bridge pairs an odd and even channel together, using the odd channels controls to control the output. For example, setting Full-Bridge mode on channel 1 bridges channel 1 and channel 2 together where the output is the differential between channels 1 and 2 and controlled by channel 1.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetControlLoop (int32_t cardIndex, int32_t module, int32_t channel, nai_control_loop_t controlLoopCfg, float64_t controlLoopValue)
 Sets the value for the control loop parameter and channel specified.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetControlLoop (int32_t cardIndex, int32_t module, int32_t channel, nai_control_loop_t controlLoopCfg, float64_t *outcontrolLoopValue)
 Retrieves the value for the control loop parameter and channel specified.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetDriveTemperature (int32_t cardIndex, int32_t module, int32_t channel, float64_t *outtempC)
 Retrieves the drive circuits temperature (in Celsius) for the channel specified.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetExtPowerThreshold (int32_t cardIndex, int32_t module, int32_t channel, nai_da_extpwr_threshold_t thresType, float64_t threshold)
 Sets the external power threshold of the type and channel specified. When the module detects a level outside the threshold defined, the External Power status (UnderVoltage or OVerVoltage) will be set.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetExtPowerThreshold (int32_t cardIndex, int32_t module, int32_t channel, nai_da_extpwr_threshold_t thresType, float64_t *outthreshold)
 Retrieves the external power threshold of the type and channel specified. When the module detects a level outside the threshold defined, the External Power status (UnderVoltage or OVerVoltage) will be set.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_SetWriteThroughMode (int32_t cardIndex, int32_t module, bool_t writeThroughEnable)
 Sets the state of the write-through mode to enabled or disabled.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetWriteThroughMode (int32_t cardIndex, int32_t module, bool_t *outwriteThroughEnable)
 Retrieves the state of the write-through mode.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_UpdateStrobe (int32_t cardIndex, int32_t module)
 Strobes (updates) all outputs to the value stored in the data registers. The outputs will update once per call.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetPowerSupply (int32_t cardIndex, int32_t module, int32_t group, float64_t *outpower)
 Retrieves the A/D measurement for the top board power supply. This is for internal use only. This varies with the range selection, but not what the D/A count for individual channels. Feature only available on the F5 module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetPowerSupplyRaw (int32_t cardIndex, int32_t module, int32_t group, uint32_t *outrawdata)
 Retrieves the A/D raw measurement for the top board power supply. This is for internal use only. This varies with the range selection, but not what the D/A count for individual channels. Feature only available on the F5 module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetVoltageWrapRange (int32_t cardIndex, int32_t module, int32_t channel, nai_da_range_mode_t *outmode, float64_t *outrange)
 Retrieves the range for the Wrap Voltage reading. This is for internal use only.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetPatternGenBuf (int32_t cardIndex, int32_t module, int32_t channel, uint32_t dataPatternLen, uint32_t *dataPattern)
 Obsolete function. H/W does not support reading pattern RAM. Pattern RAM is write-only.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_ConvertToData16 (uint32_t modId, nai_da_data_type_t type, nai_da_range_mode_t mode, nai_da_range_t range, uint16_t rawdata, float64_t *outdata)
 Calculates the voltage in volts, or current in mA, for the given mode, range and raw data.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_ConvertToDataRaw16 (uint32_t modId, nai_da_data_type_t type, nai_da_range_mode_t mode, nai_da_range_t range, float64_t data, uint16_t *outrawdata)
 Calculates the raw data for the given mode, range and voltage/current.
 

Macro Definition Documentation

◆ NAI_CF1_MAX_CHANNELS

#define NAI_CF1_MAX_CHANNELS   4

◆ NAI_CMEFG_MAX_CHANNELS

#define NAI_CMEFG_MAX_CHANNELS   8

◆ NAI_DA1_MAX_CHANNELS

#define NAI_DA1_MAX_CHANNELS   12

◆ NAI_DA2_MAX_CHANNELS

#define NAI_DA2_MAX_CHANNELS   16

◆ NAI_DA3_MAX_CHANNELS

#define NAI_DA3_MAX_CHANNELS   4

◆ NAI_DA4_MAX_CHANNELS

#define NAI_DA4_MAX_CHANNELS   4

◆ NAI_DA5_MAX_CHANNELS

#define NAI_DA5_MAX_CHANNELS   4

◆ NAI_DA_GEN3_CURRENT_LSB_AMP

#define NAI_DA_GEN3_CURRENT_LSB_AMP   0.0001 /* Amp (0.1 mA) */

◆ NAI_DA_GEN3_F5_POWER_SUPPLY_LSB_VOLT

#define NAI_DA_GEN3_F5_POWER_SUPPLY_LSB_VOLT   0.182

◆ NAI_DA_GEN3_REG_CAL_CHAN_ADD

#define NAI_DA_GEN3_REG_CAL_CHAN_ADD   0x3A8u

◆ NAI_DA_GEN3_REG_CAL_TYPE_ADD

#define NAI_DA_GEN3_REG_CAL_TYPE_ADD   0x3AAu

◆ NAI_DA_GEN3_REG_CAL_VALUE_ADD

#define NAI_DA_GEN3_REG_CAL_VALUE_ADD   0x3ACu

◆ NAI_DA_GEN5_CMEFG_CURRENT_BIPOLAR_WRAP_LSB_AMP

#define NAI_DA_GEN5_CMEFG_CURRENT_BIPOLAR_WRAP_LSB_AMP   (.010/0x7FFF) /* 10mA range, bipolar, 16bits*/

◆ NAI_DA_GEN5_DA1_CURRENT_READING_LSB_AMP

#define NAI_DA_GEN5_DA1_CURRENT_READING_LSB_AMP   (0.030/32768) /* Amp (~915 nA) */

◆ NAI_DA_GEN5_DA1_VOLT_WRAP_LSB

#define NAI_DA_GEN5_DA1_VOLT_WRAP_LSB   (NAI_DA_GEN5_DA1_VOLT_WRAP_RANGE/0x7FFF)

◆ NAI_DA_GEN5_DA1_VOLT_WRAP_LSB_PRE_FPGA_0x300

#define NAI_DA_GEN5_DA1_VOLT_WRAP_LSB_PRE_FPGA_0x300   (NAI_DA_GEN5_DA1_VOLT_WRAP_RANGE_PRE_FPGA_0x300/0x7FFF)

◆ NAI_DA_GEN5_DA1_VOLT_WRAP_RANGE

#define NAI_DA_GEN5_DA1_VOLT_WRAP_RANGE   13.0 /* Expanded Voltage Wrap Range FPGA Rev 0x0300 and later */

◆ NAI_DA_GEN5_DA1_VOLT_WRAP_RANGE_PRE_FPGA_0x300

#define NAI_DA_GEN5_DA1_VOLT_WRAP_RANGE_PRE_FPGA_0x300   10.0 /* Voltage Wrap Range Pre-FPGA Rev 0x0300 */

◆ NAI_DA_GEN5_DA1_VOLTAGE_READING_LSB_VOLT

#define NAI_DA_GEN5_DA1_VOLTAGE_READING_LSB_VOLT   0.0000763 /* !(Verify number based on uni/bipolar = (0.0763 V) to replace "lsb = 10V(maxrange)/7FFF" calculation in GetWrapVoltage() */

◆ NAI_DA_GEN5_DA2_CURRENT_BIPOLAR_WRAP_LSB_AMP

#define NAI_DA_GEN5_DA2_CURRENT_BIPOLAR_WRAP_LSB_AMP   (.010/0x7FFF) /* 10mA range, bipolar, 16bits*/

◆ NAI_DA_GEN5_DA3_CURRENT_BIPOLAR_WRAP_LSB

#define NAI_DA_GEN5_DA3_CURRENT_BIPOLAR_WRAP_LSB   (0.100/0x7FFF) /* 100mA range, bipolar, 16 bits */

◆ NAI_DA_GEN5_DA3_VOLTAGE_BIPOLAR_WRAP_LSB

#define NAI_DA_GEN5_DA3_VOLTAGE_BIPOLAR_WRAP_LSB   (40.0/0x7FFF) /* 40V range, bipolar, 16 bits */

◆ NAI_DA_GEN5_DA4_CURRENT_BIPOLAR_WRAP_LSB

#define NAI_DA_GEN5_DA4_CURRENT_BIPOLAR_WRAP_LSB   (0.010/0x7FFF) /* 10mA range, bipolar, 16 bits */

◆ NAI_DA_GEN5_DA4_VOLTAGE_BIPOLAR_WRAP_LSB

#define NAI_DA_GEN5_DA4_VOLTAGE_BIPOLAR_WRAP_LSB   (100.0/0x7FFF) /* 100V range, bipolar, 16 bits */

◆ NAI_DA_GEN5_DA5_CURRENT_LSB

#define NAI_DA_GEN5_DA5_CURRENT_LSB   (.001) /* 1mA */

◆ NAI_DA_GEN5_DA5_VOLTAGE_LSB

#define NAI_DA_GEN5_DA5_VOLTAGE_LSB   (.001) /* 1mV */

◆ NAI_DA_GEN5_MB_COMMON_MODULE_NUM

#define NAI_DA_GEN5_MB_COMMON_MODULE_NUM   0

◆ NAI_DA_GEN5_MODULE_POWER_RESET_COUNT

#define NAI_DA_GEN5_MODULE_POWER_RESET_COUNT   8

◆ NAI_DA_GEN5_WATCHDOG_STATUS_MASK

#define NAI_DA_GEN5_WATCHDOG_STATUS_MASK   0x80000000u

◆ NAI_DA_GEN5_WATCHDOG_STATUS_SHIFT

#define NAI_DA_GEN5_WATCHDOG_STATUS_SHIFT   31

Function Documentation

◆ naibrd_DA_ConvertToData16()

NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_ConvertToData16 ( uint32_t modId,
nai_da_data_type_t type,
nai_da_range_mode_t mode,
nai_da_range_t range,
uint16_t rawdata,
float64_t * outdata )

Calculates the voltage in volts, or current in mA, for the given mode, range and raw data.

Parameters
modId: (Input) D/A Module ID.
type: (Input) Type of data to set (Voltage or Current) - refer to nai_da_data_type_t.
mode: (Input) NAI_DA_RANGE_MODE_BIPOLAR or NAI_DA_RANGE_MODE_UNIPOLAR.
range: (Input) Range Code.
rawdata: (Input) Raw Data Code.
outdata: (Output) Voltage in volts or Current in mA.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_VALUE when invalid mode parameter is specified.

◆ naibrd_DA_ConvertToDataRaw16()

NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_ConvertToDataRaw16 ( uint32_t modId,
nai_da_data_type_t type,
nai_da_range_mode_t mode,
nai_da_range_t range,
float64_t data,
uint16_t * outrawdata )

Calculates the raw data for the given mode, range and voltage/current.

Parameters
modId: (Input) D/A Module ID.
type: (Input) Type of data to set (Voltage or Current) - refer to nai_da_data_type_t.
mode: (Input) NAI_DA_RANGE_MODE_BIPOLAR or NAI_DA_RANGE_MODE_UNIPOLAR.
range: (Input) Range Code.
data: (Input) Voltage in volts or Current in mA.
outrawdata: (Output) raw data code.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_VALUE when invalid mode parameter is specified.

◆ naibrd_DA_GetPatternGenBuf()

NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetPatternGenBuf ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t dataPatternLen,
uint32_t * dataPattern )

Obsolete function. H/W does not support reading pattern RAM. Pattern RAM is write-only.

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]).
channel: (Input) Channel Number of the channel to access (1 - [max channels for module]).
dataPatternLen: (Input) Length of buffer holding RAM Pattern .
dataPattern: (Input) Buffer holding RAM Pattern .
Returns
  • NAI_ERROR_NOT_SUPPORTED.

◆ naibrd_DA_GetPowerSupply()

NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetPowerSupply ( int32_t cardIndex,
int32_t module,
int32_t group,
float64_t * outpower )

Retrieves the A/D measurement for the top board power supply. This is for internal use only. This varies with the range selection, but not what the D/A count for individual channels. Feature only available on the F5 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]).
group: (Input) Channel Group Number to access (1 - [max channel group for module]).
outpower: (Output) Power Supply Voltage in volts.
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_OPEN when handle to board is invalid.
  • NAI_ERROR_INVALID_VALUE when invalid group type is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_DA_GetPowerSupplyRaw()

NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetPowerSupplyRaw ( int32_t cardIndex,
int32_t module,
int32_t group,
uint32_t * outrawdata )

Retrieves the A/D raw measurement for the top board power supply. This is for internal use only. This varies with the range selection, but not what the D/A count for individual channels. Feature only available on the F5 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]).
group: (Input) Channel Group Number to access (1 - [max channel group for module]).
outrawdata: (Output) Power Supply Voltage raw data.
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_OPEN when handle to board is invalid.
  • NAI_ERROR_INVALID_VALUE when invalid group type is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_DA_GetVoltageWrapRange()

NAIBRDFUNC nai_status_t NAIAPI naibrd_DA_GetVoltageWrapRange ( int32_t cardIndex,
int32_t module,
int32_t channel,
nai_da_range_mode_t * outmode,
float64_t * outrange )

Retrieves the range for the Wrap Voltage reading. This is for internal use only.

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]).
channel: (Input) Channel Number of the channel to access (1 - [max channels for module]).
outmode: (Output) NAI_DA_RANGE_MODE_BIPOLAR or NAI_DA_RANGE_MODE_UNIPOLAR.
outrange: (Output) Wrap Voltage Range.
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_OPEN when handle to board is invalid.
  • NAI_ERROR_INVALID_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.