VISA-COM sample code
This example gets the instrument identification string using VISA-COM in C#.
The first thing to do is add a reference to the VISA-COM interop DLL, which is usually located at
C:\Program Files\IVI Foundation\VISA\VisaCom\Primary Interop Assemblies\Ivi.Visa.Interop.dll.
using Ivi.Visa.Interop;
namespace WindowsApplication1
{
public class IdnSample: System.Windows.Forms.Form
{
private Ivi.Visa.Interop.FormattedIO488 ioDmm;
//
}
}
private void IdnSample_Load(object sender, System.EventArgs e)
{
ioDmm = new FormattedIO488Class();
SetAccessForClosed();
}
private void btnInitIO_Click(object sender, System.EventArgs e)
{
try
{
ResourceManager grm = new ResourceManager();
ioDmm.IO = (IMessage)grm.Open("GPIB::16::INSTR",
AccessMode.NO_LOCK, 2000, "");
ioDmm.IO.TerminationCharacterEnabled = true;
}
catch (SystemException ex)
{
MessageBox.Show("Open failed on " + this.txtAddress.Text + " " +
ex.Source + " " + ex.Message, "IdnSample", MessageBoxButtons.OK,
MessageBoxIcon.Error);
ioDmm.IO = null;
}
}
Digital I/O
The Series 3700A has a digital input/output port that can be used to control external digital circuitry.
For example, you can use a handler that is used to perform binning operations with a digital I/O port.