Gx5731SetPortDirection

Purpose

Sets a direction for a port groups.

Syntax

Gx5731SetPortDirection (nHandle, nPort, nDirection, pnStatus)

Parameters

Name
Type
Description
nHandle
SHORT
Handle to a GX5731 board.
nPort
SHORT
Digital I/O port number: 0-6.
nDirection
SHORT
Port bytes directions where bit 0 corresponds to byte 0, bit 1 to byte 1, bit 2 byte 2 and bit 3 to byte 3. A bit is set to hi ’1’ for Input and low ‘0’ for output.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

Each digital I/O port is divided to four groups or bytes. Each group contains eight channels and can have its own direction, input or output.

Example

The following example sets the direction of port 1, byte 0 to input and byte 1 to 3 to output:

 

Gx5731GetPortByteDirection (nHandle, 1, 6, nStatus);

 

See Also

Gx5731GetPortDirection, Gx5731SetPortByteDirection