Gx5732SetPortWord

Purpose

Writes a specific word of data to a port.

Syntax

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

Parameters

Name
Type
Description
nHandle
SHORT
Handle to a GX5732 board.
nPort
SHORT
Digital I/O port number:
0. GX5732_PORT0: Port 0.
1. GX5732_PORT1: Port 1.
2. GX5732_PORT2: Port 2.
3. GX5732_PORT3: Port 3.
4. GX5732_PORT4: Port 4.
5. GX5732_PORT5: Port 5.
6. GX5732_PORT6: Port 6.
nWord
SHORT
Port word number:
0. GX5732_PORT_LOW_WORD: low order word (bytes 0 and 1)
1. GX5732_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 0xFF12 to port 1 low order word (bytes 0 and 1) value:

 

Gx5732SetPortWord (nHandle, GX5732_PORT1, GX5732_PORT_LOW_WORD, 0xFF12, &nStatus);

 

See Also

Gx5732GetPortWord, Gx5732SetPortBit, Gx5732SetPortByte, Gx5732SetPort