PuChannel puChannel;
if(sscanf(captureSpec, "%u,%u,%u, %u,%u,%u,%u,%u,%u", &channel, &captureInfo.source, &captureInfo.clock,
&captureInfo.startTime, &captureInfo.postTriggerDelay, &captureInfo.triggerAnd, &captureInfo.triggerStore,
&captureInfo.triggerSourceData, &captureInfo.triggerMask) != 9){
err.set(ErrorConfig, "Error in CapSpec");
return err;
}
if(outFile == "")
outFile = "data.txt";
if(err = file.open(outFile, "w")){
return err.set(1, BString("Error: Opening file: ") + outFile);
}
// get Physical Channel number
if(err = tmsControl.getPuChannel(channel, puChannel)){
return err.set(1, BString("Error: Getting Physical Channel Number: ") + err.getString());
}
// Get next Cycle Number
if(err = tmsProcess.getCycleInfo(cn, ct)){
return err.set(1, BString("Error: Getting Cycle Number: ") + err.getString());
}
printf("CaptureTestData: Channel: %u:%u:%u CycleNumber: %u CycleType: %s\n", puChannel.moduleNum, puChannel.pupeNum, puChannel.pupeChan, cn, ct.retStr());
if(err = tmsControl.captureDiagnostics(puChannel, captureInfo, data)){
return err.set(1, BString("Error: Getting Data: ") + err.getString());
}
// Assumes source == 0
if(captureInfo.source == 0){
if (kst) {
if(captureInfo.triggerStore){
file.printf("FrefIn PllMsb PhaseTableMsb Lo1 Sigma Lo2 Gate Blr Mean1 Mean2 RfSelect1 RfSelect2 SelFilter SwitchState DdsFreq ");
file.printf("FRef HChange Injection CalStop CalStart CycleStop CycleStart SysClock\n");
}
else {
file.printf("FrefIn PllMsb PhaseTableMsb Lo1 Sigma Lo2 Gate Blr Mean1 Mean2 RfSelect1 RfSelect2 SelFilter SwitchState DdsFreq\n");
}
}
for(i = 0; i < data.size(); i++){
if(captureInfo.triggerStore){
file.printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n",
getBitValue(data[i], 63, 1, 0), // FREF
!getBitValue(data[i], 62, 1, 0), // PllMsb (FRef Reference)
!getBitValue(data[i], 61, 1, 0), // PhaseTableMsb (Local FREF)
getBitValue(data[i], 60, 1, 0), // LO1
// getBitValue(data[i], 57, 3, 1), // Sigma (3 bits)
getBitValue(data[i], 32, 12, 1), // Sigma (12 bits)
getBitValue(data[i], 56, 1, 0), // LO2
getBitValue(data[i], 49, 1, 0), // Gate
getBitValue(data[i], 48, 1, 0), // Blr
getBitValue(data[i], 50, 1, 0), // Mean1
getBitValue(data[i], 51, 1, 0), // Mean2
getBitValue(data[i], 52, 1, 0), // RfSelect1
getBitValue(data[i], 53, 1, 0), // RfSelect2
getBitValue(data[i], 54, 1, 0), // SelFilter
getBitValue(data[i], 44, 4, 0), // SwitchState
getBitValue(data[i], 8, 24, 1), // DDS_FREQ
getBitValue(data[i], 7, 1, 0), // FREF
getBitValue(data[i], 6, 1, 0), // HCHANGE event
getBitValue(data[i], 5, 1, 0), // INJECTION event
getBitValue(data[i], 4, 1, 0), // CAL_STOP event
getBitValue(data[i], 3, 1, 0), // CAL_START event
getBitValue(data[i], 2, 1, 0), // CYCLE_STOP event
getBitValue(data[i], 1, 1, 0), // CYCLE_START event
getBitValue(data[i], 0, 1, 0) // 10MHz System Clock
);
}
else {
file.printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n",
getBitValue(data[i], 63, 1, 0), // FREF
!getBitValue(data[i], 62, 1, 0), // PllMsb (FRef Reference)
!getBitValue(data[i], 61, 1, 0), // PhaseTableMsb (Local FREF)
getBitValue(data[i], 60, 1, 0), // LO1
// getBitValue(data[i], 57, 3, 1), // Sigma (3 bits)
getBitValue(data[i], 32, 12, 1), // Sigma (12 bits)
getBitValue(data[i], 56, 1, 0), // LO2
getBitValue(data[i], 49, 1, 0), // Gate
getBitValue(data[i], 48, 1, 0), // Blr
getBitValue(data[i], 50, 1, 0), // Mean1
getBitValue(data[i], 51, 1, 0), // Mean2
getBitValue(data[i], 52, 1, 0), // RfSelect1
getBitValue(data[i], 53, 1, 0), // RfSelect2
getBitValue(data[i], 54, 1, 0), // SelFilter
getBitValue(data[i], 44, 4, 0), // SwitchState
getBitValue(data[i], 0, 32, 1) // DDS_FREQ
);
}
}
}
else if(captureInfo.source == 1){
if (kst) {
file.printf("FrefIn PllMsb PhaseTableMsb Lo1 Sigma Lo2 MultOut1 MultOut2 F_Error\n");
}
for(i = 0; i < data.size(); i++){