OpenDev

OpenDev (char *deviceName, char *instrumentPrefix);

Purpose

Opens a GPIB device.

Parameters

Input
Name Type Description
deviceName string Must be null-terminated.
instrumentPrefix string Must be null-terminated.

Return Value

Name Type Description
bd integer Result of the open device operation.

Return Code

Code Description
-1 Device table is full, or no more devices are available.

Parameter Discussion

deviceName is a string that specifies a device name. If deviceName is "", OpenDev acts identically to ibdev by opening the first available unopened device. If deviceName is not "", OpenDev acts identically to ibfind.

instrumentPrefix is a string that specifies the instrument prefix associated with the instrument module. The instrument prefix must be identical to the prefix you enter when creating the function tree for the instrument module. If the instrument module has no prefix or you are not using OpenDev in an instrument module, pass the string "" for instrumentPrefix.

Using This Function

OpenDev attempts to find an unused device in the GPIB handler device table and open the device. If successful, OpenDev returns a device descriptor. Otherwise, it returns a negative number.

National Instruments recommends that you use ibdev to open handles to devices. Do not use ibdev in instrument modules. Use OpenDev instead.