Gx5731SetPortByte

Purpose

Writes a specific byte of data to a port group.

Syntax

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

Parameters

Name
Type
Description
nHandle
SHORT
Handle to a GX5731 board.
nPort
SHORT
Digital I/O port number: 0-6.
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 Gx5731GetPortByte 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:

 

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

 

See Also

Gx5731GetPortByte, Gx5731SetPortBit, Gx5731SetPortWord, Gx5731SetPort