AnsweredAssumed Answered

Using C for test program

Question asked by Superbrew on Dec 25, 2007
Latest reply on Jan 4, 2008 by Superbrew
Hello, I am new to C# and I am trying to write a simple GPIB test program. I would to use multiple forms because I have have pictures of test setups that I would like to use. I am trying to write a class that sets up the GPIB so that I do not need to reopen it on every form. This is what I have so far:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ivi.Visa.Interop;

namespace GlobalTest
{
class GPIB
{
private static Ivi.Visa.Interop.ResourceManager E4418Brm = new ResourceManager();
private static Ivi.Visa.Interop.FormattedIO488 E4418B = new FormattedIO488();
private static Ivi.Visa.Interop.IMessage E4418Bmsg = (E4418Brm.Open("GPIB0::13",
Ivi.Visa.Interop.AccessMode.NO_LOCK, 2000, "")as Ivi.Visa.Interop.IMessage);

private static Ivi.Visa.Interop.ResourceManager FGENrm = new ResourceManager();
private static Ivi.Visa.Interop.FormattedIO488 FGEN = new FormattedIO488();
private static Ivi.Visa.Interop.IMessage FGENmsg = (FGENrm.Open("GPIB0::11",
Ivi.Visa.Interop.AccessMode.NO_LOCK, 2000, "")as Ivi.Visa.Interop.IMessage);

public static Ivi.Visa.Interop.IMessage Pmeter
{
get { return E4418Bmsg; }
}
}
}

On an another form I have a button to put the instruments in remote mode. When I click the button both instruments go into remote.
This is the code for the button:

private void button1_Click(object sender, EventArgs e)
{
IMessage E4418B = GPIB.Pmeter;
}

Why do both instruments go into remote when I call GPIB.Pmeter? Thanks for you r help and patience.  

Outcomes