National Instruments PC-OPDIO-16 Telescope User Manual


 
Chapter 6 NI-DAQ Function Reference
© National Instruments Corporation 6-3 PC-OPDIO-16 User Manual
Visual Basic for DOS
All of the function names listed in this manual have underscores (_) in the names to delineate
words. In Visual Basic the underscore is illegal in a symbol name, so you must replace each
underscore in the NI-DAQ function names with a period when you use function names in your
program.
When you pass arrays to the NI-DAQ functions using Visual Basic in DOS, you simply pass the
array name followed by the appropriate type character and empty parentheses. For example, you
would call the DAQ_Start function using the following syntax:
status% = DAQ.Start (device%, chan%, gain%, buffer%(), count&,
timebase%, sampInterval%)
When calling an NI-DAQ function that takes no parameters, do not append the parentheses, (), to
the function name. Following is an example of how to call an NI-DAQ function that takes no
parameters:
err%=USE.E.Series.DIO
Borland Turbo Pascal
When you pass arrays to NI-DAQ functions using Borland Turbo Pascal in DOS or Windows,
you need to pass a pointer to the array. You can either declare an array and pass the array
address to the NI-DAQ function, or you can declare a pointer, dynamically allocate memory for
the pointer, and pass the pointer directly to the NI-DAQ function. For example,
var
buffer : array [1..1000] of Integer;
bufPtr : ^Integer;
status := DAQ_Start (device, chan, gain, @buffer, count,
timebase, sampInterval);
or
(* allocate memory for bufPtr first *)
status := DAQ_Start (device, chan, gain, bufPtr, count, timebase,
sampInterval);
Visual BASIC for Windows
NI-DAQ Constants Include File
The file NIDAQCNS.INC contains definitions for constants required for some of the NI-DAQ
functions. You should use the constants symbols in your programs; do not use the numerical
values.
In Visual Basic for Windows, you can load the entire NIDAQCNS.INC file into the global
module. You will then be able to use any of the constants defined in this file in any module in
your program.