Returns the direction of port bytes.
Gx5732GetPortDirection (nHandle, nPort, pnDirection, 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. |
pnDirection |
PSHORT |
Returned port bytes directions where bit 0 corresponds to byte 0, bit 1 to byte 1, bit 2 byte 2 and bit 3 to byte 0. A bit is set to hi ’1’ for output and low ‘0’ for input. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
Each digital I/O port is divided to four groups or bytes. Each group contains eight channels and can have its own direction, input or output.
The following example returns the direction of port 1:
SHORT nDirection, nStatus;
Gx5732GetPortByteDirection (nHandle, GX5732_PORT1, &nDirection, &nStatus);