Chapter 6 Application Programs
Example Program for Excel 97
140
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 2110-0457
Page 9: ...8...
Page 15: ...14 Contents Contents...
Page 16: ...1 Quick Start...
Page 26: ...2 General Information...
Page 38: ...3 Front Panel Operation and Features...
Page 70: ...4 Remote Interface Reference...
Page 122: ...5 Error Messages...
Page 133: ...Chapter 5 Error Messages Calibration Errors 132...
Page 134: ...6 Application Programs...
Page 145: ...Chapter 6 Application Programs Example Program for Excel 97 144...
Page 146: ...7 Tutorial...
Page 157: ...Chapter 7 Tutorial Remote Programming 156...
Page 158: ...8 Specifications...
Page 166: ...Appendix Service Information...
Page 175: ...Appendix Service Information General Disassembly 174 General Disassembly...
Page 202: ......
Page 203: ......
Page 204: ......
Page 205: ......
Page 209: ...208 Index Index...