Software Library API naibrd 2.24.0
See all documentation at naii.docs.com
da_basic_ops.c File Reference

Enumerations

enum  da_gen5_da_common_commands {
  DA_COMMON_CMD_DATA , DA_COMMON_CMD_RANGE , DA_COMMON_CMD_POLARITY , DA_COMMON_CMD_UPDATE_RATE ,
  DA_COMMON_CMD_TEST_ENABLE , DA_COMMON_CMD_PBIT , DA_COMMON_CMD_CLEAR_STATUS , DA_COMMON_CMD_CLEAR_STATUS_ALL_CHANS ,
  DA_COMMON_CMD_FLOATING_POINT_MODE , DA_COMMON_CMD_FLOATING_POINT_OFFSET , DA_COMMON_CMD_FLOATING_POINT_SCALE_FACTOR , DA_COMMON_CMD_BIT_THRESHOLD ,
  DA_COMMON_CMD_CHANNEL_STATUS_ENABLE , DA_COMMON_CMD_WD_MENU , DA_COMMON_CMD_MODULE_POWER_RESET_MENU , DA_COMMON_CMD_COUNT
}
 
enum  da_gen5_da_watchdog_commands {
  DA_COMMON_CMD_WD_QUIETTIME , DA_COMMON_CMD_WD_WINDOWTIME , DA_COMMON_CMD_WD_DISPLAY , DA_COMMON_CMD_WD_PET ,
  DA_COMMON_CMD_WD_KILL , DA_COMMON_CMD_WD_BACK , DA_COMMON_CMD_WD_COUNT
}
 
enum  da_module_power_reset_commands { DA_MODULE_POWER_RESET_CMD_BACK , DA_MODULE_POWER_RESET_CMD_CLEAR_MODULE_POWER_RESET_STATUS , DA_MODULE_POWER_RESET_CMD_SET_MODULE_POWER_RESET , DA_MODULE_POWER_RESET_CMD_COUNT }
 
enum  da_gen5_da2_additional_commands { DA2_ADDITIONAL_CMD_CHANNEL_ENABLE = DA_COMMON_CMD_COUNT , DA2_ADDITIONAL_CMD_COUNT }
 
enum  da_gen5_da3_additional_commands { DA3_ADDITIONAL_CMD_MODE = DA_COMMON_CMD_COUNT , DA3_ADDITIONAL_CMD_POWER , DA3_ADDITIONAL_CMD_COUNT }
 
enum  da_gen5_cf1_additional_commands { DA_CF1_CMD_WRITETHRU = DA_COMMON_CMD_COUNT , DA_CF1_CMD_STROBE , DA_CF1_ADDITIONAL_CMD_COUNT }
 

Functions

static bool_t Run_DA_BasicOps (int32_t cardIndex, int32_t module, uint32_t modId)
 This function runs the basic operations DA program. It controls the top level menu of the DA_BasicOps program and calls Handle_DA_Configuration or Handle_DA_StandardOps, depending on what the user specifies.
 
static bool_t Run_CF1DA_BasicOps (int32_t cardIndex, int32_t module, uint32_t modId)
 
static nai_status_t Handle_DA_Data (int32_t paramCount, int32_t *params)
 This function sets the contents of the data register of the channel specified by the user to the value specified by the user. For Gen5 modules, the voltage or current will be set based on the current value in the op mode register. Voltage will be set if the op mode is set to voltage mode, whereas current will be set if the op mode is set to current mode.
 
static nai_status_t Handle_DA_Mode (int32_t paramCount, int32_t *params)
 This function sets the channels operation mode: Voltage or Current.
 
static nai_status_t Handle_DA_ClearStatus (int32_t paramCount, int32_t *params)
 This function clears the status(es) of the channel specified by the user. Clearing the status of a channel sets the latched status bit of the given status corresponding to the given channel to 0. Statuses that can be cleared are BIT and Overcurrent statuses.
 
static nai_status_t Handle_DA_ClearStatusAllChannels (int32_t paramCount, int32_t *params)
 This function clears the status(es) of all of the channels on the module. Clearing the status of a channel sets the latched status bit of the given status corresponding to the given channel to 0. Statuses that can be cleared are BIT and Overcurrent statuses.
 
static nai_status_t Handle_DA_Range (int32_t paramCount, int32_t *params)
 This function sets the voltage/current range of the channel specified by the user to the range specified by the user. For Gen5 modules, the voltage or current range will be set based on the current value in the op mode register. Voltage range will be set if the op mode is set to voltage mode, whereas current range will be set if the op mode is set to current mode.
 
static nai_status_t Handle_DA_Polarity (int32_t paramCount, int32_t *params)
 This function sets the range polarity mode of the channel specified by the user to the mode specified by the user. Note that this function does not modify the range or the op mode of any of the channels; it only sets the range mode to unipolar or bipolar based on user input.
 
static nai_status_t Handle_DA_PowerSupply (int32_t paramCount, int32_t *params)
 This function enables/disables the module/channel power supply based on user input. Applies to Gen5 modules only. DA1 has one power supply for the entire module, whereas DA3 has a power supply for each channel on the module. The user can enable or disable the module power supply of a DA1 module or enable or disable any of the power supplies of the channels of a DA3 module.
 
static nai_status_t Handle_DA_EnableOutput (int32_t paramCount, int32_t *params)
 This function enables/disables the module/channel's output based on user input. Applies to Gen5 modules only. DA1 has one power supply for the entire module, whereas DA3 has a power supply for each channel on the module. The user can enable or disable the module power supply of a DA1 module or enable or disable any of the power supplies of the channels of a DA3 module.
 
static nai_status_t Handle_DA_UpdateRate (int32_t paramCount, int32_t *params)
 This function sets the update rate for the module. The user is prompted for the value in Hz. If the value is within range for the specific D/A used, then the range will be set, otherwise the original setting will not be affected.
 
static nai_status_t Handle_DA_TestEnable (int32_t paramCount, int32_t *params)
 This function.
 
static nai_status_t Handle_DA_CheckPowerOnBIT (int32_t paramCount, int32_t *params)
 Handle_DA_CheckPowerOnBIT() Checks to see if the power-on BIT test has been run on the module. If the PBIT test has run, it checks the result of the test and reports it back.
 
static nai_status_t Handle_DA_FloatingPointMode (int32_t paramCount, int32_t *params)
 This function enables/disables the hardware floating-point conversion mode of the DA module, as specified by the user.
 
static nai_status_t Handle_DA_FloatingPointOffset (int32_t paramCount, int32_t *params)
 This function sets the hardware floating-point conversion mode offset for the DA channel specified by the user. This function is only applicable when the hardware floating-point conversion mode for the module is enabled.
 
static nai_status_t Handle_DA_FloatingPointScaleFactor (int32_t paramCount, int32_t *params)
 This function sets the hardware floating-point conversion mode scale factor for the DA channel specified by the user. This function is only applicable when the hardware floating-point conversion mode for the module is enabled.
 
static nai_status_t Handle_DA_BITThresholds (int32_t paramCount, int32_t *params)
 Handle_DA_BITThresholds() allows the user to set and get the BIT error thresholds. This is an advanced feature.
 
static nai_status_t Handle_DA_ChannelStatusEnable (int32_t paramCount, int32_t *params)
 This function Enables\Disables the reporting of the Channel Status. When enabled, the user will get status updates. When disabled, the statuses will not report and status-based interrupts will not assert.
 
static nai_status_t Handle_DA_WriteThru (int32_t paramCount, int32_t *params)
 
static nai_status_t Handle_DA_Strobe (int32_t paramCount, int32_t *params)
 
static nai_status_t Handle_DA_WatchDogQuietTime (int32_t paramCount, int32_t *params)
 This function sets the watchdog quiet time for the module. The user is prompted for the value in ms.
 
static nai_status_t Handle_DA_WatchDogWindowTime (int32_t paramCount, int32_t *params)
 This function sets the watchdog window time for the module. The user is prompted for the value in ms.
 
static nai_status_t Handle_DA_DisplayWatchdog (int32_t paramCount, int32_t *params)
 This function displays the DA Watchdog Operations data.
 
static nai_status_t Handle_DA_StrobeWatchdog (int32_t paramCount, int32_t *params)
 This function will start a thread to continuously strobe the watchdog. The user is prompted for the value in ms. NOTE: When this thread/application exits the module will shut off all outputs and will need to be power cycled in order to be operational.
 
static nai_status_t Handle_DA_kill_WDStrobe_Thread (int32_t paramCount, int32_t *params)
 This function will terminate the WD strobing thread. Module will shut off outputs at this state and will need to be power cycled to be operational.
 
static nai_status_t Handle_DA_WatchdogShowMenu (int32_t paramCount, int32_t *params)
 This function displays the menu for watchdog commands.
 
static void naiapp_kill_WDStrobe_Thread ()
 This function will terminate the WD strobing thread. Module will shut off outputs at this state and will need to be power cycled to be operational.
 
static nai_status_t Handle_DA_ModulePowerResetMenu (int32_t paramCount, int32_t *p_params)
 Configure_DA_ModulePowerResetMenu displays the menu for module power reset commands.
 
static nai_status_t Handle_DA_ClearModulePowerResetStatus (int32_t paramCount, int32_t *p_params)
 Configure_DA_ClearModulePowerResetStatus handles the user request to clear the module power reset status and calls the method in the naibrd library to clear the module power reset status. The user is prompted for the module power reset status type to clear.
 
static nai_status_t Handle_DA_SetModulePowerReset (int32_t paramCount, int32_t *p_params)
 Configure_DA_SetModulePowerReset handles the user request to set the module power reset request and calls the method in the naibrd library to set the module power reset request. The user is prompted for the module power reset request type to set, and then the user is prompted to set or reset the request bit.
 
void DA_DisplayData (int32_t cardIndex, int32_t module, int32_t maxchan, uint32_t modId)
 This function displays the DA Standard Operations data.
 
DWORD WINAPI WD_Strobe_ThreadEntryPoint (LPVOID param) void *WD_Strobe_ThreadEntryPoint(void *param) static int WD_Strobe_ThreadEntryPoint(int32_t param)
 This function will continuously loop, strobing the watchdog every QuietTime + Window/2.
 
void * WD_Strobe_ThreadEntryPoint (void *arg)
 
static int WD_Strobe_ThreadEntryPoint (int32_t nParam)
 
int32_t DA_BasicOps (void)
 The purpose of the DA_BasicOps is to illustrate the methods to call in the naibrd library to perform basic operations with the DA modules for configuration setup, controlling the drive outputs, and reading the channels.
 

Variables

static const int8_t * SAMPLE_PGM_NAME = (const int8_t*)"DA Basic Operations"
 
static const int8_t * DEF_CONFIG_FILE = (const int8_t*)"default_DA_BasicOps.txt"
 
static const int8_t * SAMPLE_WD_PGM_NAME = (const int8_t*)"DA Watchdog Operations"
 
static bool_t terminateThread
 
static const int32_t DEF_DA_CHANNEL = 1
 
static HANDLE thread = NULL
 
naiapp_cmdtbl_params_t DA_StandardOpMenuCmds [DA_COMMON_CMD_COUNT+DA_ADDITIONAL_MAX_CMD_COUNT]
 
naiapp_cmdtbl_params_t DA_WatchdogOpMenuCmds [DA_COMMON_CMD_WD_COUNT]
 
naiapp_cmdtbl_params_t DA_ModulePowerResetMenuCmds [DA_MODULE_POWER_RESET_CMD_COUNT]
 
naiapp_cmdtbl_params_t DA2_AdditionalMenuCommands []
 
naiapp_cmdtbl_params_t DA3_AdditionalMenuCommands []
 
naiapp_cmdtbl_params_t DA_CF1OpMenuCmds [CF1DA_COMMON_CMD_COUNT]
 
static int32_t g_numBasicMenuCmds = 0
 

Enumeration Type Documentation

◆ da_gen5_cf1_additional_commands

Enumerator
DA_CF1_CMD_WRITETHRU 
DA_CF1_CMD_STROBE 
DA_CF1_ADDITIONAL_CMD_COUNT 

◆ da_gen5_da2_additional_commands

Enumerator
DA2_ADDITIONAL_CMD_CHANNEL_ENABLE 
DA2_ADDITIONAL_CMD_COUNT 

◆ da_gen5_da3_additional_commands

Enumerator
DA3_ADDITIONAL_CMD_MODE 
DA3_ADDITIONAL_CMD_POWER 
DA3_ADDITIONAL_CMD_COUNT 

◆ da_gen5_da_common_commands

Enumerator
DA_COMMON_CMD_DATA 
DA_COMMON_CMD_RANGE 
DA_COMMON_CMD_POLARITY 
DA_COMMON_CMD_UPDATE_RATE 
DA_COMMON_CMD_TEST_ENABLE 
DA_COMMON_CMD_PBIT 
DA_COMMON_CMD_CLEAR_STATUS 
DA_COMMON_CMD_CLEAR_STATUS_ALL_CHANS 
DA_COMMON_CMD_FLOATING_POINT_MODE 
DA_COMMON_CMD_FLOATING_POINT_OFFSET 
DA_COMMON_CMD_FLOATING_POINT_SCALE_FACTOR 
DA_COMMON_CMD_BIT_THRESHOLD 
DA_COMMON_CMD_CHANNEL_STATUS_ENABLE 
DA_COMMON_CMD_WD_MENU 
DA_COMMON_CMD_MODULE_POWER_RESET_MENU 
DA_COMMON_CMD_COUNT 

◆ da_gen5_da_watchdog_commands

Enumerator
DA_COMMON_CMD_WD_QUIETTIME 
DA_COMMON_CMD_WD_WINDOWTIME 
DA_COMMON_CMD_WD_DISPLAY 
DA_COMMON_CMD_WD_PET 
DA_COMMON_CMD_WD_KILL 
DA_COMMON_CMD_WD_BACK 
DA_COMMON_CMD_WD_COUNT 

◆ da_module_power_reset_commands

Enumerator
DA_MODULE_POWER_RESET_CMD_BACK 
DA_MODULE_POWER_RESET_CMD_CLEAR_MODULE_POWER_RESET_STATUS 
DA_MODULE_POWER_RESET_CMD_SET_MODULE_POWER_RESET 
DA_MODULE_POWER_RESET_CMD_COUNT 

Function Documentation

◆ DA_BasicOps()

int32_t DA_BasicOps ( void )

The purpose of the DA_BasicOps is to illustrate the methods to call in the naibrd library to perform basic operations with the DA modules for configuration setup, controlling the drive outputs, and reading the channels.

The following system configuration routines from the nai_sys_cfg.c file are called to assist with the configuration setup for this program prior to calling the naibrd DA routines.

  • ConfigDevice
  • DisplayDeviceCfg
  • GetBoardSNModCfg
  • CheckModule

◆ DA_DisplayData()

void DA_DisplayData ( int32_t cardIndex,
int32_t module,
int32_t maxchan,
uint32_t modId )

This function displays the DA Standard Operations data.

◆ Handle_DA_BITThresholds()

static nai_status_t Handle_DA_BITThresholds ( int32_t paramCount,
int32_t * params )
static

Handle_DA_BITThresholds() allows the user to set and get the BIT error thresholds. This is an advanced feature.

◆ Handle_DA_ChannelStatusEnable()

static nai_status_t Handle_DA_ChannelStatusEnable ( int32_t paramCount,
int32_t * params )
static

This function Enables\Disables the reporting of the Channel Status. When enabled, the user will get status updates. When disabled, the statuses will not report and status-based interrupts will not assert.

◆ Handle_DA_CheckPowerOnBIT()

static nai_status_t Handle_DA_CheckPowerOnBIT ( int32_t paramCount,
int32_t * params )
static

Handle_DA_CheckPowerOnBIT() Checks to see if the power-on BIT test has been run on the module. If the PBIT test has run, it checks the result of the test and reports it back.

◆ Handle_DA_ClearModulePowerResetStatus()

static nai_status_t Handle_DA_ClearModulePowerResetStatus ( int32_t paramCount,
int32_t * p_params )
static

Configure_DA_ClearModulePowerResetStatus handles the user request to clear the module power reset status and calls the method in the naibrd library to clear the module power reset status. The user is prompted for the module power reset status type to clear.

◆ Handle_DA_ClearStatus()

static nai_status_t Handle_DA_ClearStatus ( int32_t paramCount,
int32_t * params )
static

This function clears the status(es) of the channel specified by the user. Clearing the status of a channel sets the latched status bit of the given status corresponding to the given channel to 0. Statuses that can be cleared are BIT and Overcurrent statuses.

◆ Handle_DA_ClearStatusAllChannels()

static nai_status_t Handle_DA_ClearStatusAllChannels ( int32_t paramCount,
int32_t * params )
static

This function clears the status(es) of all of the channels on the module. Clearing the status of a channel sets the latched status bit of the given status corresponding to the given channel to 0. Statuses that can be cleared are BIT and Overcurrent statuses.

◆ Handle_DA_Data()

static nai_status_t Handle_DA_Data ( int32_t paramCount,
int32_t * params )
static

This function sets the contents of the data register of the channel specified by the user to the value specified by the user. For Gen5 modules, the voltage or current will be set based on the current value in the op mode register. Voltage will be set if the op mode is set to voltage mode, whereas current will be set if the op mode is set to current mode.

◆ Handle_DA_DisplayWatchdog()

static nai_status_t Handle_DA_DisplayWatchdog ( int32_t paramCount,
int32_t * params )
static

This function displays the DA Watchdog Operations data.

◆ Handle_DA_EnableOutput()

static nai_status_t Handle_DA_EnableOutput ( int32_t paramCount,
int32_t * params )
static

This function enables/disables the module/channel's output based on user input. Applies to Gen5 modules only. DA1 has one power supply for the entire module, whereas DA3 has a power supply for each channel on the module. The user can enable or disable the module power supply of a DA1 module or enable or disable any of the power supplies of the channels of a DA3 module.

◆ Handle_DA_FloatingPointMode()

static nai_status_t Handle_DA_FloatingPointMode ( int32_t paramCount,
int32_t * params )
static

This function enables/disables the hardware floating-point conversion mode of the DA module, as specified by the user.

◆ Handle_DA_FloatingPointOffset()

static nai_status_t Handle_DA_FloatingPointOffset ( int32_t paramCount,
int32_t * params )
static

This function sets the hardware floating-point conversion mode offset for the DA channel specified by the user. This function is only applicable when the hardware floating-point conversion mode for the module is enabled.

◆ Handle_DA_FloatingPointScaleFactor()

static nai_status_t Handle_DA_FloatingPointScaleFactor ( int32_t paramCount,
int32_t * params )
static

This function sets the hardware floating-point conversion mode scale factor for the DA channel specified by the user. This function is only applicable when the hardware floating-point conversion mode for the module is enabled.

◆ Handle_DA_kill_WDStrobe_Thread()

static nai_status_t Handle_DA_kill_WDStrobe_Thread ( int32_t paramCount,
int32_t * params )
static

This function will terminate the WD strobing thread. Module will shut off outputs at this state and will need to be power cycled to be operational.

◆ Handle_DA_Mode()

static nai_status_t Handle_DA_Mode ( int32_t paramCount,
int32_t * params )
static

This function sets the channels operation mode: Voltage or Current.

◆ Handle_DA_ModulePowerResetMenu()

static nai_status_t Handle_DA_ModulePowerResetMenu ( int32_t paramCount,
int32_t * p_params )
static

Configure_DA_ModulePowerResetMenu displays the menu for module power reset commands.

◆ Handle_DA_Polarity()

static nai_status_t Handle_DA_Polarity ( int32_t paramCount,
int32_t * params )
static

This function sets the range polarity mode of the channel specified by the user to the mode specified by the user. Note that this function does not modify the range or the op mode of any of the channels; it only sets the range mode to unipolar or bipolar based on user input.

◆ Handle_DA_PowerSupply()

static nai_status_t Handle_DA_PowerSupply ( int32_t paramCount,
int32_t * params )
static

This function enables/disables the module/channel power supply based on user input. Applies to Gen5 modules only. DA1 has one power supply for the entire module, whereas DA3 has a power supply for each channel on the module. The user can enable or disable the module power supply of a DA1 module or enable or disable any of the power supplies of the channels of a DA3 module.

◆ Handle_DA_Range()

static nai_status_t Handle_DA_Range ( int32_t paramCount,
int32_t * params )
static

This function sets the voltage/current range of the channel specified by the user to the range specified by the user. For Gen5 modules, the voltage or current range will be set based on the current value in the op mode register. Voltage range will be set if the op mode is set to voltage mode, whereas current range will be set if the op mode is set to current mode.

◆ Handle_DA_SetModulePowerReset()

static nai_status_t Handle_DA_SetModulePowerReset ( int32_t paramCount,
int32_t * p_params )
static

Configure_DA_SetModulePowerReset handles the user request to set the module power reset request and calls the method in the naibrd library to set the module power reset request. The user is prompted for the module power reset request type to set, and then the user is prompted to set or reset the request bit.

◆ Handle_DA_Strobe()

static nai_status_t Handle_DA_Strobe ( int32_t paramCount,
int32_t * params )
static

◆ Handle_DA_StrobeWatchdog()

static nai_status_t Handle_DA_StrobeWatchdog ( int32_t paramCount,
int32_t * params )
static

This function will start a thread to continuously strobe the watchdog. The user is prompted for the value in ms. NOTE: When this thread/application exits the module will shut off all outputs and will need to be power cycled in order to be operational.

◆ Handle_DA_TestEnable()

static nai_status_t Handle_DA_TestEnable ( int32_t paramCount,
int32_t * params )
static

This function.

◆ Handle_DA_UpdateRate()

static nai_status_t Handle_DA_UpdateRate ( int32_t paramCount,
int32_t * params )
static

This function sets the update rate for the module. The user is prompted for the value in Hz. If the value is within range for the specific D/A used, then the range will be set, otherwise the original setting will not be affected.

◆ Handle_DA_WatchDogQuietTime()

static nai_status_t Handle_DA_WatchDogQuietTime ( int32_t paramCount,
int32_t * params )
static

This function sets the watchdog quiet time for the module. The user is prompted for the value in ms.

◆ Handle_DA_WatchdogShowMenu()

static nai_status_t Handle_DA_WatchdogShowMenu ( int32_t paramCount,
int32_t * params )
static

This function displays the menu for watchdog commands.

◆ Handle_DA_WatchDogWindowTime()

static nai_status_t Handle_DA_WatchDogWindowTime ( int32_t paramCount,
int32_t * params )
static

This function sets the watchdog window time for the module. The user is prompted for the value in ms.

◆ Handle_DA_WriteThru()

static nai_status_t Handle_DA_WriteThru ( int32_t paramCount,
int32_t * params )
static

◆ naiapp_kill_WDStrobe_Thread()

static void naiapp_kill_WDStrobe_Thread ( )
static

This function will terminate the WD strobing thread. Module will shut off outputs at this state and will need to be power cycled to be operational.

◆ Run_CF1DA_BasicOps()

static bool_t Run_CF1DA_BasicOps ( int32_t cardIndex,
int32_t module,
uint32_t modId )
static

◆ Run_DA_BasicOps()

static bool_t Run_DA_BasicOps ( int32_t cardIndex,
int32_t module,
uint32_t modId )
static

This function runs the basic operations DA program. It controls the top level menu of the DA_BasicOps program and calls Handle_DA_Configuration or Handle_DA_StandardOps, depending on what the user specifies.

◆ WD_Strobe_ThreadEntryPoint() [1/3]

static int WD_Strobe_ThreadEntryPoint ( int32_t nParam)
static

◆ WD_Strobe_ThreadEntryPoint() [2/3]

DWORD WINAPI WD_Strobe_ThreadEntryPoint ( LPVOID param)

This function will continuously loop, strobing the watchdog every QuietTime + Window/2.

◆ WD_Strobe_ThreadEntryPoint() [3/3]

void * WD_Strobe_ThreadEntryPoint ( void * arg)

Variable Documentation

◆ DA2_AdditionalMenuCommands

naiapp_cmdtbl_params_t DA2_AdditionalMenuCommands[]
Initial value:
=
{
DA_ADDITIONAL_CMD_ITEM_CH_ENABLE(DA2_ADDITIONAL_CMD_CHANNEL_ENABLE),
}
@ DA2_ADDITIONAL_CMD_CHANNEL_ENABLE
Definition da_basic_ops.c:208

◆ DA3_AdditionalMenuCommands

naiapp_cmdtbl_params_t DA3_AdditionalMenuCommands[]
Initial value:
=
{
DA_ADDITIONAL_CMD_ITEM_MODE(DA3_ADDITIONAL_CMD_MODE),
DA_ADDITIONAL_CMD_ITEM_POWER(DA3_ADDITIONAL_CMD_POWER)
}
@ DA3_ADDITIONAL_CMD_MODE
Definition da_basic_ops.c:221
@ DA3_ADDITIONAL_CMD_POWER
Definition da_basic_ops.c:222

◆ DA_CF1OpMenuCmds

naiapp_cmdtbl_params_t DA_CF1OpMenuCmds[CF1DA_COMMON_CMD_COUNT]
Initial value:
=
{
{"DATA", "Set Data", DA_COMMON_CMD_DATA, Handle_DA_Data},
{"RANGE", "Set Voltage Range", DA_COMMON_CMD_RANGE, Handle_DA_Range},
{"POLARITY", "Set Voltage Range", DA_COMMON_CMD_POLARITY, Handle_DA_Polarity},
{"WriteThru", "Set Write-Through Mode", DA_CF1_CMD_WRITETHRU, Handle_DA_WriteThru},
{"Strobe", "Strobe Output", DA_CF1_CMD_STROBE, Handle_DA_Strobe},
}
static nai_status_t Handle_DA_WriteThru(int32_t paramCount, int32_t *params)
Definition da_basic_ops.c:2191
static nai_status_t Handle_DA_Polarity(int32_t paramCount, int32_t *params)
This function sets the range polarity mode of the channel specified by the user to the mode specified...
Definition da_basic_ops.c:767
@ DA_CF1_CMD_STROBE
Definition da_basic_ops.c:235
@ DA_CF1_CMD_WRITETHRU
Definition da_basic_ops.c:234
static nai_status_t Handle_DA_Data(int32_t paramCount, int32_t *params)
This function sets the contents of the data register of the channel specified by the user to the valu...
Definition da_basic_ops.c:398
@ DA_COMMON_CMD_POLARITY
Definition da_basic_ops.c:114
@ DA_COMMON_CMD_DATA
Definition da_basic_ops.c:112
@ DA_COMMON_CMD_RANGE
Definition da_basic_ops.c:113
static nai_status_t Handle_DA_Strobe(int32_t paramCount, int32_t *params)
Definition da_basic_ops.c:2221
static nai_status_t Handle_DA_Range(int32_t paramCount, int32_t *params)
This function sets the voltage/current range of the channel specified by the user to the range specif...
Definition da_basic_ops.c:682

◆ DA_ModulePowerResetMenuCmds

naiapp_cmdtbl_params_t DA_ModulePowerResetMenuCmds[DA_MODULE_POWER_RESET_CMD_COUNT]
Initial value:
=
{
{"BACK", "Back to Main Menu", DA_MODULE_POWER_RESET_CMD_BACK, NULL},
}
static nai_status_t Handle_DA_SetModulePowerReset(int32_t paramCount, int32_t *p_params)
Configure_DA_SetModulePowerReset handles the user request to set the module power reset request and c...
Definition da_basic_ops.c:2057
@ DA_MODULE_POWER_RESET_CMD_BACK
Definition da_basic_ops.c:147
@ DA_MODULE_POWER_RESET_CMD_SET_MODULE_POWER_RESET
Definition da_basic_ops.c:149
@ DA_MODULE_POWER_RESET_CMD_CLEAR_MODULE_POWER_RESET_STATUS
Definition da_basic_ops.c:148
static nai_status_t Handle_DA_ClearModulePowerResetStatus(int32_t paramCount, int32_t *p_params)
Configure_DA_ClearModulePowerResetStatus handles the user request to clear the module power reset sta...
Definition da_basic_ops.c:1978

◆ DA_StandardOpMenuCmds

naiapp_cmdtbl_params_t DA_StandardOpMenuCmds[DA_COMMON_CMD_COUNT+DA_ADDITIONAL_MAX_CMD_COUNT]
Initial value:
=
{
{"DATA", "Set Data", DA_COMMON_CMD_DATA, Handle_DA_Data},
{"RANGE", "Set Voltage Range", DA_COMMON_CMD_RANGE, Handle_DA_Range},
{"POLARITY", "Set Polarity", DA_COMMON_CMD_POLARITY, Handle_DA_Polarity},
{"UPDATE_RATE","Set the update rate", DA_COMMON_CMD_UPDATE_RATE, Handle_DA_UpdateRate},
{"TEST_ENABLE","Enable/Disable internal test", DA_COMMON_CMD_TEST_ENABLE, Handle_DA_TestEnable},
{"PBIT", "Check Power-On BIT", DA_COMMON_CMD_PBIT, Handle_DA_CheckPowerOnBIT},
{"CLEAR", "Clear DA Statuses", DA_COMMON_CMD_CLEAR_STATUS, Handle_DA_ClearStatus},
{"ALL CLEAR", "Clear DA Statuses All Channels", DA_COMMON_CMD_CLEAR_STATUS_ALL_CHANS, Handle_DA_ClearStatusAllChannels},
{"FP_MODE", "Enable/Disable Hardware Floating-Point Conversion Mode", DA_COMMON_CMD_FLOATING_POINT_MODE, Handle_DA_FloatingPointMode},
{"OFFSET", "Set Hardware Floating-Point Conversion Mode Offset", DA_COMMON_CMD_FLOATING_POINT_OFFSET, Handle_DA_FloatingPointOffset},
{"SCALE", "Set Hardware Floating-Point Conversion Mode Scale Factor", DA_COMMON_CMD_FLOATING_POINT_SCALE_FACTOR, Handle_DA_FloatingPointScaleFactor},
{"BIT_THRESH", "Set BIT Error Threshold", DA_COMMON_CMD_BIT_THRESHOLD, Handle_DA_BITThresholds},
{"CHANSTAT", "Channel Status Enable/Disable", DA_COMMON_CMD_CHANNEL_STATUS_ENABLE, Handle_DA_ChannelStatusEnable},
#if !defined (NAIBSP_CONFIG_SOFTWARE_OS_DEOS)
{"WATCHDOG", "Show Watchdog Menu Options", DA_COMMON_CMD_WD_MENU, Handle_DA_WatchdogShowMenu},
#endif
{"PWRRESET", "Show Module Power Reset Menu Options", DA_COMMON_CMD_MODULE_POWER_RESET_MENU, Handle_DA_ModulePowerResetMenu}
}
static nai_status_t Handle_DA_FloatingPointOffset(int32_t paramCount, int32_t *params)
This function sets the hardware floating-point conversion mode offset for the DA channel specified by...
Definition da_basic_ops.c:1196
static nai_status_t Handle_DA_UpdateRate(int32_t paramCount, int32_t *params)
This function sets the update rate for the module. The user is prompted for the value in Hz....
Definition da_basic_ops.c:989
static nai_status_t Handle_DA_FloatingPointMode(int32_t paramCount, int32_t *params)
This function enables/disables the hardware floating-point conversion mode of the DA module,...
Definition da_basic_ops.c:1146
static nai_status_t Handle_DA_ClearStatusAllChannels(int32_t paramCount, int32_t *params)
This function clears the status(es) of all of the channels on the module. Clearing the status of a ch...
Definition da_basic_ops.c:598
static nai_status_t Handle_DA_BITThresholds(int32_t paramCount, int32_t *params)
Handle_DA_BITThresholds() allows the user to set and get the BIT error thresholds....
Definition da_basic_ops.c:1295
static nai_status_t Handle_DA_TestEnable(int32_t paramCount, int32_t *params)
This function.
Definition da_basic_ops.c:1023
static nai_status_t Handle_DA_ClearStatus(int32_t paramCount, int32_t *params)
This function clears the status(es) of the channel specified by the user. Clearing the status of a ch...
Definition da_basic_ops.c:513
static nai_status_t Handle_DA_ChannelStatusEnable(int32_t paramCount, int32_t *params)
This function Enables\Disables the reporting of the Channel Status. When enabled, the user will get s...
Definition da_basic_ops.c:1366
static nai_status_t Handle_DA_CheckPowerOnBIT(int32_t paramCount, int32_t *params)
Handle_DA_CheckPowerOnBIT() Checks to see if the power-on BIT test has been run on the module....
Definition da_basic_ops.c:1089
@ DA_COMMON_CMD_UPDATE_RATE
Definition da_basic_ops.c:115
@ DA_COMMON_CMD_BIT_THRESHOLD
Definition da_basic_ops.c:123
@ DA_COMMON_CMD_FLOATING_POINT_OFFSET
Definition da_basic_ops.c:121
@ DA_COMMON_CMD_TEST_ENABLE
Definition da_basic_ops.c:116
@ DA_COMMON_CMD_FLOATING_POINT_MODE
Definition da_basic_ops.c:120
@ DA_COMMON_CMD_MODULE_POWER_RESET_MENU
Definition da_basic_ops.c:128
@ DA_COMMON_CMD_CHANNEL_STATUS_ENABLE
Definition da_basic_ops.c:124
@ DA_COMMON_CMD_PBIT
Definition da_basic_ops.c:117
@ DA_COMMON_CMD_CLEAR_STATUS_ALL_CHANS
Definition da_basic_ops.c:119
@ DA_COMMON_CMD_CLEAR_STATUS
Definition da_basic_ops.c:118
@ DA_COMMON_CMD_WD_MENU
Definition da_basic_ops.c:126
@ DA_COMMON_CMD_FLOATING_POINT_SCALE_FACTOR
Definition da_basic_ops.c:122
static nai_status_t Handle_DA_ModulePowerResetMenu(int32_t paramCount, int32_t *p_params)
Configure_DA_ModulePowerResetMenu displays the menu for module power reset commands.
Definition da_basic_ops.c:1897
static nai_status_t Handle_DA_WatchdogShowMenu(int32_t paramCount, int32_t *params)
This function displays the menu for watchdog commands.
Definition da_basic_ops.c:1537
static nai_status_t Handle_DA_FloatingPointScaleFactor(int32_t paramCount, int32_t *params)
This function sets the hardware floating-point conversion mode scale factor for the DA channel specif...
Definition da_basic_ops.c:1246

◆ DA_WatchdogOpMenuCmds

naiapp_cmdtbl_params_t DA_WatchdogOpMenuCmds[DA_COMMON_CMD_WD_COUNT]
Initial value:
=
{
{"BACK", "Back to Main Menu", 0, NULL},
{"DISPLAY", "Display Watchdog Settings", DA_COMMON_CMD_WD_DISPLAY, Handle_DA_DisplayWatchdog},
{"TIME QUIET", "Set Watchdog Quiet Time", DA_COMMON_CMD_WD_QUIETTIME, Handle_DA_WatchDogQuietTime},
{"WINDOW", "Set Watchdog Window Time", DA_COMMON_CMD_WD_WINDOWTIME, Handle_DA_WatchDogWindowTime},
{"STROBE", "Start thread to continuously strobe watchdog", DA_COMMON_CMD_WD_PET, Handle_DA_StrobeWatchdog},
{"KILL", "Kill Watchdog strobing thread", DA_COMMON_CMD_WD_KILL, Handle_DA_kill_WDStrobe_Thread}
}
static nai_status_t Handle_DA_WatchDogWindowTime(int32_t paramCount, int32_t *params)
This function sets the watchdog window time for the module. The user is prompted for the value in ms.
Definition da_basic_ops.c:1631
@ DA_COMMON_CMD_WD_KILL
Definition da_basic_ops.c:139
@ DA_COMMON_CMD_WD_PET
Definition da_basic_ops.c:138
@ DA_COMMON_CMD_WD_WINDOWTIME
Definition da_basic_ops.c:136
@ DA_COMMON_CMD_WD_DISPLAY
Definition da_basic_ops.c:137
@ DA_COMMON_CMD_WD_QUIETTIME
Definition da_basic_ops.c:135
static nai_status_t Handle_DA_WatchDogQuietTime(int32_t paramCount, int32_t *params)
This function sets the watchdog quiet time for the module. The user is prompted for the value in ms.
Definition da_basic_ops.c:1597
static nai_status_t Handle_DA_StrobeWatchdog(int32_t paramCount, int32_t *params)
This function will start a thread to continuously strobe the watchdog. The user is prompted for the v...
Definition da_basic_ops.c:1702
static nai_status_t Handle_DA_DisplayWatchdog(int32_t paramCount, int32_t *params)
This function displays the DA Watchdog Operations data.
Definition da_basic_ops.c:1666
static nai_status_t Handle_DA_kill_WDStrobe_Thread(int32_t paramCount, int32_t *params)
This function will terminate the WD strobing thread. Module will shut off outputs at this state and w...
Definition da_basic_ops.c:1880

◆ DEF_CONFIG_FILE

const int8_t* DEF_CONFIG_FILE = (const int8_t*)"default_DA_BasicOps.txt"
static

◆ DEF_DA_CHANNEL

const int32_t DEF_DA_CHANNEL = 1
static

◆ g_numBasicMenuCmds

int32_t g_numBasicMenuCmds = 0
static

◆ SAMPLE_PGM_NAME

const int8_t* SAMPLE_PGM_NAME = (const int8_t*)"DA Basic Operations"
static

◆ SAMPLE_WD_PGM_NAME

const int8_t* SAMPLE_WD_PGM_NAME = (const int8_t*)"DA Watchdog Operations"
static

◆ terminateThread

bool_t terminateThread
static

◆ thread

static int thread = NULL
static