SRS Labs SR850 Computer Hardware User Manual


 
6-39
Remote Programming
EXAMPLE PROGRAM 2
Using Microsoft QUICKBASIC (v4.5) with the National Instruments GPIB
card on the IBM PC.
To successfully interface the SR850 to a PC via the GPIB interface, the instrument, interface card, and inter-
face drivers must all be configured properly. To configure the SR850, the GPIB address must be set in the
SYSTEM SETUP menu. The default GPIB address is 8; use this address unless a conflict occurs with other
instruments in your system. The SR850 will be set to GPIB address 8 whenever a reset is performed (power
on with the [<-] 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 con-
figure the resident GPIB driver for you GPIB card. Please refer to the National Instruments manual for infor-
mation. In this example, the following options must be set with IBCONF:
Device name: LIA
Device address: 8
Terminate Read on EOS: No (For binary transfers)
Once all the hardware and GPIB drivers are configured, use "IBIC". This terminal emulation program allows
you to send commands to the SR850 directly from your computer's keyboard. If you cannot talk to the SR850
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 SR850. After you are familiar with these simple commands,
you can explore more complex programming commands.
Link with the National Basic Library (see the National software manual for more information on making
QuickBasic libraries.)
' ***********************************************************************************************************************
' QuickBASIC 4.0/4.5 SR850 Example Program
'
' The program assumes that a device has been initialized with the device name "LIA"
' The device name is the name used in IBCONF to configure the National Instruments driver.
' Connect the Sine Out to the A Input with a BNC cable.
' The program will configure the SR850 to sweep the internal oscillator from 10 to 100 Hz in 100 seconds.
' The line notch (50/60 Hz) filter will be engaged. As the frequency is swept, the response of the notch filter
' is graphed.
' Binary X and Y data will be transferred to the PC during the sweep using the FAST transfer command.
' After the sweep is complete, the existing magnitude (R) data in the data buffer will be transferred in ASCII
' format as well as the LIA non-normalized floating point format (faster transfer).
' IEEE floating point format can not be used in BASIC since BASIC does not use this format.
' use the National Instruments include file
REM $INCLUDE: 'qbdecl4.bas'
DECLARE SUB TXLIA (LIA%, SND$)
DECLARE SUB FINDERR ()