Fluke 2635A Lawn Mower User Manual


 
Computer Operations
Computer Interface Commands and Operation
4
4-57
10 ' HYDRALOG.BAS Hydra Program to scan VDC, VAC, OHMS, FREQ or TEMP
20 ' - initializes RS-232 Communications between PC and Hydra
30 ' - configures a number of Hydra channels for one type
40 ' of measurement (e.g., VDC, VAC, temperature, etc.)
50 ' - scan channels 3 times, and display and record measurement
60 ' data in file "TESTDATA.PRN"
70 '
80 ' NOTE: Hydra must be set up for RS-232 communications, 9600 baud,
90 ' no parity, 8 bit data
100 '
110 KEY OFF ' Switch keyboard event trapping off
120 '
130 ' NOTE: Error message checking is not done here -- QBasic will notify the
140 ' user and exit if there is a problem
150 '
160 ' Open Communications port with 9600 baud, no parity, 8 it data,
170 ' ignore Clear to Send, Data Set Ready, and Carrier Detect.
180 '
190 OPEN "COM2:9600,N,8,,cs0,ds0,cd0" FOR RANDOM AS #1
200 '
210 '
220 OPEN "testdata.PRN" FOR OUTPUT AS #2 ' Open data file
230 '
240 PRINT #1, "ECHO 0" ' Turn off command echo on Hydra
250 '
260 '-----
270 ' Find out the number of channels the user wants to configure
280 ' NOTE: Channel 0 will not be used
290 '
300 NUMCHANNELS = 0
310 WHILE (NUMCHANNELS < 1) OR (NUMCHANNELS > 20)
320 INPUT "Enter the number of channels to be scanned (1-20): ", NUMCHANNELS
330 WEND
340 '
350 'Turn unused channels off
360 PRINT "(Wait...)"
370 '
380 FOR INDEX = (NUMCHANNELS + 1) TO 20
390 PRINT #1, "FUNC " + STR$(INDEX) + ",OFF"
400 GOSUB 1120
410 NEXT INDEX
420 '
430 '
440 'Configure Hydra Channels
450 ' First, initialize screen and display Hydra identification info
460 CLS
470 LOCATE 1, 25: PRINT "Sample Program for Hydra"
480 PRINT #1, "*IDN?": GOSUB 1120: LINE INPUT #1, RESULT$
490 LOCATE 2, 20: PRINT RESULT$
500 '
510 WHILE (1)
520 'Print banner line at bottom of screen
530 LOCATE 25, 1
540 PRINT "1 = VDC 2 = VAC 3 = OHMS 4 = FREQ 5 = TEMP 6 = Quit";
550 ' Get channel configurations
560 FUNC$ = "0"
570 WHILE (FUNC$ < "1") OR (FUNC$ > "6")
580 LOCATE 23, 1: INPUT " Selection: ", FUNC$
590 WEND
600 ' Exit and clean up if choice is "Quit"
610 IF FUNC$ = "6" THEN CLOSE 1, 2: CLS : KEY ON: END
op51f.eps
Figure 4-4. Sample Program (GWBASIC) (1 of 2)