Reads a port value.
Gx5732GetPort (nHandle, nPort, pdwValue, pnStatus)
Name |
Type |
Description |
nHandle |
SHORT |
Handle to a GX5732 board. |
nPort |
SHORT |
Digital I/O port number:0. GX5732_PORT0: Port 0.1. GX5732_PORT1: Port 1.2. GX5732_PORT2: Port 2.3. GX5732_PORT3: Port 3.4. GX5732_PORT4: Port 4.5. GX5732_PORT5: Port 5.6. GX5732_PORT6: Port 6. |
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. |
Use the Gx5732SetPort to write data to the port when in Output direction.
The following example reads port 1 value:
SHORT nStatus;
DWORD dwValue;
Gx5732GetPort (nHandle, GX5732_PORT1, &dwValue, &nStatus);
Gx5732SetPort, Gx5732GetPortBit, Gx5732GetPortByte, Gx5732GetPortWord, Gx5732SetPortDirection