Stanford Research Systems SR844 User Manual page 137

Rf lock-in amplifier
Table of Contents

Advertisement

// ************************************************************************
// Example program using Microsoft C v7.0 and
// the Capital Equipment Corp CEC488 interface card.
// To use another interface card, modify the GPIB subroutines
// where indicated.
// The SR844 is assumed to be at address 8 (default).
// Link this object file with ieee488.lib provided by CEC
// (or the library for your GPIB card).
// ************************************************************************
// Connect the REF OUT to the SIGNAL IN
// ************************************************************************
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
#include <math.h>
#include <ieee-c.h>
// ************************************************************************
#define
sr844 8
int
status, length;
char
recv[80];
char
cmd[80];
int
FastBuf[1600];
int
rLiaBuf[1600];
int
pLiaBuf[1600];
float rfBuf[800];
float pfBuf[800];
char
rAscBuf[10][20];
char
pAscBuf[10][20];
double fscale[15] = {1.0E-7, 3.0E-7, 1.0E-6, 3.0E-6, 1.0E-5, 3.0E-5, 1.0E-4, 3.0E-4,
int
sens;
// ************************************************************************
// Subroutines at the end of this listing
// ************************************************************************
// GPIB interface subroutines
// You may need to modify these for your interface card!
void TxGpib (int, char *);
void GetGpib (int);
void TxSr844 (char *);
void GetSr844 (char *);
void WaitIFC (void);
// ************************************************************************
void GetSpace (void);
double xLIA (int,int);
double xBin (int,int);
// This is the CEC header file
// Use the .h file for your interface card.
// send(), enter(), transmit(), rarray(), tarray(),
// spoll(), initialize(), settimeout() are routines
// defined in ieee-c.h.
// address of SR844
// CEC routines use these
// global GPIB receive string
// global GPIB command string
// Fast Transfer Mode buffer (2 ints per point, X&Y)
// LIA float buffer (ch1) (2 ints per point)
// LIA float buffer (ch2) (2 ints per point)
// IEEE binary buffer (ch1) (1 float per point)
// IEEE binary buffer (ch2) (1 float per point)
// ASCII string buffer (ch1)
// ASCII string buffer (ch2)
1.0E-3, 3.0E-3, 1.0E-2, 3.0E-2, 1.0E-1, 3.0E-1, 1.0};
// array of full scale sensitivities in Volts
// sensitivity number [0-14]
// transmit string to device
// receive string from device
// transmit string to SR844, wait for IFC
// transmit query string to SR844 (wait for IFC),
// and get receive string
// wait for IFC status in SR844 (command complete)
// pause and wait for space bar
// translate LIA float data to real values
// translate IEEE binary data
Example Program 4-35
SR844 RF Lock-In Amplifier

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents