Reads a port word value.
Gx5731GetPortWord (nHandle, nPort, nWord, pwValue, pnStatus)
Name |
Type |
Description |
nHandle |
SHORT |
Handle to a GX5731 board. |
nPort |
SHORT |
Digital I/O port numbers are as follow:
|
nWord |
SHORT |
Port word number: 0-1. Where 0 is for low order word (bytes 0 and 1) and 1 for the high order word (bytes 2 and 3). |
pwValue |
PWORD |
Returned port word value: 0 to 65,535 (0-0xFFFF). Where bit 0 corresponds to channel 0 and bit 15 to channel 15. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
Use the Gx5731SetPortWord to write data to the port word when in Output direction.
The following example reads port 1, word 0 value:
SHORT nStatus;
WORD wValue;
Gx5731GetPortByte (nHandle, 1, 0, &wValue, &nStatus);
Gx5731SetPortWord, Gx5731GetPortBit, Gx5731GetPortByte, Gx5731GetPort