Specifications

13
// setup BERT
Console.Write(“N4962A SERIAL BERT 11.3 GB/S “ + BERTAddress + “ setup..”);
BERT.IO.Clear();
BERT.WriteString(“*RST;*OPC?”, true);
temp = BERT.ReadString();
BERT.WriteString(“:SOUR:ROSC:SOUR EXT”, true);
System.Threading.Thread.Sleep(200);
BERT.WriteString(“:SOUR:ROSC:FREQ “ + (srcFreq/1e6), true);
BERT.WriteString(“:SOUR:PATT “ + BERTPattern, true);
BERT.WriteString(“:SOUR:VOLT “ + (BERTAmplitude*1000), true);
if (BERTErrInj)
BERT.WriteString(“:SOUR:PRBS:IERR:RAT ERR” + BERTErrInjRate, true);
BERT.WriteString(“:MOD NORM”, true);
Console.WriteLine(“done”);
// autoalign and check for error-free operation
Console.Write(“Autoalign and error check..”);
BERT.WriteString(“:SENS:ROSC:PHAS AUTO”, true);
BERT.WriteString(“*OPC?”, true);
temp = BERT.ReadString();
BERT.WriteString(“:SENS:ROSC:PHAS?”, true);
temp = BERT.ReadString().TrimEnd(‘\r’, ‘\n’);
Console.Write(temp + “ degrees..”);
BERT.WriteString(“:SENS:SWE:TIME 0.1”, true);
BERT.WriteString(“:TRIG:INIT”, true);
System.Threading.Thread.Sleep(100);
BERT.WriteString(“:TRIG:SAMP;:SENS:DATA? ALL”, true);
double[] results = (double[])BERT.ReadList(
IEEEASCIIType.ASCIIType_R8, “,”);
if (results[3] > BERTErrThreshold)
{
Console.WriteLine(“failed”);
Console.WriteLine(results[2] + “, BER: “ + results[3] +
“; bits: “ + results[0] + “; errs: “ + results[1]);
Environment.Exit(1);
}
Console.WriteLine(“passed”);
// start measurement
Console.WriteLine(BERTGateTime.ToString() + “s BER measurement”);
BERT.WriteString(“:SENS:SWE:TIME “ + BERTGateTime.ToString(), true);
BERT.WriteString(“:TRIG:INIT”, true);
bool running = true;
while (running)
{
BERT.WriteString(“:STAT:OPER:MEAS:COND?”, true);
running = ((double)BERT.ReadNumber(
IEEEASCIIType.ASCIIType_R4, true) == 1);
System.Threading.Thread.Sleep(1000);
BERT.WriteString(“:TRIG:SAMP;:SENS:DATA? ALL”, true);
results = (double[])BERT.ReadList(IEEEASCIIType.ASCIIType_R8, “,”);
Console.WriteLine(results[2] + “, BER: “ + results[3] +
“; bits: “ + results[0] + “; errs: “ + results[1]);
if (results[2] == BERTGateTime) running = false;
}
}
}
}