Instructions
Strona 163 z 185
Dystrybucja Conrad Electronic Sp. z o.o., ul. Kniaźnina 12, 31-637 Kraków, Polska
Copyright © Conrad Electronic 2012, Kopiowanie, rozpowszechnianie, zmiany bez zgody zabronione.
www.conrad.pl
www.conrad.pl
7. Wybierz Browse.... i przejdź do katalogu C:\Windows\System32.
8. Wybierz plik, visa32.dll, i kliknij przycisk Otwórz ( spowoduje dodanie odniesienia do "VISA
Library").
9. Zapisz swój projekt.
W funkcji Sub Main należy dodać kod inicjalizacyjny.
Sub Main()
Rem #########################################
Rem
Rem Using NI-VISA library visa32.dll
Rem
Rem Set device on the VOLTage:DC configure and
Rem read the measure
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 * 64
stat = viOpenDefaultRM(dfltRM)
If (stat < VI_SUCCESS) Then
'Rem Error initializing VISA ... exiting
MsgBox "USBTMC resource not found.", vbExclamation, "2100 multimeter device
test"
Exit Sub
End If
Rem Find all 2100 USBTMC instruments in the system
stat = viFindRsrc(dfltRM, "USB[0-9]*::0x05E6::0x2100::?*INSTR", fList, nList,
desc)
If (stat < VI_SUCCESS) Then
'Rem Error finding resources ... exiting
MsgBox "2100 device not found.", vbExclamation, "2100 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