Gx5731SetPort

Purpose

Write data to the specified port.

Syntax

Gx5731SetPort (nHandle, nPort, dwValue, pnStatus)

Parameters

Name
Type
Description
nHandle
SHORT
Handle to a GX5731 board.
nPort
SHORT
Specified Module's port number:
0. GX5731_PORT0: Module port 0
1. GX5731_PORT1: Module port 1
2. GX5731_PORT2: Module port 2.   
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 Gx5731GetPort to read data from the port.

Example

The following example writes 0xFF00FF to port 1:

 

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

 

See Also

Gx5731GetPort, Gx5731SetPortBit, Gx5731SetPortByte, Gx5731SetPortWord, Gx5731SetPortDirection