EasyManuals Logo

HP 1670A Series User Manual

HP 1670A Series
108 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 #63 background imageLoading...
Page #63 background image
Example
Programming
the
Logic
Analyzer
To
write
programs
that
open
the
command
parser
socket
To write programs that
open
the command parser
socket
The command parser socket of
the
logic analyzer is 5025.
Connection to the command
parser
socket is, by definition, a control user
connection. Because only one control user connection is allowed, you will
not
be
able
to
open
the
command parser socket
if
someone else is accessing
the
logic analyzer's
file
system
as
the
control user.
The following C program opens a socket and sends
the
*IDN
query command
to
request
the instrument's identity.
#include
<stdio.h>
#include
<sys/types.h>
#include
<sys/socket.h>
#include
<netinet/in.h>
typedef
struct
sockaddr_in
tdSOCKET_ADDR;
#define
PARSER_PORT
5025
#define
SERV_HOST_ADDR
"15
.10.
96
.12"
#define
PARSER_BUFFER_SIZE
100
char
receiveBuffer[PARSER_BUFFER_SIZE],
*cmdString
= {
"*IDN?\r\n"
} ;
main
()
int
sockfd,
port;
tdSOCKET_ADDR
serv_addr;
char
*addr;
/*
Initialize
a
server
socket
*/
port
= PARSER_PORT;
addr
=
SERV_HOST_ADDR
;
serv_addr.sin_family
=
AF_INET;
serv_addr.sin_addr.s_addr
=
inet_addr
(
addr
);
serv_addr.sin_port
=
htons
(port);
5-12

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the HP 1670A Series and is the answer not in the manual?

HP 1670A Series Specifications

General IconGeneral
BrandHP
Model1670A Series
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals