Stanford Research Systems SR850 User Manual page 212

Dsp lock-in amplifier
Table of Contents

Advertisement

Remote Programming
printf("\n\n");
for (i=0;i<10;i++)
printf("%d %e\n",i,rfBuf[i]);
}
void printOutLIAResults(void)
{
/* calculates the first 10 values of R transferred in LIA float format by the SR850 */
int i,mant,exp;
int *ptr;
float val;
printf("\n\n");
ptr =(int *) rfBuf; /* ptr points to integers in rfBuf, not floats! */
for (i=0;i<10;i++) {
mant = *ptr++;
exp
= *ptr++ - 124;
val
= (float) mant * (float) pow(2.0,(double) exp);
printf("%d %e\n",i,val);
}
}
void initGpib(char *devName)
{
if ((lia=ibfind(devName))<0) {
printf("\nCannot Find SR850 \n\a");
exit(1);
}
}
void txLia(char *str)
{
char serPol;
ibwrt(lia,str,strlen(str));
do {
ibrsp(lia,&serPol);
}
while ((serPol&2)==0); /* until the command finishes executing */
}
void setupLiaForSweep(void)
{
txLia("*RST");
txLia("FMOD1;SLLM10.;SULM100.");
txLia("ILIN1");
txLia("SRAT10;SEND0;SLEN100");
txLia("SMOD0");
txLia("DTYP0,3;DTRC0,3");
/* this is simple since the values are already floats */
/* first comes the mantissa (16 bits) */
/* then the binary exponent (16 bits) offset by 124 */
/* now poll for IFC RDY */
/* initialize the lock-in */
/* set single screen */
/* set chart display, 'R' display */
/* set sweep mode and sweep limits */
/* put in the line notch filter */
/* set 64 Hz sample rate, stop at end of scan, 100 second
scan length */
6-36

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents