Programming Manual MSO/UPO2000 Series
146 / 156
Instruments.uni-trend.com
{
var resource = string.Format("TCPIP0::{0}::inst0::INSTR", ip);
var mbSession = (MessageBasedSession)rmSession.Open(resource);
mbSession.RawIO.Write("*IDN?\n");
System.Console.WriteLine(mbSession.RawIO.ReadString());
}
catch (Exception ex)
{
System.Console.WriteLine(ex.Message);
}
}
}
void Main(string[] args)
{
tcp_ip_test("192.168.20.11");
}
}
VB
Example
Environment: Window systm, Microsoft Visual Basic 6.0.
Description: Access the instrument via USBTMC and TCP/IP, and send "*IDN?" command on NI-VISA
to query the device information.
Steps
:
1.
Open Visual Basic software and create a new standard application program project.
2.
Set the project environment that can adjust NI-VISA libray, press Existing tab of Project>>Add
Existing Item, in file "include" of NI-VISA installement path to find file visa32.bas and add this file,
as shown in the following figure.
3.
Source code: