99
99
Program Examples
/* Example program using Microsoft C V5.1 and the National Instruments GPIB card */
/* This program assumes that a TTL trigger source is connected to the TRIGGER input */
/* This program assumes that the SR430 is installed as device "mcs" using IBCONF */
#include<stdio.h>
#include<dos.h>
#include<conio.h>
#include<stdlib.h>
#include"decl.h"
/* National Instruments Header File */
void main(void);
int
ibfind(char *);
/* Function Prototypes for GPIB Calls */
void
ibwrt(int,char *,int);
void
ibrd(int,char *,int);
void
ibrda(int,char *,int);
void
ibwait(int,int);
void
ibstop(int);
void
ibrsp(int,int *);
void main(void)
{
int i;
int sr430;
int sp;
int buff[2000];
char tstr[20];
IBM PC, Microsoft C V5.1 using the National Instruments GPIB interface.
To successfully interface the SR430 to a PC via the GPIB interface, the instrument, interface card, and inter-
face drivers must all be configured properly. To configure the SR430, the GPIB address must be set in the
SETUP menu. The default GPIB address is 8; use this address unless a conflict occurs with other instruments
in your system. The SR430 will be set to GPIB address 8 whenever a reset is performed (power on with the
[CLR] key down).
Make sure that you follow all the instructions for installing the GPIB card. The National Instruments card can-
not be simply unpacked and put into your computer. To configure the card you must set jumpers and switches
on the card to set the I/O address and interrupt levels. You must run the program "IBCONF" to configure the
resident GPIB driver for you GPIB card. Please refer to the National Instruments manual for information. In
the example below, the SR430 is installed as a device named "mcs".
Once all the hardware and GPIB drivers are configured, use "IBIC". This terminal emulation program allows
you to send commands to the SR430 directly from your computer's keyboard. If you cannot talk to the SR430
via "IBIC", then your programs will not run.
Use the simple commands provided by National Instruments. Use "IBWRT" and "IBRD" to write and read from
the SR430. After you are familiar with these simple commands, you can explore more complex programming
commands.
Binary Transfer Speed
The example program uses the BINB? binary data dump command to transfer data from the SR430 to the
PC. Using a 12 MHz AT, a 16k record takes 0.8 second to transfer to the PC.
Содержание SR430
Страница 2: ......
Страница 6: ...4 ...
Страница 22: ...20 Guide To Operation ...
Страница 26: ...24 Guide To Operation ...
Страница 36: ...34 Mode Menu ...
Страница 54: ...52 Save Menu ...
Страница 60: ...58 Recall Menu ...
Страница 70: ...68 Plot Menu ...
Страница 74: ...72 Test Menu ...
Страница 76: ...74 Info Menu ...
Страница 97: ...96 Remote Programming ...
Страница 99: ...98 98 Program Examples ...
Страница 107: ...106 106 Test and Calibration ...
Страница 113: ...112 112 Using Photomultiplier Tubes ...
Страница 125: ...124 124 124 Circuit Description ...