Writes a specific bit of data to a port channel.
Gx5732SetPortBit (nHandle, nPort, nBit, ucValue, 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. |
nBit |
SHORT |
Port channel number: 0 to 31. |
ucValue |
BYTE |
Channel value: 0 for low state and 1 for hi state. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
Only bit that reside in a group set to output direction will be written.
Use the Gx5732GetPortBit to read data from a port bit.
The following example set port 1, bit 30 value to hi state:
Gx5732GetPort (nHandle, GX5732_PORT1, 30, 1, &nStatus);
Gx5732GetPortBit, Gx5732SetPortByte, Gx5732SetPortWord, Gx5732SetPort