Specifications

21
5.5 Useful code snippets for programming the N4965A-CTR multi-channel BERT controller
Once you’ve referenced the IVI driver in your Visual Studio project, assigned a using command
simplify the object namespace, initialized the driver object, and connected to an instrument, now what?
To turn on the TG5P1A generator pod attached to Channel 1 of the N4965A-CTR multi-channel BERT controller
instrument, set the amplitude of the output to 1.0V, change the pattern to PRBS15, and set 2.5dB of de-emphasis:
IAgilent TechnologiesN4965A-CTR MULTI-CHANNEL BERT CONTROLLERChannelGenerator gen =
pcbDriver.Channels.get_Item(“1”).Generator;
gen.State = Agilent TechnologiesN4965A-CTR MULTI-CHANNEL BERT CONTROLLERStateEnum.
Agilent TechnologiesN4965A-CTR MULTI-CHANNEL BERT CONTROLLERStateOn;
gen.Output.Amplitude = 1.0;
gen.Pattern.Name = Agilent TechnologiesN4965A-CTR MULTI-CHANNEL BERT
CONTROLLERGeneratorPatternEnum.
Agilent TechnologiesN4965A-CTR MULTI-CHANNEL BERT
CONTROLLERGeneratorPatternPRBS15;
gen.Output.Deemphasis = 2.5;
To turn on the N4965A-200 12.5 Gb/s error detector remote head attached to Channel 2 of the N4965A-CTR
multi-channel BERT controller instrument, and set the pattern to PRBS15:
IAgilent TechnologiesN4965A-CTR MULTI-CHANNEL BERT CONTROLLERChannelDetector det =
pcbDriver.Channels.get_Item(“2”).Detector;
det.State = Agilent TechnologiesN4965A-CTR MULTI-CHANNEL BERT CONTROLLERStateEnum.
Agilent TechnologiesN4965A-CTR MULTI-CHANNEL BERT CONTROLLERStateOn;
det.Pattern.Name = Agilent TechnologiesN4965A-CTR MULTI-CHANNEL BERT
CONTROLLERDetectorPatternEnum.
Agilent TechnologiesN4965A-CTR MULTI-CHANNEL BERT
CONTROLLERDetectorPatternPRBS15;
To perform a clock/data alignment on the N4965A-200 12.5 Gb/s error detector remote head, to align the
sampling point with the most open portion of the eye, and to start a 10 second measurement:
det.Eye.AutoAlign();
det.Gate.Period = 10;
det.Gate.State = Agilent TechnologiesN4965A-CTR MULTI-CHANNEL BERT CONTROLLERStateEnum.
Agilent TechnologiesN4965A-CTR MULTI-CHANNEL BERT CONTROLLERStateOn;
To capture the number of bits, number of errors, BER, and elapsed time calculated while the measurement is running:
double[] fetchAllAry = new double[4];
double numBits, numErrors, BER, ElapsedTime;
do
{
// get the new gated results
det.Fetch.All(ref fetchAllAry);
numBits = fetchAllAry[0];
numErrors = fetchAllAry[1];
BER = fetchAllAry[2];
ElapsedTime = fetchAllAry[3];
}
while (det.Gate.State == Agilent TechnologiesN4965A-CTR MULTI-CHANNEL BERT
CONTROLLERStateEnum.Agilent TechnologiesN4965A-CTR MULTI-CHANNEL BERT
CONTROLLERStateOn);
Other examples are available. Please contact Agilent Technologies for more information.