Gx6196WritePio

Purpose

Write data to the PIO output register.

Syntax

Gx6196WritePio (nHandle, ucData, pnStatus)

Parameters

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

Comments

A channel’s output must be enabled before it can drive a logic level.

Example

The following example enables the output on all PIO channels and then set PIO channels 0-2 to high and set channel 3-7 to low:

 

Gx6196SetPiotOutputEnable(Handle, 0xFF, &nStatus);

Gx6196WritePio(nHandle, 0x7, &nStatus);

 

See Also

Gx6196ReadPio, Gx6196GetPio, GxSWGetErrorString