DIF BasicOps
Edit this on GitLab
DIF BasicOps
Explanation
About this Sample Application Code
This sample application code is designed for use with North Atlantic Industries' (NAI) hardware and software solutions, specifically to interact with their embedded function modules via a Software Support Kit (SSK). The provided code is centered around using NAI’s library functions to perform basic operations on Discrete I/O (DIF) modules connected to NAI hardware.
Included Libraries and Files
- Standard C Libraries:
- stdio.h
, stdlib.h
, string.h
, time.h
, ctype.h
: Standard C libraries for input/output operations, memory allocation, string manipulation, date/time functionalities, and character type checks.
-
NAI Specific Include Files:
-
"include/naiapp_boardaccess_menu.h"
-
"include/naiapp_boardaccess_query.h"
-
"include/naiapp_boardaccess_access.h"
-
"include/naiapp_boardaccess_display.h"
-
"include/naiapp_boardaccess_utils.h"
-
"nai.h"
-
"naibrd.h"
-
"functions/naibrd_dif.h"
-
"advanced/nai_ether_adv.h"
These files include specific declarations and functionalities provided by NAI to interact with their hardware.
Global Constants and Function Prototypes
- CONFIG_FILE
is set to "default_DIF_BasicOps.txt"
as the default configuration file.
- Function prototypes for main functionalities like Run_DIF_BasicOps
, Cfg_DIF_Channel
, Display_DIF_ChannelCfg
, and several configuration and status functions are declared.
Enumerations and Command Tables
Enumerations and command tables are defined for easy command management:
- enum dt_basicops_commands
: Enumerates the commands for the basic operations:
- DIF_BASICOP_CMD_IOFORMAT
- DIF_BASICOP_CMD_OUTPUTSTATE
- DIF_BASICOP_CMD_STATUS
- DIF_BASICOP_CMD_ROC
- DIF_BASICOP_CMD_STATUS_CLEAR
-
DIF_BasicOpMenuCmds
: Maps commands to their descriptions and associated functions:c naiapp_cmdtbl_params_t DIF_BasicOpMenuCmds[] = { {"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}, };
Main Entry Point
The main function of the code, conditionally compiled as main
(for most environments) or DIF_BasicOps
(for VxWorks), is the entry point.
- It enters a loop querying the user for a card index and module number.
- Calls Run_DIF_BasicOps
with specified card and module if valid.
- Provides an option for the user to quit the application.
Core Functions
- Run_DIF_BasicOps
: It verifies the selected module and invokes Cfg_DIF_Channel
if applicable.
- Cfg_DIF_Channel
: Displays configuration for channels, provides menu commands, and processes these commands using a loop until the user decides to quit.
- Display_DIF_ChannelCfg
: Retrieves and displays the configuration of specified DIF channels leveraging NAI library functions.
- Display_DIF_Status
and Clear_DIF_Status
: Used for displaying and clearing status states of the DIF channels.
- Configure_DIF_IOFormat
and Configure_DIF_OutputState
: Allow user to set Input/Output format and output states respectively.
Detailed Configuration and State Management These functions provide detailed management of the DIF modules' states and configurations including: - Getting and Setting I/O formats - Reading channel states - Setting output states - Handling and displaying status, including overcurrent conditions
Conclusion This sample code is a comprehensive demonstration of interacting with NAI’s DIF modules using their provided libraries. It covers initializing and configuring modules, querying user inputs, displaying statuses, and managing I/O configurations effectively. The code is well-structured with clear function definitions to handle the various operational commands for NAI hardware components.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <ctype.h>
/* Common Sample Program include files */
#include "include/naiapp_boardaccess_menu.h"
#include "include/naiapp_boardaccess_query.h"
#include "include/naiapp_boardaccess_access.h"
#include "include/naiapp_boardaccess_display.h"
#include "include/naiapp_boardaccess_utils.h"
/* naibrd include files */
#include "nai.h"
#include "naibrd.h"
#include "functions/naibrd_dif.h"
#include "advanced/nai_ether_adv.h"
static const int8_t *CONFIG_FILE = (int8_t *)"default_DIF_BasicOps.txt";
/* Function prototypes */
int32_t Run_DIF_BasicOps(int32_t cardIndex, int32_t module, int32_t ModuleID);
static void Cfg_DIF_Channel(int32_t cardIndex, int32_t module, uint32_t ModuleID, int32_t MaxChannel);
static void Display_DIF_ChannelCfg(int32_t cardIndex, int32_t module, int32_t chan, uint32_t ModuleID);
static nai_status_t Display_DIF_Status(int32_t paramCount, int32_t* p_params);
static nai_status_t Clear_DIF_Status(int32_t paramCount, int32_t* p_params);
static nai_status_t Configure_DIF_IOFormat(int32_t paramCount, int32_t* p_params);
static nai_status_t Configure_DIF_OutputState(int32_t paramCount, int32_t* p_params);
static const int32_t DEF_DIF_CHANNEL = 1;
/****** Command Table *******/
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
};
/****** Command Tables *******/
naiapp_cmdtbl_params_t DIF_BasicOpMenuCmds[] = {
{"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},
};
/**************************************************************************************************************/
/**
<summary>
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
</summary>
*/
/**************************************************************************************************************/
#if defined (__VXWORKS__)
int32_t DIF_BasicOps(void)
#else
int32_t main(void)
#endif
{
bool_t stop = FALSE;
int32_t cardIndex;
int32_t moduleCnt;
int32_t module;
uint32_t moduleID = 0;
int8_t inputBuffer[80];
int32_t inputResponseCnt;
if (naiapp_RunBoardMenu(CONFIG_FILE) == TRUE)
{
while (stop != TRUE)
{
/* Query the user for the card index */
stop = naiapp_query_CardIndex(naiapp_GetBoardCnt(), 0, &cardIndex);
if (stop != TRUE)
{
check_status(naibrd_GetModuleCount(cardIndex, &moduleCnt));
/* Query the user for the module number */
stop = naiapp_query_ModuleNumber(moduleCnt, 1, &module);
if (stop != TRUE)
{
moduleID = naibrd_GetModuleID(cardIndex, module);
if ((moduleID != 0))
{
Run_DIF_BasicOps(cardIndex, module, moduleID);
}
}
}
printf("\nType Q to quit or Enter key to restart application:\n");
stop = naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
}
}
printf("\nType the Enter key to exit the program: ");
naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
naiapp_access_CloseAllOpenCards();
return 0;
}
/**************************************************************************************************************/
/**
<summary>
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.
</summary>
*/
/**************************************************************************************************************/
int32_t Run_DIF_BasicOps(int32_t cardIndex, int32_t module, int32_t ModuleID)
{
int32_t MaxChannel;
MaxChannel = naibrd_DIF_GetChannelCount(ModuleID);
if (MaxChannel == 0)
{
printf(" *** Module selection not recognized as DIF module. ***\n\n");
}
else
{
Cfg_DIF_Channel(cardIndex, module, ModuleID, MaxChannel);
}
return cardIndex;
}
/**************************************************************************************************************/
/**
<summary>
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.
</summary>
*/
/**************************************************************************************************************/
static void Cfg_DIF_Channel(int32_t cardIndex, int32_t module, uint32_t ModuleID, int32_t MaxChannel)
{
bool_t bQuit = FALSE;
bool_t bContinue = TRUE;
bool_t bCmdFound = FALSE;
nai_status_t status = 0;
int32_t chan, defaultchan = 1;
int32_t cmd;
int8_t inputBuffer[80];
int32_t inputResponseCnt;
naiapp_AppParameters_t dif_params;
p_naiapp_AppParameters_t dif_basicops_params = &dif_params;
dif_basicops_params->cardIndex = cardIndex;
dif_basicops_params->module = module;
dif_basicops_params->modId = ModuleID;
while (bContinue)
{
printf(" \r\n\r\n");
printf("Channel selection \r\n");
printf("================= \r\n");
defaultchan = DEF_DIF_CHANNEL;
bQuit = naiapp_query_ChannelNumber(MaxChannel, defaultchan, &chan);
dif_basicops_params->channel = chan;
naiapp_utils_LoadParamMenuCommands(DIF_BASICOP_CMD_COUNT, DIF_BasicOpMenuCmds);
while (bContinue)
{
Display_DIF_ChannelCfg(cardIndex, module, chan, ModuleID);
naiapp_display_ParamMenuCommands((int8_t *)"DIF Basic Operation Menu");
printf("\nType DIF command or %c to quit : ", NAI_QUIT_CHAR);
bQuit = naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
if (!bQuit)
{
if (inputResponseCnt > 0)
{
bCmdFound = naiapp_utils_GetParamMenuCmdNum(inputResponseCnt, inputBuffer, &cmd);
if (bCmdFound)
{
switch (cmd)
{
case DIF_BASICOP_CMD_IOFORMAT:
case DIF_BASICOP_CMD_OUTPUTSTATE:
case DIF_BASICOP_CMD_STATUS_CLEAR:
case DIF_BASICOP_CMD_STATUS:
DIF_BasicOpMenuCmds[cmd].func(APP_PARAM_COUNT, (int32_t*)dif_basicops_params);
break;
case DIF_BASICOP_CMD_ROC:
status = NAI_SUCCESS;
status |= check_status(naibrd_DIF_ResetAll(cardIndex, module, NAI_DIF_RESET_OVERCURRENT)); /*This resets all channels*/
status |= check_status(naibrd_DIF_Reset(cardIndex, module, chan, (nai_dif_reset_type_t)NAI_DIF_RESET_OVERCURRENT)); /*This alternate function resets channel 1 only on Gen5 modules. */
if (status == NAI_SUCCESS)
printf("Overcurrent condition reset completed \n");
break;
default:
printf("Invalid command entered\n");
break;
}
}
else
printf("Invalid command entered\n");
}
}
else
bContinue = FALSE;
}
}
}
/**************************************************************************************************************/
/**
<summary>
Display_DIF_ChannelCfg illustrate the methods to call in the naibrd library to retrieve the configuration states
for basic operation.
</summary>
*/
/**************************************************************************************************************/
static void Display_DIF_ChannelCfg(int32_t cardIndex, int32_t module, int32_t chan, uint32_t ModuleID)
{
uint32_t ioformat = 0;
nai_dif_state_t outputstate = 0;
nai_dif_state_t inputstate = 0;
uint32_t ModuleVer;
uint32_t ModuleRev;
uint32_t ModInfo_Special;
naibrd_GetModuleInfo(cardIndex, module, &ModuleID, &ModuleVer, &ModuleRev, &ModInfo_Special);
check_status(naibrd_DIF_GetIOFormat(cardIndex, module, chan, &ioformat));
check_status(naibrd_DIF_GetOutputState(cardIndex, module, chan, &outputstate));
check_status(naibrd_DIF_GetInputState(cardIndex, module, chan, &inputstate));
printf("\n === Channel %d ===\n\n", chan);
printf(" IOFormat Output Input \n");
printf(" --------- ------ ----- \n");
if (ModuleID == NAI_MODULE_ID_D8)
{
/*For all Gen3 and prior modules, I/O output mode configuration control setting is different.*/
switch (ioformat)
{
case NAI_DIF_IOFORMAT_INPUT:
printf(" Input ");
break;
case NAI_DIF_GEN3_IOFORMAT_OUTPUT:
printf(" Output ");
break;
default:
printf(" Unknown ");
break;
}
}
else
{
switch (ioformat)
{
case NAI_DIF_IOFORMAT_INPUT:
printf(" Input ");
break;
case NAI_DIF_GEN5_IOFORMAT_OUTPUT:
printf(" Output ");
break;
default:
printf(" Unknown ");
break;
}
}
if (ioformat != NAI_DIF_IOFORMAT_INPUT)
{
switch (outputstate)
{
case NAI_DIF_STATE_LO:
printf(" Low ");
break;
case NAI_DIF_STATE_HI:
printf(" High");
break;
/* undefined value read back */
default:
printf(" UNK ");
break;
}
}
else
printf(" --- ");
printf(" %3i ", inputstate);
}
/**************************************************************************************************************/
/**
<summary>
Display_DIF_Status illustrate the methods to call in the naibrd library to retrieve the status states.
</summary>
*/
/**************************************************************************************************************/
static nai_status_t Display_DIF_Status(int32_t paramCount, int32_t* p_params)
{
nai_status_bit_t statusread;
nai_status_t status = 0;
p_naiapp_AppParameters_t p_dif_params = (p_naiapp_AppParameters_t)p_params;
int32_t cardIndex = p_dif_params->cardIndex;
int32_t module = p_dif_params->module;
int32_t chan = p_dif_params->channel;
#if defined (WIN32)
UNREFERENCED_PARAMETER(paramCount);
#endif
/* Available statusread:
NAI_DIF_STATUS_BIT_LATCHED,
NAI_DIF_STATUS_BIT_REALTIME, (GEN5 only)
NAI_DIF_STATUS_OVERCURRENT_LATCHED,
NAI_DIF_STATUS_OVERCURRENT_REALTIME, (GEN5 only)
NAI_DIF_STATUS_LO_HI_TRANS_LATCHED,
NAI_DIF_STATUS_LO_HI_TRANS_REALTIME, (GEN5 only)
NAI_DIF_STATUS_HI_LO_TRANS_LATCHED,
NAI_DIF_STATUS_HI_LO_TRANS_REALTIME, (GEN5 only)
*/
printf("\n");
printf(" ------------------------- Status ----------------------------\n");
printf(" | BIT | OC | Lo-Hi Trans | Hi-Lo Trans |\n");
printf(" Latch RT Latch RT Latch RT Latch RT \n");
printf(" -------------- --------------- -------------- ---------------\n");
status = check_status(naibrd_DIF_GetStatus(cardIndex, module, chan, NAI_DIF_STATUS_BIT_LATCHED, &statusread));
if (status == NAI_SUCCESS)
printf(" %3i ", statusread);
else
printf(" Err %3i", status);
status = check_status(naibrd_DIF_GetStatus(cardIndex, module, chan, NAI_DIF_STATUS_BIT_REALTIME, &statusread));
if (status == NAI_SUCCESS)
printf(" %3i ", statusread);
else if (status == NAI_ERROR_NOT_SUPPORTED)
printf(" N/A "); /*not available*/
else
printf(" Err %3i", status);
status = check_status(naibrd_DIF_GetStatus(cardIndex, module, chan, NAI_DIF_STATUS_OVERCURRENT_LATCHED, &statusread));
if (status == NAI_SUCCESS)
printf(" %3i ", statusread);
else
printf(" Err %3i", status);
status = check_status(naibrd_DIF_GetStatus(cardIndex, module, chan, NAI_DIF_STATUS_OVERCURRENT_REALTIME, &statusread));
if (status == NAI_SUCCESS)
printf(" %3i ", statusread);
else if (status == NAI_ERROR_NOT_SUPPORTED)
printf(" N/A "); /*not available*/
else
printf(" Err %3i", status);
status = check_status(naibrd_DIF_GetStatus(cardIndex, module, chan, NAI_DIF_STATUS_LO_HI_TRANS_LATCHED, &statusread));
if (status == NAI_SUCCESS)
printf(" %3i ", statusread);
else
printf(" Err %3i", status);
status = check_status(naibrd_DIF_GetStatus(cardIndex, module, chan, NAI_DIF_STATUS_LO_HI_TRANS_REALTIME, &statusread));
if (status == NAI_SUCCESS)
printf(" %3i ", statusread);
else if (status == NAI_ERROR_NOT_SUPPORTED)
printf(" N/A "); /*not available*/
else
printf(" Err %3i", status);
status = check_status(naibrd_DIF_GetStatus(cardIndex, module, chan, NAI_DIF_STATUS_HI_LO_TRANS_LATCHED, &statusread));
if (status == NAI_SUCCESS)
printf(" %3i ", statusread);
else
printf(" Err %3i", status);
status = check_status(naibrd_DIF_GetStatus(cardIndex, module, chan, NAI_DIF_STATUS_HI_LO_TRANS_REALTIME, &statusread));
if (status == NAI_SUCCESS)
printf(" %3i ", statusread);
else if (status == NAI_ERROR_NOT_SUPPORTED)
printf(" N/A "); /*not available*/
else
printf(" Err %3i", status);
printf("\n\n");
return NAI_ERROR_UNKNOWN;
}
/**************************************************************************************************************/
/**
<summary>
Clear_DIF_Status illustrate the methods to call in the naibrd library to clear the latched status states.
</summary>
*/
/**************************************************************************************************************/
static nai_status_t Clear_DIF_Status(int32_t paramCount, int32_t* p_params)
{
nai_status_t status = 0;
p_naiapp_AppParameters_t p_dif_params = (p_naiapp_AppParameters_t)p_params;
int32_t cardIndex = p_dif_params->cardIndex;
int32_t module = p_dif_params->module;
int32_t chan = p_dif_params->channel;
#if defined (WIN32)
UNREFERENCED_PARAMETER(paramCount);
#endif
/* Available status:
NAI_DIF_STATUS_BIT_LATCHED,
NAI_DIF_STATUS_OVERCURRENT_LATCHED,
NAI_DIF_STATUS_LO_HI_TRANS_LATCHED,
NAI_DIF_STATUS_HI_LO_TRANS_LATCHED,
*/
/*Clear latched status - move this to separate operator option selection */
status |= check_status(naibrd_DIF_ClearStatus(cardIndex, module, chan, NAI_DIF_STATUS_BIT_LATCHED));
status |= check_status(naibrd_DIF_ClearStatus(cardIndex, module, chan, NAI_DIF_STATUS_OVERCURRENT_LATCHED));
status |= check_status(naibrd_DIF_ClearStatus(cardIndex, module, chan, NAI_DIF_STATUS_LO_HI_TRANS_LATCHED));
status |= check_status(naibrd_DIF_ClearStatus(cardIndex, module, chan, NAI_DIF_STATUS_HI_LO_TRANS_LATCHED));
if (status == NAI_SUCCESS)
printf("Latched Status cleared \n\n");
return NAI_ERROR_UNKNOWN;
}
/**************************************************************************************************************/
/**
<summary>
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.
</summary>
*/
/**************************************************************************************************************/
static nai_status_t Configure_DIF_IOFormat(int32_t paramCount, int32_t* p_params)
{
bool_t bQuit = FALSE;
bool_t bUpdateIOCfg = FALSE;
uint32_t state = 0;
int8_t iofmtreq;
uint32_t ModuleID;
uint32_t ModuleVer;
uint32_t ModuleRev;
uint32_t ModInfo_Special;
p_naiapp_AppParameters_t p_dif_params = (p_naiapp_AppParameters_t)p_params;
int32_t cardIndex = p_dif_params->cardIndex;
int32_t module = p_dif_params->module;
int32_t chan = p_dif_params->channel;
int8_t inputBuffer[80];
int32_t inputResponseCnt;
#if defined (WIN32)
UNREFERENCED_PARAMETER(paramCount);
#endif
naibrd_GetModuleInfo(cardIndex, module, &ModuleID, &ModuleVer, &ModuleRev, &ModInfo_Special);
/* Set I/O format configuration for channel. Available configurations include:
NAI_DIF_IOFORMAT_INPUT
NAI_DIF_GEN3_IOFORMAT_OUTPUT
NAI_DIF_GEN5_IOFORMAT_OUTPUT
NAI_DIF_IOFORMAT_OUTPUT
*/
printf("Type the desired IO configuration ");
printf("(I=Input, Out=Output): ");
bQuit = naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
if (!bQuit)
{
if (inputResponseCnt > 0)
{
iofmtreq = (int8_t)toupper(inputBuffer[0]);
if (iofmtreq == 'I')
{
state = NAI_DIF_IOFORMAT_INPUT;
bUpdateIOCfg = TRUE;
}
else if (iofmtreq == 'O')
{
if (ModuleID == NAI_MODULE_ID_D8)
state = NAI_DIF_GEN3_IOFORMAT_OUTPUT;
else
state = NAI_DIF_GEN5_IOFORMAT_OUTPUT;
bUpdateIOCfg = TRUE;
}
else
{
printf("ERROR: Invalid selection\n");
}
}
if (!bQuit)
{
if (bUpdateIOCfg)
check_status(naibrd_DIF_SetIOFormat(cardIndex, module, chan, state));
}
}
return (bQuit) ? NAI_ERROR_UNKNOWN : NAI_SUCCESS;
}
/**************************************************************************************************************/
/**
<summary>
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.
</summary>
*/
/**************************************************************************************************************/
static nai_status_t Configure_DIF_OutputState(int32_t paramCount, int32_t* p_params)
{
bool_t bQuit = FALSE;
bool_t bUpdateOutput = FALSE;
nai_dif_state_t outputstate = 0;
uint32_t ModuleID;
uint32_t ModuleVer;
uint32_t ModuleRev;
uint32_t ModInfo_Special;
p_naiapp_AppParameters_t p_dif_params = (p_naiapp_AppParameters_t)p_params;
int32_t cardIndex = p_dif_params->cardIndex;
int32_t module = p_dif_params->module;
int32_t chan = p_dif_params->channel;
int8_t inputBuffer[80];
int32_t inputResponseCnt;
#if defined (WIN32)
UNREFERENCED_PARAMETER(paramCount);
#endif
naibrd_GetModuleInfo(cardIndex, module, &ModuleID, &ModuleVer, &ModuleRev, &ModInfo_Special);
/* Set the output state (high or low) on output channels.
This is not applicable for channels configured as inputs.
*/
printf("\nEnter the desired output state ");
printf("(L=low output, H=high output): ");
bQuit = naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
if (!bQuit)
{
if (inputResponseCnt > 0)
{
switch (toupper(inputBuffer[0]))
{
case 'L':
outputstate = 0;
bUpdateOutput = TRUE;
break;
case 'H':
outputstate= 1;
bUpdateOutput = TRUE;
break;
default:
printf("ERROR: Invalid Output State Format Entry\n");
break;
}
}
}
if (!bQuit)
{
if (bUpdateOutput)
check_status(naibrd_DIF_SetOutputState(cardIndex, module, chan, outputstate));
}
return (bQuit) ? NAI_ERROR_UNKNOWN : NAI_SUCCESS;
}