Gx5731GetPort

Purpose

Reads a port value.

Syntax

Gx5731GetPort (nHandle, nPort, pdwValue, 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.
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 Gx5731SetPort to write data to the port when in Output direction.

Example

The following example reads port 1 value:

 

SHORT nStatus;

DWORD dwValue;

 

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

 

See Also

Gx5731SetPort, Gx5731GetPortBit, Gx5731GetPortByte, Gx5731GetPortWord, Gx5731SetPortDirection