Gx5732GetPortByte

Purpose

Reads a port byte value.

Syntax

Gx5732GetPortByte (nHandle, nPort, nByte, pucValue, 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

pucValue
PBYTE
Returned value 0-255. Each bit represents the specific channel state bit 0 for lowest channel number.
pnStatus
LPSHORT
Returned status: 0 on success, negative number on failure.

Comments

Use the Gx5732SetPortByte to write data to the port byte when in Output direction.

Example

The following example reads port 1, byte 2 value:

 

SHORT nStatus;

BYTE ucValue;

Gx5732GetPortByte (nHandle, GX5732_PORT1, GX5732_PORT_BYTE2, &ucValue, &nStatus);

 

See Also

Gx5732SetPortByte, Gx5732GetPortBit, Gx5732GetPortWord, Gx5732GetPort