MX Foundation 4
Periodic Frame Service

The transmission channels of A629 modules support this service (logical channel 1 to 120).

Refer to the MXF_A629_TXPERIODIC_MJRFRAME_MSG structure for major frame building.

The major frame (XPP) can contain up to 31 minor frames (messages) and a total of 31 messages (wordstrings).

The minor frame rate is taken from the module TI value.

Each element of the major frame corresponds to the MXF_A629_TXPERIODIC_MJRFRAME_MSG structure. It contains the label to be sent, the length of the wordstring, and other options.

Before setting the major frame, it is suggested to clear it using the mxfTxPeriodicMajorFrameClear() function.

The minor frame can then be set using the mxfA629TxPeriodicMajorFrameSet() function. By default, the major frame is empty.

To set the data associated to the label, refer to the Periodic Update Message Service section.

Building a major frame:

#define MAX_TX_RECORDS_TO_TRANSMIT 1
#define TX_BUFFER_SIZE MAX_TX_RECORDS_TO_TRANSMIT*sizeof(MXF_A629_DATAREC)
HMXF_SERVER server;
HMXF_CHANNEL txChannel;
HMXF_BUFFER txBuffer[6]={0,0,0,0,0,0};
uint64 index;
...
// Sets timebase to RTC nsec
if(!rc)
rc = mxfSystemTimeBaseSet(server, MXF_TIMEBASE_DEVICE_NSEC);
// Allocates buffer for tx data
if(!rc)
{
// Allocate six TX Periodic Update Message buffer
for(index=0; index<6 && !rc; index++)
rc = mxfTxPeriodicUpdateMsgBufferAlloc(txChannel, index, TX_BUFFER_SIZE, &txBuffer[index], NULL);
}
// Clears the major frame
if(!rc)
// Sets the minor frame #0 using 3 WordStrings
if(!rc)
{
memset(minorFrame, 0, sizeof(minorFrame));
//WordString #0 : Label 0x1, CID 0x4
minorFrame[0].buffer = txBuffer[0];
minorFrame[0].label = 0x1;
minorFrame[0].cid = 0;
minorFrame[0].length = 1;
//WordString #1 : Label 0x2, CID 0x4
minorFrame[1].buffer = txBuffer[1];
minorFrame[1].label = 0x2;
minorFrame[1].cid = 0;
minorFrame[1].length = 2;
//WordString #2 : Label 0x3, CID 0x4
minorFrame[2].buffer = txBuffer[2];
minorFrame[2].label = 0x3;
minorFrame[2].cid = 0;
minorFrame[2].length = 3;
rc = mxfA629TxPeriodicMajorFrameSet(txChannel, 0, 0, 3, minorFrame);
}
//--- Set the minor frame #1 with 2 WordStrings --//
if(!rc)
{
//WordString #0 : Label 0x4, CID 0x4
minorFrame[0].buffer = txBuffer[3];
minorFrame[0].label = 0x4;
minorFrame[0].cid = 0;
minorFrame[0].length = 4;
minorFrame[0].options = MXF_A629_TXPERIODIC_MJRFRAME_MSG_OPT_CRC_ENABLE;
//WordString #1 : Label 0x5, CID 0x4
minorFrame[1].buffer = txBuffer[4];
minorFrame[1].label = 0x5;
minorFrame[1].cid = 0;
minorFrame[1].length = 5;
minorFrame[1].options = MXF_A629_TXPERIODIC_MJRFRAME_MSG_OPT_CRC_ENABLE;
rc = mxfA629TxPeriodicMajorFrameSet(txChannel, 0, 1, 2, minorFrame);
}
//--- Set default data for label 0x1, CID 0x4 ---//
if(!rc)
{
memset(&txRec629, 0, sizeof(txRec629));
txRec629.control = 0;
txRec629.repeatCount = 1;
txRec629.dataSize = 4;
txRec629.data[0] = 0;
txRec629.data[1] = 0x1111;
rc = mxfA629TxPeriodicUpdateMsgWrite(txBuffer[0], 1, &txRec629);
}
//--- Set default data for label 0x2, CID 0x4 ---//
if(!rc)
{
txRec629.control = 0;
txRec629.repeatCount = 1;
txRec629.dataSize = 6;
txRec629.data[0] = 0;
txRec629.data[1] = 0x2222;
txRec629.data[2] = 0x2222;
rc = mxfA629TxPeriodicUpdateMsgWrite(txBuffer[1], 1, &txRec629);
}
//Start the major frame in the Block mode
if(!rc)
{
majorProperties.mode = MXF_A629_TXPERIODIC_MJRFRAME_PROPERTIES_MODE_BLOCK;
majorProperties.reserved = 0;
rc = mxfA629TxPeriodicMajorFrameStart(txChannel, 0, 0, &majorProperties);
}
...
// Stops the major frame
if(!rc)
rc = mxfTxPeriodicMajorFrameStop(txChannel, 0, 0);
if(!rc)
rc = mxfTxPeriodicMajorFrameClear(txChannel, 0);
...
Note
If two wordstrings with the same buffer are close to each other in the minor frame, it can happen that the firmware doesn't have the time to update the buffer before the next occurrence of the wordstring is sent, so the same data will be sent twice. If they need to have different data, simply assign a different buffer to one of the wordstring and update both buffers individually.
Updated 10/23/2023