TC BasicOps
Edit this on GitLab
TC BasicOps Sample Application (SSK 1.x)
Overview
The TC BasicOps sample application demonstrates how to configure and read thermocouple (TC) modules using the NAI Software Support Kit (SSK 1.x). It covers the core TC operations you will need in your own application: selecting thermocouple type, reading temperature in Celsius and Fahrenheit, reading raw voltage, configuring sample rate, managing cold junction compensation (CJC), setting alert and alarm thresholds, checking power-on BIT, clearing status registers, configuring offset temperature, suspending background operations, and triggering system calibration, open-line checks, and BIT on demand.
This sample supports TC module types including TC1 and compatible variants. Consult the TC module manual for hardware-specific specifications. It serves as a practical API reference — each menu command maps directly to one or more naibrd_TC_*() API calls that you can lift into your own code.
Prerequisites
Before running this sample, make sure you have:
-
An NAI board with a TC module installed.
-
SSK 1.x installed on your development host.
-
The sample applications built. Refer to the SSK 1.x build instructions for your platform if you have not already compiled them.
-
Thermocouples connected to the channels you intend to test (or open channels for open-line testing).
How to Run
Launch the TC_BasicOps executable from your build output directory. On startup the application looks for a configuration file (default_TC_BasicOps.txt). On the first run, this file will not exist — the application will present an interactive board menu where you configure a board connection, card index, and module slot. You can save this configuration so that subsequent runs skip the menu and connect automatically. Once connected and a module is selected, you will be prompted for a channel number, then the TC operations menu appears.
Board Connection and Module Selection
|
Note
|
This startup sequence is common to all NAI sample applications. The board connection and module selection code shown here is not specific to TC. For details on board connection configuration, see the First Time Setup Guide. |
The main() function follows a standard SSK 1.x startup flow:
-
Call
naiapp_RunBoardMenu()to load a saved configuration file (if one exists) or present the interactive board menu. The configuration file (default_TC_BasicOps.txt) is not included with the SSK — it is created when the user saves their connection settings from the board menu. On the first run, the menu will always appear. -
Query the user for a card index with
naiapp_query_CardIndex(). -
Query for a module slot with
naiapp_query_ModuleNumber(). -
Retrieve the module ID with
naibrd_GetModuleID()so downstream code can verify the module type.
#if defined (__VXWORKS__)
int32_t TC_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)
{
stop = naiapp_query_CardIndex(naiapp_GetBoardCnt(), 0, &cardIndex);
if (stop != TRUE)
{
check_status(naibrd_GetModuleCount(cardIndex, &moduleCnt));
stop = naiapp_query_ModuleNumber(moduleCnt, 1, &module);
if (stop != TRUE)
{
moduleID = naibrd_GetModuleID(cardIndex, module);
if ((moduleID != 0))
{
Run_TC_BasicOps(cardIndex, module, moduleID);
}
}
}
/* ... quit/restart prompt ... */
}
}
naiapp_access_CloseAllOpenCards();
return 0;
}
After retrieving the module ID, Run_TC_BasicOps() checks whether the selected module is a TC type by calling naibrd_TC_GetChannelCount(). If the channel count is zero, the module is not a TC and the sample prints an error. Otherwise it initializes all channels by calling naibrd_TC_SetConfiguration() with NAI_TC_CONFIG:
MaxChannel = naibrd_TC_GetChannelCount(ModuleID);
if (MaxChannel == 0)
{
printf(" *** Module selection not recognized as TC module. ***\n\n");
}
else
{
for (chanNum = 1; chanNum <= MaxChannel; chanNum++)
{
naibrd_TC_SetConfiguration(cardIndex, module, chanNum, NAI_TC_CONFIG);
}
Cfg_TC_Channel(cardIndex, module, MaxChannel, ModuleID);
}
naibrd_TC_SetConfiguration() places each channel into its default operating configuration. This call is required before reading temperature or voltage data.
|
Important
|
Common connection errors you may encounter at this stage:
|
Program Structure
Entry Point
On standard platforms the entry point is main(). On VxWorks the entry point is TC_BasicOps():
#if defined (__VXWORKS__)
int32_t TC_BasicOps(void)
#else
int32_t main(void)
#endif
Application Parameters
The Cfg_TC_Channel() function populates an naiapp_AppParameters_t struct that is passed to every command handler. Your application will need to track these same values:
tc_basicOps_params->cardIndex = cardIndex;
tc_basicOps_params->module = module;
tc_basicOps_params->maxChannels = naibrd_TC_GetChannelCount(MaxChannel);
tc_basicOps_params->modId = ModuleID;
tc_basicOps_params->displayHex = FALSE;
-
cardIndex— identifies which board in a multi-board system. -
module— the slot number where the TC module is installed. -
channel— the currently selected channel (prompted at startup). -
maxChannels— total channel count for the detected module. -
modId— the module identifier returned bynaibrd_GetModuleID().
Command Loop
Cfg_TC_Channel() drives the interactive command loop. On each iteration it displays the current channel configuration, prints the command menu, and dispatches the user’s selection:
| Command | Description |
|---|---|
0 |
Enable/disable channel status reporting |
1 |
Set thermocouple type (J, K, E, T, N, B, R, S) |
2 |
Set sample rate |
3 |
Set compensation temperature |
4 |
Enable/disable cold junction compensation (CJC) |
5 |
Set CJC type (manual or auto) |
6 |
Set a threshold value (alert/alarm, high/low) |
7 |
Clear a status register |
8 |
Check power-on BIT |
9 |
Set offset temperature |
A |
Suspend/resume background operations (BIT, open-line tests, system cal) |
B |
Trigger system calibration |
C |
Trigger open-line check |
D |
Trigger BIT |
The menu-driven structure is a convenience of the sample application. In your own application, you would call the same underlying naibrd_TC_*() API functions directly.
Reading Temperature and Voltage
On each command loop iteration, Display_TC_ChannelCfg() reads and displays the current channel state. To read temperature and voltage in your own application:
float64_t celsiusTemp = 0.0;
float64_t fahrenheitTemp = 0.0;
float64_t voltage = 0.0;
naibrd_TC_GetTemperature(cardIndex, module, channel, NAI_TC_TEMP_TYPE_CELSIUS, &celsiusTemp);
naibrd_TC_GetTemperature(cardIndex, module, channel, NAI_TC_TEMP_TYPE_FAHRENHEIT, &fahrenheitTemp);
naibrd_TC_GetVoltage(cardIndex, module, channel, &voltage);
-
celsiusTemp/fahrenheitTemp— the measured temperature in the specified unit. The module converts the thermocouple voltage to temperature using the linearization curve for the configured thermocouple type. -
voltage— the raw thermocouple voltage in microvolts.
|
Note
|
If no thermocouple is connected, the temperature reading will be invalid and the open-line status will be set. Always verify the thermocouple connection before relying on temperature readings. |
Thermocouple Configuration
Set Thermocouple Type
To configure the thermocouple type for a channel in your own application, call naibrd_TC_SetThermocoupleType():
naibrd_TC_SetThermocoupleType(cardIndex, module, channel, NAI_TC_THERMOCOUPLE_TYPE_K);
Supported types: NAI_TC_THERMOCOUPLE_TYPE_J, _K, _E, _T, _N, _B, _R, _S. The thermocouple type determines which temperature-to-voltage linearization curve the module uses. The type must match the actual thermocouple sensor connected to the channel — a mismatch produces inaccurate temperature readings.
To read back the current type:
nai_tc_thermocouple_type_t tcType;
naibrd_TC_GetThermocoupleType(cardIndex, module, channel, &tcType);
Set Sample Rate
To configure the sampling rate for a channel:
float64_t sampleRate = 10.0; /* Hz */
naibrd_TC_SetSampleRate(cardIndex, module, channel, sampleRate);
To read back the current rate:
float64_t currentRate = 0.0;
naibrd_TC_GetSampleRate(cardIndex, module, channel, ¤tRate);
Consult your TC module’s manual for supported sample rate values.
Set Compensation Temperature
The compensation temperature is used when CJC is in manual mode. It represents the temperature at the cold junction (typically the terminal block where the thermocouple wires connect to the module):
float64_t compTemp = 25.0; /* degrees Celsius */
naibrd_TC_SetCompTemperature(cardIndex, module, channel, compTemp);
To read back the current compensation temperature:
float64_t currentCompTemp = 0.0;
naibrd_TC_GetCompTemperature(cardIndex, module, channel, ¤tCompTemp);
Enable/Disable Cold Junction Compensation
CJC corrects for the temperature difference at the connection point between the thermocouple wires and the measurement electronics. This is a module-wide setting:
/* Enable CJC */
naibrd_TC_SetCJCEnable(cardIndex, module, TRUE);
/* Disable CJC */
naibrd_TC_SetCJCEnable(cardIndex, module, FALSE);
To read back the current state:
bool_t cjcEnabled = FALSE;
naibrd_TC_GetCJCEnable(cardIndex, module, &cjcEnabled);
|
Note
|
CJC is a module-wide setting, not per-channel. Enabling or disabling CJC affects all channels on the module. |
Set CJC Type
To select between automatic and manual cold junction compensation:
/* Auto: module uses its internal temperature sensor */
naibrd_TC_SetCompType(cardIndex, module, channel, NAI_TC_COMP_TYPE_AUTO);
/* Manual: module uses the value from naibrd_TC_SetCompTemperature() */
naibrd_TC_SetCompType(cardIndex, module, channel, NAI_TC_COMP_TYPE_MANUAL);
In auto mode, the module measures the cold junction temperature with an onboard sensor. In manual mode, you must provide an accurate cold junction temperature via naibrd_TC_SetCompTemperature().
Set Offset Temperature
To apply a temperature offset correction to a channel:
float64_t offsetTemp = 0.5; /* degrees Celsius */
naibrd_TC_SetOffsetTemperature(cardIndex, module, channel, offsetTemp);
To read back the current offset:
float64_t currentOffset = 0.0;
naibrd_TC_GetOffsetTemperature(cardIndex, module, channel, ¤tOffset);
|
Note
|
Offset temperature may not be supported on all TC module variants. The API returns NAI_ERROR_NOT_SUPPORTED on modules that do not have this feature.
|
|
Important
|
Common Errors
|
Threshold Configuration
TC modules support four threshold levels for monitoring temperature conditions. When a channel’s temperature crosses a threshold, the corresponding status bit is set.
Set Thresholds
naibrd_TC_SetThreshold(cardIndex, module, channel, NAI_TC_THRESH_ALERT_LO, alertLoValue);
naibrd_TC_SetThreshold(cardIndex, module, channel, NAI_TC_THRESH_ALARM_LO, alarmLoValue);
naibrd_TC_SetThreshold(cardIndex, module, channel, NAI_TC_THRESH_ALERT_HI, alertHiValue);
naibrd_TC_SetThreshold(cardIndex, module, channel, NAI_TC_THRESH_ALARM_HI, alarmHiValue);
-
NAI_TC_THRESH_ALERT_LO— low alert threshold. Set this to warn when temperature drops below normal operating range. -
NAI_TC_THRESH_ALARM_LO— low alarm threshold. Set this below the alert level for critical low-temperature detection. -
NAI_TC_THRESH_ALERT_HI— high alert threshold. Set this to warn when temperature exceeds normal operating range. -
NAI_TC_THRESH_ALARM_HI— high alarm threshold. Set this above the alert level for critical high-temperature detection.
All threshold values are in degrees Celsius.
Read Thresholds
float64_t alertLo, alarmLo, alertHi, alarmHi;
naibrd_TC_GetThreshold(cardIndex, module, channel, NAI_TC_THRESH_ALERT_LO, &alertLo);
naibrd_TC_GetThreshold(cardIndex, module, channel, NAI_TC_THRESH_ALARM_LO, &alarmLo);
naibrd_TC_GetThreshold(cardIndex, module, channel, NAI_TC_THRESH_ALERT_HI, &alertHi);
naibrd_TC_GetThreshold(cardIndex, module, channel, NAI_TC_THRESH_ALARM_HI, &alarmHi);
Status and Diagnostics
Read Channel Status
The sample reads all status types for the selected channel on each display iteration. Status types come in real-time and latched pairs:
nai_status_bit_t statuses[NAI_TC_STATUS_TYPE_ENUM_COUNT];
for (i = 0; i < NAI_TC_STATUS_TYPE_ENUM_COUNT; i++)
{
naibrd_TC_GetStatus(cardIndex, module, channel, i, &statuses[i]);
}
The status types include:
-
BIT — built-in test status. A failure indicates the measurement path is not functioning correctly.
-
Open — open-line detection. Set when no thermocouple is connected or the wire is broken.
-
Alert Low / Alarm Low — temperature below the corresponding threshold.
-
Alert High / Alarm High — temperature above the corresponding threshold.
-
Summary — aggregate of all status conditions. If any individual status is in a fail state, the summary reports a fail.
Each type has real-time (current condition) and latched (holds until explicitly cleared) variants.
Clear Status
To clear a specific latched status:
naibrd_TC_ClearStatus(cardIndex, module, channel, NAI_TC_STATUS_BIT_LATCHED);
naibrd_TC_ClearStatus(cardIndex, module, channel, NAI_TC_STATUS_OPEN_LATCHED);
naibrd_TC_ClearStatus(cardIndex, module, channel, NAI_TC_STATUS_ALERT_LO_LATCHED);
/* ... etc. */
Channel Status Enable
To enable or disable status reporting on a per-channel basis:
/* Enable status reporting */
naibrd_TC_SetChanStatusEnable(cardIndex, module, channel, TRUE);
/* Disable status reporting */
naibrd_TC_SetChanStatusEnable(cardIndex, module, channel, FALSE);
Disabling channel status also suppresses any interrupts that would be triggered by status conditions on that channel.
Check Power-On BIT
To verify that the module passed its power-on built-in test (PBIT), call naibrd_TC_CheckPowerOnBITComplete() then read each channel’s BIT status:
bool_t pbitComplete = FALSE;
nai_status_bit_t bitStatus = 0u;
int32_t channelCount = naibrd_TC_GetChannelCount(modId);
naibrd_TC_CheckPowerOnBITComplete(cardIndex, module, &pbitComplete);
if (pbitComplete)
{
for (chan = 1; chan <= channelCount; chan++)
{
naibrd_TC_GetStatus(cardIndex, module, chan, NAI_TC_STATUS_BIT_LATCHED, &bitStatus);
if (bitStatus)
printf("Ch. %d: BIT FAILED\n", chan);
else
printf("Ch. %d: BIT Passed\n", chan);
}
}
PBIT only executes once, at power-on. If the module has not been power-cycled since installation, PBIT may not have completed — this is normal.
Suspend Background Operations
To temporarily suspend BIT, open-line tests, and system calibration on a channel:
/* Suspend background operations */
naibrd_TC_SetBackgroundOpSuspend(cardIndex, module, channel, TRUE);
/* Resume background operations */
naibrd_TC_SetBackgroundOpSuspend(cardIndex, module, channel, FALSE);
Suspending background operations is useful when you need uninterrupted temperature readings. While suspended, the module does not perform BIT, open-line checks, or system calibration on that channel, which eliminates brief measurement disruptions caused by these background activities.
Trigger Diagnostics On Demand
To manually trigger specific diagnostic operations:
/* Trigger system calibration */
naibrd_TC_TriggerBackgroundOperation(cardIndex, module, channel,
NAI_TC_BACKGROUND_OP_SYSTEM_CAL);
/* Trigger open-line check */
naibrd_TC_TriggerBackgroundOperation(cardIndex, module, channel,
NAI_TC_BACKGROUND_OP_OPEN);
/* Trigger BIT */
naibrd_TC_TriggerBackgroundOperation(cardIndex, module, channel,
NAI_TC_BACKGROUND_OP_BIT);
These operations run once when triggered. If background operations are suspended, these manual triggers are the only way to run diagnostics on that channel.
|
Important
|
Common Errors
|
Troubleshooting Reference
This table summarizes common errors and symptoms covered in the sections above. Consult the TC module manual for hardware-specific diagnostic procedures.
| Error / Symptom | Possible Causes | Suggested Resolution |
|---|---|---|
No board found or connection timeout |
Board not powered, incorrect or missing configuration file, network issue |
Verify hardware is powered and connected. If |
Module not recognized as TC |
Selected slot does not contain a TC module |
Verify TC module installation and slot number |
Temperature reads zero or invalid |
No thermocouple connected, wrong thermocouple type configured |
Connect a thermocouple; verify the type setting matches the sensor |
Open-line status set |
Broken or disconnected thermocouple wire |
Check wiring continuity |
BIT failure on a channel |
Hardware fault in the measurement path |
Check thermocouple connections. Consult your module’s manual for diagnostics. |
Alert/alarm status set |
Temperature outside configured threshold range |
Adjust thresholds or investigate the thermal condition causing the exceedance |
|
Feature not available on this TC module variant (e.g., offset temperature) |
Consult your module’s manual for supported features |
CJC compensation incorrect |
Wrong CJC mode or inaccurate manual compensation temperature |
Switch to auto CJC, or set an accurate compensation temperature in manual mode |
PBIT not complete |
Module has not been power-cycled since installation |
Power-cycle the module and re-run the PBIT check |
Background operations disrupting readings |
BIT, open-line, or system cal running in the background |
Suspend background operations on channels where uninterrupted readings are needed |
Full Source
The complete source for this sample is provided below for reference. The sections above explain each part in detail.
Full Source — TC_BasicOps.c (SSK 1.x)
#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_tc.h"
#include "advanced/nai_ether_adv.h"
static const int8_t *CONFIG_FILE = (const int8_t *)"default_TC_BasicOps.txt";
/* Function prototypes */
int32_t Run_TC_BasicOps(int32_t cardIndex, int32_t module, uint32_t ModuleID);
static void Cfg_TC_Channel(int32_t cardIndex, int32_t module, int32_t MaxChannel, uint32_t ModuleID);
static void Display_TC_ChannelCfg(int32_t cardIndex, int32_t module, int32_t chan);
static void TC_Display_ThermoCoupleType(int32_t cardIndex, int32_t module, int32_t chan);
static void TC_Display_Temperature(int32_t cardIndex, int32_t module, int32_t chan);
static void TC_Display_Voltage(int32_t cardIndex, int32_t module, int32_t chan);
static void TC_Display_SampleRate(int32_t cardIndex, int32_t module, int32_t chan);
static void TC_Display_CompTemp(int32_t cardIndex, int32_t module, int32_t chan);
static void TC_Display_CJCEnable(int32_t cardIndex, int32_t module, int32_t chan);
static void TC_Display_Statuses(int32_t cardIndex, int32_t module, int32_t chan);
static void TC_Display_Thresholds(int32_t cardIndex, int32_t module, int32_t chan);
static void TC_Display_CJCType(int32_t cardIndex, int32_t module, int32_t chan);
static void TC_Display_OffsetTemp(int32_t cardIndex, int32_t module, int32_t chan);
static void TC_Display_BackgroundOpSuspension(int32_t cardIndex, int32_t module, int32_t chan);
static nai_status_t TC_Set_ChanStatusEnable(int32_t paramCount, int32_t* p_params);
static nai_status_t TC_Set_ThermoCoupleType(int32_t paramCount, int32_t* p_params);
static nai_status_t TC_Set_SampleRate(int32_t paramCount, int32_t* p_params);
static nai_status_t TC_Set_CompTemp(int32_t paramCount, int32_t* p_params);
static nai_status_t TC_Set_CJCEnable(int32_t paramCount, int32_t* p_params);
static nai_status_t TC_Set_Thresh(int32_t paramCount, int32_t* p_params);
static nai_status_t TC_ClearStatus(int32_t paramCount, int32_t* p_params);
static nai_status_t TC_CheckPowerOnBIT(int32_t paramCount, int32_t* p_params);
static nai_status_t TC_Set_CJCType(int32_t paramCount, int32_t* p_params);
static nai_status_t TC_Set_OffsetTemp(int32_t paramCount, int32_t* p_params);
static nai_status_t TC_Set_BackgroundOpSuspension(int32_t paramCount, int32_t* p_params);
static nai_status_t TC_Trigger_SystemCalibration(int32_t paramCount, int32_t* p_params);
static nai_status_t TC_Trigger_OpenCheck(int32_t paramCount, int32_t* p_params);
static nai_status_t TC_Trigger_BIT(int32_t paramCount, int32_t* p_params);
static uint32_t g_TCModId = 0u;
enum tc_basicops_commands
{
TC_BASICOP_CMD_SET_CHAN_STATUS_ENABLE,
TC_BASICOP_CMD_SET_THERMO_COUPLE_TYPE,
TC_BASICOP_CMD_SET_SAMPLE_RATE,
TC_BASICOP_CMD_SET_COMP_TEMP,
TC_BASICOP_CMD_SET_CJC_ENABLE,
TC_BASICOP_CMD_SET_CJC_TYPE,
TC_BASICOP_CMD_SET_THRESH,
TC_BASICOP_CMD_CLEAR_STATUS,
TC_BASICOP_CMD_CHECK_POWER_ON_BIT,
TC_BASICOP_CMD_SET_OFFSET_TEMP,
TC_BASICOP_CMD_SET_BACKGROUND_OP_SUSPEND,
TC_BASICOP_CMD_TRIGGER_SYSTEM_CAL,
TC_BASICOP_CMD_TRIGGER_OPEN_CHECK,
TC_BASICOP_CMD_TRIGGER_BIT,
TC_BASICOP_CMD_COUNT
};
naiapp_cmdtbl_params_t TC_BasicOpMenuCmds[] = {
{"0", "Enable/Disable Channel Status Reporting", TC_BASICOP_CMD_SET_CHAN_STATUS_ENABLE, TC_Set_ChanStatusEnable},
{"1", "Set the Thermo Couple Type", TC_BASICOP_CMD_SET_THERMO_COUPLE_TYPE, TC_Set_ThermoCoupleType},
{"2", "Set the Sample Rate", TC_BASICOP_CMD_SET_SAMPLE_RATE, TC_Set_SampleRate},
{"3", "Set the Compensation Temperature", TC_BASICOP_CMD_SET_COMP_TEMP, TC_Set_CompTemp},
{"4", "Enable/Disable Cold Junction Compensation", TC_BASICOP_CMD_SET_CJC_ENABLE, TC_Set_CJCEnable},
{"5", "Set the CJC Type", TC_BASICOP_CMD_SET_CJC_TYPE, TC_Set_CJCType},
{"6", "Set a Threshold Value", TC_BASICOP_CMD_SET_THRESH, TC_Set_Thresh},
{"7", "Clear a Status", TC_BASICOP_CMD_CLEAR_STATUS, TC_ClearStatus},
{"8", "Check Power-On BIT", TC_BASICOP_CMD_CHECK_POWER_ON_BIT, TC_CheckPowerOnBIT},
{"9", "Set the Offset Temperature", TC_BASICOP_CMD_SET_OFFSET_TEMP, TC_Set_OffsetTemp},
{"A", "Suspend BIT/Open tests and System Cal", TC_BASICOP_CMD_SET_BACKGROUND_OP_SUSPEND, TC_Set_BackgroundOpSuspension},
{"B", "Trigger System Calibration", TC_BASICOP_CMD_TRIGGER_SYSTEM_CAL, TC_Trigger_SystemCalibration},
{"C", "Trigger Open-Line Check", TC_BASICOP_CMD_TRIGGER_OPEN_CHECK, TC_Trigger_OpenCheck},
{"D", "Trigger BIT", TC_BASICOP_CMD_TRIGGER_BIT, TC_Trigger_BIT}
};
#if defined (__VXWORKS__)
int32_t TC_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)
{
stop = naiapp_query_CardIndex(naiapp_GetBoardCnt(), 0, &cardIndex);
if (stop != TRUE)
{
check_status(naibrd_GetModuleCount(cardIndex, &moduleCnt));
stop = naiapp_query_ModuleNumber(moduleCnt, 1, &module);
if (stop != TRUE)
{
moduleID = naibrd_GetModuleID(cardIndex, module);
if ((moduleID != 0))
{
Run_TC_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;
}
/* ... remaining functions: Run_TC_BasicOps, Cfg_TC_Channel, Display_TC_ChannelCfg, */
/* TC_Display_* helpers, TC_Set_* command handlers, TC_ClearStatus, */
/* TC_CheckPowerOnBIT, TC_Trigger_* handlers */
/* See the SSK installation directory for the complete source. */