67
Limited Warranty
The media on which you receive National Instruments software are
warranted not to fail to execute programming instructions, due to defects in
materials and workmanship, for a period of 90 days from date of shipment,
as evidenced by receipts or other documentation. National Instruments will,
at its option, repair or replace software media that do not execute
programming instructions if National Instruments receives notice of such
defects during the warranty period. National Instruments does not warrant
that the operation of the software shall be uninterrupted or error free.
A Return Material Authorization (RMA) number must be obtained from the
factory and clearly marked on the outside of the package before any
equipment will be accepted for warranty work. National Instruments will
pay the shipping costs of returning to the owner parts which are covered by
warranty.
National Instruments believes that the information in this manual is
accurate. The document has been carefully reviewed for technical accuracy.
In the event that technical or typographical errors exist, National
Instruments reserves the right to make changes to subsequent editions of
this document without prior notice to holders of this edition. The reader
should consult National Instruments if errors are suspected. In no event
shall National Instruments be liable for any damages arising out of or
related to this document or the information contained in it.
E
XCEPT AS SPECIFIED HEREIN
, N
ATIONAL
I
NSTRUMENTS MAKES NO
WARRANTIES
,
EXPRESS OR IMPLIED
,
AND SPECIFICALLY DISCLAIMS
ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A
PARTICULAR PURPOSE
. C
USTOMER
'
S RIGHT TO RECOVER DAMAGES
CAUSED BY FAULT OR NEGLIGENCE ON THE PART OF
N
ATIONAL
I
NSTRUMENTS SHALL BE LIMITED TO THE AMOUNT THERETOFORE
PAID BY THE CUSTOMER
. N
ATIONAL
I
NSTRUMENTS WILL NOT BE
LIABLE FOR DAMAGES RESULTING FROM LOSS OF DATA
,
PROFITS
,
USE OF PRODUCTS
,
OR INCIDENTAL OR CONSEQUENTIAL DAMAGES
,
EVEN IF ADVISED OF THE POSSIBILITY THEREOF
. This limitation of the
liability of National Instruments will apply regardless of the form of action,
whether in contract or tort, including negligence. Any action against
National Instruments must be brought within one year after the cause of
action accrues. National Instruments shall not be liable for any delay in
performance due to causes beyond its reasonable control. The warranty
provided herein does not cover damages, defects, malfunctions, or service
failures caused by owner's failure to follow the National Instruments
installation, operation, or maintenance instructions; owner's modification of
32
the product; owner's abuse, misuse, or negligent acts; and power failure or
surges, fire, flood, accident, actions of third parties, or other events outside
reasonable control.
Copyright
Under the copyright laws, this publication may not be reproduced or
transmitted in any form, electronic or mechanical, including photocopying,
recording, storing in an information retrieval system, or translating, in
whole or in part, without the prior written consent of National Instruments
Corporation.
Trademarks
NI-488
®
and NI-488.2™ are trademarks of National Instruments
Corporation.
Product and company names listed are trademarks or trade names of their
respective companies.
Warning Regarding Medical and Clinical Use
of National Instruments Products
National Instruments products are not designed with components and testing
intended to ensure a level of reliability suitable for use in treatment and
diagnosis of humans. Applications of National Instruments products
involving medical or clinical treatment can create a potential for accidental
injury caused by product failure, or by errors on the part of the user or
application designer. Any use or application of National Instruments
products for or involving medical or clinical treatment must be performed by
properly trained and qualified medical personnel, and all traditional medical
safeguards, equipment, and procedures that are appropriate in the particular
situation to prevent serious injury or death should always continue to be
used when National Instruments products are being used. National
Instruments products are NOT intended to be a substitute for any form of
established process, procedure, or equipment used to monitor or safeguard
human health and safety in medical or clinical treatment.
37
© National Instruments Corp.
v
Visual Basic
Contents
About This Manual
..........................................................................vii
Organization of This Manual......................................................vii
Conventions Used in This Manual.............................................viii
Related Documentation..............................................................ix
Customer Communication..........................................................ix
Chapter 1
General Information
........................................................................1-1
Visual Basic Files.......................................................................1-1
Programming Preparations.........................................................1-2
Visual Basic NI-488 I/O Calls and Functions ............................1-3
NI-488 IL Functions.....................................................1-6
Dynamic Reconfiguration of Board and
Device Characteristics...................................1-8
Using the NI-488.2 Routine Examples..........1-9
Chapter 2
Programming Examples
.................................................................2-1
Visual Basic NI-488.2 Programming Example..........................2-1
Visual Basic Example Program–NI-488.2
Routines .......................................................................2-4
GPIB Programming Examples...................................................2-12
Visual Basic Example Program–Device Functions.....2-14
Visual Basic Example Program–Board Functions.......2-18
Appendix A
Multiline Interface Messages
.......................................................A-1
Appendix B
Customer Communication
............................................................B-1
Glossary
.................................................................................................G-1
12
Contents
Visual Basic
vi
© National Instruments Corp.
Figures
Figure 1-1. GPIBPROJ.MAK...................................................................1-3
Figure 2-1. VB488_2.MAK......................................................................2-3
Figure 2-2. VBDEVICE.MAK .................................................................2-13
Tables
Table 1-1. Visual Basic NI-488 Calls......................................................1-4
Table 1-2. Functions That Alter Default Characteristics.........................1-8
Table 1-3. Visual Basic NI-488.2 Routines.............................................1-9
29
© National Instruments Corp.
vii
Visual Basic
About This Manual
This manual contains information for programming the NI-488.2 routines
and the NI-488 functions in Visual Basic. The term Visual Basic as used in
this manual refers to Microsoft Visual Basic for Windows.
This manual assumes that the driver is installed and that you are familiar
with the driver operation and programming in Visual Basic.
Organization of This Manual
This manual is organized as follows.
•
Chapter 1, General Information, contains information you need to
prepare for programming the NI-488.2 driver in Visual Basic.
•
Chapter 2, Programming Examples, contains programming examples
for the NI-488.2 routines and NI-488 functions.
•
Appendix A, Multiline Interface Messages, contains an interface
message reference list, which describes the mnemonics and messages
that correspond to the interface functions.
•
Appendix B, Customer Communication, contains forms you can
use to request help from National Instruments or to comment on
our products and manuals.
•
The Glossary contains an alphabetical list and description of terms
used in this manual, including abbreviations, acronyms, metric
prefixes, mnemonics, and symbols.
44
About This Manual
Visual Basic
viii
© National Instruments Corp.
Conventions Used in This Manual
The following conventions are used in this manual:
italic
Italic text denotes emphasis, a cross
reference, or an introduction to a key
concept.
bold italic
Bold italic text denotes a note, caution, or
warning.
monospace
Lowercase text in this font denotes text or
characters that are to be literally input from
the keyboard, sections of code,
programming examples, and syntax
examples. This font is also used for the
proper names of disk drives, paths,
directories, programs, subprograms,
subroutines, device names, functions,
variables, filenames, and extensions, and
for statements and comments taken from
program code.
bold monospace
Lowercase text in this font is used to highlight
the location and usage of NI-488.2 routines and
NI-488 functions on sample programs
<>
Angle brackets enclose the name of a key on the
keyboard–for example, <PageDown>.
<Control>
Key names are capitalized.
IEEE 488
IEEE 488 and IEEE 488.2 are used throughout
IEEE 488.2
this manual to refer to the ANSI/IEEE Standard
488.1-1987 and the ANSI/IEEE Standard
488.2-1987, respectively, which define the
GPIB.
NI-488.2
NI-488.2 is used throughout this manual to refer
to the NI-488.2 software unless otherwise noted.
31
About This Manual
© National Instruments Corp.
ix
Visual Basic
Visual Basic
Visual Basic is used throughout this manual to
refer to Visual Basic for Windows unless
otherwise noted.
Abbreviations, acronyms, metric prefixes, mnemonics, symbols, and terms
are listed in the Glossary.
Related Documentation
The following documents contain information that you may find helpful as
you read this manual:
•
NI-488.2 Software Reference Manual for MS-DOS, (part
number 320282-01)
•
ANSI/IEEE Standard 488.1-1987, IEEE Standard Digital Interface for
Programmable Instrumentation
•
ANSI/IEEE Standard 488.2-1987, IEEE Standard Codes, Formats,
Protocols, and Common Commands
•
Microsoft Visual Basic Programmer's Guide
Customer Communication
National Instruments wants to receive your comments on our products and
manuals. We are interested in the applications you develop with our
products, and we want to help if you have problems with them. To make it
easy for you to contact us, this manual contains comment and configuration
forms for you to complete. These forms are in Appendix B, Customer
Communication, at the end of this manual.
38
© National Instruments Corp.
1-1
Visual Basic
Chapter 1
General Information
This chapter contains information you need to prepare for programming the
NI-488.2 driver in Visual Basic.
Visual Basic Files
The NI-488.2 forWindows Language Interface for Microsoft Visual Basic
diskette contains the following files which are relevant to programming in
Visual Basic.
The following are Microsoft Visual Basic language interface files.
VBIB.BAS
Visual Basic source file with NI-488 functions
and NI-488.2 routines that call the GPIB.DLL.
NIGLOBAL.BAS
Visual Basic global module, includes certain
predefined constant declarations.
The following is a skeleton for creating a new Visual Basic application
project.
GPIBPROJ.MAK
skeleton's project file
GPIBPROJ.FRM
skeleton's form file
The following is a sample project that uses NI-488 board-level functions.
VBBOARD.MAK
sample's project file
VBBOARD.FRM
sample's form file
VBBOARD.EXE
sample made into an executable file
The following is a sample project that uses NI-488 device-level functions.
VBDEVICE.MAK
sample's project file
VBDEVICE.FRM
sample's form file
VBDEVICE.EXE
sample made into an executable file
Documents you may be interested
Documents you may be interested