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

SUM1553 BC RTtoRT

SUM1553 BC RT-to-RT Sample Application (SSK 1.x)

Overview

The SUM1553 BC RT-to-RT sample application demonstrates how to configure a SUMMIT 1553 channel as a Bus Controller (BC) and issue RT-to-RT transfer commands using the NAI Software Support Kit (SSK 1.x). An RT-to-RT transfer is a single bus transaction where the BC commands one Remote Terminal to transmit data directly to another Remote Terminal. The BC issues two command words on the bus — a receive command to the destination RT and a transmit command to the source RT — and the data flows between the two RTs without passing through the BC.

The sample defines two selectable RT-to-RT message configurations:

  1. Option 1 — Receive command to RT address 1, subaddress 2; Transmit command from RT address 2, subaddress 2.

  2. Option 2 — Receive command to RT address 2, subaddress 2; Transmit command from RT address 1, subaddress 2.

Each message transfers 32 words. The user selects which direction to send, and the BC executes a single RT-to-RT transfer each time. Unlike the BC Scheduler sample (which runs a continuous loop), this sample executes one message per user action and then stops.

Important

This sample uses the naibrd_SUM1553_* API for SUMMIT 1553 modules (N7, N8, NA, NB, NC). If you are using FTx modules (FT0—​FTF, FTJ, FTK), see the M1553 BC sample guides which use the naibrd_1553_* API. The two APIs target different hardware cores and are not interchangeable.

Supported Modules

This sample supports SUMMIT 1553 module types: N7, N8, NA, NB, and NC. The helper function IsSUMMIT1553(modid) is used at runtime to confirm that the selected module slot contains a supported SUMMIT 1553 device. Each SUMMIT 1553 module provides up to 2 channels.

Note
The SUM1553 BC RT-to-RT sample can run in conjunction with the SUM1553_RT_PingPong or SUM1553_RT_ProcCtrl companion samples. To exercise an RT-to-RT transfer, you need two RT applications running on separate channels (or separate modules), each configured with the corresponding RT addresses.

Prerequisites

Before running this sample, make sure you have:

  • An NAI board with a SUMMIT 1553 module installed (N7, N8, NA, NB, or NC).

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

  • Two RTs available on the bus at the target addresses (RT 1 and RT 2 by default). You can use two instances of the SUM1553_RT_PingPong or SUM1553_RT_ProcCtrl sample on separate channels.

How to Run

Launch the SUM1553_BC_RTtoRT executable from your build output directory. On startup the application looks for a configuration file (default_SUM1553_BCRTtoRT.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, you select a BC channel and then choose which RT-to-RT transfer direction to send.

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 SUMMIT 1553.

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_SUM1553_BCRTtoRT.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() and pass it to Run_SUM1553_BC_RTtoRT() for channel configuration.

#if defined (__VXWORKS__)
int32_t SUM1553_BC_RTtoRT(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_SUM1553_BC_RTtoRT(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 SUMMIT 1553 module. Use the board menu to verify which slots are populated.

Program Structure

Entry Point

The program entry point is main() on most platforms and SUM1553_BC_RTtoRT() on VxWorks. Both follow the same logic: run the board menu, then loop over card/module selection until the user quits.

Module Detection

After the user selects a module slot, naibrd_GetModuleID() returns the module identifier. The helper IsSUMMIT1553(modid) (called inside Get1553BCCfg()) validates that the module is a supported SUMMIT 1553 type. SUMMIT 1553 modules provide up to 2 channels, so the BC channel number is constrained accordingly.

User Input Flow

The application walks the user through three selection steps before executing a transfer:

  1. Card index — naiapp_query_CardIndex() prompts for the board to use.

  2. Module slot — naiapp_query_ModuleNumber() prompts for the slot containing the SUMMIT 1553 module.

  3. BC channel — Get1553BCCfg() prompts for the channel to configure as the Bus Controller (default channel 1).

Once the channel is selected, Run_SUM1553_BC_RTtoRT() takes over. It resets the channel, configures it as a BC, and enters an interactive loop where the user selects an RT-to-RT transfer direction to execute.

Interactive Loop

After initialization, the application presents a menu with two RT-to-RT transfer options. Each time the user selects an option:

  • The application builds and loads a two-block command sequence (one RT-to-RT message command plus an End-of-List command).

  • The BC executes the single message and stops.

  • The user can select another transfer direction or press 'Q' to quit.

RT-to-RT Transfer Architecture

An RT-to-RT transfer is a MIL-STD-1553B bus transaction where data moves directly between two Remote Terminals under BC control. The BC places two command words on the bus in a single transaction:

  1. A receive command addressed to the destination RT (the RT that will receive the data).

  2. A transmit command addressed to the source RT (the RT that will send the data).

The source RT responds with its status word followed by the data words. The destination RT then responds with its status word acknowledging receipt. The BC itself does not handle the data payload — it only orchestrates the transfer.

How RT-to-RT Differs from BC-to-RT

In a standard BC-to-RT message, the BC supplies the data from its own data block. In an RT-to-RT transfer, the data comes from the transmitting RT. The BC still loads a data block (Block C in this sample), but the SUMMIT 1553 core uses it as a scratch buffer during the transaction — the actual payload originates from the transmitting RT’s subaddress buffer.

Command Word Construction for RT-to-RT

An RT-to-RT command block requires both cmd1 and cmd2 fields to be populated. The control word must have the rtrt flag set to 1 to indicate this is an RT-to-RT transfer:

  • cmd1 — the receive command word. The tx bit is 0, meaning this RT will receive data.

  • cmd2 — the transmit command word. The tx bit is 1, meaning this RT will transmit data.

Device Initialization

Before building the command sequence, the application resets the SUMMIT 1553 channel and places it into Bus Controller mode. This is handled at the start of Run_SUM1553_BC_RTtoRT().

/* Reset the channel */
check_status(naibrd_SUM1553_Reset(cardIndex,module,bcchan));

/* Wait for channels to reset */
while(check_status(naibrd_SUM1553_IsResetting(cardIndex,module,bcchan,&resetting)) == NAI_SUCCESS && resetting);

/* Setup the BC */
check_status(naibrd_SUM1553_SetMode(cardIndex,module,bcchan,NAI_SUM1553_OPSTATUS_BC_MODE)); /* Configure as BC */

/* Start with the first command */
check_status(naibrd_SUM1553_BC_SetCmdBlockPtr(cardIndex,module,bcchan,FIRST_CMD));

The reset-and-poll sequence ensures the hardware is in a known state. After the reset completes, naibrd_SUM1553_SetMode() configures the channel as a Bus Controller. The command block pointer is set to block 0 so the BC knows where to start when execution is enabled.

Important
  • Reset not completing — the hardware is not responding. Verify that the module is present and the card connection is active. A stuck reset may indicate a hardware fault or a module that was not properly initialized at the board level.

  • Mode set failure — the channel may already be in use by another application or configured in a mode that does not support BC operation. Ensure no other process holds the channel and that the module type supports Bus Controller mode.

RT-to-RT Command Block Configuration

Each time the user selects a transfer direction, the application builds a two-command sequence: one RT-to-RT message command followed by an End-of-List command. This sequence is loaded fresh on each user selection.

Command 0: RT-to-RT Message (32 Words)

The RT-to-RT command block uses NAI_SUM1553_OPCODE_EXEBLK_CONT with the rtrt flag set to 1 in the control word. Both cmd1 and cmd2 are populated — cmd1 carries the receive command for the destination RT, and cmd2 carries the transmit command for the source RT.

/* RTRT Message with 32 words to RT SubAddress */
wordcnt = 32;
ctrl = NAI_SUM1553_BC_CTRL_WORD(NAI_SUM1553_OPCODE_EXEBLK_CONT,1,1,1,0);
cmd1 = NAI_SUM1553_COMMAND_WORD(rt1addr,0,rt1subaddr,wordcnt);
cmd2 = NAI_SUM1553_COMMAND_WORD(rt2addr,1,rt2subaddr,wordcnt);
datablocknum = BLOCKC;
branchblock = 0;
timerus = 0;
check_status(naibrd_SUM1553_BC_LoadCmdBlock(cardIndex,module,bcchan,ncmd++,ctrl,cmd1,cmd2,datablocknum,branchblock,timerus));
for (i = 0; i < wordcnt; i++)
   datablock[BLOCKC][i] = (uint16_t)(0xC000 + i);
check_status(naibrd_SUM1553_BC_LoadDataBlock(cardIndex,module,bcchan,BLOCKC,datablock[BLOCKC]));

Key differences from a standard BC-to-RT command block:

  • Control word rtrt parameter is 1 — NAI_SUM1553_BC_CTRL_WORD(NAI_SUM1553_OPCODE_EXEBLK_CONT,1,1,1,0). This tells the SUMMIT 1553 core that this is an RT-to-RT transaction requiring two command words on the bus.

  • Both cmd1 and cmd2 are populated — in a BC-to-RT or RT-to-BC message, only cmd1 is used and cmd2 is zero. For RT-to-RT, cmd1 is the receive command (tx=0) and cmd2 is the transmit command (tx=1).

  • Data block — Block C is loaded with a recognizable pattern (0xC000 + offset). For an RT-to-RT transfer, the actual data on the bus comes from the transmitting RT, not from this data block. The data block serves as a scratch/storage area for the BC core during the transaction.

Command 1: End-of-List

After the RT-to-RT message, an ENDOFLIST command block terminates execution. Unlike the BC Scheduler sample which uses a GOTO to create a continuous loop, this sample executes a single message and stops.

/* Load EOL */
ctrl = NAI_SUM1553_BC_CTRL_WORD(NAI_SUM1553_OPCODE_ENDOFLIST,1,1,0,0);
cmd1 = 0;
cmd2 = 0;
datablocknum = 0;
branchblock = 0;
timerus = 0;
check_status(naibrd_SUM1553_BC_LoadCmdBlock(cardIndex,module,bcchan,ncmd++,ctrl,cmd1,cmd2,datablocknum,branchblock,timerus));

The ENDOFLIST opcode stops BC execution after processing this block. No command words, data block, or branch target are needed.

Important
  • Command block load failure — verify that the block number is within the valid range (0—​2047) and that all parameters are consistent with the selected opcode. An invalid block number or a malformed control word will cause naibrd_SUM1553_BC_LoadCmdBlock() to return an error status.

  • Data block load failure — data block numbers must be in the range 0—​1023. Ensure the datablocknum passed to naibrd_SUM1553_BC_LoadDataBlock() matches a valid block index.

  • RT-to-RT message not executing — verify that the rtrt flag is set to 1 in the control word. If the flag is 0, the hardware treats the command as a single-command-word transaction and cmd2 is ignored, resulting in a standard BC-to-RT or RT-to-BC message instead of an RT-to-RT transfer.

Starting Execution

With the command blocks loaded, two calls execute the RT-to-RT transfer. First, set the command block pointer to the entry point, then enable execution:

/* Start with the first command */
check_status(naibrd_SUM1553_BC_SetCmdBlockPtr(cardIndex,module,bcchan,FIRST_CMD));

/* Run the BC */
check_status(naibrd_SUM1553_EnableExecution(cardIndex,module,bcchan,1));

Because the command sequence ends with ENDOFLIST, the BC executes the single RT-to-RT message and then stops automatically. The user can then select another transfer direction, which reloads the command blocks and restarts execution.

Stopping Execution

When the user quits the interactive loop, the application explicitly disables BC execution:

/* Disable the BC */
check_status(naibrd_SUM1553_EnableExecution(cardIndex,module,bcchan,0));

This is a safety measure — the BC has already stopped due to the ENDOFLIST command, but explicitly disabling execution ensures the channel is in a clean state.

Important
  • No RT response (both RTs) — verify that two RTs are running on the bus at the expected addresses (RT 1 and RT 2 by default). An RT-to-RT transfer requires both a transmitting RT and a receiving RT to be present and operational.

  • Wrong data direction — the cmd1 receive command and cmd2 transmit command determine which RT sends and which receives. If the data flows in the wrong direction, check that the RT addresses and tx/rx bits are correctly assigned in the two command words.

  • Transfer succeeds but data is unexpected — the data on the bus comes from the transmitting RT’s subaddress buffer, not from the BC’s data block. Verify that the transmitting RT has the expected data loaded for the targeted subaddress.

Troubleshooting Reference

This table summarizes common errors and symptoms covered in the sections above. For detailed context on each entry, refer to the relevant section. Consult your module’s manual for hardware-specific diagnostic procedures.

Error / Symptom Possible Causes Suggested Resolution

No board found or connection timeout

Board not powered, missing configuration file, network issue

Verify hardware and configuration. If file doesn’t exist, configure and save from board menu.

Module not recognized as SUMMIT 1553

Selected module is not N7/N8/NA/NB/NC. IsSUMMIT1553() returned false.

Verify module type at the selected slot.

Reset not completing

Hardware not responding after reset

Verify module is powered and seated properly.

Mode set failure

Channel already in use or module doesn’t support BC mode

Close other applications using this channel.

Command block load failure

Invalid block number or parameters

Verify block number is within range (0-2047) and parameters are valid.

RT-to-RT message not executing

rtrt flag not set in control word

Ensure NAI_SUM1553_BC_CTRL_WORD has rtrt=1 for RT-to-RT commands.

No RT response

One or both RTs not present on the bus at the target addresses

Verify two RTs are running with correct addresses (default: RT 1 and RT 2).

Wrong data direction

cmd1/cmd2 RT addresses or tx/rx bits swapped

cmd1 must be the receive command (tx=0), cmd2 must be the transmit command (tx=1).

Transfer succeeds but data is unexpected

Transmitting RT does not have expected data loaded on the targeted subaddress

Verify the source RT’s subaddress buffer contains the expected data.

Full Source

The complete source for this sample is provided below for reference. The sections above explain each part in detail.

Full Source — SUM1553_BC_RTtoRT.c (SSK 1.x)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.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"

/* Common 1553 Sample Program include files */
#include "nai_1553_utils.h"

/* naibrd include files */
#include "nai.h"
#include "naibrd.h"
#include "functions/naibrd_sum1553.h"

static const int8_t *CONFIG_FILE = (int8_t *)"default_SUM1553_BCRTtoRT.txt";

/* Function prototypes */
static bool_t Run_SUM1553_BC_RTtoRT(int32_t cardIndex, int32_t module, uint32_t modid);

static const int32_t DEF_BC_CHANNEL    = 1;
static const uint8_t DEF_RT_ADDR1      = 1;
static const uint8_t DEF_RT_ADDR2      = 2;
static const uint8_t DEF_RT_SUBADDR1   = 2;
static const uint8_t DEF_RT_SUBADDR2   = 2;
static const uint16_t BLOCKC = 2;

static uint16_t datablock[3][32];

/**************************************************************************************************************/
/**
<summary>
The purpose of the SUM1553_BC_RTtoRT is to illustrate the methods to call in the naibrd library to send an RT-to-RT
message.

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 1553 routines.
 - ConfigDevice
 - DisplayDeviceCfg
 - GetBoardSNModCfg
 - CheckModule

 Note, the SUM1553_BC_RTtoRT can run in conjunction with the SUM1553_RT_PingPong or SUM1553_RT_ProcCtrl
 applications to illustrate BC and RT operations together with the NAI 1553 module.
</summary>
*/
/**************************************************************************************************************/
#if defined (__VXWORKS__)
int32_t SUM1553_BC_RTtoRT(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_SUM1553_BC_RTtoRT(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_SUM1553_BC_RTtoRT queries the user for the module and channel to configure as the Bus Controller (BC).
After getting the module/channel selection, methods in the naibrd library are invoked to setup this channel
as a BC with either of the following 1553 messages:
1) RT-RT message with 32 words of data for which the Rx command is to the "DEF_RT_ADDR1" RT Address and
   "DEF_RT_SUBADDR1" Subaddress and the Tx command is to the "DEF_RT_ADDR2" RT Address and "DEF_RT_SUBADDR2"
   Subaddress
2) RT-RT message with 32 words of data for which the Rx command is to the "DEF_RT_ADDR2" RT Address and
   "DEF_RT_SUBADDR2" Subaddress and the Tx command is to the "DEF_RT_ADDR1" RT Address and "DEF_RT_SUBADDR1"
   Subaddress

Once the BC is configured and running, the user can:
1) Type the Enter key to send another RT-to-RT message.
3) Type 'Q' to quit stop the BC execution and exit the routine.
</summary>
*/
/**************************************************************************************************************/
static bool_t Run_SUM1553_BC_RTtoRT(int32_t cardIndex, int32_t module, uint32_t modid)
{
   bool_t bQuit;
   bool_t bContinue = TRUE;
   int32_t bcchan = 2;

   const uint16_t FIRST_CMD = 0;
   bool_t resetting;
   uint32_t ncmd = 0;
   int32_t wordcnt = 32;
   uint8_t rt1addr = DEF_RT_ADDR1;
   uint8_t rt2addr = DEF_RT_ADDR2;
   uint8_t rt1subaddr = DEF_RT_SUBADDR1;
   uint8_t rt2subaddr = DEF_RT_SUBADDR2;

   uint16_t ctrl;
   uint16_t cmd1, cmd2;
   uint16_t datablocknum;
   uint16_t branchblock;
   uint32_t timerus;
   int32_t i;

   int8_t inputBuffer[80];
   int32_t inputResponseCnt;

   bQuit = Get1553BCCfg(modid, DEF_BC_CHANNEL, &bcchan);
   if (!bQuit)
   {
      /* Reset the channel */
      check_status(naibrd_SUM1553_Reset(cardIndex,module,bcchan));

      /* Wait for channels to reset */
      while(check_status(naibrd_SUM1553_IsResetting(cardIndex,module,bcchan,&resetting)) == NAI_SUCCESS && resetting);

      /* Setup the BC */
      check_status(naibrd_SUM1553_SetMode(cardIndex,module,bcchan,NAI_SUM1553_OPSTATUS_BC_MODE)); /* Configure as BC */

      /* Start with the first command */
      check_status(naibrd_SUM1553_BC_SetCmdBlockPtr(cardIndex,module,bcchan,FIRST_CMD));

      while (bContinue)
      {
         printf("\n1) Rx: RT Addr %d, SA %d; Tx: RT Addr %d, SA %d\n", DEF_RT_ADDR1, DEF_RT_SUBADDR1, DEF_RT_ADDR2, DEF_RT_SUBADDR2);
         printf("2) Rx: RT Addr %d, SA %d; Tx: RT Addr %d, SA %d\n", DEF_RT_ADDR2, DEF_RT_SUBADDR2, DEF_RT_ADDR1, DEF_RT_SUBADDR1);
         printf("\nSelect a number to send another RT-to-RT message or %c to quit: ", NAI_QUIT_CHAR);
         bQuit = naiapp_query_ForQuitResponse(sizeof(inputBuffer), NAI_QUIT_CHAR, inputBuffer, &inputResponseCnt);
         if (!bQuit)
         {
            if (inputBuffer[0] == '1')
            {
               rt1addr = DEF_RT_ADDR1;
               rt1subaddr = DEF_RT_SUBADDR1;
               rt2addr = DEF_RT_ADDR2;
               rt2subaddr = DEF_RT_SUBADDR2;
            }
            else if (inputBuffer[0] == '2')
            {
               rt1addr = DEF_RT_ADDR2;
               rt1subaddr = DEF_RT_SUBADDR2;
               rt2addr = DEF_RT_ADDR1;
               rt2subaddr = DEF_RT_SUBADDR1;
            }
            else
            {
               printf("\nInvalid value.\n");
               continue;
            }

            /* First command block */
            ncmd = FIRST_CMD;

            /* RTRT Message with 32 words to RT SubAddress */
            wordcnt = 32;
            ctrl = NAI_SUM1553_BC_CTRL_WORD(NAI_SUM1553_OPCODE_EXEBLK_CONT,1,1,1,0);
            cmd1 = NAI_SUM1553_COMMAND_WORD(rt1addr,0,rt1subaddr,wordcnt);
            cmd2 = NAI_SUM1553_COMMAND_WORD(rt2addr,1,rt2subaddr,wordcnt);
            datablocknum = BLOCKC;
            branchblock = 0;
            timerus = 0;
            check_status(naibrd_SUM1553_BC_LoadCmdBlock(cardIndex,module,bcchan,ncmd++,ctrl,cmd1,cmd2,datablocknum,branchblock,timerus));
            for (i = 0; i < wordcnt; i++)
               datablock[BLOCKC][i] = (uint16_t)(0xC000 + i);
            check_status(naibrd_SUM1553_BC_LoadDataBlock(cardIndex,module,bcchan,BLOCKC,datablock[BLOCKC]));

            /* Load EOL */
            ctrl = NAI_SUM1553_BC_CTRL_WORD(NAI_SUM1553_OPCODE_ENDOFLIST,1,1,0,0);
            cmd1 = 0;
            cmd2 = 0;
            datablocknum = 0;
            branchblock = 0;
            timerus = 0;
            check_status(naibrd_SUM1553_BC_LoadCmdBlock(cardIndex,module,bcchan,ncmd++,ctrl,cmd1,cmd2,datablocknum,branchblock,timerus));

            /* Start with the first command */
            check_status(naibrd_SUM1553_BC_SetCmdBlockPtr(cardIndex,module,bcchan,FIRST_CMD));

            /* Run the BC */
            check_status(naibrd_SUM1553_EnableExecution(cardIndex,module,bcchan,1));
         }
         else
         bContinue = FALSE;
      }

      /* Disable the BC */
      check_status(naibrd_SUM1553_EnableExecution(cardIndex,module,bcchan,0));
   }
   return bQuit;
}

Help Bot

X