GtDio6xChannelReadSenseLogicLevel

Applies To

GX5296

Purpose

Reads back the current logic level of a specified channel.

Syntax

GtDio6xChannelReadSenseLogicLevel (nHandle, nChannel, pnLogicLevel, 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.

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.
GX5961: Each GX5961 board has 4 auxiliary channels that support all the Pin Electronics API functions.
pnLogicLevel
PSHORT
Returns the current logic level of a channel

0.    GTDIO6X_CHANNEL_LOGIC_LEVEL_LOW – Channel voltage level below the programmed ViL voltage.

1.    GTDIO6X_CHANNEL_LOGIC_LEVEL_HIGH – Channel voltage level is above the programmed ViH voltage.

2.    GTDIO6X_CHANNEL_LOGIC_LEVEL_INVALID – Channel voltage is below the ViH and above the ViL voltage levels.

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

Comments

This function reads the current logic level of a particular channel in the Domain.

Example

The following reads channel 56 logic level:

 

SHORT nStatus, nLogicLevel;

 

GtDio6xChannelReadSenseLogicLevel(nHandle,56, &nLogicLevel, &nStatus);

 

if(nLogicLevel==GTDIO6X_CHANNEL_LOGIC_LEVEL_LOW)

    printf(“Logic level is Low, voltage is below the programmed ViL”);

elseif(nLogicLevel=GTDIO6X_CHANNEL_LOGIC_LEVEL_HIGH)

    printf(“Logic level is High, voltage is above the programmed ViH”);

else

    printf(“Logic leve is Invalid, voltage is between the programmed ViL and ViH”);

See Also

GtDio6xChannelGetSenseLevels, GtDio6xChannelSetSenseLevels, GtDio6xGetErrorString