Gx6196GetPio

Purpose

Returns PIO output register data.

Syntax

Gx6196GetPio (nHandle, pucData, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Handle to a GX6196 board.
pucData
PBYTE
Returned 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

This function returns data from the output register (set by Gx6196WritePio).

Example

The following example reads back the PIO channels output register state:

 

BYTE ucData;

 

Gx6196WritePio(nHandle, 0xCD, &nStatus);

Gx6196GetPio(nHandle, &ucData, &nStatus);

if(ucData==0xCD)

   printf(“Output register is reading back correctly”);

 

See Also

Gx6196WritePio, Gx6196ReadPio, GxSWGetErrorString