EasyManuals Logo

Agilent Technologies 4155C User Manual

Agilent Technologies 4155C
312 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 #152 background imageLoading...
Page #152 background image
4-6 Agilent 4155C/4156C VXIplug&play Driver User’s Guide, Edition 4
Programming Examples for Visual Basic .NET Users
Programming Basics
Sub perform_meas(ByVal Ag415x As Hp4156b) ’26
Dim i As Integer = 0
Dim j As Integer = 0
Dim nop1 As Integer = 1
Dim nop2 As Integer = 1
Dim data(nop2, nop1) As String
Dim val As String = "enter data header"
Dim fname As String = "C:\enter_file_name.txt"
Dim title As String = "Measurement Result"
Dim msg As String = "No error."
Dim err As Integer = 0
Ag415x.SetSwitch(1, 1) ’this is dummy. ’38
’ insert measurement program code
Ag415x.ErrorQuery(err, msg) ’41
If err <> 0 Then Ag415x.ZeroOutput(0) : GoTo Check_err
Ag415x.ZeroOutput(0) ’44
save_data(fname, title, val, data, nop1, nop2, Ag415x)
Check_err: ’47
If err <> 0 Then MsgBox("Instrument error: " & err & Chr(10) & msg, vbOKOnly,
"")
End Sub ’49
Line Description
26 Beginning of the perform_meas subprogram.
27 to 36 Declares variables used in this program template. The values are dummy. You must
change the values to match your program. If you find unnecessary variables, delete
them.
i and j: Variables used to specify the element of the data array.
nop1 and nop2: Number of measurement steps. Also used to declare the data array.
data: String data array used to store the measurement result data except for the header.
val: String data variable to store the header (first line) of the measurement result data.
fname: Full path name of the measurement result data file to be saved.
title: Title of the message box used to display the measurement result data.
msg and err: Variables used to display an error message.
38 to 39 The lines are placed as dummy. Remove the lines and insert your program code to
control the instruments and perform measurement.
41 to 42 Checks if the 4155/4156 causes an error, and goes to Check_err if an error is detected.
44 to 45 Applies 0 V from all channels and calls the save_data subprogram (lines 51 to 73).
47 to 48 Opens a message box to display error message if an error is detected.
49 End of the perform_meas subprogram.

Table of Contents

Other manuals for Agilent Technologies 4155C

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Agilent Technologies 4155C and is the answer not in the manual?

Agilent Technologies 4155C Specifications

General IconGeneral
BrandAgilent Technologies
Model4155C
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals