Gx5733SetPortByte

Purpose

Write a specific byte of data to a port byte group.

Syntax

Gx5733SetPortByte (nHandle, nPort, nByte, ucValue, pnStatus)

Parameters

Name
Type
Description
nHandle
SHORT
Handle to a GX5733 board.
nPort
SHORT
Module port 0 (GX5733_PORT0) only.
nByte
SHORT
Port byte number: 0-3, 0 for the port low order byte and 3 for the high order byte.
ucValue
BYTE
Value to set 0-255. Each bit represents the specific channel state bit 0 for lowest channel number.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

Only byte set to output direction will be written.

Use the Gx5733GetPortByte to read data from a port byte.

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

Gx5733GetPortByte, Gx5733SetPortBit, Gx5733SetPortWord, Gx5733SetPort