![Agilent Technologies E1465A Скачать руководство пользователя страница 96](http://html.mh-extra.com/html/agilent-technologies/e1465a/e1465a_user-manual_2867810096.webp)
96 Register-Based Programming
Appendix B
Example: Scanning
Channels (C/HP-UX)
This C/HP-UX programming example scans through the bank 0 channels
(closing one switch at a time) and makes measurements between switch
closures. You must insert your own programming code for the measurement
part of this program. For example, if you are using the E1411B, see the
E1326B/E1411B Multimeter User's Manual
for programming examples.
NOTE
The sub ver_time allows time for the switches to close. The program should
print a time around 7 ms. If the time is less, you must change the value of j
in the for loop. For example, instead of 7000, you might need to use 10000.
The math.h include file requires a -lm option when compiling this program.
/******************************************************/
/***
scanning.c
***/
/******************************************************/
#include <time.h>
#include <math.h> /*file to perform math functions*/
#include <sys/vxi.h> /*source file for controller VXI drivers*/
#include <fcntl.h>
#include <stdio.h>
#define logical_address 120 /*logical address of Form C Switch*/
#define lastch 15
int fd, i, j, reg;
double y;
typedef unsigned short word;
typedef struct dev_regs{ /*set up pointers*/
unsigned short id_reg;
unsigned
short
device_type;
unsigned short status_reg;
unsigned short dummy[13];
unsigned short bank0_channels;
} DEV_REGS;
main( )
{
/*open the controller VXI interface*/
fd=open("/dev/vxi/primary",O_RDWR);
if (fd) {
perror("open");
exit(1);
}
/*retrieve the A16 pointers*/
dev=(struct dev_regs*)vxi_get_a16_addr(fd,logical_address);
Continued on next page
Содержание E1465A
Страница 2: ......
Страница 6: ...6 ...
Страница 10: ...10 Notes ...
Страница 12: ...12 Getting Started Chapter 1 Figure 1 1 E1465A 16x16 Relay Matrix Module TERMINAL MODULE MATRIX MODULE A B C D ...
Страница 13: ...Getting Started 13 Chapter 1 Figure 1 2 E1466A 4x64 Relay Matrix Module TERMINAL MODULE MATRIX MODULE A B C D ...
Страница 14: ...14 Getting Started Chapter 1 Figure 1 3 E1467A 8x32 Relay Matrix Module TERMINAL MODULE MATRIX MODULE A B C D ...
Страница 18: ...18 Getting Started Chapter 1 Notes ...
Страница 80: ...80 Matrix Modules Command Reference Chapter 4 Notes ...
Страница 98: ...98 Register Based Programming Appendix B Notes ...