
Chapter 6 Application Programs
Example Program for Excel 97
144
To write an Excel macro you must first open a module in Excel. Go to the
View
menu,
choose
Toolbars
, and then select
Control Toolbox
. The
Control Toolbox
dialog box
appears. Select the
Command button
in the dialog box. Click cell A1 and drag across
the cell B3. The “
CommandButton1
” box is created. To change the button name, click
the right mouse button on that button and then select Properties. The
Properties
dialog
box appears. In the
Properties
dialog, change the “(name)” and “caption” to “Diode”.
To try the example for characterizing a diode, type “Voltages” in cell A4 and “Current”
in cell B4. In cell A5 type 0.6. Fill in the cells A5 to A15 in 0.02 increments so that
cell A15 contains 0.8.
To enter the “Diode” macro example in this section, go to the
View
menu, choose
Toolbars
, and then
Visual Basic Editor
icon. The “
Code window
” appears. Then type
the text as shown on page 139 into the “
[Moudle1 (code)]
” window. To enter the
declaration for Windows
®
95/NT, go to the
Insert
menu, choose
Module
. The
“
Module window
” appears. Then type the text as shown starting on page 141. This
module will configure all of the overhead required to communicate with the power
supply over the interface. Choose the preferred interface by setting “bGPIB=” to
“True” or “False” and change the GPIB address or RS-232 port in the routine
“OpenPort( )’’ contained in the module.
To run the macro, return back to the
Excel
window and select the
Run Macro
button
in the dialog box and choose the macro name, and then click on the
Run
button . The
power supply will reset to power on condition and then step through the voltages in
the worksheet. After each step the current is measured, and recorded in the worksheet.
Make any changes necessary to suit your application in the “Diode’’ module. You
must enter the information in the modules exactly as shown or error will be generated.
If several system errors occur while attempting to run a macro, you may have to reboot
your PC to get the GPIB port or RS-232 port to work properly.
N o t e
To use the example with Window
®
3.1, you will need to modify the declarations at
the top of the module. Change ‘visa32.dll’ to ‘visa.dll’ in all declarations.
Summary of Contents for E3646A
Page 2: ...2...
Page 16: ...16 Contents Contents...
Page 17: ...1 Quick Start...
Page 27: ...2 General Information...
Page 39: ...3 Front Panel Operation and Features...
Page 72: ...Chapter 3 Front Panel Operation and Features Calibration Overview 72...
Page 73: ...4 Remote Interface Reference...
Page 125: ...5 Error Messages...
Page 136: ...Chapter 5 Error Messages Calibration Errors 136...
Page 137: ...6 Application Programs...
Page 148: ...Chapter 6 Application Programs Example Program for Excel 97 148...
Page 149: ...7 Tutorial...
Page 160: ...Chapter 7 Tutorial Remote Programming 160...
Page 161: ...8 Specifications...
Page 169: ...Appendix Service Information...
Page 178: ...Appendix Service Information General Disassembly 178 General Disassembly...
Page 210: ......