Gx5733SetPortWord

Purpose

Write a specific word of data to a port.

Syntax

Gx5733SetPortWord (nHandle, nPort, nWord, wValue, pnStatus)

Parameters

Name
Type
Description
nHandle
SHORT
Handle to a GX5733 board.
nPort
SHORT
Digital I/O port number: 1-3
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).
wValue
WORD
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

Each digital I/O port contains two words. Each word contains two bytes or 16 channels. Set the word byte directions to output before using this function.

Example

The following example writes 0x5 (bit 16 and 19 hi and bit 17, 18, 20-23 to low state) to port 1, byte 2 value:

 

Gx5733GetPortByte (nHandle, 1, 2, 0x5, &nStatus);

 

See Also

Gx5733GetPortWord, Gx5733SetPortBit, Gx5733SetPortByte, Gx5733SetPort