Agilent Technologies 1660C Series User Manual page 60

Lan
Table of Contents

Advertisement

Programming the Logic Analyzer
To write programs that open \system\program
Example
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)
{
}
int getstr(FILE *file, char *str)
{
}
void main()
{
/* Send a query and retrieve and print the response */
/* Send command strings to the logic analyzer */
5-10
fwrite(str, strlen(str), 1, file);
return(fread(str, 1, STR_LEN, file));
FILE *file;
int num;
char receive_str[STR_LEN];
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(1);
file = fopen("/logic/system/program", "r");
while (getstr(file, receive_str) == 0);
fclose(file);
printf("%s\n", receive_str);
file = fopen("/logic/system/program", "w");
putstr(file, "*rst\n");
putstr(file, ":sel 1\n");

Advertisement

Table of Contents
loading

This manual is also suitable for:

1660 cs series1670a series

Table of Contents