Gx5733GetPortByte

Purpose

Reads a port byte value.

Syntax

Gx5733GetPortByte (nHandle, nPort, nByte, pucValue, 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.
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 Gx5733SetPortByte to write data to the port bit when in Output direction.

Example

The following example reads port 1, byte 2 value:

 

SHORT nStatus;

BYTE ucValue;

 

Gx5733GetPortByte (nHandle, 1, 2, &ucValue, &nStatus);

 

See Also

Gx5733SetPortByte, Gx5733GetPortBit, Gx5733GetPortWord, Gx5733GetPort