HP (Hewlett-Packard) B Network Router User Manual


 
A24_READ.C
/* A24_READ.C - This program reads the digitizer’s A24 base address. */
/* Include the following header files */
#include <stdio.h>
#include <cfunc.h> /* This file is from the HP-IB Command Library */
#define CMD_MOD 70900L /* I/O path between the digitizer and the Command Module */
/* Function prototypes */
long get_base_addr(void);
/****************************************************************************/
void main(void)
{
long base_addr;/* variable for digitizer A24 base address */
base_addr = get_base_addr(); /* function call to calculate and */
/* return digitizer A24 base address */
printf("\nA24 base address = %ld", base_addr);
}
/****************************************************************************/
long get_base_addr(void)
{
/* base address of (A24) offset register in A16 address space */
long base_addr = (0x1FC000 + (40 * 64)) + 6; /* digitizer logical address is 40 */
float a24offst; /* A24 offset from A16 offset register */
char rd_addr[80]; /* command string variable */
/* Create the command string which reads the A24 base address from the offset register*/
sprintf(rd_addr, "DIAG:PEEK? %ld, %d", base_addr,16);
/* Send DIAG:PEEK? command */
IOOUTPUTS(CMD_MOD, rd_addr, strlen(rd_addr));
/* Read value from offset register */
IOENTER(CMD_MOD, &a24offst);
Continued on Next Page
346 Register Programming Appendix C