7-3
7.2 Sample Program (Example of Program Using Visual Basic)
7.2 Sample Program (Example of Program Using Vi-
sual Basic)
7.2.1 Common items for sample program
(1) Notes on use
Note 1:
The sample programs are used in any personal computer for control with the
following environmental conditions:
• Microsoft Visual Basic version 2.0 or later
• OS such as MS Windows (version 3.1 or later) or Windows 95 in which
above Visual Basic can operate.
• The GPIB board manufactured by the National Instruments corporation is
mounted.
• BASIC library (NI-488 or NI-488.2) for the above GPIB board: Used as a
library for Visual Basic.
Note 2:
The number on the left of the program list is the line number used for the
program explanation. Do not write the number in the program.
Note 3:
Because the sample programs are given mainly to explain the GPIB control
procedures, the user interface related to screen display is simplified. For de-
tails on creating a practical user interface, refer to the handbook of Visual Ba-
sic. (See paragraph (3).)
Note 4:
The description of the sample programs in this section is arranged as follows
because of restrictions on structured programming in Visual Basic and the
number of pages:
• In each item, the project file “***.mak” is used to manage required files.
• If routines described in previous paragraphs are required in each paragraph,
only the part that calls these routines and reference paragraphs are de-
scribed. When operating a routine, write the required routine in the code
module file, and call this file (multiple files can also be specified) from the
project file.
Note 5:
Be sure to write subroutine Form1_click() of the program to the form file (with
extension of. FRM).