Visual C# Sample Program
Sample program of setting and queries (USB)
// Create VISA ResourceManager object
Ivi.Visa.Interop.ResourceManager rm = new Ivi.Visa.Interop.ResourceManager();
Ivi.Visa.Interop.AccessMode accessMode = Ivi.Visa.Interop.AccessMode.NO_LOCK;
// Serial number of the multifunction genarator
string serial = "0123456";
int timeOut = 0;
string optionString = "";
// Connect with the device(USB)
Ivi.Visa.Interop.IMessage msg = (Ivi.Visa.Interop.IMessage)rm.Open(
"USB0::0x0D4A::0x000F::" + serial + "::INSTR",
accessMode,
timeOut,
optionString);
// Set the frequncy as 5.0 kHz, and ask the value
msg.WriteString(":FREQ 5000;:FREQ?\n");
Console.WriteLine(msg.ReadString(256));
// Close the device
msg.Close();
Sample program of setting and queries (GPIB)
// Create VISA ResourceManager object
Ivi.Visa.Interop.ResourceManager rm = new Ivi.Visa.Interop.ResourceManager();
Ivi.Visa.Interop.AccessMode accessMode = Ivi.Visa.Interop.AccessMode.NO_LOCK;
int timeOut = 0;
string optionString = "";
// Connect with the device(GPIB address:2)
Ivi.Visa.Interop.IMessage msg = (Ivi.Visa.Interop.IMessage)rm.Open(
"GPIB0::2::INSTR",
accessMode,
timeOut,
optionString);
// Set the Offset as 0.0V, Amplitude as 20.0Vp-p and Output as on,
// and ask the value
msg.WriteString(":SOUR1:VOLT:OFFS 0V;:SOUR1:VOLT 20VPP;OUTP1 1;:SOUR1:VOLT?");
Console.WriteLine(msg.ReadString(256));
// Close the device
msg.Close();