Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

GPIB in C# using NI VISA

In trying to use the Tutorial example for C# .Net Instrument Control Tutorial:http://zone.ni.com/devzone/cda/tut/p/id/2739

 

My Code snippet is as follows:

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//using System.Resources;
using NationalInstruments.VisaNS;

namespace ProjectInterfaces
{
    public class GPIB
    {

        private MessageBasedSession mbSession;
        private static string myGPIBDevice = "GPIB::03::INSTR";

        public void GPIB_Init()
        {
            mbSession = (MessageBasedSession)ResourceManager.GetLocalManager();
            Open(myGPIBDevice);
        }
    }
}

 

 

I get the following errors:

Error    3    Cannot convert type 'NationalInstruments.VisaNS.ResourceManager' to 'NationalInstruments.VisaNS.MessageBasedSession'  
Error    4    The name 'Open' does not exist in the current context  

 

What am I missing?

0 Kudos
Message 1 of 2
(5,533 Views)

Never mind I found the problem.  used a ";" instead of "." on the line.

0 Kudos
Message 2 of 2
(5,532 Views)