Specifications

18
5.2 Using IVI-COM driver references in your program code
Now you’ve added the IVI driver reference to your project, you can interact with
the IVI driver from any code block in your project. Select the code file you want
to interact with the instrument and add a “using” statement to simplify the
namespace associated with the IVI driver reference.
Using Agilent Technologies.Agilent TechnologiesN4962A.Interop;
Using Agilent Technologies.Agilent TechnologiesN4963A.Interop;
Next you will want to create an instance of the Agilent Technologies IVI driver
interface class. Because we want to share this reference with sub-classes,
we use the protected variable definition. You could use private or public if you
prefer.
protected Agilent TechnologiesN4963A syn;
protected Agilent TechnologiesN4962A BERT;
Now we have a reference to the IVI driver and variables that we’ve initialized to
communicate with the driver. We’re not done yet!
5.3 Communicating with an instrument using the IVI-COM driver
The next step is to connect an instance of the IVI driver class to a specific
instrument. This code requires that you know the resource address of the instru-
ment, which is a VISA string that identifies how the instrument is connected to
the computer.
This code is shown in the next section.
5.4 10-second BER measurement example using the N4962A serial BERT 12.5 Gb/s and
N4963A clock synthesizer 13.5 GHz with an IVI-COM driver in Visual C#
using System;
using System.Text;
using Agilent Technologies.Agilent TechnologiesN4963A.Interop;
using Agilent Technologies.Agilent TechnologiesN4962A.Interop;
using Ivi.Driver.Interop;
namespace TG1B1A_IVI_demo
{
class Program
{
static void Main(string[] args)
{
// vars
double bitCount=0, errCount=0, elapTime=0, BER=0;
// measurement setup
string srcAddress = “GPIB::16”; // GPIB address of N4963A CLOCK SYNTHESIZER13.5
GHZ
double srcFreq = 10e9; // frequency in Hz
string BERTAddress = “GPIB::5”; // GPIB address of N4962A SERIAL BERT 12.5 GB/S
double BERTAmplitude = 0.5; // output amplitude
double BERTGateTime = 10; // measurement gate time
double BERTErrThreshold = 1e-5; // pre-measurement error threshold
bool BERTErrInj = true; // error injection
Agilent TechnologiesN4962AErrorInjectionEnum BERTErrInjRate =
Agilent TechnologiesN4962AErrorInjectionEnum.