Example Program
4-37
SR844 RF Lock-In Amplifier
printf (" X Y R Phase \n");
printf (" %14.6E %14.6E %14.6E %14.6E\n", xval, yval, rval, pval);
GetSpace ();
// *******************************************************************
// ***** Fast Data Transfer mode test *****
printf("FastAcqData");
// Acquire and transfer data simultaneously
settimeout (11000); // Turn off timeout for SR844 or set the timeout longer
// than the total acquisition time. The timeout measures
// the time to complete a transfer,
// not the time since the most recent byte is received.
TxSr844("FAST1; STRD");
// Turn FAST mode data transfer ON,
// then start scan using the STRD start acquisition
// after 0.5s.
// The STRD command MUST be used if the data transfer
// is to be started by this program! Do NOT use STRT!
// Take data for 10 seconds and then stop.
// 10 seconds of data at 64 Hz sample rate has
// 640 points.
// Each point consists of X(2 bytes) and Y(2 bytes)
// for a total of 4*(64*10) bytes.
transmit ("MLA TALK 8", &status); // make sr844 the talker right away
j=0;
// total bytes received
for (i=0; i<10; i++) {
// get 64 points (256 bytes) 10 times
rarray ((char *)(128*i),64*4,&nCount,&status);
// rarray receives bytes from the interface and puts them into the
// FastBuf[] array. Each transfer moves 64 points (64*4 bytes).
// The actual number of bytes transferred is in nCount.
printf ("."); j+=nCount;
// update progress to screen, increment total byte count
}
// Depending upon the system, you may need to transfer all
// of the desired points at once
// to avoid missing data between transfers.
// Fast mode will abort if the SR844 finds the host not ready to receive data.
TxSr844("PAUS; FAST0");
// Pause the data storage, turn off FAST mode
settimeout (5000);
// Set timeout shorter again
nPts = j/4;
// Number of points (bytes/4) received
printf("%d bytes.(%d pts).", j, nPts);
if (j==2560) printf ("OK"); else printf ("NOT OK");
// 2560 = 4*(64*10) bytes
// ****** Print first 10 points received ******
GetSr844 ("SENS?"); sens=atoi(recv);
// Get sensitivity setting
printf (".fs=%8.1EV\n",fscale[sens]);
printf (" n X Y R Phase \n");
for (i=0; i<10; i++ ) {
printf ("%3d %14.6E %14.6E %14.6E %14.6E\n", i, xBin(3,i),
xBin(4,i), xBin(1,i), xBin(2,i));
// xBin converts the received integer X and Y data
// into real X, Y, R, phase based upon the sensitivity
}
GetSpace ();
// pause
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...