Stanford Research Systems SR810 Manual page 102

Dsp lock-in amplifier
Table of Contents

Advertisement

Remote Programming
void
setupLia(void);
void
printOutBinaryResults(void);
void
printOutIEEEResults(void);
void
printOutLIAResults(void);
/* National Instruments Interface Function Prototypes (488.1 Calls - see the National software manual).
These are declared in "decl.h"
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[660*2];
float
rfBuf[1000];
void main(int argc, char *argv[])
{
int
nPts,i;
char
tstr[20];
if (argc<2) {
printf("\nUsage: liatest <devName>\n");
exit(1);
}
else
initGpib(SR810);
txLia("OUTX1");
setupLia();
printf("\nAcquiring Data\n");
ibtmo(lia,0);
txLia("FAST2;STRD");
/* take data for 10 seconds and then stop */
ibrd(lia,(char *)rxBuf,2564L);
of
i=(int)ibcnt;
txLia("PAUS");
printOutBinaryResults();
/* SR810 handle */
/* FAST mode data buffer */
/* Floating point data buffer */
/* Set the SR810 to output responses to the GPIB port */
/* Setup the SR810 */
/* turn off timeout for lia or set the timeout longer than the scan (10 seconds).
The timeout measures the time to transfer the FULL number of bytes, not the
time since the most recent byte is received.*/
/* Turn FAST mode data transfer ON, then start scan using the STRD start
after delay command. The STRD command MUST be used if the scan is to
be started by this program! Do NOT use STRT. */
10 seconds of data at 64 Hz sample rate has 64*10 + 1
points, each point consists of X (2 bytes) and Y (2 bytes) for a total
4*(64*10+1) = 2564 bytes. */
/* save total number of bytes read */
/* pause the data storage so no new points are taken */
/* format and print the results */
/* get FAST mode data for 10 seconds.
5-28

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents