Gx5733GetPort

Purpose

Reads a port value.

Syntax

Gx5733GetPort (nHandle, nPort, pdwValue, 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.
pdwValue
PDWORD
Returned port value, 32 bit integer where each bit represents a channel. Bit 0 for channel 0 and bit 31 for channel 31.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

Use the Gx5733SetPort to write data to the port when in Output direction.

Example

The following example reads port 1 value:

 

SHORT nStatus;

DWORD dwValue;

Gx5733GetPort (nHandle, 1, &dwValue, &nStatus);

 

See Also

Gx5733SetPort, Gx5733GetPortBit, Gx5733GetPortByte, Gx5733GetPortWord, Gx5733SetPortDirection