Integrator Resources

The official home for NAI Support

Not sure where to start? Try Quick Start Guide or ask a question below!

Toggle Components with Visual Button
JavaScript Form Processing

DL BasicOpsMenu

DL BasicOps Sample Application (SSK 1.x)

Overview

The DL BasicOps sample application demonstrates how to configure and operate Digital-to-LVDT (DL) converter channels using the NAI Software Support Kit (SSK 1.x). DL modules generate LVDT (Linear Variable Differential Transformer) excitation signals and output analog position signals that simulate LVDT sensor behavior. This makes them essential for testing and stimulating systems that consume LVDT position data — flight control computers, actuator controllers, and hydraulic valve positioners, among others.

An LVDT is a transformer-based sensor that converts linear displacement into a proportional AC voltage. It has three coils: a primary (reference excitation) winding and two secondary windings. As a ferromagnetic core moves through the coil assembly, the coupling between primary and secondaries changes, producing a differential voltage proportional to the core’s position. The DL module reverses this relationship — instead of measuring a physical core position, it accepts a digital position command and synthesizes the corresponding excitation and signal voltages that an LVDT sensor would produce at that position. The receiving system cannot distinguish the DL module’s output from a real LVDT sensor.

The sample covers the core DL operations you will need in your own application: enabling channel power, setting output position, choosing between ratio and fixed signal output modes, configuring excitation and signal voltage parameters, setting fault-detection thresholds, selecting 2-wire or 4-wire wiring modes, adjusting phase offset, reading back measured voltages and status, and toggling between decimal and hexadecimal display.

This sample supports the following DL module types: DLA, DLB, DLC, DLJ, DLK, DLL, DLM, and DLN. It serves as a practical API reference — each menu command maps directly to one or more naibrd_DL_*() API calls that you can lift into your own code.

Prerequisites

Before running this sample, make sure you have:

  • An NAI board with a DL module installed (DLA-DLC or DLJ-DLN).

  • 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.

How to Run

Launch the DL_BasicOpsMenu executable from your build output directory. On startup the application looks for a configuration file (default_DL_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, a command menu lets you exercise each DL operation.

LVDT Signal Fundamentals

To use the DL module effectively, it helps to understand the signal it generates.

Reference excitation. The DL module drives a sinusoidal excitation signal on the reference output. This corresponds to the voltage that would normally be applied to the primary winding of a real LVDT. You configure its amplitude with the expected reference voltage parameter (NAI_DL_CONFIGURATION_REF_VOLT) and read back the actual measured amplitude with NAI_DL_MEASURED_REF_VOLTAGE. The frequency of this excitation is set by the module hardware and can be read back with NAI_DL_MEASURED_REF_FREQUENCY.

Signal (VLL) output. The signal output represents the differential secondary voltage of a simulated LVDT — this is the "velocity of linear length" or VLL voltage. Its amplitude depends on the commanded position and the output mode:

  • Ratio mode (NAI_DL_VLL_MODE_RATIO): The signal amplitude is a scaled proportion of the reference amplitude, determined by the position value. A position of 0.0 produces zero signal; increasing position produces proportionally larger signal voltage. This mimics how a real LVDT’s secondary output is ratiometric to its excitation.

  • Fixed mode (NAI_DL_VLL_MODE_FIXED): The signal output is set to a specific voltage independent of the reference amplitude, configured via NAI_DL_CONFIGURATION_VLL_VOLT.

Wire modes. DL modules support two wiring configurations:

  • 4-wire mode (NAI_DL_4WIRE_MODE): Separate reference excitation and signal output pairs. This is the standard LVDT connection with distinct primary and secondary wiring.

  • 2-wire mode (NAI_DL_2WIRE_MODE): A combined connection where the module provides both position A and position B outputs on a reduced wire count. In 2-wire mode, you can set independent positions on subchannel A and subchannel B using DL_SUBCHANNEL_A and DL_SUBCHANNEL_B.

Position value. The position represents the simulated core displacement. The DL module converts this digital value into the appropriate ratio of signal-to-reference voltage. The display distinguishes between the commanded position and the "wrap position" — the wrap-back measurement is the module’s internal verification of the output it is actually generating, useful for confirming that the output matches the commanded value.

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 DL.

The main() function follows a standard SSK 1.x startup flow:

  1. Call naiapp_RunBoardMenu() to load a saved configuration file (if one exists) or present the interactive board menu. The configuration file (default_DL_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.

  2. Query the user for a card index with naiapp_query_CardIndex().

  3. Query for a module slot with naiapp_query_ModuleNumber().

  4. Retrieve the module ID with naibrd_GetModuleID() so downstream code can adapt to the specific DL variant installed.

#if defined (__VXWORKS__)
int32_t DL_BasicOpsMenu(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))
               {
                  DLBasicMenu_Run(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;
}
Important

Common connection errors you may encounter at this stage:

  • No board found — verify that the board is powered on and physically connected. Check that the configuration file lists the correct interface and address.

  • Connection timeout — confirm network settings (for Ethernet connections) or bus configuration (for PCI/PCIe). Firewalls and IP mismatches are frequent causes.

  • Invalid card or module index — indices are zero-based for cards and one-based for modules. Ensure the values you pass match your hardware setup.

  • Module not present at selected slot — the slot you selected does not contain a DL module. Use the board menu to verify which slots are populated.

Program Structure

Application Parameters

The sample tracks its operating context in an naiapp_AppParameters_t struct. Your application will need to track the same values:

  • cardIndex — identifies which board to communicate with (zero-based).

  • module — the slot number where the DL module is installed (one-based).

  • modId — the module ID returned by naibrd_GetModuleID(), used to determine the DL variant and its channel count.

  • channel — the channel currently being configured (one-based).

The channel count is queried at runtime using naibrd_DL_GetChannelCount(modid), which returns the correct count for the specific DL module variant installed.

Command Loop

The DLBasicMenu_Run() function implements the interactive menu loop. On each iteration it displays the current measurements for all channels, then presents the command menu. The menu system is a sample convenience — in your own code, call these API functions directly.

The available commands are:

Command Description

1

Set Power State

2

Set Channel Output (Gen 2/3 only)

3

Set Position

4

Set Configuration

5

Set Display Mode (decimal or hexadecimal)

naiapp_cmdtbl_params_t DL_BasicOpsMenuCmds[] =
{
   {"1", "Set Power State",                   DL_BASICMENU_CMD_SET_POWER_STATE,    NULL                         },
   {"2", "Set Channel Output (Gen 2/3 only)", DL_BASICMENU_CMD_SET_CHANNEL_OUTPUT, DLBasicMenu_SetChannelOutput },
   {"3", "Set Position",                      DL_BASICMENU_CMD_SET_POSITION,       DL_BasicMenu_SetPosition     },
   {"4", "Set Configuration",                 DL_BASICMENU_CMD_SET_CONFIGURATION,  DL_BasicMenu_SetConfiguration},
   {"5", "Set Display Mode",                  DL_BASICMENU_CMD_SET_DISPLAY_HEX,    NULL                         }
};

Power Supply Control

Before a DL channel can generate any output, you must enable its power supply. To turn a channel’s power supply on or off in your own application, call naibrd_DL_SetPowerSupplyState().

naibrd_DL_SetPowerSupplyState(cardIndex, module, channel, (nai_dl_on_off_t)atoi((char*)inputBuffer));

Parameters:

  • cardIndex — board index (zero-based).

  • module — module slot (one-based).

  • channel — channel number (one-based).

  • state — DL_ON (1) to enable the power supply, DL_OFF (0) to disable it.

When the power supply is off, the channel’s reference excitation and signal outputs are inactive. You can verify the current power state in the measurement display, which shows "ON" or "OFF" in the Power column.

To read back the power state programmatically, the display function calls naibrd_DL_GetPowerSupplyState():

nai_dl_on_off_t outPowerSupplyState = 0;
naibrd_DL_GetPowerSupplyState(cardIndex, module, channel, &outPowerSupplyState);
Important

Common Errors

  • No output after configuration — the most common oversight is forgetting to enable the power supply. Always call naibrd_DL_SetPowerSupplyState() with DL_ON before expecting any output from a channel.

  • NAI_ERROR_NOT_SUPPORTED — the selected channel number exceeds the channel count for the installed DL module variant. Verify the channel count with naibrd_DL_GetChannelCount().

Channel Output Enable (Gen 2/3 Only)

On Generation 2 and Generation 3 DL modules, you can independently enable or disable the channel output stage. To toggle the output in your own application, call naibrd_DL_SetConfigurationValue() with the NAI_DL_CONFIGURATION_OUTPUT_MODE parameter.

naibrd_DL_SetConfigurationValue(cardIndex, module, channel,
   NAI_DL_CONFIGURATION_OUTPUT_MODE, (nai_dl_enabled_disabled_t)atoi((char*)inputBuffer));

Parameters:

  • NAI_DL_CONFIGURATION_OUTPUT_MODE — the configuration parameter selector.

  • Value: 1 to enable the output, 0 to disable it.

This is distinct from the power supply control. The power supply energizes the channel’s internal circuitry, while the output enable controls whether the generated signal is actually driven onto the output pins. On Generation 1 modules, the output is always enabled when the power supply is on, so this command applies only to Gen 2/3 hardware.

Important

Common Errors

  • NAI_ERROR_NOT_SUPPORTED — this command is not supported on Generation 1 DL modules. If you call it on a Gen 1 module, the API will return an error. Check your module variant before using this feature.

  • Output enabled but no signal — verify that the power supply is also turned on. Both conditions must be met for output.

Position Control

The position value is the primary control parameter for a DL module — it determines what LVDT position the module simulates. To set the position in your own application, call naibrd_DL_SetPosition().

The sample prompts for the position type before setting the value, because the DL module supports different position subchannels depending on the wire mode:

  • 4-wire position (type 0) or 2-wire position A (type 1): Both write to DL_SUBCHANNEL_A. In 4-wire mode, this is the single position output. In 2-wire mode, this is the first of two independent position outputs.

  • 2-wire position B (type 2): Writes to DL_SUBCHANNEL_B. This second position output is only meaningful in 2-wire mode.

/* Setting position on subchannel A (4-wire or 2-wire position A) */
naibrd_DL_SetPosition(cardIndex, module, channel, DL_SUBCHANNEL_A, value);

/* Setting position on subchannel B (2-wire position B) */
naibrd_DL_SetPosition(cardIndex, module, channel, DL_SUBCHANNEL_B, value);

Parameters:

  • channel — channel number (one-based).

  • subchannel — DL_SUBCHANNEL_A or DL_SUBCHANNEL_B.

  • value — the desired position as a float64_t. Consult your module’s manual for the valid position range.

The measurement display reads back both the commanded position and the wrap (measured) position so you can verify the output:

float64_t outPosition = 0;
float64_t outWrapPosition = 0;
naibrd_DL_GetPosition(cardIndex, module, channel, DL_SUBCHANNEL_A, &outPosition);
naibrd_DL_GetMeasuredValue(cardIndex, module, channel,
   NAI_DL_MEASURED_WRAP_POSITION_SUBCHANNEL_A, &outWrapPosition);

The "Position" column shows the commanded value you set. The "W.Position" (wrap position) column shows the module’s internal measurement of what it is actually outputting. Under normal operation, these two values should match closely. A significant discrepancy may indicate a hardware fault or misconfiguration.

Important

Common Errors

  • Position out of range — if the value exceeds the module’s supported range, behavior is undefined. Consult your module’s manual for valid position limits.

  • Subchannel B ignored in 4-wire mode — setting DL_SUBCHANNEL_B has no effect when the channel is configured for 4-wire mode. Switch to 2-wire mode first if you need two independent position outputs.

  • Wrap position does not match — if the wrap-back position differs significantly from the commanded position, check that the power supply is on and the channel output is enabled.

Channel Configuration

The Set Configuration command provides access to all channel parameters through a single submenu. To configure any of these parameters in your own application, call the appropriate naibrd_DL_*() function as shown below.

Wire Mode

To select between 2-wire and 4-wire LVDT wiring modes, call naibrd_DL_SetWireMode().

naibrd_DL_SetWireMode(cardIndex, module, channel, (nai_dl_wire_mode_type_t)iValue);

Valid values:

  • NAI_DL_4WIRE_MODE (1) — standard 4-wire LVDT connection with separate reference and signal pairs.

  • NAI_DL_2WIRE_MODE (2) — 2-wire connection supporting two independent position subchannels (A and B).

The wire mode determines how the module drives its output pins and how position subchannels are interpreted. Changing the wire mode while the channel is active will reconfigure the output — ensure your receiving system is prepared for the transition.

Output Mode (Ratio vs. Fixed)

To select how the signal (VLL) voltage relates to the reference voltage, call naibrd_DL_SetOutputMode().

naibrd_DL_SetOutputMode(cardIndex, module, channel, (nai_dl_vll_mode_type_t)iValue);

Valid values:

  • NAI_DL_VLL_MODE_RATIO (0) — the signal voltage is computed as a ratio of the reference voltage, scaled by the position value. This is the standard LVDT behavior where the secondary output is proportional to both excitation amplitude and core position.

  • NAI_DL_VLL_MODE_FIXED (1) — the signal voltage is set to a fixed value configured via NAI_DL_CONFIGURATION_VLL_VOLT, independent of the reference amplitude.

The output mode is shown in the "Output" column of the measurement display as either "RATIO" or "FIXED".

Expected Reference Voltage

To set the expected amplitude of the reference excitation, call naibrd_DL_SetConfigurationValue() with NAI_DL_CONFIGURATION_REF_VOLT.

naibrd_DL_SetConfigurationValue(cardIndex, module, channel,
   NAI_DL_CONFIGURATION_REF_VOLT, value);

This sets the voltage amplitude for the reference (primary) excitation signal that the module generates. The value is in volts. The measurement display shows this as "Exp.Ref(V)" and the actual measured reference voltage as "Ref Volt." Consult your module’s manual for the supported voltage range.

Expected Signal (VLL) Voltage

To set the expected signal voltage, call naibrd_DL_SetConfigurationValue() with NAI_DL_CONFIGURATION_VLL_VOLT.

naibrd_DL_SetConfigurationValue(cardIndex, module, channel,
   NAI_DL_CONFIGURATION_VLL_VOLT, value);

In fixed output mode, this directly sets the signal output amplitude. In ratio mode, this value represents the expected full-scale signal voltage. The measurement display shows this as "Exp.Sig(V)" and the actual measured signal as "Sig Volt."

Reference Voltage Threshold

To set the threshold below which the module flags a reference loss condition, call naibrd_DL_SetConfigurationValue() with NAI_DL_CONFIGURATION_THRESHOLD_REF_VOLT.

naibrd_DL_SetConfigurationValue(cardIndex, module, channel,
   NAI_DL_CONFIGURATION_THRESHOLD_REF_VOLT, value);

If the measured reference voltage drops below this threshold, the REF status bit will be set in the status display. This is useful for detecting excitation loss faults.

Signal (VLL) Voltage Thresholds

To set signal voltage thresholds for subchannel A and subchannel B, call naibrd_DL_SetConfigurationValue() with the appropriate parameter:

/* Subchannel A threshold */
naibrd_DL_SetConfigurationValue(cardIndex, module, channel,
   NAI_DL_CONFIGURATION_THRESHOLD_VLL_VOLT, value);

/* Subchannel B threshold (2-wire mode) */
naibrd_DL_SetConfigurationValue(cardIndex, module, channel,
   NAI_DL_CONFIGURATION_THRESHOLD_VLL_VOLT_SUBCHANNEL_B, value);

When the measured signal voltage drops below the configured threshold, the SIG status bit will be set. Subchannel B thresholds are only relevant in 2-wire mode.

Current Thresholds

To set current fault thresholds for subchannel A and subchannel B, call naibrd_DL_SetConfigurationValue() with the appropriate parameter:

/* Subchannel A current threshold */
naibrd_DL_SetConfigurationValue(cardIndex, module, channel,
   NAI_DL_CONFIGURATION_THRESHOLD_CURRENT_SUBCHANNEL_A, value);

/* Subchannel B current threshold (2-wire mode) */
naibrd_DL_SetConfigurationValue(cardIndex, module, channel,
   NAI_DL_CONFIGURATION_THRESHOLD_CURRENT_SUBCHANNEL_B, value);

The current measurement reflects the load current being drawn on the signal output. If the measured current exceeds the threshold, this may indicate an overload condition. The measurement display shows the current value in the "Curr" column.

Phase Offset

To adjust the phase relationship between the reference excitation and the signal output, call naibrd_DL_SetConfigurationValue() with NAI_DL_CONFIGURATION_PHASE_OFFSET.

naibrd_DL_SetConfigurationValue(cardIndex, module, channel,
   NAI_DL_CONFIGURATION_PHASE_OFFSET, value);

In a real LVDT, the secondary signal is nominally in phase with the primary excitation, but wiring length, transformer characteristics, and system loading can introduce a phase shift. The phase offset parameter lets you simulate this shift so that the receiving system sees a realistic signal. The value is in degrees. Consult your module’s manual for the supported range.

Important

Common Errors

  • NAI_ERROR_INVALID_VALUE — the configuration value is outside the valid range for the selected parameter. Consult your module’s manual for supported ranges.

  • NAI_ERROR_NOT_SUPPORTED — the selected configuration parameter is not supported by the installed module variant. Not all DL modules support all configuration options.

  • Threshold has no effect — verify that the power supply is on and the channel is generating output. Thresholds are evaluated against measured values, which are only valid when the channel is active.

  • Wire mode change has no visible effect — if you change from 4-wire to 2-wire mode, you may need to set position values on both subchannels separately. The existing subchannel A position is preserved, but subchannel B defaults to its previous value.

Measurement Display and Status Monitoring

Each iteration of the command loop calls DLBasicMenu_DisplayMeasurements() to read and display all channel measurements. This function demonstrates the full set of read-back API calls you will use to monitor DL channel operation.

Measurement Values (Decimal Mode)

In decimal display mode, the function reads the following values for each channel:

naibrd_DL_GetWireMode(cardIndex, module, channel, &outWireMode);
naibrd_DL_GetConfigurationValue(cardIndex, module, channel,
   NAI_DL_CONFIGURATION_REF_VOLT, &outExpRefVolt);
naibrd_DL_GetConfigurationValue(cardIndex, module, channel,
   NAI_DL_CONFIGURATION_VLL_VOLT, &outExpSigVolt);
naibrd_DL_GetPosition(cardIndex, module, channel, DL_SUBCHANNEL_A, &outPosition);
naibrd_DL_GetMeasuredValue(cardIndex, module, channel,
   NAI_DL_MEASURED_WRAP_POSITION_SUBCHANNEL_A, &outWrapPosition);
naibrd_DL_GetMeasuredValue(cardIndex, module, channel,
   NAI_DL_MEASURED_REF_VOLTAGE, &outRefVolt);
naibrd_DL_GetMeasuredValue(cardIndex, module, channel,
   NAI_DL_MEASURED_VLL_VOLTAGE, &outSigVolt);
naibrd_DL_GetMeasuredValue(cardIndex, module, channel,
   NAI_DL_MEASURED_REF_FREQUENCY, &outFreq);
naibrd_DL_GetMeasuredValue(cardIndex, module, channel,
   NAI_DL_MEASURED_SIGNAL_CURRENT, &outCurr);
naibrd_DL_GetOutputMode(cardIndex, module, channel, &outOutputState);
naibrd_DL_GetPowerSupplyState(cardIndex, module, channel, &outPowerSupplyState);

The display columns and their meanings:

Column Description

Chan

Channel number.

Mode

Wire mode: "2-WI" for 2-wire, "4-WI" for 4-wire.

Exp.Ref(V)

Configured expected reference excitation voltage.

Exp.Sig(V)

Configured expected signal (VLL) voltage.

Position

Commanded position value (subchannel A).

W.Position

Wrap-back (measured) position — the module’s verification of its actual output.

Ref Volt.

Measured reference voltage amplitude.

Sig Volt.

Measured signal (VLL) voltage amplitude.

Freq

Measured reference excitation frequency in Hz.

Curr

Measured signal output current in mA.

Output

Output mode: "RATIO" or "FIXED".

Power

Power supply state: "ON" or "OFF".

Raw Register Values (Hex Mode)

When you switch the display to hexadecimal mode (command 5), the function reads raw register values instead of floating-point measurements using naibrd_DL_GetRawValueByChannel():

naibrd_DL_GetRawValueByChannel(cardIndex, module, channel,
   NAI_DL_RAW_REF_VOLT, &outExpRefVolt);
naibrd_DL_GetRawValueByChannel(cardIndex, module, channel,
   NAI_DL_RAW_VLL_VOLT, &outExpVllVolt);
naibrd_DL_GetRawValueByChannel(cardIndex, module, channel,
   NAI_DL_RAW_POSITION_SUBCHANNEL_A, &outPosition);
naibrd_DL_GetRawValueByChannel(cardIndex, module, channel,
   NAI_DL_RAW_WRAP_POSITION_SUBCHANNEL_A, &outWrapPosition);
naibrd_DL_GetRawValueByChannel(cardIndex, module, channel,
   NAI_DL_RAW_WRAP_REF_VOLT, &outWrapRefVolt);
naibrd_DL_GetRawValueByChannel(cardIndex, module, channel,
   NAI_DL_RAW_WRAP_VLL_VOLT, &outWrapVllVolt);
naibrd_DL_GetRawValueByChannel(cardIndex, module, channel,
   NAI_DL_RAW_WRAP_REF_FREQ, &outFreq);
naibrd_DL_GetRawValueByChannel(cardIndex, module, channel,
   NAI_DL_RAW_WRAP_CURRENT_SUBCHANNEL_A, &outCurr);

Hex mode is useful for low-level debugging and register-level verification. The raw values are the actual register contents before floating-point conversion.

Status Bits

After the measurement table, the display reads four status flags per channel:

naibrd_DL_GetStatus(cardIndex, module, channel, NAI_DL_STATUS_BIT, &bitStatus);
naibrd_DL_GetStatus(cardIndex, module, channel, NAI_DL_STATUS_SIGNAL_LOSS, &signalLoss);
naibrd_DL_GetStatus(cardIndex, module, channel, NAI_DL_STATUS_REF_LOSS, &refStatus);
naibrd_DL_GetStatus(cardIndex, module, channel, NAI_DL_STATUS_PLL, &pllStatus);
Status Meaning

BIT

Built-In Test result. Non-zero indicates the channel has detected an internal fault condition.

SIG

Signal loss. Non-zero indicates the measured signal (VLL) voltage is below the configured threshold.

REF

Reference loss. Non-zero indicates the measured reference voltage is below the configured threshold.

PLL

Phase-Locked Loop status. Non-zero indicates the PLL has lost lock on the reference frequency.

A healthy, active channel should show all zeros in the status display. If any status bit is set, check the corresponding threshold configuration and verify that the power supply is on.

Important

Common Errors

  • All measurements read zero — the channel power supply is off. Enable it with naibrd_DL_SetPowerSupplyState().

  • Status bits set immediately after power-on — this is normal. The module may need a brief settling period after power-on before measurements stabilize. Check status again after a short delay.

  • REF loss flagged with valid configuration — verify the reference voltage threshold is set appropriately. If the threshold is higher than the configured reference voltage, the status will always indicate a loss.

  • PLL not locked — the module’s internal oscillator may need time to lock after power-on or after a frequency change. If PLL remains unlocked, check the module hardware.

Display Mode Toggle

The Set Display Mode command (command 5) switches between decimal and hexadecimal display of measurement values. This does not change any hardware configuration — it only affects how the sample application formats the readback data on screen.

if (atoi((char*)inputBuffer) == 0)
{
   displayHex = FALSE;  /* Decimal display */
}
else
{
   displayHex = TRUE;   /* Hexadecimal display */
}

In your own application, you choose between the floating-point API (naibrd_DL_GetConfigurationValue(), naibrd_DL_GetMeasuredValue(), naibrd_DL_GetPosition()) and the raw register API (naibrd_DL_GetRawValueByChannel()) depending on whether you need engineering units or raw register data.

Troubleshooting Reference

This section consolidates the error conditions covered in the preceding sections. Consult your module’s manual for hardware-specific diagnostics beyond what is listed here.

Error / Symptom Possible Causes Suggested Resolution

No board found

Board not powered, not connected, or configuration file has wrong interface/address.

Verify physical connection and power. Check or recreate the configuration file.

Connection timeout

Network misconfiguration, firewall blocking traffic, IP mismatch, or incorrect bus settings.

Confirm Ethernet settings or PCI/PCIe bus configuration. Disable firewalls for testing.

Invalid card or module index

Card index is not zero-based or module index is not one-based.

Use zero-based card indices and one-based module indices.

Module not present at selected slot

The selected slot does not contain a DL module.

Use the board menu to verify which slots are populated.

No output from channel

Power supply not enabled, or channel output not enabled (Gen 2/3).

Call naibrd_DL_SetPowerSupplyState() with DL_ON. On Gen 2/3, also enable the output with NAI_DL_CONFIGURATION_OUTPUT_MODE.

All measurements read zero

Power supply is off for the channel.

Enable the channel power supply.

Wrap position does not match commanded position

Channel not powered, output not enabled, or hardware fault.

Verify power supply and output enable. If the mismatch persists, check hardware connections.

REF status bit set

Reference voltage below the configured threshold, or threshold set too high.

Check the reference voltage configuration and threshold setting. Ensure the threshold is below the expected reference voltage.

SIG status bit set

Signal (VLL) voltage below the configured threshold.

Verify the VLL voltage configuration, output mode, and threshold settings.

PLL status bit set

Phase-Locked Loop not locked after power-on or frequency change.

Allow settling time after power-on. If PLL remains unlocked, check module hardware.

NAI_ERROR_NOT_SUPPORTED

Feature not available on the installed module variant (e.g., channel output enable on Gen 1, or unsupported configuration parameter).

Check module variant and consult the module manual for supported features.

NAI_ERROR_INVALID_VALUE

Configuration value outside the valid range.

Consult the module manual for supported parameter ranges.

Subchannel B position has no effect

Channel is in 4-wire mode, which only uses subchannel A.

Switch to 2-wire mode to use independent A and B position outputs.

Full Source

Full Source — DL_BasicOpsMenu.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_dl.h"

#if !defined (TRUE)
#define TRUE   1
#endif
#if !defined (FALSE)
#define FALSE   0
#endif

static const int8_t *SAMPLE_PGM_NAME = (int8_t*) "DL Module Basic Operation Program";
static const int8_t *CONFIG_FILE = (int8_t*) "default_DL_BasicOps.txt";
static bool_t displayHex = FALSE;

static bool_t DLBasicMenu_Run(int32_t cardIndex, int32_t module, uint32_t modid);
static void DLBasicMenu_DisplayMeasurements(int32_t cardIndex, int32_t module, int32_t modid);
static bool_t DLBasicMenu_SetPowerState(int32_t cardIndex, int32_t module, int32_t channel);
static nai_status_t DLBasicMenu_SetChannelOutput(int32_t paramCount, int32_t* p_params);
static nai_status_t DL_BasicMenu_SetPosition(int32_t paramCount, int32_t* p_params);
static nai_status_t DL_BasicMenu_SetConfiguration(int32_t paramCount, int32_t* p_params);

enum dl_basicOpsMenu_commands
{
   DL_BASICMENU_CMD_SET_POWER_STATE,
   DL_BASICMENU_CMD_SET_CHANNEL_OUTPUT,
   DL_BASICMENU_CMD_SET_POSITION,
   DL_BASICMENU_CMD_SET_CONFIGURATION,
   DL_BASICMENU_CMD_SET_DISPLAY_HEX,
   DL_BASICMENU_CMD_COUNT
};

naiapp_cmdtbl_params_t DL_BasicOpsMenuCmds[] =
{
   {"1",   "Set Power State",                     DL_BASICMENU_CMD_SET_POWER_STATE,      NULL                         },
   {"2",   "Set Channel Output (Gen 2/3 only)",   DL_BASICMENU_CMD_SET_CHANNEL_OUTPUT,   DLBasicMenu_SetChannelOutput },
   {"3",   "Set Position",                        DL_BASICMENU_CMD_SET_POSITION,         DL_BasicMenu_SetPosition     },
   {"4",   "Set Configuration",                   DL_BASICMENU_CMD_SET_CONFIGURATION,    DL_BasicMenu_SetConfiguration},
   {"5",   "Set Display Mode",                    DL_BASICMENU_CMD_SET_DISPLAY_HEX,      NULL                         }
};

#if defined (__VXWORKS__)
int32_t DL_BasicOpsMenu(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))
               {
                  DLBasicMenu_Run(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;
}

static bool_t DLBasicMenu_Run(int32_t cardIndex, int32_t module, uint32_t modid)
{
   bool_t bQuit = FALSE;
   bool_t bCmdFound = FALSE;
   int32_t MAX_CHANNELS = naibrd_DL_GetChannelCount(modid);
   int32_t cmd;
   int8_t inputBuffer[80];
   int32_t inputResponseCnt;
   naiapp_AppParameters_t  dl_params;
   p_naiapp_AppParameters_t dl_basicops_params = &dl_params;
   dl_basicops_params->cardIndex = cardIndex;
   dl_basicops_params->module = module;
   dl_basicops_params->modId = modid;

   naiapp_utils_LoadParamMenuCommands(DL_BASICMENU_CMD_COUNT, DL_BasicOpsMenuCmds);

   printf("\n\n\n\n");
   do
   {
      DLBasicMenu_DisplayMeasurements(cardIndex, module, modid);
      naiapp_display_ParamMenuCommands((int8_t*)SAMPLE_PGM_NAME);
      printf("\n Type command or %c to quit : ", NAI_QUIT_CHAR);
      bQuit = naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
      if (!bQuit && inputResponseCnt > 0)
      {
         bCmdFound = naiapp_utils_GetParamMenuCmdNum(inputResponseCnt, inputBuffer, &cmd);
         if (bCmdFound)
         {
            switch (cmd)
            {
               case DL_BASICMENU_CMD_SET_POWER_STATE:
                  naiapp_query_ChannelNumber(MAX_CHANNELS, 1, &dl_basicops_params->channel);
                  bQuit = DLBasicMenu_SetPowerState(cardIndex, module, dl_basicops_params->channel);
                  break;
               case DL_BASICMENU_CMD_SET_CHANNEL_OUTPUT:
               case DL_BASICMENU_CMD_SET_POSITION:
               case DL_BASICMENU_CMD_SET_CONFIGURATION:
                  naiapp_query_ChannelNumber(MAX_CHANNELS, 1, &dl_basicops_params->channel);
                  DL_BasicOpsMenuCmds[cmd].func(APP_PARAM_COUNT, (int32_t*)dl_basicops_params);
                  break;
               case DL_BASICMENU_CMD_SET_DISPLAY_HEX:
                  printf("\n 0 for DECIMAL, 1 for HEX: ");
                  bQuit = naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
                  if (atoi((char*)inputBuffer) == 0)
                  {
                     displayHex = FALSE;
                  }
                  else
                  {
                     displayHex = TRUE;
                  }
                  break;
            }
         }
      }
   } while (!bQuit);

   return bQuit;
}

static void DLBasicMenu_DisplayMeasurements(int32_t cardIndex, int32_t module, int32_t modid)
{
   int32_t channel = 0, MAX_CHANNEL = naibrd_DL_GetChannelCount(modid);

   printf("\n============================");
   printf("\n====Display Measurements====");
   printf("\n============================\n\n");

   if (displayHex == FALSE)
   {
      printf("%7s%8s%14s%14s%12s%14s%13s%13s%8s%8s%10s%9s\n", "Chan", "Mode", "Exp.Ref(V)", "Exp.Sig(V)", "Position", "W.Position", "Ref Volt.", "Sig Volt.", "Freq", "Curr", "Output", "Power");
      for (channel = 1; channel <= MAX_CHANNEL; channel++)
      {
         nai_dl_wire_mode_type_t outWireMode = 0;
         float64_t outExpRefVolt = 0;
         float64_t outExpSigVolt = 0;
         float64_t outPosition = 0;
         float64_t outWrapPosition = 0;
         float64_t outRefVolt = 0;
         float64_t outSigVolt = 0;
         float64_t outFreq = 0;
         float64_t outCurr = 0;
         nai_dl_vll_mode_type_t outOutputState = 0;
         nai_dl_on_off_t outPowerSupplyState = 0;

         naibrd_DL_GetWireMode(cardIndex, module, channel, &outWireMode);
         naibrd_DL_GetConfigurationValue(cardIndex, module, channel, NAI_DL_CONFIGURATION_REF_VOLT, &outExpRefVolt);
         naibrd_DL_GetConfigurationValue(cardIndex, module, channel, NAI_DL_CONFIGURATION_VLL_VOLT, &outExpSigVolt);
         naibrd_DL_GetPosition(cardIndex, module, channel, DL_SUBCHANNEL_A, &outPosition);
         naibrd_DL_GetMeasuredValue(cardIndex, module, channel, NAI_DL_MEASURED_WRAP_POSITION_SUBCHANNEL_A, &outWrapPosition);
         naibrd_DL_GetMeasuredValue(cardIndex, module, channel, NAI_DL_MEASURED_REF_VOLTAGE, &outRefVolt);
         naibrd_DL_GetMeasuredValue(cardIndex, module, channel, NAI_DL_MEASURED_VLL_VOLTAGE, &outSigVolt);
         naibrd_DL_GetMeasuredValue(cardIndex, module, channel, NAI_DL_MEASURED_REF_FREQUENCY, &outFreq);
         naibrd_DL_GetMeasuredValue(cardIndex, module, channel, NAI_DL_MEASURED_SIGNAL_CURRENT, &outCurr);
         naibrd_DL_GetOutputMode(cardIndex, module, channel, &outOutputState);
         naibrd_DL_GetPowerSupplyState(cardIndex, module, channel, &outPowerSupplyState);

         printf("%4d     ", channel);
         switch (outWireMode)
         {
            case NAI_DL_2WIRE_MODE:
               printf("%5s", "2-WI");
               break;
            case NAI_DL_4WIRE_MODE:
               printf("%5s", "4-WI");
               break;
            default:
               printf("%5s", "N/A");
               break;
         }
         printf("     %7.3f   %11.3f    %10.3f   %10.3f   %10.3f   %10.3f%9.0f    %5.0f   ", outExpRefVolt, outExpSigVolt, outPosition, outWrapPosition, outRefVolt, outSigVolt, outFreq, outCurr);
         switch (outOutputState)
         {
         case NAI_DL_VLL_MODE_RATIO:
            printf("%6s   ", "RATIO");
            break;
         case NAI_DL_VLL_MODE_FIXED:
            printf("%6s   ", "FIXED");
            break;
         }
         switch (outPowerSupplyState)
         {
            case DL_OFF:
               printf("%5s", "OFF");
               break;
            case DL_ON:
               printf("%5s", "ON");
               break;
         }

         printf("\n");
      }
   }
   else
   {
      printf("%7s%8s%14s%14s%12s%16s%13s%14s%9s%11s%11s%7s\n", "Chan", "Mode", "Exp.Ref(V)", "Exp.Sig(V)", "Position", "W.Position", "Ref Volt.", "Sig Volt.", "Freq", "Curr", "Output", "Power");
      for (channel = 1; channel <= MAX_CHANNEL; channel++)
      {

         nai_dl_wire_mode_type_t outWireMode = 0;
         uint32_t outExpRefVolt = 0;
         uint32_t outExpVllVolt = 0;
         uint32_t outPosition = 0;
         uint32_t outWrapPosition = 0;
         uint32_t outWrapRefVolt = 0;
         uint32_t outWrapVllVolt = 0;
         uint32_t outFreq = 0;
         uint32_t outCurr = 0u;
         nai_dl_vll_mode_type_t outOutputState = 0;
         nai_dl_on_off_t outPowerSupplyState = 0;

         naibrd_DL_GetWireMode(cardIndex, module, channel, &outWireMode);
         naibrd_DL_GetRawValueByChannel(cardIndex, module, channel, NAI_DL_RAW_WRAP_REF_VOLT, &outWrapRefVolt);
         naibrd_DL_GetRawValueByChannel(cardIndex, module, channel, NAI_DL_RAW_WRAP_VLL_VOLT, &outWrapVllVolt);
         naibrd_DL_GetRawValueByChannel(cardIndex, module, channel, NAI_DL_RAW_POSITION_SUBCHANNEL_A, &outPosition);
         naibrd_DL_GetRawValueByChannel(cardIndex, module, channel, NAI_DL_RAW_WRAP_POSITION_SUBCHANNEL_A, &outWrapPosition);
         naibrd_DL_GetRawValueByChannel(cardIndex, module, channel, NAI_DL_RAW_REF_VOLT, &outExpRefVolt);
         naibrd_DL_GetRawValueByChannel(cardIndex, module, channel, NAI_DL_RAW_VLL_VOLT, &outExpVllVolt);
         naibrd_DL_GetRawValueByChannel(cardIndex, module, channel, NAI_DL_RAW_WRAP_REF_FREQ, &outFreq);
         naibrd_DL_GetRawValueByChannel(cardIndex, module, channel, NAI_DL_RAW_WRAP_CURRENT_SUBCHANNEL_A, &outCurr);
         naibrd_DL_GetOutputMode(cardIndex, module, channel, &outOutputState);
         naibrd_DL_GetPowerSupplyState(cardIndex, module, channel, &outPowerSupplyState);

         printf("%4d     ", channel);
         switch (outWireMode)
         {
         case NAI_DL_2WIRE_MODE:
            printf("%5s", "2-WI");
            break;
         case NAI_DL_4WIRE_MODE:
            printf("%5s", "4-WI");
            break;
         default:
            printf("%5s", "N/A");
            break;
         }
         printf("     0x%08X    0x%08X   0x%08X     0x%08X   0x%08X    0x%08X  0x%08X 0x%08X ", outExpRefVolt, outExpVllVolt, outPosition, outWrapPosition, outWrapRefVolt, outWrapVllVolt, outFreq, outCurr);
         switch (outOutputState)
         {
         case NAI_DL_VLL_MODE_RATIO:
            printf("%6s ", "RATIO");
            break;
         case NAI_DL_VLL_MODE_FIXED:
            printf("%6s ", "FIXED");
            break;
         }
         switch (outPowerSupplyState)
         {
         case DL_OFF:
            printf("%5s", "OFF");
            break;
         case DL_ON:
            printf("%5s", "ON");
            break;
         }

         printf("\n");

      }
   }

   printf("\n%7s%4s%4s%4s%4s\n", "Chan", "BIT", "SIG", "REF", "PLL");
   for (channel = 1; channel <= MAX_CHANNEL; channel++)
   {

      nai_dl_module_status_t bitStatus = 0;
      nai_dl_module_status_t signalLoss = 0;
      nai_dl_module_status_t refStatus = 0;
      nai_dl_module_status_t pllStatus = 0;

      naibrd_DL_GetStatus(cardIndex, module, channel, NAI_DL_STATUS_BIT, &bitStatus);
      naibrd_DL_GetStatus(cardIndex, module, channel, NAI_DL_STATUS_SIGNAL_LOSS, &signalLoss);
      naibrd_DL_GetStatus(cardIndex, module, channel, NAI_DL_STATUS_REF_LOSS, &refStatus);
      naibrd_DL_GetStatus(cardIndex, module, channel, NAI_DL_STATUS_PLL, &pllStatus);

      printf("%4d%5d%4d%4d%4d\n", channel, bitStatus, signalLoss, refStatus, pllStatus);

   }
}
static bool_t DLBasicMenu_SetPowerState(int32_t cardIndex, int32_t module, int32_t channel)
{
   bool_t bQuit = FALSE;
   int8_t inputBuffer[80];
   int32_t inputResponseCnt;

   printf("\n 0 for OFF, 1 for ON: ");
   bQuit = naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
   naibrd_DL_SetPowerSupplyState(cardIndex, module, channel, (nai_dl_on_off_t)atoi((char*)inputBuffer));

   return bQuit;
}
static nai_status_t DLBasicMenu_SetChannelOutput(int32_t paramCount, int32_t* p_params)
{
   bool_t bQuit = FALSE;
   p_naiapp_AppParameters_t p_dl_params = (p_naiapp_AppParameters_t)p_params;
   int32_t cardIndex = p_dl_params->cardIndex;
   int32_t module = p_dl_params->module;
   int32_t channel = p_dl_params->channel;
   int8_t inputBuffer[80];
   int32_t inputResponseCnt;

   printf("\n 0 for OFF, 1 for ON: ");
   bQuit = naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
   naibrd_DL_SetConfigurationValue(cardIndex, module, channel, NAI_DL_CONFIGURATION_OUTPUT_MODE, (nai_dl_enabled_disabled_t)atoi((char*)inputBuffer));

   return (bQuit) ? NAI_ERROR_UNKNOWN : NAI_SUCCESS;
}
static nai_status_t DL_BasicMenu_SetPosition(int32_t paramCount, int32_t* p_params)
{
   p_naiapp_AppParameters_t p_dl_params = (p_naiapp_AppParameters_t)p_params;
   int32_t cardIndex = p_dl_params->cardIndex;
   int32_t module = p_dl_params->module;
   int32_t channel = p_dl_params->channel;
   bool_t bQuit = FALSE;
   int32_t positionType = 0;
   float64_t value = 0.0;
   int8_t inputBuffer[80];
   int32_t inputResponseCnt;

   printf("\n Select Position to set (0 for 4-Wire Position, 1 for 2-Wire Position A, 2 for 2-Wire Position B): ");
   bQuit = naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
   if (bQuit == FALSE)
   {
      positionType = atoi((char*)inputBuffer);

      switch (positionType)
      {
         case 0:
         case 1:
            printf("\n Enter Position Value to set: ");
            bQuit = naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
            value = atof((char*)inputBuffer);
            naibrd_DL_SetPosition(cardIndex, module, channel, DL_SUBCHANNEL_A, value);
         break;
         case 2:
            printf("\n Enter Position Value to set: ");
            bQuit = naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
            value = atof((char*)inputBuffer);
            naibrd_DL_SetPosition(cardIndex, module, channel, DL_SUBCHANNEL_B, value);
         break;
         default:
            printf("\n Invalid selection entered!\n");
            bQuit = TRUE;
         break;
      }
   }

   return (bQuit) ? NAI_ERROR_UNKNOWN : NAI_SUCCESS;
}
static nai_status_t DL_BasicMenu_SetConfiguration(int32_t paramCount, int32_t* p_params)
{
   p_naiapp_AppParameters_t p_dl_params = (p_naiapp_AppParameters_t)p_params;
   int32_t cardIndex = p_dl_params->cardIndex;
   int32_t module = p_dl_params->module;
   int32_t channel = p_dl_params->channel;
   bool_t bQuit = FALSE;
   int32_t configurationType = 0;
   float64_t value = 0;
   int32_t iValue = 0;
   int8_t inputBuffer[80];
   int32_t inputResponseCnt;

   printf("\n Select Configuration (0 Wire Mode, 1 Output Mode, 2 Exp Ref, 3 Exp VLL, 4 Ref Thresh, 5 VLL Thresh A, 6 VLL Thresh B, 7 Current Thresh A, 8 Current Thresh B, 9 Phase): ");
   bQuit = naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
   if (bQuit == FALSE)
   {
      configurationType = atoi((char*)inputBuffer);

      switch (configurationType)
      {
         case 0:
            printf("\n Enter Wire Mode (1 for 4-Wire Mode, 2 for 2-Wire Mode): ");
            bQuit = naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
            if (bQuit == FALSE)
            {
               iValue = atoi((char*)inputBuffer);
               naibrd_DL_SetWireMode(cardIndex, module, channel, (nai_dl_wire_mode_type_t)iValue);
            }
         break;
         case 1:
            printf("\n Enter Output Mode (0 for Ratio Mode, 1 for Fixed Mode): ");
            bQuit = naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
            if (bQuit == FALSE)
            {
               iValue = atoi((char*)inputBuffer);
               naibrd_DL_SetOutputMode(cardIndex, module, channel, (nai_dl_vll_mode_type_t)iValue);
            }
         break;
         case 2:
            printf("\n Enter Value: ");
            bQuit = naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
            if (bQuit == FALSE)
            {
               value = atof((char*)inputBuffer);
               naibrd_DL_SetConfigurationValue(cardIndex, module, channel, NAI_DL_CONFIGURATION_REF_VOLT, value);
            }
         break;
         case 3:
            printf("\n Enter Value: ");
            bQuit = naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
            if (bQuit == FALSE)
            {
               value = atof((char*)inputBuffer);
               naibrd_DL_SetConfigurationValue(cardIndex, module, channel, NAI_DL_CONFIGURATION_VLL_VOLT, value);
            }
         break;
         case 4:
            printf("\n Enter Value: ");
            bQuit = naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
            if (bQuit == FALSE)
            {
               value = atof((char*)inputBuffer);
               naibrd_DL_SetConfigurationValue(cardIndex, module, channel, NAI_DL_CONFIGURATION_THRESHOLD_REF_VOLT, value);
            }
         break;
         case 5:
            printf("\n Enter Value: ");
            bQuit = naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
            if (bQuit == FALSE)
            {
               value = atof((char*)inputBuffer);
               naibrd_DL_SetConfigurationValue(cardIndex, module, channel, NAI_DL_CONFIGURATION_THRESHOLD_VLL_VOLT, value);
            }
         break;
         case 6:
            printf("\n Enter Value: ");
            bQuit = naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
            if (bQuit == FALSE)
            {
               value = atof((char*)inputBuffer);
               naibrd_DL_SetConfigurationValue(cardIndex, module, channel, NAI_DL_CONFIGURATION_THRESHOLD_VLL_VOLT_SUBCHANNEL_B, value);
            }
         break;
         case 7:
            printf("\n Enter Value: ");
            bQuit = naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
            if (bQuit == FALSE)
            {
               value = atof((char*)inputBuffer);
               naibrd_DL_SetConfigurationValue(cardIndex, module, channel, NAI_DL_CONFIGURATION_THRESHOLD_CURRENT_SUBCHANNEL_A, value);
            }
         break;
         case 8:
            printf("\n Enter Value: ");
            bQuit = naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
            if (bQuit == FALSE)
            {
               value = atof((char*)inputBuffer);
               naibrd_DL_SetConfigurationValue(cardIndex, module, channel, NAI_DL_CONFIGURATION_THRESHOLD_CURRENT_SUBCHANNEL_B, value);
            }
         break;
         case 9:
            printf("\n Enter Value: ");
            bQuit = naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
            if (bQuit == FALSE)
            {
               value = atof((char*)inputBuffer);
               naibrd_DL_SetConfigurationValue(cardIndex, module, channel, NAI_DL_CONFIGURATION_PHASE_OFFSET, value);
            }
         break;
         default:
            printf("\n Invalid Selection Entered!\n");
            bQuit = TRUE;
         break;
      }
   }

   return (bQuit) ? NAI_ERROR_UNKNOWN : NAI_SUCCESS;
}

Help Bot

X