Stanford Research Systems SR844 User Manual page 141

Rf lock-in amplifier
Table of Contents

Advertisement

test=1; GetSpace ();
}
else printf ("2.",nCount);
if (test==0) printf ("OK");
// ****** Read first 10 points in ASCII ******
printf(".ASCII.", nPts);
for (i=0; i<10; i++) {
sprintf (cmd, "TRCA?1,%d,1", i); // (CH1, starting with bin i, 1 point)
GetSr844 (cmd);
strcpy (rAscBuf[i], recv);
sprintf (cmd, "TRCA?2,%d,1", i); // (CH2, starting with bin i, 1 point)
GetSr844 (cmd);
strcpy (pAscBuf[i], recv);
}
printf ("\n");
// ****** Print first 10 points ******
// for Ch1
printf ("CH1:
for (i=0; i<10; i++ ) {
printf ("
// xLIA translates LIA float format into IEEE floating point.
// Data in rfBuf is already IEEE floats.
}
// for Ch2
printf ("CH2:
for (i=0; i<10; i++ ) {
printf ("
}
GetSpace ();
TxSr844 ("REST");
}
// ************************************************************************
// Subroutines
// ************************************************************************
void TxGpib (int address, char *command) {
// Routine to transmit the string command to a GPIB address.
// Modify this routine for your GPIB interface.
send (address, command, &status);
if (status != 0) {
// Handle transmit errors here
printf ("\nCommand = %s\n", command);
printf ("Error at device %d : status = %d\n", address, status);
GetSpace ();
}
}
// CH2 ok
// All transfers finished ok
n
ASCII
%3d
%14s
%14.6E
xLIA(1,i) );
n
ASCII
%3d
%14s
%14.6E
xLIA(2,i) );
// pause
// Reset scan, clear buffers
// a string to and address.
// Sets status=0 if result is ok.
Example Program 4-39
// Get string from SR844
// Copy to string array rAscBuf
// Get string from SR844
// Copy to string array rAscBuf
IEEE
LIA\n");
%14.6E\n", i, rAscBuf[i], rfBuf[i],
IEEE
LIA\n");
%14.6E\n", i, pAscBuf[i], pfBuf[i],
// send() is the CEC routine to send
SR844 RF Lock-In Amplifier

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents