Gx5733SetPort

Purpose

Write data to the specified port.

Syntax

Gx5733SetPort (nHandle, nPort, dwValue, pnStatus)

Parameters

Name
Type
Description
nHandle
SHORT
Handle to a GX5733 board.
nPort
SHORT
Digital I/O port number: 1-3.
dwValue
DWORD
Port value to set: 0 to 4,294,967,295 (0-0xFFFFFFFF), 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

Only bytes that are set to output direction will be written.

Use the Gx5733GetPort to read data from the port.

Example

The following example writes 0xFF00FF to port 1:

 

Gx5733SetPort (nHandle, 1, 0xFF00FF, &nStatus);

 

See Also

Gx5733ModuleGetPort, Gx5733SetPortBit, Gx5733SetPortByte, Gx5733SetPortWord, Gx5733SetPortDirection