diff --git a/src/mx_stream/mx_fe.c b/src/mx_stream/mx_fe.c index b9f0af6fe103d9d0ac09b80901ec89d8e52386fa..39b1a67986c7cac722f49a3616f9e0a3ba4474e4 100644 --- a/src/mx_stream/mx_fe.c +++ b/src/mx_stream/mx_fe.c @@ -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]),