2100-900-01 Rev. D / September 2011 Return to Section Topics B-35
Model 2100 6 1/2-Digit Resolution Digital Multimeter User’s Manual Appendix B: Remote Interface Reference
Rem send command -- Enable math
stat = viWrite(sesn, "CALC:STAT ON", 12, ret)
If (stat < VI_SUCCESS) Then
MsgBox "System command error.", vbExclamation, "2100 multimeter device test"
stat = viClose(fList)
Exit Sub
End If
Rem send command -- Take readings
stat = viWrite(sesn, "READ?" & vbLf, 6, ret)
If (stat < VI_SUCCESS) Then
MsgBox "System command error.", vbExclamation, "2100 multimeter device test"
stat = viClose(fList)
Exit Sub
End If
Sleep (3000) ' wait for math processing
Rem fetch the measure data
stat = viRead(sesn, readin, 128, ret)
If (stat < VI_SUCCESS) Then
MsgBox "Read in data error.", vbExclamation, "2100 multimeter device test"
stat = viClose(fList)
Exit Sub
End If
Rem set to local mode
stat = viWrite(sesn, "system:local", 12, ret)
If (stat < VI_SUCCESS) Then
MsgBox "System command error. (system:local)", vbExclamation, "2100
multimeter device test"
stat = viClose(fList)
Exit Sub
End If
stat = viClose(sesn)
stat = viClose(fList)
stat = viClose(dfltRM)
For i = 0 To (5 - 1) ' print out the 4 times samples reading
Debug.Print "Rdgs = "; Mid(readin, i * 16 + 1, 15)
Next
MsgBox "End of Job."
End Sub
Visual C++ programming example: DEVQUERY
Visual C++ sample application
Using DEVQUERY
This C++ sample application is a Win32 console application. It illustrates how to use the Keithley
Instruments, Inc. IOUtils command. A Win32 console application is a Win32 application that uses
text-based input and output, not a graphical interface. You can quickly create a Win32 application
by using simple input and output functions.