Gx5733GetPortDirection

Purpose

Returns the direction of port bytes.

Syntax

Gx5733GetPortDirection (nHandle, nPort, pnDirection, pnStatus)

Parameters

Name
Type
Description
nHandle
SHORT
Handle to a GX5733 board.
nPort
SHORT
Digital I/O port numbers are as follow:
  • Digital I/O port numbers 1-3.
  • Port 0 if no I/O module installed.
pnDirection
PSHORT
Returned port bytes directions where bit 0 corresponds to byte 0, bit 1 to byte 1, bit 2 byte 2 and bit 3 to byte 0. A bit is set to hi ’1’ for output and low ‘0’ for input.
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 returns the direction of port 1:

 

SHORT nDirection, nStatus;

Gx5733GetPortByteDirection (nHandle, &nDirection, &nStatus);

 

See Also

Gx5733SetPortDirection, Gx5733GetPortByteDirection