Example Program - Stanford Research Systems SR810 Manual

Dsp lock-in amplifier
Table of Contents

Advertisement

EXAMPLE PROGRAM 1

Using Microsoft C (v5.1) with the National Instruments GPIB card on the IBM PC.
To successfully interface the SR810 to a PC via the GPIB interface, the instrument, interface card, and
interface drivers must all be configured properly. To configure the SR810, the GPIB address must be set
using the [Setup] key. The default GPIB address is 8; use this address unless a conflict occurs with other
instruments in your system. The SR810 will be set to GPIB address 8 whenever a reset is performed (power
on with the [Setup] key down).
Make sure that you follow all the instructions for installing the GPIB card. The National Instruments card
cannot be simply unpacked and put into your computer. To configure the card you must set jumpers and
switches on the card to set the I/O address and interrupt levels. You must run the program "IBCONF" to
configure the resident GPIB driver for you GPIB card. Please refer to the National Instruments manual for
information. In this example, the following options must be set with IBCONF:
Device name:
Device address:
Terminate Read on EOS:
Once all the hardware and GPIB drivers are configured, use "IBIC". This terminal emulation program allows
you to send commands to the SR810 directly from your computer's keyboard. If you cannot talk to the SR810
via "IBIC", then your programs will not run. Use the simple commands provided by National Instruments. Use
"IBWRT" and "IBRD" to write and read from the SR810. After you are familiar with these simple commands,
you can explore more complex programming commands.
/*******************************************************************************************************/
/*
Example program using Microsoft C V5.1 and the National Instruments GPIB card.
Connect the Sine Out to the A Input with a BNC cable.
Run this program by typing the program name followed by a space and the device name.
The device name is the name used in IBCONF to configure the National Instruments driver.
For example, if the program is called LIATEST and the above configuration is used,
then type LIATEST LIA.
Binary X and Y data will be transferred for 10 seconds to the PC using the FAST transfer command.
After the fast transfer is complete, the existing magnitude (R) data in the data buffer will be transferred in
IEEE floating point format as well as the LIA non-normalized floating point format (faster transfer) */
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "decl.h"
#define SR810 argv[1]
/* function prototypes */
void
main(int, char *[]);
void
txLia(char *);
void
initGpib(char *);
LIA
8
No (for binary transfers)
5-27
Remote Programming

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents