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

nai rtd cfg

nai rtd cfg

Explanation

About the Sample Application Code

This sample application code in C is provided by North Atlantic Industries for use with their Software Support Kit (SSK) to interact with their embedded function modules. Below is a detailed explanation of the code, covering its purpose, structure, and relevant definitions.

Purpose

The primary objective of this code is to initialize the configurations for an RTD (Resistance Temperature Detector) module on a specific card. It sets various parameters such as card index, module index, module ID, channel, and channel range (minimum and maximum channels).

Header Includes

The code begins with a series of #include directives, which incorporate various header files necessary for the application. Each included header file serves a specific purpose:

  • C Standard Library Headers: c #include <stdio.h> #include <ctype.h> #include <stdlib.h> #include <string.h> These headers provide standard input-output functions, character handling functions, general utilities, and string manipulation functions, respectively.

  • Common Sample Program include files: c #include "include/naiapp_interrupt.h" #include "include/naiapp_interrupt_ether.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" These headers are likely part of the NAI SSK and provide functionalities related to interrupts, querying board status, accessing and displaying board information, and utility functions.

  • Common RTD Sample Program include files: c #include "nai_rtd_cfg.h" #include "nai_rtd_int.h" These headers are specific to RTD functionalities. They include configurations and internal details essential for RTD operations.

  • naibrd include files: c #include "nai.h" #include "naibrd.h" #include "nai_ether.h" #include "functions/naibrd_rtd.h" These headers seem to be part of the core API provided by NAI, dealing with board-level interactions and Ethernet communications.

Function Definition

Function: initializeRTDConfigurations

void initializeRTDConfigurations(
   int32_t cardIndex, int32_t module,
   int32_t modid, int32_t channel,
   int32_t maxChannel, int32_t minChannel)
{
   inputRTDConfig.cardIndex = cardIndex;
   inputRTDConfig.module = module;
   inputRTDConfig.modid = modid;
   inputRTDConfig.channel = channel;
   inputRTDConfig.maxChannel = maxChannel;
   inputRTDConfig.minChannel = minChannel;
}

This function initializes the RTD configuration with the provided parameters. It sets the following fields in a global or externally defined structure inputRTDConfig:

  • cardIndex: The index of the card being configured.

  • module: The index of the module on the card.

  • modid: The unique identifier for the module.

  • channel: The current channel to be configured.

  • maxChannel: The maximum channel number available on the module.

  • minChannel: The minimum channel number available on the module.

Definitions, Types, and Inferences

  • int32_t: A data type defined in <stdint.h>, representing a 32-bit signed integer.

  • inputRTDConfig: This is likely a structure defined elsewhere in the included headers, representing the RTD configuration. It contains fields corresponding to RTD parameters.

In summary, this sample application code initializes RTD module settings on an NAI card via a dedicated function initializeRTDConfigurations. The included headers facilitate interaction with the RTD module and other board functionalities provided by NAI’s libraries.

#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>

/* Common Sample Program include files */
#include "include/naiapp_interrupt.h"
#include "include/naiapp_interrupt_ether.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"

/* Common RTD Sample Program include files */
#include "nai_rtd_cfg.h"
#include "nai_rtd_int.h"
/* naibrd include files */
#include "nai.h"
#include "naibrd.h"
#include "nai_ether.h"
#include "functions/naibrd_rtd.h"

/**************************************************************************************************************/
/**
<summary>

</summary>
*/
/**************************************************************************************************************/
void initializeRTDConfigurations(int32_t cardIndex, int32_t module, int32_t modid, int32_t channel, int32_t maxChannel, int32_t minChannel)
{
   inputRTDConfig.cardIndex = cardIndex;
   inputRTDConfig.module = module;
   inputRTDConfig.modid = modid;
   inputRTDConfig.channel = channel;
   inputRTDConfig.maxChannel = maxChannel;
   inputRTDConfig.minChannel = minChannel;
}

Help Bot

X