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 #61 background imageLoading...
Page #61 background image
Example
Programming
the
Logic
Analyzer
To
write
programs
that
open
\sys
tern
\program
Programming
the
logic
analyer
within
a C program
The following example in C
opens
the
\system\program
file and sends
several commands and queries.
#include
<stdio.h>
#include
<unistd.h>
#define
STR_LEN
80
void
putstr(FILE
*file,
char
*str)
{
fwrite(str,
strlen(str),
1,
file);
int
getstr(FILE
*file,
char
*str)
return(fread(str,
1,
STR_LEN,
file));
void
main()
{
FILE
*file;
int
num;
char
receive_str[STR_LENJ;
/*
Send
a
query
and
retrieve
and
print
the
response
*/
file
=
fopen
("/logic/system/program",
"r");
while
(getstr(file,
receive_str)
==
0);
fclose
(file);
file=
fopen("/logic/system/program",
"w");
putstr(file,
"*idn?\n");
fclose
(file);
sleep(l);
file=
fopen("/logic/system/program",
"r");
while
(getstr(file,
receive_str)
==
0);
fclose
(file);
printf("%s\n",
receive_str);
/*
Send
command
strings
to
the
logic
analyzer
*/
file=
fopen("/logic/system/program",
"w");
putstr(file,
"*rst\n");
putstr(file,
":sel
1\n");
5-10

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