Gx5733GetPortByteDirection

Purpose

Returns the direction of a port byte.

Syntax

Gx5733GetPortByteDirection (nHandle, nPort, nByte, bInOut, 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.
nByte
SHORT
Port byte number: 0-3, 0 for the port low order byte and 3 for the high order byte.
bInOut
PBOOL
Returned byte direction:
0. (FALSE) - Input.
1. (TRUE) - 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 returns the byte direction of port 1, byte 3:

 

SHORT nStatus;

BOOL bOut;

 

Gx5733GetPortByteDirection (nHandle, 1, 3, &bOut, nStatus);

 

See Also

Gx5733SetPortByteDirection, Gx5733GetPortDirection