Bnc 645 User Manual Page 183

  • Download
  • Add to my manuals
  • Print
  • Page
    / 190
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 182
183
The following example uses CONFigure with the dBm math operation.
The CONFigure command gives you a little more programming
flexibility than the MEASure? command. This allows you to
“incrementally” change the multimeter’s configuration. The example is
is shown in Visual Basic.
Creating the Application
Create a new Visual Basic project as follows:
1. Create a new Standar.EXE project.
2. To set the startup object for a Windows Application to Sub Main
3. Add New Module, Declare a Sub Main().
LISTING D.2. THE CONFigure FUNCTION.
Sub Main()
Dim Model 645 As Object
Dim Rdgs(1 To 5) As Double
Dim i As Integer ' Array Index
' To assign an object reference using CreateObject
Set Model 645 = CreateObject("Berkeley Nucleonics Corporation.IOUtils")
' Address String Grammar for rsrcName Parameter
Model 645.Connect = "USB::5710::4002::tw00000001"
' USB[board]::manufacturer ID::model code::serial number[::USB interface
' number][::INSTR]
Model 645.Output = "*RST" ' Reset Model 645
Model 645.Output = "*CLS" ' Clear Model 645 status registers
Model 645.Output = "CALC:DBM:REF 50" ' 50 ohm reference resistance
Model 645.Output = "CONF:VOLT:AC 1,0.001" ' Set Model 645 to 1 amp ac range
Model 645.Output = "DET:BAND 200" ' Select 200 Hz (fast) ac filter
Model 645.Output = "TRIG:COUN 5" ' Model 645 will accept 5 triggers
Model 645.Output = "TRIG:SOUR IMM" ' Trigger source is IMMediate
Model 645.Output ="CALC:FUNC DBM" ' Select dBm function
Model 645.Output = "CALC:STAT ON" ' Enable math
Model 645.Output = "READ?" ' Take readings; send to output buffer
Rdgs = Model 645.Input
For i = LBound(Rdgs) To UBound(Rdgs)
Debug.Print Rdgs(i)
Next i
End Sub
Using the Status Registers
The following example shows how you can use the multimeter’s status
Page view 182

Comments to this Manuals

No comments