beautypg.com

Measurement Computing Data Acquisition Systems rev.10.4 User Manual

Page 274

background image

Enter a device name in the text box, or use the default “DaqBoard2K0.” Device Name is for identifying
the specific DaqBoard/2000 Series board [ or cPCI DaqBoard/2000c Series board]. Note that Device
Name
actually refers to the PCI[cPCI] slot and not to the actual DaqBoard/2000 Series board[or cPCI
DaqBoard/2000c].

Programming Note:
It should be noted that the daqName parameter of daqOpen should correspond to the name of the
device presented here. In this case, “DaqBoard2K0” should be used as the daqName to open the
DaqBoard/2000 Series board [or cPCI DaqBoard/2000c] represented here. Notice the device named
“DaqBook0” directly under the “DaqBoard2k0” device. To open the this device the daqName
parameter of daqOpen should be set to “DaqBook0”

Verify “DaqBoard/2000 is listed as the Device Type. Note that available device types can be viewed via
the pull-down list.

Confirm that the DaqBoard/2000 text box shows a Bus #, Slot #, and Serial Number.

Verify that the DaqBoard/2000’s serial number matches the serial number obtained in step 5.

Steps 5 and 6 apply only to DaqBoard/2000 Series [and 2000c Series] devices.

Obtaining a Device’s handle

daqOpen

should be performed prior to any other operation performed on the device. This function will return a

device handle that is used by other functions to reference the device. Once the device has been opened, the device
handle should be used to perform subsequent operations on the device. If successful, this function will return a non-
negative handle which can then be used in subsequent API calls.

Most functions in this manual require a device handle in order to perform their operation. When the device session
is complete, daqClose may be called with the device handle to close the device session.

If a -1 is returned as the handle then daqOpen function failed to properly open the device. If this
occurs, the returned handle is not valid and cannot be used in any other handle based function. The
-1 handle constitutes a fatal error condition and the device cannot be further accessed.

Prototypes

C/C++

daqOpen (LPSTR daqName);

Visual BASIC

VBdaqOpen& (ByVal daqName$)

Program References

DAQADCEX01.CPP, DAQADCEX02.CPP, DAQDIGIOEX01.CPP, DAQDIGIOEX02.CPP,
DAQEX.FRM (VB)

4.5-44 Daq API Command Reference

908794

Programmer’s

Manual