DDC Reference Sample Code : bcdemo_wordincrement
Download
This sample demonstrates a technique to setup aceXtreme boards to auto increment a data word value of a specific message using ACE_OPCODE_INC opcode.
1. Overview
- The sample schedules one BC->RT message to be transmitted very 500uS with the value of Data Word 0 & 1 (i.e. a pair of 16-bit words treated as one 32-bit value) being incremented by 1 in successive transmissions of this message.
- It creates a Memory Object on the first Data Block of this message and adds an ACE_OPCODE_INC opcode on this memory object.
- After transmission of this message in every cycle, the ACE_OPCODE_INC opcode gets executed which will internally increment the value of word 0 of the data block without the need for software intervention. Once word 0 overflows, the incrementing
continues on word 1 since this technique works on 32-bit values. This upcounting goes on for up to 2power32.
- Since the increment is done by the 1553 hardware, it is highly reliable even for messages having short periodicity where software techniques of incrementing data words becomes unliable.
- The same technique can be used to decrement the value of data words as well by using the ACE_OPCODE_DEC opcode. It may also be extended to increment/decrement values of multiple words across messages.
- This sample requires an aceXtreme 1553 hardware from DDC.
2. APIs Demonstrated
aceInitialize
aceBCInstallHBuf
aceBCDataBlkCreate
aceBCMsgCreateBCtoRT
aceBCOpCodeCreate
acexBCMemObjCreate
aceBCFrameCreate
aceBCStart
aceBCStop
aceFree
3. Build and Test Details
The sample was built and tested using Visual Studio 2022 on on Windows 11. BU-69092S0-110 v4.9.5 was used with BU-67103U200L-JL0.