National Instruments 320682C Musical Toy Instrument User Manual


 
Chapter 4 GPIB/GPIB-488.2 Library
© National Instruments Corporation 4-21 LabWindows/CVI Standard Libraries
OpenDev
int
bd = OpenDev
(char
*
deviceName,
char
*
instrumentPrefix
);
Purpose
Opens a GPIB device.
Parameters
Input
deviceName
string Must be null-terminated.
instrumentPrefix
string Must be null-terminated.
Return Value
bd
integer Result of the open device
operation.
Return Codes
-1
Device table is full, or no more devices available.
Parameter Discussion
deviceName
is a string specifying a device name that appears in the IBCONF device table. If
deviceName
is not "", OpenDev acts identically to ibfind. If
deviceName
is "", OpenDev
acts identically to ibdev. OpenDev uses the first available unopened device.
instrumentPrefix
is a string that specifies the instrument prefix associated with the instrument
module. The instrument prefix must be identical to the prefix entered when creating the function
tree for the instrument module. If the instrument module has no prefix or if OpenDev is not
being used in an instrument module, pass the string "" for
instrumentPrefix
.
Using This Function
This function attempts to find an unused device in the GPIB handler's device table and open it. If
successful, OpenDev returns a device descriptor. Otherwise, it returns a negative number.