Gx5732SetPortByte

Purpose

Writes a specific byte of data to a port group.

Syntax

Gx5732SetPortByte (nHandle, nPort, nByte, ucValue, pnStatus)

Parameters

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.
nByte
SHORT
Port byte number: 0-3, 0 for the port low order byte and 3 for the high order byte.
0. GX5732_PORT_BYTE0
1. GX5732_PORT_BYTE1
2. GX5732_PORT_BYTE2
3. GX5732_PORT_BYTE3
ucValue
BYTE
Value to set 0-255. Each bit represents the specific channel state bit 0 for lowest channel number.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

Only byte set to output direction will be written.

Use the Gx5732GetPortByte to read data from a port byte.

Example

The following example writes 0x5 (bit 16 and 19 hi and bit 17, 18, 20-23 to low state) to port 1, byte 2 value:

 

Gx5732GetPortByte (nHandle, GX5732_PORT1, GX5732_PORT_BYTE2, 0x5, &nStatus);

 

See Also

Gx5732GetPortByte, Gx5732SetPortBit, Gx5732SetPortWord, Gx5732SetPort