National Instruments NI-488.2 Time Clock User Manual


 
Developing Your Application Chapter 3
NI-488.2 User Manual for Windows 3-18 © National Instruments Corp.
Visual Basic
With Visual Basic, you access the NI-488 functions as subroutines, using the BASIC
keyword CALL followed by the NI-488 function name (for example CALL ibtrg
(ud%)). You can also access the NI-488 functions using another set of functions, the il
functions (for example result% = iltrg (ud%)). If you are using Visual Basic
and prefer calling functions instead of subroutines, then you can use the il functions.
With some of the ib commands (for example, ibrd) the length of the string buffer is
automatically calculated within the actual subroutine, which eliminates the need to pass
in the length as an extra parameter.
Before you run your Visual Basic application, include the files niglobal.bas and
vbib.bas in your application project file.
If you are using Microsoft Visual Basic 1.0, you must edit niglobal.bas to define
the constants true and false as follows:
global const true = -1
global const false = 0
In Microsoft Visual Basic 2.0 and higher, true and false are reserved words;
therefore, these constants are no longer defined in niglobal.bas.
After you have written your Visual Basic application, choose the Start option from the
Run menu to execute your program.
Direct Entry with C
Before you compile your C application program, make sure that the following lines are
included at the beginning of your program:
#ifdef __cplusplus
extern "C"{
#endif
#include "windecl.h
int ibsta, iberr; /* NI-488.2 global status variables */
long ibcntl;
#ifdef __cplusplus
}
#endif
You must define the global status variables in your application program.