DDC Reference Sample Code : bcdemo_GPF.c   Download 

This sample demonstrates controlled execution of a BC message based on the value of General Purpose Flag 3 (GPF3).

  1. This sample creates a BC to RT message and makes the execution of the message conditional to the value of GPF3 being set to 1. This is done by setting the condition code field of aceBCOpCodeCreate to ACE_CNDTST_GP3_1.
  2. A second opcode is added to the frame to reset GPF3 to zero (using ACE_OPCODE_FLG), demonstrating modification of GPF values directly from within the 1553 controller.
  3. In the GetBCHBufDecodedMsgs function, users are given the option to press 'q' to quit or any other key to retransmit the message. If a key other than 'q' is pressed, the function sets GPF3 by calling aceBCSetGPFState, triggering the message to be transmitted once. This approach allows an application to control message execution using General Purpose Flags (GPFs).
  4. To test the sample do the following:
    1. Run sample. You should see the message 01-R-01-10 being transmitted once.
    2. Press a key other than 'q'. You should see the message 01-R-01-10 being transmitted again, once.
    3. Repeat the above step to see this message being transmitted upon every key press (other than 'q')
    4. To quit application press 'q'.