Gx5642GetChannelDifferentialPortDirection

Purpose

Returns the specified channel Differential Port Direction.

Syntax

Gx5642GetChannelDifferentialPortDirection (nHandle, nChannel, pnDirection, pnStatus)

Parameters

Name
Type
Description
nHandle
SHORT
Handle to a GX5642 board.
nChannel
SHORT
Channel range is: GX5642_FIRST_CHANNEL (0) to GX5642_LAST_CHANNEL (63).
pnDirection
PSHORT
The channel Differential Port Direction can be as follows:
0. GX5642_CHANNEL_PORT_INPUT – channel port is set as input.
1. GX5642_CHANNEL_PORT_OUTPUT – channel port is set as output.
pnStatus

 

PSHORT
Returned status: 0 on success, negative number on failure.

Comments

For protection, by default all channels are disabled after power-up and reset. The channels can be enabled and or disabled by calling Gx5642SetChannelOutputState.

Note: The channel should be set to Static I/O mode prior calling this function by calling Gx5642SetChannelMode otherwise the function returns an error.

Example

The following example returns channel 0 Differential Port Direction:

 

SHORT nDirection;

Gx5642GetChannelDifferentialPortDirection (nHandle, 0, &nDirection, &nStatus);

 

See Also

Gx5642SetChannelDifferentialPortDirection, Gx5642SetChannelDifferentialPort, Gx5642SetChannelMode, GxPioGetErrorString