Typical Visual BASIC
Example Program
Using Agilent SICL
The following is an example program written in Visual BASIC using the
Agilent Standard Instrument Control Library. The program:
–
sends commands to the AFG to generate an arbitrary waveform;
–
receives data from the AFG;
–
shows how to send coupled commands;
–
and performs error checking of the AFG.
Only program codes are given here. Refer to the actual program on the CD
to see the data that generates the form, buttons, etc.
’ ARBWAVE.FRM - This program generates a 100 points ramp. The data to generate
’ the ramp is transferred to the AFG as comma separated voltages
’ Instrument GPIB address
Const ShowAddr = "hpib7,9,10"
Dim Addr As Integer
Dim ChkName As String
Sub CheckError (SubName As String)
’ Check for any errors
Dim Actual As Long
Dim RdErr As String * 256
Dim Work As String
Dim ErrNum As Integer
Dim TempName As String
TempName = ChkName
ChkName = "CheckError"
’ Read error message
Call iwrite(Addr, ByVal "SYSTem:ERRor?" + Chr$(10), 14, 1, Actual)
Call iread(Addr, ByVal RdErr, 256, 0, Actual)
’ If error was detected
ErrNum = Val(RdErr)
If ErrNum <> 0 Then
’ Store message only into Work string
Work = Mid$(RdErr, 1, Actual - 1)
Work = Work + " - in Sub " + SubName
’ Enable and clear error list box
ShowErr.Enabled = True
ShowErr.Visible = True
ShowErr.Clear
Continued on Next Page
Chapter 1
Getting Started 33
Содержание E1445A
Страница 2: ......
Страница 14: ...Notes 12 Agilent E1445A User s Manual Contents...
Страница 18: ...Notes 16 Agilent E1445A Arbitrary Function Generator User s Manual...
Страница 19: ...Notes Agilent E1445A Arbitrary Function Generator User s Manual 17...
Страница 20: ...Notes 18 Agilent E1445A Arbitrary Function Generator User s Manual...
Страница 54: ...Notes 52 Getting Started Chapter 1...
Страница 84: ...Notes 82 Generating Standard Waveforms Chapter 2...
Страница 204: ...Notes 202 Arming and Triggering Chapter 5...
Страница 432: ...Figure 9 1 E1445A Status Groups and Associated Registers 430 AFG Status Chapter 9...
Страница 446: ...Notes 444 AFG Status Chapter 9...
Страница 464: ...Notes 462 Agilent E1445A Specifications Appendix A...
Страница 534: ...Notes 532 Agilent E1445A User s Manual Index...