Gx6196SetPioOutputEnable

Purpose

Sets the PIO channels output enable states.

Syntax

Gx6196SetPioOutputEnable (nHandle, ucOutputEnable, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Handle to a GX6196 board.
ucOutputEnable
BYTE
8 bits (0-255), each corresponds to a PIO channel. A bit that is set to 1 indicates that output is enabled. A bit that is set to 0 indicates that the output is disabled. Low bit (0x1) indicates that channel 0 is enabled and high bit 0x80 indicates that channel 7 output is enabled.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

Each of the 8 PIO channels has an output enable setting. A PIO channel will only be able to drive a voltage level when the channel’s output enable is set.

Example

The following example sets all PIO output enables and then writes 0x9 to the PIO, enabling PIO channel 0 and 3 and then setting these channels to high:

 

Gx6196SetPioOutputEnable (nHandle, 0x09, &nStatus);

Gx6196WritePio (nHandle, 0x9, &nStatus);

 

See Also

Gx6196GetPioOutputEnable, Gx6196WritePio, Gx6196ReadPio, GxSWGetErrorString