Example Program
4-39
SR844 RF Lock-In Amplifier
test=1; GetSpace ();
}
else printf ("2.",nCount);
// CH2 ok
if (test==0) printf ("OK");
// All transfers finished 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);
// Get string from SR844
strcpy (rAscBuf[i], recv);
// Copy to string array rAscBuf
sprintf (cmd, "TRCA?2,%d,1", i); // (CH2, starting with bin i, 1 point)
GetSr844 (cmd);
// Get string from SR844
strcpy (pAscBuf[i], recv);
// Copy to string array rAscBuf
}
printf ("\n");
// ****** Print first 10 points ******
// for Ch1
printf ("CH1: n ASCII IEEE LIA\n");
for (i=0; i<10; i++ ) {
printf (" %3d %14s %14.6E %14.6E\n", i, rAscBuf[i], rfBuf[i],
xLIA(1,i) );
// xLIA translates LIA float format into IEEE floating point.
// Data in rfBuf is already IEEE floats.
}
// for Ch2
printf ("CH2: n ASCII IEEE LIA\n");
for (i=0; i<10; i++ ) {
printf (" %3d %14s %14.6E %14.6E\n", i, pAscBuf[i], pfBuf[i],
xLIA(2,i) );
}
GetSpace ();
// pause
TxSr844 ("REST");
// Reset scan, clear buffers
}
// ************************************************************************
// 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);
// send() is the CEC routine to send
// a string to and address.
// Sets status=0 if result is ok.
if (status != 0) {
// Handle transmit errors here
printf ("\nCommand = %s\n", command);
printf ("Error at device %d : status = %d\n", address, status);
GetSpace ();
}
}
Summary of Contents for SR844
Page 10: ...viii SR844 RF Lock In Amplifier...
Page 12: ...1 2 Getting Started SR844 RF Lock In Amplifier...
Page 32: ...2 2 SR844 Basics SR844 RF Lock In Amplifier...
Page 60: ...3 2 Operation SR844 RF Lock In Amplifier...
Page 102: ...3 44 Shift Functions SR844 RF Lock In Amplifier...
Page 108: ...4 6 Index of Commands SR844 RF Lock In Amplifier...
Page 144: ...4 42 Example Program SR844 RF Lock In Amplifier...
Page 146: ...5 2 Performance Tests SR844 RF Lock In Amplifier...
Page 150: ...5 6 Performance Tests SR844 RF Lock In Amplifier...
Page 156: ...5 12 Performance Tests SR844 RF Lock In Amplifier...
Page 158: ...5 14 Performance Tests SR844 RF Lock In Amplifier...
Page 162: ...5 18 Performance Tests SR844 RF Lock In Amplifier...
Page 166: ...5 22 SR844 Test Record SR844 RF Lock In Amplifier...
Page 168: ...6 2 Circuitry Parts Lists and Schematics SR844 RF Lock In Amplifier...
Page 246: ...Parts Lists SR844 RF Lock In Amplifier 6 80 Schematic Diagrams...