REMOTE PROGRAMMING
4-12
EXAMPLE PROGRAM 1
Using Microsoft C with the National Instruments GPIB card on the IBM PC.
To successfully interface the SR715/720 to a PC via the GPIB interface, the instrument, interface card, and
interface drivers must all be configured properly. To configure the SR715/720, the GPIB address must be set
using the switches SW2 on the rear panel.
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:
SR715/720
Device address:same as
SR715/720 switch settings
EOS character:
0AH (linefeed)
Terminate Read on EOS:
Yes
Once all the hardware and GPIB drivers are configured, use "IBIC". This terminal emulation program allows
you to send commands to the SR715/720 directly from your computer's keyboard. If you cannot talk to the
SR715/720 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 SR715/720. After you are familiar with these simple commands, you can explore more complex
programming commands.
/
************************************************************************************
/
/
*
Program to measure capacitance values with the LCR and read them using a National Instruments AT-GPIB
card. Internal bias is selected for C measurements (e.g. for electrolytic caps) so proper polarity must be
observed to avoid capacitor damage.
This program is written in Microsoft C version 5.1. Compile with \AL\c and link with the MCIB.OBJ module
supplied by National Instruments.
The LCR meter should be installed as device "SR720" using IBCONF.
*
/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <decl.h>
/
*
supplied by National Instruments in AT-GPIB package
*
/
/
*
function prototype
*
/
void main (void);
void main (void)
{
int lcr, bin;
char
string[80];
double cmeas, dissp;
if ((lcr = ibfind("720")) <=0) /
*
locate the lcr meter for communications
*
/
{
printf ("? No LCR meter connected ?\n");