Stanford Research Systems SR830 Manual page 109

Dsp lock-in amplifier
Table of Contents

Advertisement

Remote Programming
void
main(int, char *[]);
void
txLia(char *);
void
initGpib(char *);
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(SR830);
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);
i=(int)ibcnt;
/* SR830 handle */
/* FAST mode data buffer */
/* Floating point data buffer */
/* Set the SR830 to output responses to the GPIB port */
/* Setup the SR830 */
/* 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. */
/* get FAST mode data for 10 seconds.
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 of
4*(64*10+1) = 2564 bytes. */
/* save total number of bytes read */
5-26

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents