Quantcast
Channel: Instrument Control (GPIB, Serial, VISA, IVI) topics
Viewing all articles
Browse latest Browse all 5566

Failed to to GPIB address

$
0
0

Hello guys! I am trying to write a C# program to communicate with my Yokogawa multimeter,

I have NI Visa (version 2022 Q3) and Ni488.2 (version 21.5.0)  installed

My Visa resource name for this device is : GPIB0::1::INSTR

 

here is my C# code,

 

using System;
using System.Threading;
using System.Windows;
using NationalInstruments.Visa;

namespace GPIB_DMM_voltage
{
class program {


static void Main(string[] args)
{

try
{

var session = (Ivi.Visa.IMessageBasedSession)Ivi.Visa.GlobalResourceManager.Open("GPIB0::01::INSTR");
session.FormattedIO.WriteLine("*IDN?");
string idName = session.FormattedIO.ReadLine();

Console.WriteLine($"*IDN?) = {idName}");
session.Dispose();
session = null;

}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}

Console.WriteLine("press entrer key to end");
Console.ReadLine();

 

}
}
}

 

But when I ran it, it is giving me this error.

KevinSu66_0-1659385956531.png

 

 

Anyone know why? please help! and thank you guys!!

 


Viewing all articles
Browse latest Browse all 5566

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>