Programming Manual MSO/UPO2000 Series
145 / 156
Instruments.uni-trend.com
to query the device information.
Steps
:
1.
Open Visual Studio software and create a new C# console project.
2.
Add C# quote Ivi.Visa.dll and NationalInstruments.Visa.dll of VISA.
3.
Source code:
a)
USBTMC
Example
class Program
{
void usbtmc_test()
{
using (var rmSession = new ResourceManager())
{
var resources = rmSession.Find("USB?*INSTR");
foreach (string s in resources)
{
try
{
var mbSession = (MessageBasedSession)rmSession.Open(s);
mbSession.RawIO.Write("*IDN?\n");
System.Console.WriteLine(mbSession.RawIO.ReadString());
}
catch (Exception ex)
{
System.Console.WriteLine(ex.Message);
}
}
}
}
void Main(string[] args)
{
usbtmc_test();
}
}
b)
TCP/IP
Example
class Program
{
void tcp_ip_test(string ip)
{
using (var rmSession = new ResourceManager())
{
try