Fluke user manual 2620A, 2625A, 2. Sample Program

Models: 2625A 2620A

1 197
Download 197 pages 4.31 Kb
Page 80
Image 80

2620A, 2625A

Users Manual

10

’ EXAMPLE.BAS

Hydra program to scan VDC, VAC,

OHMS, FREQ, or TEMP

20

- initialize RS232 communication and set up Hydra

30

- display and record measurement data in "TESTDATA.PRN"

40

’ Hydra must be set up for RS232, 9600 baud, no parity (from front panel)

50

KEY OFF

 

 

 

60

’ Open communications port 9600 baud, no parity, 8 bit data,

70

’ ignor Clear to Send, Data Set Ready, Carrier Detect

80

OPEN "COM1:9600,N,8,,cs,ds,cd" FOR RANDOM AS #1

 

90

IF ERRORCODE <>

0 THEN PRINT "ERROR - Could not open com1:" : END

100

 

 

110

OPEN "testdata.prn" FOR OUTPUT AS #2

’Open data file

120

IF ERRORCODE <> 0 THEN PRINT "ERROR - Could not open data file" : END

130

 

 

140

PRINT #1, "ECHO 0"

’Turn off command echo

150

 

 

160

NUMBEROFCHANS = 0

 

 

170

WHILE (NUMBEROFCHANS < 1) OR (NUMBEROFCHANS > 20)

180INPUT "Enter number of channels (1-20): ", NUMBEROFCHANS

190WEND

200PRINT "(Wait...)"

210 FOR I = (NUMBEROFCHANS + 1) TO 20

’ Turn unused channels off

220PRINT #1, "FUNC" + STR$(I) + ",OFF"

230GOSUB 800

240NEXT I

250

260CLS

270LOCATE 2,25 : PRINT "Sample Program for Hydra"

275PRINT #1, "*IDN?" : GOSUB 800 : LINE INPUT #1, RESULT$

276LOCATE 3,20 : PRINT RESULT$;

280

290WHILE (1)

300’ Print banner line at bottom of screen

310LOCATE 25,1

320PRINT "1 = VDC 2 = VAC 3 = OHMS 4 = FREQ 5 = TEMP 6 = QUIT";

330

340FUNC$ = "0"

350WHILE (FUNC$ < "1") OR (FUNC$ > "6")

360

 

LOCATE 23,1 : INPUT "

Selection: ", FUNC$

370

 

WEND

 

380

Exit and clean up if "Quit"

 

390If FUNC$ = "6" THEN CLOSE 1, 2 : CLS : KEY ON : END

400

410’ Set up later part of command string to Hydra (function and range)

420IF FUNC$ = "1" THEN CMD$ = "VDC, 1"

430IF FUNC$ = "2" THEN CMD$ = "VAC, 1"

440IF FUNC$ = "3" THEN CMD$ = "OHMS, 1, 2"

450IF FUNC$ = "4" THEN CMD$ = "FREQ, 1"

460IF FUNC$ = "5" THEN CMD$ = "TEMP, K"

470

480’ Set up Hydra

485LOCATE 23,1 : PRINT "Programming... ";

490

FOR I = 1 TO NUMBEROFCHANS

’ Program channels

Figure 4-2. Sample Program

4-10

Page 80
Image 80
Fluke user manual 2620A, 2625A, 2. Sample Program