To Write Programs That Open The Command Parser Socket - HP 16500L Installation And Service Manual

Interface module
Table of Contents

Advertisement

Programming the HP 16500B

To write programs that open the command parser socket

To write programs that open the command parser
socket
If you are programming in C, open the HP 16500B command parser
socket and send programming commands to it.
The HP 16500B command parser socket port identification number 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 HP 16500B's file system as the control user.
Example
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
#define SERV_HOST_ADDR
#define PARSER_BUFFER_SIZE
char
main ()
{
5-12
receiveBuffer[PARSER_BUFFER_SIZE],
*cmdString = { "*IDN?\r\n" };
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 );
5025
"15.10.96.12"
100

Advertisement

Table of Contents
loading

Table of Contents