background image

13

The following are examples of programs which communicate with the SR640 in a variety of
languages over both RS232 and GPIB. In each case, the program does the same thing: Set the
channel 1 pregain to 10 db, the Channel 2 postgain to 20 db, and read the value of the channel
1 cutoff frequency.  Once the basics of writing to and reading from the SR640 are mastered,
the task of programming is reduced to simply finding the appropriate command from the
command list.

Pr ogr am Exampl e 1
I BM PC, BASI C, vi a RS232

In this example, the IBM PC's COM2: serial port is used to communicate with the SR640.  Note
that a "straight through" RS232 cable (NOT a null modem cable) should be used to connect the
PC to the SR640. The SR640 should be set to operate at 9600 baud, 8 bits, no parity.

10'Example program for the SR640 filter using IBM BASIC over the COM2: port
20'
30'Open the COM2: port for 9600, 8 bits, no parity, ignore handshake
40 OPEN "COM2:9600,N,8,2,CS,DS,CD" AS #1
50'
60' Clear COM2 port
70 PRINT #1,"  "
80' Set channel 1 pregain and postgain
90 PRINT #1,"PREG1,1;PSTG2,2"
100 'Now read channel 1 cutoff frequency
110 PRINT #1, "FREQ?1"
120 INPUT #1, FREQ

'read answer

130 PRINT "frequency = ",FREQ
140 STOP

Pr ogr am Exampl e 2
I BM PC, Mi cr osof t FORTRAN, Nati onal  I nstr uments GPI B Car d

Please refer to the "Guide to Programming" section for additional information on using the
National Instruments GPIB card.  The GPIB.COM driver must be configured with IBCONF before
using the National Instruments cards.

c example program for the SR620 using Microsoft FORTRAN and National Instruments GPIB
card
c compile with /FPa /AL and link with MFIBL.OBJ (supplied by National Instruments)

$storage:2

c this line must be in the source file

common /ibglob/ibsta,iberr,ibcnt
integer sr640

PR OG RAMMING  EXAMPLES

Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

Summary of Contents for SR640 Series

Page 1: ...service in house repair center WE BUY USED EQUIPMENT Sell your excess underutilized and idle used equipment We also offer credit for buy backs and trade ins www artisantg com WeBuyEquipment REMOTE IN...

Page 2: ...2 99 Notice The information described in this manual pertains to the SR640 dual channel low pass filter the SR645 dual channel high pass filter and the SR650 low pass high pass filter The manual refer...

Page 3: ...ith the SR640 9 Configuration Switches 9 Command Syntax 9 RS 232 Echo 9 COMMAND LIST Filter Commands 11 Status and Interface Commands 12 PROGRAMMING EXAMPLES Basic 13 FORTRAN 13 C 14 INSTRUMENT DESCRI...

Page 4: ...2 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...

Page 5: ...lever back into its normal position and insert the correct fuse into the fuse holder LINE FUSE Verify that the correct line fuse is installed before connecting the line cord For 100V 120V use a 1 Amp...

Page 6: ...4 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...

Page 7: ...0 FILTER SPECIFICATIONS Frequency Range 1Hz to 100 kHz with 3 digit resolution Type 8 pole 6 zero elliptic Rolloff 115 dB octave Passband Ripple 0 1 dB pk pk typical Stopband Attenuation 80 dB typical...

Page 8: ...6 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...

Page 9: ...channel may be changed using the frequency increment and decrement buttons to the right of the dis play When one of these buttons is pressed the displayed frequency will begin scrolling up or down Not...

Page 10: ...L button resets the display to the actual filter frequency If the SR640 has been placed in the REMOTE mode by a command from the computer interface press ing the CLR LOCAL button will return the unit...

Page 11: ...nt to the SR640 may be sent in either UPPER or lower case A command to the SR640 consists of 4 ASCII characters followed by an optional question mark character followed by a list of arguments separ at...

Page 12: ...e refer to the National Instruments manuals for complete details Once all the hardware and software has been con figured properly try using the IBIC program sup plied with the National Instruments car...

Page 13: ...The INVT command inverts the output signal with respect to the input n 1 or leaves it uninverted n 0 LOCL n The LOCL command sets the local remote mode of the instrument Allowed values are n mode 0 l...

Page 14: ...the byte returned by the SR640 when it is serial polled via the GPIB interface It may also be queried using the STB command SRE n The SRE command sets the service request en able byte to the value spe...

Page 15: ...ver the COM2 port 20 30 Open the COM2 port for 9600 8 bits no parity ignore handshake 40 OPEN COM2 9600 N 8 2 CS DS CD AS 1 50 60 Clear COM2 port 70 PRINT 1 80 Set channel 1 pregain and postgain 90 PR...

Page 16: ...format bn f14 0 write answer stop end Pr ogr am Exampl e 3 I BM PC Mi cr osof t C Nati onal I nstr uments GPI B car d Program to test SR640 communication using National Instruments GPIB card and Micro...

Page 17: ...loat answer sr640 ibinit SR640 locate device if sr640 0 error ibwrt sr640 PREG1 1 PREG2 2 15 set gain ibwrt sr640 FREQ 1 6 query frequency ibrd sr640 string 30 and get answer sscanf string f answer pr...

Page 18: ...n of Stage paramaters for the low pass filter are 1 6347 5493 2 8060 9507 2 0793 3 9850 2 095 1 9653 4 1 076 7 375 2 6776 For the high pass filter the parameters are simply related by the lowpass to h...

Page 19: ...7 provides 2K of battery backed up RAM U1 is a 64K ROM which contains the calibration information for the filter channels The calibration ROM is mapped as I O requiring flip flop U5B to switch between...

Page 20: ...service in house repair center WE BUY USED EQUIPMENT Sell your excess underutilized and idle used equipment We also offer credit for buy backs and trade ins www artisantg com WeBuyEquipment REMOTE IN...

Reviews: