GX3501, GX3509, GX3510, GX3540
Returns the specified PIO expansion board channel value.
GxFpgaPioGetChannel (nHandle, nGroup, nChannel, pnData, pnStatus)
Name |
Type |
Comments |
pnHandle |
SHORT |
Handle to a GX3500 board. |
nGroup |
SHORT |
Group value is as follows:0. GXFPGA_PIO_GROUP_A.1. GXFPGA_PIO_GROUP_B.2. GXFPGA_PIO_GROUP_C.3. GXFPGA_PIO_GROUP_D. |
nChannel |
SHORT |
Channel range is 0 to 19. |
pnData |
PSHORT |
Channel value:0. Logic low.1. Logic high. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
When using the GX3540, this function is limited to reading back-channel values from GXFPGA_PIO_GROUP_A and GXFPGA_PIO_GROUP_D. Attempting to read back values from GXFPGA_PIO_GROUP_B or GXFPGA_PIO_GROUP_C will result in an error.
The following example reads the logic level from channel 4 of Flex I/O group A into the nData variable:
SHORT nData;
GxFpgaPioGetChannel (nHandle, GXFPGA_PIO_GROUP_A, 0x4, &nData, &nStatus);
GxFpgaPioSetChannel, GxFpgaPioSetChannelDirection, GxFpgaGetErrorString