Reads a port value.
Gx5731GetPort (nHandle, nPort, pdwValue, pnStatus)
Name |
Type |
Description |
nHandle |
SHORT |
Handle to a GX5731 board. |
nPort |
SHORT |
Digital I/O port numbers are as follow:
|
pdwValue |
PDWORD |
Returned port value, 32-bit integer where each bit represents a channel. Bit 0 for channel 0 and bit 31 for channel 31. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
The following example reads port 1 value:
SHORT nStatus;
DWORD dwValue;
Gx5731GetPort (nHandle, 1, &dwValue, &nStatus);
Gx5731SetPort, Gx5731GetPortBit, Gx5731GetPortByte, Gx5731GetPortWord, Gx5731SetPortDirection