
80
Keysight M8070A Programming Guide
3
Programming Examples
public override double getInstantaneousBER()
// M8020A
{
double accumulatedBER = 0.0;
List<double> result = new List<double>();
result = this.getBERAccResults();
accumulatedBER = result[2];
return accumulatedBER;
}
public override List<string> setBERCounterResults()
// M8020A
{
List<double> berResults = new List<double>();
List<double> bitCounter = new List<double>();
double bitCount = 0.0;
double errorCount = 0.0;
double elapsedTime = 0.0;
double timeStamp = 0.0;
double ber = 0.5;
bitCounter = this.getErrorCounter();
bitCount = bitCounter[0] - m_prevBitCount;
errorCount = bitCounter[1] - m_prevErrorCount;
timeStamp = bitCounter[2];
elapsedTime = 1000.0 * (timeStamp - m_prevTimeStamp);
ber = errorCount / bitCount;
m_BitCount = bitCount;
m_ErrorCount = errorCount;
m_BER = ber;
return this.ErrorQ();
}
private List<double> getErrorCounter()
// M8020A
{
List<double> bitCounter = new List<double>();
double bitCount = 0.0;
double errorCount = 0.0;
double timeStamp = 0.0;
double counted1s = 0.0;
double counted0s = 0.0;
double erroneous1s = 0.0;
double erroneous0s = 0.0;
string identifier = "";
string resultStr = "";
string valStr = "";
int index = 0;