48
DME1600
Sample Programs
Program 2: Using CONFigure commands for math functions
In the following example, CONFigure commands are used for dBm calculation.
The CONFigure commands are slightly more flexible than the MEASure? commands. You
can use these commands to gradually change the DME1600’s settings. This sample program
is written in Visual Basic.
PPublic Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub main()
Rem
#########################################
Rem
Rem Using NI-VISA library visa32.dll
Rem
Rem Set sample count 5 configuration and
Rem read the trigger
Rem
Rem
#########################################
Dim stat As ViStatus
Dim dfltRM As ViSession
Dim sesn As ViSession
Dim fList As ViFindList
Dim desc As String * VI_FIND_BUFLEN
Dim nList As Long
Dim ret As Long
Dim readin As String * 128
Dim i As Integer ' Array index
stat = viOpenDefaultRM(dfltRM)
If (stat < VI_SUCCESS) Then
'Rem Error initializing VISA ... exiting
MsgBox "USBTMC resource not found.", vbExclamation, "DME1600
multimeter device test"
Exit Sub
End If
Rem Find all DME1600 USBTMC instruments in the system
stat = viFindRsrc(dfltRM, "USB[0-9]*::0x164E::0x0DAD::?*INSTR", fList,
nList, desc)
If (stat < VI_SUCCESS) Then
'Rem Error finding resources ... exiting
MsgBox "DME1600 device not found.", vbExclamation, "DME1600
multimeter device test"
viClose (dfltRM)
Exit Sub
End If
Rem Open a session to each and determine if it matches
stat = viOpen(dfltRM, desc, VI_NULL, VI_NULL, sesn)
If (stat < VI_SUCCESS) Then
MsgBox "Open device failed.", vbExclamation, "DME1600 multimeter
device test"
stat = viClose(fList)
Exit Sub
End If
Summary of Contents for DME1600
Page 4: ...4 DME1600 This page left blank intentionally...
Page 5: ...Setup This chapter explains the settings that you need to configure to use the interfaces 1...
Page 9: ...Message Reference This chapter explains the SCPI com mands 2 Message Reference...
Page 43: ...Appendix A Error Messages B Sample Programs...
Page 55: ......