Gx5641SetGroupDifferentialPortDirection

Purpose

Sets the specified group differential Port Direction.

Syntax

Gx5641SetGroupDifferentialPortDirection (nHandle, nGroup, dwDirection, pnStatus)

Parameters

Name
Type
Description
nHandle
SHORT
Handle to a GX5641 board.
nGroup
SHORT

Group value is as follows:

0. GX5641_GROUP0 (channels 0 to 31)

1. GX5641_GROUP1 (channels 32 to 63)

dwDirection
DWORD

Group’s output state.

Each of the 32-bits represents a channel in the group. Bit 0 is the first channel in the group and bit 31 is the last channel in the group.

Bit low - channel port is set as input.

Bit high - channel port is set as output.

pnStatus

 

PSHORT

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

Comments

For protection, by default all channel’s connections (TTL and Deferential) are disabled after power-up and reset. The channels can be enabled and or disabled by calling Gx5641SetGroupOutputState.

Note: Only channels in the group that were set to Static I/O mode prior calling this function by calling Gx5641SetGroupMode will be set.

Example

The following example sets group 0 Differential Port channels 0, 4, 8 direction to output:

 

Gx5641SetGroupDifferentialPortDirection (nHandle, GX5641_GROUP0, 0x00000111, &nStatus);

 

See Also

Gx5641GetGroupDifferentialPortDirection, Gx5641SetGroupDifferentialPort, Gx5641SetGroupMode, GxPioGetErrorString