Gets the PIO channels output enable states.
Gx6196GetPioOutputEnable (nHandle, pucOutputEnable, pnStatus)
Name |
Type |
Comments |
nHandle |
SHORT |
Handle to a GX6196 board. |
pucOutputEnable |
PBYTE |
Returned 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. |
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.
The following example gets all PIO output states:
BYTE ucOutputEnable;
Gx6196GetPioOutputEnable (nHandle, &ucOutputEnable, &nStatus);
if (ucOutputEnable & 0x2)
printf(“Channel 1 output is enabled”);
Gx6196SetPioOutputEnable, Gx6196WritePio, Gx6196ReadPio, GxSWGetErrorString