Technical data
154 Agilent Connectivity Guide
6 Programming Your Instruments
private void USBInstrument_TextChanged(object sender,
System.EventArgs e)
{
}
private void button1_Click(object sender, System.EventArgs e)
{
Ivi.Visa.Interop.ResourceManager io_mgr=new
Ivi.Visa.Interop.ResourceManagerClass();
Ivi.Visa.Interop.FormattedIO488 fgen=new
Ivi.Visa.Interop.FormattedIO488Class();
fgen.IO=(Ivi.Visa.Interop.IMessage)io_mgr.Open(USBInstrument.Text,Ivi.
Visa.Interop.AccessMode.NO_LOCK,2000,"");
fgen.WriteString("*rst",true);
fgen.IO.Clear();
fgen.WriteString("FUNCtion SINusoid",true); //Select waveshape
//
//Other options are SQUare, RAMP, PULSe, NOISe, DC, and USER
//
fgen.WriteString("OUTput:LOAD 50",true);
//Set the load impedance in Ohms
//(50 ohms default)
//
//May also be INFinity, as when using oscilloscope or DMM
//
fgen.WriteString("FREQuency 2500",true); //Set the frequency
fgen.WriteString("VOLTage 1.2",true); //Set the amplitude in
//Vpp.
//Also see VOLTage:UNIT
fgen.WriteString("VOLTage:OFFSet 0.4",true);
//Set the offset in Volts
//Voltage may also be set as VOLTage:HIGH and VOLTage:LOW for
//low level and high level.
//
fgen.WriteString("OUTPut ON",true);
//Turn on the instrument output
}
}
}