Agilent Technologies E5071C Manual page 1158

Hide thumbs Also See for E5071C:
Table of Contents

Advertisement

Programming
Breaks the communication and terminates the VISA system.
Lines 320 to 360
If an error occurs in a VISA function, displays the detail of the error and
terminates the program.
Read out the product information (ctrl_ext.vba)
10| Sub Main()
20|
30| Dim status As Long 'VISA function status return code
40| Dim Defrm As Long 'Session to Default Resource Manager
50| Dim Equip As Long 'Session to instrument
60| Dim Prod As String * 100 'String to receive the result
70|
80| ' Initializes the VISA system.
90| status = viOpenDefaultRM(Defrm)
100| If (status <> VI_SUCCESS) Then GoTo VisaErrorHandler
110|
120| ' Opens the session to the specified instrument.
130| status = viOpen(Defrm, "GPIB0::17::INSTR", 0, 0, Equip)
140| If (status <> VI_SUCCESS) Then GoTo VisaErrorHandler
150|
160| ' Asks for the instrument's product information.
170| status = viVPrintf(Equip, "*IDN?" & Chr$(10), 0)
180| If (status <> VI_SUCCESS) Then GoTo VisaErrorHandler
190|
200| ' Reads the result.
210| status = viVScanf(Equip, "%t", Prod)
220| If (status <> VI_SUCCESS) Then GoTo VisaErrorHandler
230|
240| ' Displays the result.
250| MsgBox Prod
260|
270| ' Closes the resource manager session (which closes everything)
280| Call viClose(Defrm)
290|
300| GoTo Prog_end
310|
1385

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents