Example Programs.2-72 - HP 3325B Operating Manual

Synthesizer/function generator
Hide thumbs Also See for 3325B:
Table of Contents

Advertisement

Example Programs
RS-232 Interface Example Program for HP Series 300
30
40
50
60
70
80
90
100
110
120
130
140
160
170
190
200
210
220
240
250
260
270
280
zm
300
310
320
330
340
350
360
! HP-BASIC Program to control the HP 3325B synthesizer using either
! a HP98644, HP98626, or the build-in serial interface in
! a Series-200 or Series-300 computer.
!
! The connecting cable depends on the RS232 interface:
!
HP98644A interface:
use 13242G cable {25 pin M to 25 pin M).
I
Built-in interface; use 92221P cable (9 pin M to 25 pin M).
ASSIGN @Hp3325 to 9
! Select code for the serial interface,
! usually 9 or 10
GOSUB Initialize card
I
OUTPUT @Hp3325:''RST"
! reset the HP 3325B
!
OUTPUT @Hp3325;''QSTB?"
! ask for status register
ENTER @Hp3325;Stat
! read status from HP 3325B
IF Bit(Stat,0) OR BiT(Stat,3) then print "3325B has an error"
j
OUTPUT @Hp3325:"FR 123 KH; AM 1 VO"
! program freq and amptd
OUTPUT @Hp3325;"FR?"
! ask for frequency
ENTER @Hp3325;Freq
! read it back
PRINT "Frequency in Hz = ":Freq
!
OUTPUT @Hp3325;"LCL"
! retrun front panel to local control
!
PRINT "Program done."
STOP
!
!
_
370 lnitialize_card:
I
380 !
390 lsc=SC(@Hp3325)
! Get Interface select code
400 !
410 Reset_=0
420 Baud=3
430 Parity «4
440 !
450 ! ALL the RS232 switches on the HP 3325B rear panel should be
460 ! up. This sets baud * 300, parity ON, parity EVEN
470 !
480 CONTROL Isc.Resetjl
! reset the card
4^ CONTROL lsc,Baud;300
! set baud rate
500 CONTROLlsc,Parityj16-i-8-i-0-i'2 Isetparity
510 RETURN
520 END
2-73

Advertisement

Table of Contents
loading

Table of Contents