Omega OMB-DAQ-54 User Manual page 134

Usb data acquisition modules
Table of Contents

Advertisement

API Commands
Overview
This appendix includes information regarding type-sensitive API function wrappers for Visual Basic,
Personal Daq driver commands for Windows
channels, event-handling, hardware, A/D gain, general I/O, digital I/O port connection (page B-29), and
API error codes (page B-33).
Type-Sensitive API Function Wrappers for Visual Basic
Each API function has a wrapper serving as an interface between the Visual Basic program and the actual
API function calls. API function prototypes (made available by
file (
PDAQX.BAS
Declare Function BdaqAdcTransferSetBuffer& Lib "pdaqx.dll" Alias _
"daqAdcTransferSetBuffer" (ByVal handle&, buf As Any, ByVal ScanCount&, _
ByVal transferMask&)
Ideally, any application written in Visual Basic should call the function above by using the function
wrapper,
VbdaqAdcTransferSetBuffer
BdaqAdcTransferSetBuffer
Function VBdaqAdcTransferSetBuffer&(ByVal handle&, buf%(), ByVal ScanCount&,
ByVal transferMask&)
Dim lb1&
lb1& = LBound(buf%)
daqErrno& = BdaqAdcTransferSetBuffer&(handle&, buf%(lb1&), ScanCount&,
If ((daqErrno& <> 0) And (daqErrnum& <> 0)) Then Error daqErrnum&
End Function
For Visual Basic versions preceding 5.0, proper error handling is made possible with the use of wrappers.
In cases where API functions return structured information, the function wrappers assist in presenting that
information to the programmer. For
the DLL) is transferred to a standard VB string array that is easier to work with on the programming end.
It is important to note that while every API function supported in Visual Basic has at least one associated
wrapper, the API functions that include buffer references have two different associated wrappers
(dependent on the buffer's data type). For example, consider the
The prototype has a buffer parameter declared as type
buffers can contain either integers (16-bit numbers), or single-precision floating-point numbers (Single
data type).
VBdaqAdcTransferSetBuffer
VBdaqAdcTransferSetBufferSingle
The only difference between the
functions is that the
The following table lists buffer-related API functions and associated wrappers.
API Function
BdaqAdcTransferSetBuffer
BdaqAdcTransferBufData
BdaqAdcRdScan
BdaqAdcRdN
BdaqAdcRdScanN
BdaqAdcGetBufData
BdaqAdcRd
BdaqCvtRawDataFormat
Personal Daq User's Manual
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
) as follows:
, rather than calling the API function directly via
. The standard wrapper for this function is:
transferMask&)
VBdaqAdcTransferSetBuffer& = daqErrno&
VBdaqGetDeviceList
- would be used to call the
buffer containing integers.
VBdaqAdcTransferSetBuffer
parameters consist of different data types for each wrapper.
buf
Integer Wrapper
VBdaqAdcTransferSetBuffer
VBdaqAdcTransferBufData
VBdaqAdcRdScan
VBdaqAdcRdN
VBdaqAdcRdScanN
VBdaqAdcGetBufData
VBdaqAdcRd
VBdaqCvtRawDataFormat
Appendix B,
887095
TM
in 32-bit mode, parameter definitions such as A/D
PDAQX.DLL
the information in the byte array (returned by
daqAdcTransferSetBuffer
(see previous wrapper code). Data acquisition
Any
daqAdcTransferSetBuffer
- would be used for a buffer containing single-precision
floating-point numbers.
and
VBdaqAdcTransferSetBufferSingle
Floating-Point Wrapper
VBdaqAdcTransferSetBufferSingle
VBdaqAdcTransferBufDataSingle
VBdaqAdcRdScanSingle
VBdaqAdcRdNSingle
VBdaqAdcRdScanNSingle
VBdaqAdcGetBufDataSingle
VBdaqAdcRdSingle
VBdaqCvtRawDataFormatSingle
B
are declared in the header
)
function.
function with a
API Commands
B-1

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Omb-daq-55Omb-daq-56

Table of Contents