GtDio6xChannelGetNameIndex

Applies To

GX5296, GX5961, GX5964, File

Purpose

Returns the I/O channel number associated with the name.

Syntax

GtDio6xChannelGetNameIndex (nHandle, pszName, plChannel, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Session identifier:

     Board handle is used when communicating with the hardware. The Board handle session identifier is returned by calling GtDio6xInitialize or GtDio6xSetupInitialization.

     File handle is used when communicating with a file. The File handle session identifier is  returned by calling GtDio6xFileOpen.

pszName
PSTR
Specify the name of an I/O channel.
plChannel
PLONG
Used to return the I/O channel number associated with the name. This parameter is 0-based. Auxiliary channel numbers begin with 1000.
pnStatus
PSHORT
Returned status: 0 on success, negative value on failure.

Comments

An I/O Channel can be associated with a unique name. This name can be set and read from the software front panel as well. The names are saved to file when GtDio6xFileSave is called.

Example

The following example sets the name of channel 4 to “My First Channel”, retrieve the channel’s name and then uses the name to retrieve back the channel index:

 

SHORT nStatus;

LONG lChannel;

CHAR  szChannelName[256];

 

GtDio6xChannelSetName(nHandle, 4, “My First Channel”, &nStatus);

GtDio6xChannelGetName(nHandle, 4, szChannelName, 256 &nStatus);

printf(“Channel 4 name is: %s”, szChannelName);

 

GtDio6xChannelGetNameIndex (nHandle, szChannelName, &lChannel, pnStatus);

 

See Also

GtDio6xChannelSetName, GtDio6xChannelGetNameIndex, GtDio6xGetErrorString