3.6
Programming Example
3-16
3.6.
Programming Example
The following is a typical program example used for setting data and loading query data.
3.6.1. Setting Conditions for an Instrument
Example For Channel 1, sets each item with the value given. Center frequency: 10 MHz, Frequency
span: 1 MHz (linear interval), Output level: +5 dBm, Number of measurement points: 601,
IF RBW: 3 kHz, and Settling time: 0 seconds.
Program
(VB6.0)
Adds declare_bis.bas and bis_macro.bas to the standard module in advance.
Assume the first argument in the API function, lngID, is defined separately as an external
variable. Place bis.dll in a folder that can be recognized by Visual Basic.
Private Sub cmdSetup_Click ()
Dim seg As SourSeg
Call BisMeasAct(lngID, 1)
' Sets the measurement channel to CH1.
seg.dblFreq1 = 10.0e6
' Sets the center frequency.
seg.dblFreq2 = 1.0e6
' Sets the frequency span.
seg.lngFtype = BIS_FREQ_CNTSPN ' Sets center and span settings mode.
seg.lngFmode = BIS_FREQ_LIN
' Sets the linear interval.
seg.lngPntN = 601
' Sets the number of measurement points.
seg.sngRbw = 3.0e3
' Sets the IF RBW.
seg.sngPow1 = 5.0
' Sets the output level (start).
seg.sngPow2 = 5.0
' Sets the output level (finish).
seg.sngStime = 0.0
' Sets the settling time.
Call BisSourSeg(lngID, seg, LenB(seg))
End Sub