
Chapter 3
155
Programming Examples
Using C Programming Over Socket LAN (Windows NT)
Using C Programming Over Socket LAN
(Windows NT)
This is a C programming example (getopt.c) that demonstrates simple
socket programming. It is written in C, and compiles in the Windows
NT environment.
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 Windows NT PC, or from
within a script.
Содержание E4406A VSA Series
Страница 4: ...4 ...
Страница 59: ...59 2 Programming Fundamentals ...
Страница 76: ...76 Chapter2 Programming Fundamentals Using the Instrument Status Registers Overall Status Register System ...
Страница 124: ...124 Chapter2 Programming Fundamentals Using the LAN to Control the Analyzer ...
Страница 125: ...125 3 Programming Examples ...
Страница 164: ...164 Chapter3 Programming Examples Using Java Programming Over Socket LAN ...
Страница 165: ...165 4 Programming Command Cross References ...
Страница 379: ...379 6 Error Messages ...
Страница 412: ...412 Chapter6 Error Messages Error Message Descriptions ...