Gx5731GetPortByte

Purpose

Reads a port byte value.

Syntax

Gx5731GetPortByte (nHandle, nPort, nByte, pucValue, pnStatus)

Parameters

Name
Type
Description
nHandle
SHORT
Handle to a GX5731 board.
nPort
SHORT
Digital I/O port numbers are as follow:
  • Digital I/O port numbers 3-6.
  • Any port number 0 to 2 that has 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 Gx5731SetPortByte 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;

 

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

 

See Also

Gx5731SetPortByte, Gx5731SetPortBit, Gx5731GetPortWord, Gx5731GetPort