EasyManuals Logo
Home>Agilent Technologies>Inverter>E4428C

Agilent Technologies E4428C Programming Guide

Agilent Technologies E4428C
366 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 #140 background imageLoading...
Page #140 background image
130 Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide
Programming Examples
LAN Programming Interface Examples
Sockets LAN Programming Using PERL
This example uses PERL to control the signal generator over the sockets LAN interface. The signal
generator frequency is set to 1 GHz, queried for operation complete and then queried for it’s identify
string. This example was developed using PERL version 5.6.0 and requires a PERL version with the
IO::Socket library.
1. In the code below, enter your signal generator’s hostname in place of the xxxxx in the code line:
my $instrumentName= “xxxxx”; .
2. Save the code listed below 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
The following program example is available on the signal generator Documentation CD- ROM as
perl.txt.
#!/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 hostname
my $instrumentName = "xxxxx";
# Get socket
$sock = new IO::Socket::INET ( PeerAddr => $instrumentName,
PeerPort => 5025,
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 E4428C

Questions and Answers:

Question and Answer IconNeed help?

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

Agilent Technologies E4428C Specifications

General IconGeneral
BrandAgilent Technologies
ModelE4428C
CategoryInverter
LanguageEnglish

Related product manuals