Skip to content
Snippets Groups Projects
Commit 970dc1b7 authored by Jonathan Hanks's avatar Jonathan Hanks
Browse files

Fixes to mx_fe

When resyncing to the IOP, reset the counter for all models.
This helps mx_fe skip models that have not been started (ie
their mbuf is unitialized).

Corrected some index values.  The ixDataBlock dcuheaders where
indexed with the wrong value, and could cause a bad tpBlockSize
to be caculated if a required model was stopped (this happens when
the ii index != the db index) which can manifest itself with the
process aborting after seeing an overflow.
parent 5700e93a
No related branches found
No related tags found
No related merge requests found
......@@ -145,8 +145,15 @@ int ii;
int threads_rdy = 0;
int timeout = 0;
// if reset, want to set IOP cycle to impossible number
if(reset) ipcPtr[0]->cycle = 50;
// if reset, want to set all models cycle counters to impossible number
// this takes care of uninitialized or stopped models
if (reset)
{
for (ii = 0; ii < nsys; ++ii)
{
ipcPtr[ii]->cycle = 50;
}
}
usleep(1000);
// Wait until received data from at least 1 FE or timeout
do {
......@@ -308,7 +315,7 @@ int loadMessageBuffer( int nsys,
ixDataBlock->header.dcuheader[db].timeNSec = shmIpcPtr[ii]->bp[lastCycle].timeNSec;
crcLength = shmIpcPtr[ii]->bp[lastCycle].crc;
// Set Status -- as running
ixDataBlock->header.dcuheader[ii].status = 2;
ixDataBlock->header.dcuheader[db].status = 2;
// Indicate size of data block
// ********ixDataBlock->header.dcuheader[db].dataBlockSize = shmIpcPtr[ii]->dataBlockSize;
ixDataBlock->header.dcuheader[db].dataBlockSize = crcLength;
......@@ -317,7 +324,7 @@ int loadMessageBuffer( int nsys,
ixDataBlock->header.dcuheader[db].dataBlockSize = DAQ_DCU_BLOCK_SIZE;
// Calculate TP data size
ixDataBlock->header.dcuheader[db].tpCount = (unsigned int)shmTpTable[ii]->count & 0xff;
ixDataBlock->header.dcuheader[db].tpBlockSize = sizeof(float) * modelrates[ii] * ixDataBlock->header.dcuheader[ii].tpCount / DAQ_NUM_DATA_BLOCKS_PER_SECOND;
ixDataBlock->header.dcuheader[db].tpBlockSize = sizeof(float) * modelrates[ii] * ixDataBlock->header.dcuheader[db].tpCount / DAQ_NUM_DATA_BLOCKS_PER_SECOND;
// Copy GDSTP table to xmission buffer header
memcpy(&(ixDataBlock->header.dcuheader[db].tpNum[0]),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment