Gx5732GetPortByteDirection

Purpose

Returns the direction of a port byte.

Syntax

Gx5732GetPortByteDirection (nHandle, nPort, nByte, bInOut, pnStatus)

Parameters

Name
Type
Description
nhandle
SHORT
Handle to a GX5732 board.
nPort
SHORT
Digital I/O port number:
0. GX5732_PORT0: Port 0.
1. GX5732_PORT1: Port 1.
2. GX5732_PORT2: Port 2.
3. GX5732_PORT3: Port 3.
4. GX5732_PORT4: Port 4.
5. GX5732_PORT5: Port 5.
6. GX5732_PORT6: Port 6.
nByte
SHORT
Port byte number: 0-3, 0 for the port low order byte and 3 for the high order byte:
0. GX5732_PORT_BYTE0
1. GX5732_PORT_BYTE1
2. GX5732_PORT_BYTE2
3. GX5732_PORT_BYTE3
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;

Gx5732GetPortByteDirection (nHandle, GX5732_PORT1, GX5732_PORT_BYTE3, &bOut, nStatus);

 

See Also

Gx5732SetPortByteDirection, Gx5732GetPortDirection