GtDio6xChannelGetMode

Applies To

GX5296, GX5961, GX5964, File

Purpose

Returns the channel mode.

Syntax

GtDio6xChannelGetMode (nHandle, nChannel, pnMode, 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.

nChannel
SHORT
Used to specify the channel to Get. This parameter is 0-based and refers to any channel in the Domain. Auxiliary channel numbers begin with 1000.
GX5296: Each GX5296 board has 4 auxiliary channels that support all the Pin Electronics API functions. Only the Master board can use any of the 4 auxiliary channels to select any of the specified aux signal (GtDio6xChannelSetAuxiliaryOutputSignal API).
GX5961: Each GX5961 board has 4 fully programmable auxiliary channels, and 8 TTL I/O channels. First 4 auxiliary channels may use all the Pin Electronics and GtDio6xChannelSetAuxiliaryOutputSignal API. The TTL 8 auxiliary channels can only be used by GtDio6xChannelSetAuxiliaryOutputSignal.
GX5964: Does not have Auxiliary channels.
pnMode
PSHORT
Used to get the channel mode:

0.    GTDIO6X_CHANNEL_MODE_DYNAMIC_IO: Normal sequencer-controlled mode used when outputting vectors dynamically. Output voltage levels will be set according to the GtDio6xChannelSetSourceLevels API.

1.    GTDIO6X_CHANNEL_MODE_DISABLED: Disable pin electronics.

2.    GTDIO6X_CHANNEL_MODE_OUTPUT_LOW: Force a static logic low level on the output. The output voltage level low will be set according to the GtDio6xChannelSetSourceLevels API.

3.    GTDIO6X_CHANNEL_MODE_OUTPUT_HIGH: Force a static logic high level on the output. The output voltage level high will be set according to the GtDio6xChannelSetSourceLevels API.

4.    GTDIO6X_CHANNEL_MODE_PMU_FORCE_CURRENT: Force a current in PMU mode. The force current will be set according to the GtDio6xChannelSetPmuForcedCurrentAPI.

5.    GTDIO6X_CHANNEL_MODE_PMU_FORCE_VOLTAGE: Force a voltage in PMU mode. The force voltage will be set according to the GtDio6xChannelSetPmuForcedVoltageAPI.

pnStatus
PSHORT
Returned status: 0 on success, negative value on failure.

Comments

This function sets a channel into a particular function mode. A channel can function as a dynamic digital I/O where the data sequencer controls its operation, a static level output, or as a parametric measurement unit (PMU). There are two PMU modes that can be selected, Force Voltage and Force Current.

In Forced Voltage mode, the pin electronics attempt to force a certain voltage. The output current limit serves to limit the amount of current the pin electronics will generate in order to generate a given forced voltage.

In Forced Current mode, the pin electronics attempt to force a certain current.

Example

The following example does the following:

1.    Sets channels 0, 2 and 3 to dynamoc I/O.

2.    Sets channels 10, 12 and 13 to forced curnet I/O.

3.    Sets channels 20, 22 and 23 to forced voltage I/O.

4.    Returns channels 0, 10, and 20 mode.

 

SHORT nStatus, nMode;

SHORT alChannelList[3];

 

// Fill the channels array

alChannelList[0]=0;

alChannelList[1]=2;

alChannelList[2]=3;

GtDio6xChannelSetMode(nHandle, 3, alChannelList, GTDIO6X_CHANNEL_MODE_DYNAMIC_IO, &nStatus);

 

// Fill the channels array

alChannelList[0]=20;

alChannelList[1]=22;

alChannelList[2]=23;

GtDio6xChannelSetMode(nHandle, 3, alChannelList, GTDIO6X_CHANNEL_MODE_PMU_FORCE_VOLTAGE, &nStatus);

 

GtDio6xChannelGetMode(nHandle, 0, &nMode, &nStatus);

GtDio6xChannelGetMode(nHandle, 10, &nMode, &nStatus);

GtDio6xChannelGetMode(nHandle, 20, &nMode, &nStatus);

 

See Also

GtDio6xChannelSetMode, GtDio6xChannelSetSourceLevels, GtDio6xChannelGetSourceLevels, GtDio6xChannelSetPmuForcedVoltage, GtDio6xChannelGetPmuForcedVoltage,  GtDio6xChannelSetPmuForcedCurrent, GtDio6xChannelGetPmuForcedCurrent, GtDio6xGetErrorString