
Programming
6–44
2714 & 2715 Programmer Manual
Introduction to GPIB Programming
The routines in the GPIB Sample Subroutines on page 6–48 can also work with
earlier versions of QuickBASIC. However, you must use the appropriate GPIB
system software and make the changes to function calls as outlined in the
READĆQB.DOC
document file from National Instruments. The GPIB system
software is that supplied by National Instruments along with their boards.
The devices considered are the National Instruments PCII, PCIIA, and PCII/IIA
GPIB boards, supplied by Tektronix or directly available from National
Instruments dealers. Consult Introduction To Programming on page 1–1 and the
material supplied with your board for detailed instructions.
Beginning Your GPIB Program
Before you begin programming, several steps must be performed to ensure that
QuickBASIC has the necessary GPIB information. See Preparing the Software
on page 1–10 for the procedure.
A BASIC or QuickBASIC program usually begins with a list of declarations.
This establishes variable types and the names of global variables. Several
variable names are used by the National Instruments software. To prevent any
confusion, National Instruments supplies a program file that declares these
variables for you. Place this line at the beginning of your programs to properly
declare the reserved National Instruments variables:
REM $INCLUDE 'QBDECL4.BAS'
QuickBASIC supports the sub-program module concept, so traditional
COMMON
statements are replaced with
COMMON SHARED
statements. This means that the
variable names so declared may be shared by all modules. Further, each
sub-program module must be declared. The following lines declare the global
variables used by our subroutines and demonstration program:
COMMON SHARED BD%,BDNAME$,RD$,
WRT$ , EVENT.CODE$
COMMON SHARED NUMBYT%
Table 6–1 lists the global variables declared by
QBDCL4.BAS
and the
COMMON
SHARED
statements, and their purpose.
Summary of Contents for 2714
Page 4: ......
Page 11: ...Introduction ...
Page 12: ......
Page 38: ...Introduction to Programming 1 26 2714 2715 Programmer Manual ...
Page 39: ...Message Structure ...
Page 40: ......
Page 54: ...Instrument Specific Message Structure 2 14 2714 2715 Programmer Manual ...
Page 55: ...Functional Groups ...
Page 56: ......
Page 85: ...Command Query ...
Page 86: ......
Page 179: ...Status Reporting ...
Page 180: ......
Page 197: ...Programming ...
Page 198: ......
Page 266: ...Programming 6 68 2714 2715 Programmer Manual ...
Page 267: ...Appendices ...
Page 268: ......
Page 276: ...Appendix A RS 232 Concepts A 8 2714 2715 Programmer Manual ...
Page 296: ...Appendix B GPIB System Concepts B 20 2714 2715 Programmer Manual ...
Page 297: ...Index ...
Page 298: ......
Page 307: ......
Page 308: ......