Gx5733GetPortWord

Purpose

Reads a port word value.

Syntax

Gx5733GetPortWord (nHandle, nPort, nWord, pwValue, 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.
nWord
SHORT
Port word number:
0. GX5733_PORT_LOW_WORD: port low order word (bytes 0 and 1).
1. GX5733_PORT_HIGH_WORD: high order word (bytes 2 and 3).
pwValue
PWORD
Returned port word value: 0 to 65,535 (0-0xFFFF). Where bit 0 corresponds to channel 0 and bit 15 to channel 15.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

Use the Gx5733SetPortWord to write data to the port word when in Output direction.

Example

The following example reads port 1, word 0 value:

 

SHORT nStatus;

WORD wValue;

Gx5733GetPortByte (nHandle, 1, 0, &wValue, &nStatus);

 

See Also

Gx5733SetPortWord, Gx5733GetPortBit, Gx5733GetPortByte, Gx5733GetPort