Programming Guide
Digital Oscilloscopes Series
159
3.1、USBTMC access code:
Write a function Usbtmc_test.
Private Function Usbtmc_test() As Long
' This code demonstrates sending synchronous read & write
commands
' to an USB Test & Measurement Class (USBTMC) instrument
using
' NI-VISA
' The example writes the "*IDN?\n" string to all the USBTMC
' devices connected to the system and attempts to read back
' results using the write and read functions.
' The general flow of the code is
' Open Resource Manager
' Open VISA Session to an Instrument
' Write the Identification Query Using viWrite
' Try to Read a Response With viRead
' Close the VISA Session
Const MAX_CNT = 200
Dim defaultRM As Long
Dim instrsesn As Long