Gx5733SetPortBit

Purpose

Write a specific bit of data to a port channel.

Syntax

Gx5733SetPortBit (nHandle, nPort, nBit, ucValue, pnStatus)

Parameters

Name
Type
Description
nHandle
SHORT
Handle to a GX5733 board.
nPort
SHORT
Digital I/O port number: 1-3.
nBit
SHORT
Port channel number: 0 to 31.
ucValue
BYTE
Channel value: 0 for low state and 1 for hi state.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

Only bit that reside in a group set to output direction will be written.

Use the Gx5733GetPortBit to read data from the port.

Example

The following example set port 1, bit 30 value to hi state:

 

Gx5733GetPort (nHandle, 1, 30, 1, &nStatus);

 

See Also

Gx5733GetPortBit, Gx5733SetPortByte, Gx5733SetPortWord, Gx5733SetPort