Stanford Research Systems SR850 User Manual page 210

Dsp lock-in amplifier
Table of Contents

Advertisement

Remote Programming
/* function prototypes */
void main(int, char *[]);
void txLia(char *);
void initGpib(char *);
void setupLiaForSweep(void);
void printOutBinaryResults();
void printOutIEEEResults();
void printOutLIAResults();
/* National Instruments Interface Function Prototypes (488.1 Calls - see the National software manual).*/
int
ibfind(char*);
void ibwrt(int,char *,int);
void ibrd(int,char *,unsigned long);
void ibrsp(int,char *);
void ibeos(int,int);
void ibtmo(int,int);
/* global variables */
int
lia;
int
rxBuf[6600*2];
float rfBuf[6600];
void main(int argc, char *argv[])
{
int i,x,y,nPts;
int *ptr;
char tstr[20];
if (argc<2) {
printf("\nUsage: liatest <devName>\n");
exit(1);
}
else
initGpib(SR850);
txLia("OUTX1");
setupLiaForSweep();
printf("\nAcquiring Data\n");
ibtmo(lia,0);
txLia("FAST2;STRD"); /* Turn FAST mode data transfer ON, then start scan using the STRD start
ibrd(lia,(char *)rxBuf,6401L*4L);
/* SR850 handle */
/* FAST mode data buffer */
/* Floating point data buffer */
/* Set the SR850 to output responses to the GPIB port */
/* Setup the SR850 sweep */
/* turn off timeout for lia or set the timeout longer than the scan. The timeout
measures the time to transfer the full number of bytes, not the time since the
most recent byte is received.*/
after delay command. The STRD command MUST be used if the scan is to be
started by this program! Do NOT use STRT. */
/* get FAST mode data.
The 100 sec sweep at 64 Hz has 64*100 + 1 points, each point
consists of X (2 bytes) and Y (2 bytes) for a total of 4 bytes. */
6-34

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents