EasyManuals Logo

Agilent Technologies E8267C Programming Guide

Agilent Technologies E8267C
198 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #108 background imageLoading...
Page #108 background image
102 Chapter 2
Programming Examples
LAN Programming Examples
2. Save the code using the filename lanperl.
3. Run the program by typing perl lanperl at the UNIX term window prompt.
Setting the Power Level and Sending Queries Using PERL
#!/usr/bin/perl
# PROGRAM NAME: perl.txt
# Example of talking to the signal generator via SCPI-over-sockets
#
use IO::Socket;
# Change to your instrument's name
my $instrumentName = "xxxxx";
# Get socket
$sock = new IO::Socket::INET ( PeerAddr => $instrumentName,
PeerPort => 7777,
Proto => 'tcp',
);
die "Socket Could not be created, Reason: $!\n" unless $sock;
# Set freq
print "Setting frequency...\n";
print $sock "freq 1 GHz\n";
# Wait for completion
print "Waiting for source to settle...\n";
print $sock "*opc?\n";
my $response = <$sock>;
chomp $response; # Removes newline from response
if ($response ne "1")
{
die "Bad response to '*OPC?' from instrument!\n";
}

Table of Contents

Other manuals for Agilent Technologies E8267C

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Agilent Technologies E8267C and is the answer not in the manual?

Agilent Technologies E8267C Specifications

General IconGeneral
BrandAgilent Technologies
ModelE8267C
CategoryPortable Generator
LanguageEnglish

Related product manuals