EasyManuals Logo

Agilent Technologies E4406A VSA Series User Manual

Agilent Technologies E4406A VSA Series
420 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 #141 background imageLoading...
Page #141 background image
Chapter 3 141
Programming Examples
Using C Programming Over Socket LAN
Using C Programming Over Socket LAN
This is a C programming example (socketio.c) that demonstrates simple
socket programming. It is written in C, and compiles in the HP-UX
UNIX environment, or the WIN32 environment. It is portable to other
UNIX environments with only minor changes.
In UNIX, LAN communication via sockets is very similar to reading or
writing a file. The only difference is the openSocket() routine, which
uses a few network library routines to create the TCP/IP network
connection. Once this connection is created, the standard fread() and
fwrite() routines are used for network communication.
In Windows, the routines send() and recv() must be used, since
fread() and fwrite() may not work on sockets.
The program reads the analyzer's host name from the command line,
followed by the SCPI command. It then opens a socket to the analyzer,
using port 5025, and sends the command. If the command appears to be
a query, the program queries the analyzer for a response, and prints the
response.
This example program can also be used as a utility to talk to your
analyzer from the command prompt on your UNIX workstation or
Windows 95 PC, or from within a script.
This program is also available on your documentation CD ROM.
Example:
/***************************************************************************
* $Header: socketio.c,v 1.5 96/10/04 20:29:32 roger Exp $
* $Revision: 1.5 $
* $Date: 96/10/04 20:29:32 $
*
* $Contributor: LSID, MID $
*
* $Description: Functions to talk to an Agilent E4406A transmitter
* tester via TCP/IP. Uses command-line arguments.
*
* A TCP/IP connection to port 5025 is established and
* the resultant file descriptor is used to "talk" to the
* instrument using regular socket I/O mechanisms. $
*
*
*
* E4406A Examples:
*
* Query the center frequency:
* lanio 15.4.43.5 'sens:freq:cent?'
*

Table of Contents

Other manuals for Agilent Technologies E4406A VSA Series

Questions and Answers:

Question and Answer IconNeed help?

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

Agilent Technologies E4406A VSA Series Specifications

General IconGeneral
BrandAgilent Technologies
ModelE4406A VSA Series
CategoryTest Equipment
LanguageEnglish

Related product manuals