44 Programming Examples
SR620 Universal Time Interval Counter
Program Example 1
IBM PC, BASIC, via RS232
In this example, the IBM PC's COM2: serial port is used to communicate with the SR620. The program sets
up the SR620 and then starts measurements and reads the results. Only pins 2,3 and 7 of the PC's port
need to be connected to the SR620.
10 ' Example program to start a measurement and read the result. This
20 ' program uses IBM Basic and communicates via the COM2:RS232 port.
30 '
40 ' set up the SR620 for 9600 baud, 8 bits, no parity
50 OPEN "COM2:9600,N,8,2,CS,DS,CD" AS #1
60 '
70 ' setup COM2: for 9600 baud , no parity, 8 data bits, 2 stop bits
80 ' ignore cts,dsr, and cd
90 '
100 PRINT #1," "
' clear COM2:
105 ' clear TIC ,set to width of ref, 10 samples,automeasure off'
110 PRINT #1,"*RST;MODE1;SRCE2;SIZE10;AUTM0
120 PRINT #1,"STRT;*WAI;XAVG?" ' start measurement, wait until done,read
130 INPUT #1,TIME#
' read double precision answer
140 PRINT "width = ",TIME#
150 GOTO 120
' loop forever
Tips on Interfacing to PC's using a National Instrument GPIB Card
To succesfully interface the SR620 to a PC via the GPIB , the instrument, interface card, and interface drivers
must all be configured properly. To configure the SR620, you must set the GPIB address in line 2 of the
"Control" CONFIG menu. The default GPIB address is 16: use this address unless a conflict occurs with other
instruments in your system. The SR620 will be set to GPIB address 16 whenever a COLD BOOT is done ( if
the RESET key is held down when the unit is turned "ON".)
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 interupt levels. You must run the program "IBCONF" to
configure the resident GPIB driver for your GPIB card. Please refer to the National Instruments manual for
additional information.
Once all the hardware and GPIB drivers are configured, use IBIC. This terminal emulation program allows you
to send commands to the SR620 directly from your computer's keyboard. If you cannot talk to the SR620 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 SR620. After you are familiar with these simple command you can explore other, more complex,
programming commands.
Содержание SR620
Страница 2: ...SR620 Universal Time Interval Counter...
Страница 6: ...iv Table of Contents SR620 Universal Time Interval Counter...
Страница 8: ...vi Safety and Preparation for Use SR620 Universal Time Interval Counter...
Страница 12: ...x Specifications SR620 Universal Time Interval Counter...
Страница 58: ...42 Programming Commands SR620 Universal Time Interval Counter...
Страница 72: ...56 Programming Examples SR620 Universal Time Interval Counter...
Страница 76: ...60 Troubleshooting Tips SR620 Universal Time Interval Counter...
Страница 82: ...66 Performance Test SR620 Universal Time Interval Counter...
Страница 90: ...74 Calibration Procedure SR620 Universal Time Interval Counter...
Страница 102: ...86 Circuit Description SR620 Universal Time Interval Counter...
Страница 124: ...108 Parts List SR620 Universal Time Interval Counter...