Stanford Research Systems SR844 User Manual page 139

Rf lock-in amplifier
Table of Contents

Advertisement

printf ("
X
printf ("
%14.6E
GetSpace ();
// *******************************************************************
// ***** Fast Data Transfer mode test *****
printf("FastAcqData");
settimeout (11000); // Turn off timeout for SR844 or set the timeout longer
TxSr844("FAST1; STRD");
transmit ("MLA TALK 8", &status); // make sr844 the talker right away
j=0;
for (i=0; i<10; i++) {
rarray ((char *)(FastBuf+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");
settimeout (5000);
nPts = j/4;
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);
printf (".fs=%8.1EV\n",fscale[sens]);
printf ("
n
X
for (i=0; i<10; i++ ) {
printf ("%3d
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 ();
Y
%14.6E
%14.6E
// Acquire and transfer data simultaneously
// than the total acquisition time. The timeout measures
// the time to complete a transfer,
// not the time since the most recent byte is received.
// 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.
// total bytes received
// get 64 points (256 bytes) 10 times
// Pause the data storage, turn off FAST mode
// Set timeout shorter again
// Number of points (bytes/4) received
Y
%14.6E
%14.6E
// pause
Example Program 4-37
R
%14.6E\n", xval, yval, rval, pval);
// Get sensitivity setting
R
%14.6E
%14.6E\n", i, xBin(3,i),
SR844 RF Lock-In Amplifier
Phase \n");
Phase \n");

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents