EasyManuals Logo

Anritsu Site Master S331L Scpi Programming Manual

Anritsu Site Master S331L
96 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #70 background imageLoading...
Page #70 background image
A-2 Visual Basic Appendix A — Examples
A-4 PN: 10580-00322 Rev. F S331L PM
A-2 Visual Basic
This function can be called in a Visual Basic program. It sends the *IDN? query to the
instrument and returns the byte count and ASCII response string.
Rem This example is based on Example 2-1 from the NI-VISA User Manual.
Public Sub IdnMain(ByVal address As String, ByRef byteCount As String,
ByRef returnBytes As String)
Const BUFFER_SIZE = 200
Dim stat As ViStatus
Dim dfltRM As ViSession
Dim sesn As ViSession
Dim retCount As Long
Dim buffer As String * BUFFER_SIZE
Rem ***Include visa32.dll as a reference in your project.***
Rem Begin by initializing the system
stat = viOpenDefaultRM(dfltRM)
If (stat < VI_SUCCESS) Then
Rem Error initializing VISA...exiting
MsgBox “Can't initialize VISA”
Exit Sub
End If
Rem Open communication with Device
Rem NOTE: For simplicity, we will not show error checking
Rem TODO: Add error handling.
stat = viOpen(dfltRM, address, VI_NULL, VI_NULL, sesn)
Rem Set the timeout for message-based communication
Rem TODO: Add error handling.
stat = viSetAttribute(sesn, VI_ATTR_TMO_VALUE, 120000)
Rem Ask the device for identification
Rem TODO: Add error handling.

Table of Contents

Other manuals for Anritsu Site Master S331L

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Anritsu Site Master S331L and is the answer not in the manual?

Anritsu Site Master S331L Specifications

General IconGeneral
BrandAnritsu
ModelSite Master S331L
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals