5-39
1) Program example using N88–BASIC
10'***SAMPLE PROGRM4***
20 CMD DELIM=0
30 ADRS=8
40 ISET IFC : Interface clear
50 ISET REN : Remote enable
60 WBYTE &H14; : Device clear
70 PRINT@ADRS;"*RST;*CLS;TRM 1" : Specifies presets, status clear, and terminator
80 PRINT @ADRS;"INPCH 2;INP2Z 1;ATTN 1" : Set input channel Input2, 1 MÉ∂, and ATT On
90 PRINT @ADRS;"SMP 3;RES 3;STS 1" : Sets 10 ms sample rate, 1 Hz resolution, and arithmetic mean
100 PRINT @ADRS;"OM 0" : Specifies output mode 0 numeric format
110 INPUT @ADRS;FREQ$ : Reads measurement value
120 PRINT FREQ$
130 GOTO 110
140 END
2) Program example using Visual Basic
Sub SAMP4 ()
ADRS%=8
Cls
Call SendIFC(0) : Interface clear
If ibsta% And EERR Then
Call ERRMSG(ADRS%, "Error: IFC")
End If
Call DevClear(0, ADRS%) : Device clear
If ibsta% And EERR Then
Call ERRMSG(ADRS%, "Error: DCL")
End If
Call Send(0, ADRS%, "*RST;TRM 1", NLend) : Specifies presets and terminator
If ibsta% And EERR Then
Call ERRMSG(ADRS%, "Error: SENDING COMAND")
End If : Set input channel Input2, 1 MΩ, and ATT On
Call Send(0, ADRS%, "INPCH 2;INP2Z 1;ATTN 1", NLend)
: Sets 10 ms sample rate, 1 Hz resolution, and arithmetic mean
Call Send(0, ADRS%, "SMP 3;RES 3;STS 1", NLend)
Call Send(0, ADRS%, "OM 0", NLend) : Specifies output mode 0 numeric format
For I%=1 To 10
FREQ$=Space$(40)
Call Receive(0, ADRS%, FREQ$, STOPend) : Reads measurement value
Print FREQ$
Next I%
Call ibonl(ADRS%, 0)
End Sub
5.6 Sample Programs