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

Enumerations

enum  dt_basicops_commands {
  DIF_BASICOP_CMD_IOFORMAT , DIF_BASICOP_CMD_OUTPUTSTATE , DIF_BASICOP_CMD_STATUS , DIF_BASICOP_CMD_ROC ,
  DIF_BASICOP_CMD_STATUS_CLEAR , DIF_BASICOP_CMD_COUNT
}
 

Functions

int32_t Run_DIF_BasicOps (int32_t cardIndex, int32_t module, int32_t ModuleID)
 Run_DIF_BasicOps prompts the user for the card, module and channel to use for the application and calls Cfg_DIF_Channel if the card, module, channel is valid for as a discrete module.
 
static void Cfg_DIF_Channel (int32_t cardIndex, int32_t module, uint32_t ModuleID, int32_t MaxChannel)
 Cfg_DIF_Channel handles calling the Display_DIF_ChannelCfg routine to display the discrete channel configuration and calling the routines associated with the user's menu commands.
 
static void Display_DIF_ChannelCfg (int32_t cardIndex, int32_t module, int32_t chan, uint32_t ModuleID)
 Display_DIF_ChannelCfg illustrate the methods to call in the naibrd library to retrieve the configuration states for basic operation.
 
static nai_status_t Display_DIF_Status (int32_t paramCount, int32_t *p_params)
 Display_DIF_Status illustrate the methods to call in the naibrd library to retrieve the status states.
 
static nai_status_t Clear_DIF_Status (int32_t paramCount, int32_t *p_params)
 Clear_DIF_Status illustrate the methods to call in the naibrd library to clear the latched status states.
 
static nai_status_t Configure_DIF_IOFormat (int32_t paramCount, int32_t *p_params)
 Configure_DIF_IOFormat handles the user request to configure the Input/Output configuration for the selected channel and calls the method in the naibrd library to set the Input/Output mode.
 
static nai_status_t Configure_DIF_OutputState (int32_t paramCount, int32_t *p_params)
 Configure_DIF_OutputState handles the user request to set the Output state for the selected channel and calls the method in the naibrd library to set the Output state.
 
int32_t DIF_BasicOps (void)
 The purpose of the DIF_BasicOps is to illustrate the methods to call in the naibrd library to perform basic operations with the discrete modules for configuration setup, controlling the drive outputs, and reading the channels.
 

Variables

static const int8_t * CONFIG_FILE = (int8_t *)"default_DIF_BasicOps.txt"
 
static const int32_t DEF_DIF_CARD_INDEX = 0
 
static const int32_t DEF_DIF_MODULE = 1
 
static const int32_t DEF_DIF_CHANNEL = 1
 
naiapp_cmdtbl_params_t DIF_BasicOpMenuCmds []
 

Enumeration Type Documentation

◆ dt_basicops_commands

Enumerator
DIF_BASICOP_CMD_IOFORMAT 
DIF_BASICOP_CMD_OUTPUTSTATE 
DIF_BASICOP_CMD_STATUS 
DIF_BASICOP_CMD_ROC 
DIF_BASICOP_CMD_STATUS_CLEAR 
DIF_BASICOP_CMD_COUNT 

Function Documentation

◆ Cfg_DIF_Channel()

static void Cfg_DIF_Channel ( int32_t cardIndex,
int32_t module,
uint32_t ModuleID,
int32_t MaxChannel )
static

Cfg_DIF_Channel handles calling the Display_DIF_ChannelCfg routine to display the discrete channel configuration and calling the routines associated with the user's menu commands.

◆ Clear_DIF_Status()

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

Clear_DIF_Status illustrate the methods to call in the naibrd library to clear the latched status states.

◆ Configure_DIF_IOFormat()

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

Configure_DIF_IOFormat handles the user request to configure the Input/Output configuration for the selected channel and calls the method in the naibrd library to set the Input/Output mode.

◆ Configure_DIF_OutputState()

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

Configure_DIF_OutputState handles the user request to set the Output state for the selected channel and calls the method in the naibrd library to set the Output state.

◆ DIF_BasicOps()

int32_t DIF_BasicOps ( void )

The purpose of the DIF_BasicOps is to illustrate the methods to call in the naibrd library to perform basic operations with the discrete 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 DIF routines.

  • ClearDeviceCfg
  • QuerySystemCfg
  • DisplayDeviceCfg
  • GetBoardSNModCfg
  • SaveDeviceCfg

◆ Display_DIF_ChannelCfg()

static void Display_DIF_ChannelCfg ( int32_t cardIndex,
int32_t module,
int32_t chan,
uint32_t ModuleID )
static

Display_DIF_ChannelCfg illustrate the methods to call in the naibrd library to retrieve the configuration states for basic operation.

◆ Display_DIF_Status()

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

Display_DIF_Status illustrate the methods to call in the naibrd library to retrieve the status states.

◆ Run_DIF_BasicOps()

int32_t Run_DIF_BasicOps ( int32_t cardIndex,
int32_t module,
int32_t ModuleID )

Run_DIF_BasicOps prompts the user for the card, module and channel to use for the application and calls Cfg_DIF_Channel if the card, module, channel is valid for as a discrete module.

Variable Documentation

◆ CONFIG_FILE

const int8_t* CONFIG_FILE = (int8_t *)"default_DIF_BasicOps.txt"
static

◆ DEF_DIF_CARD_INDEX

const int32_t DEF_DIF_CARD_INDEX = 0
static

◆ DEF_DIF_CHANNEL

const int32_t DEF_DIF_CHANNEL = 1
static

◆ DEF_DIF_MODULE

const int32_t DEF_DIF_MODULE = 1
static

◆ DIF_BasicOpMenuCmds

naiapp_cmdtbl_params_t DIF_BasicOpMenuCmds[]
Initial value:
= {
{"Format", "DIF Set IO Format", DIF_BASICOP_CMD_IOFORMAT, Configure_DIF_IOFormat},
{"Out", "DIF Set Output State", DIF_BASICOP_CMD_OUTPUTSTATE, Configure_DIF_OutputState},
{"Stat", "DIF Display Status", DIF_BASICOP_CMD_STATUS, Display_DIF_Status},
{"Reset", "DIF Reset Overcurrent", DIF_BASICOP_CMD_ROC, NULL},
{"Clear", "DIF Clear Status", DIF_BASICOP_CMD_STATUS_CLEAR, Clear_DIF_Status},
}
static nai_status_t Configure_DIF_IOFormat(int32_t paramCount, int32_t *p_params)
Configure_DIF_IOFormat handles the user request to configure the Input/Output configuration for the s...
Definition dif_basic_ops.c:444
static nai_status_t Clear_DIF_Status(int32_t paramCount, int32_t *p_params)
Clear_DIF_Status illustrate the methods to call in the naibrd library to clear the latched status sta...
Definition dif_basic_ops.c:398
@ DIF_BASICOP_CMD_STATUS
Definition dif_basic_ops.c:42
@ DIF_BASICOP_CMD_OUTPUTSTATE
Definition dif_basic_ops.c:41
@ DIF_BASICOP_CMD_STATUS_CLEAR
Definition dif_basic_ops.c:44
@ DIF_BASICOP_CMD_IOFORMAT
Definition dif_basic_ops.c:40
@ DIF_BASICOP_CMD_ROC
Definition dif_basic_ops.c:43
static nai_status_t Configure_DIF_OutputState(int32_t paramCount, int32_t *p_params)
Configure_DIF_OutputState handles the user request to set the Output state for the selected channel a...
Definition dif_basic_ops.c:510
static nai_status_t Display_DIF_Status(int32_t paramCount, int32_t *p_params)
Display_DIF_Status illustrate the methods to call in the naibrd library to retrieve the status states...
Definition dif_basic_ops.c:304