1-9 Ethernet LAN TCP/IP Requirements and Setup
General GPIB Information
1-22
PN: 10370-10374 Rev. F
MG369xC GPIB PM
Ethernet Control Example in C# Programming using NI VISA
//Ethernet control example in C# programming using National Instruments Visa
using
System;
using
System.Collections.Generic;
using
System.Text;
using
System.IO;
using
NationalInstruments.VisaNS;
using
System.Threading;
namespace
AutoTriggerSweepButton
{
class
Program
{
static void
Main(
string
[] args)
{
String
TcpIpResourceName =
"TCPIP::172.26.203.104::inst0::INSTR"
;
//
string
responseString =
null
;
NationalInstruments.VisaNS.MessageBasedSession mbSession =
null
;
try
{
mbSession =
(MessageBasedSession)ResourceManager.GetLocalManager().Open(TcpIpResourceName);
mbSession.Write(
"*IDN?"
);
Console
.WriteLine(
"The Instrument ID is:"
);
responseString = mbSession.ReadString();
Console
.WriteLine(responseString);
mbSession.Write(
"INITiate:CONTinuous OFF"
);
mbSession.Write(
"TRIGger:SOURce IMMediate"
);
mbSession.Write(
"FREQuency:MODE SWEep1"
);
mbSession.Write(
"SWEep1:GENeration STEPped"
);
mbSession.Write(
"FREQuency:STARt 3 GHz"
);
mbSession.Write(
"FREQUency:STOP 4 GHz"
);
mbSession.Write(
"SWEep1:POINts 101"
);
mbSession.Write(
"SWEep1:DWELl 1 ms"
);
mbSession.Write(
"INITiate:CONTinuous ON"
);
// Delay to allow some sweeps to occur.
Note
NI is a trademark of the National Instruments Corporation.
Summary of Contents for MG369 C Series
Page 2: ......
Page 6: ...Contents 4 PN 10370 10374 Rev F MG369xC GPIB PM ...
Page 262: ...A 34 PN 10370 10374 Rev F MG369xC GPIB PM ...
Page 264: ...Index 2 PN 10370 10374 Rev F MG369xC GPIB PM ...
Page 265: ......