Gx5642SetChannelTTLPort

Purpose

Sets the specified channel TTL Port value.

Syntax

Gx5642SetChannelTTLPort (nHandle, nChannel, bData, pnStatus)

Parameters

Name
Type
Description
nHandle
SHORT
Handle to a GX5642 board.
nChannel
SHORT
Channel range is: GX5642_FIRST_CHANNEL (0) to GX5642_LAST_CHANNEL (63).
bData
BOOL
TTL Port value:
0. Logic low
1. Logic high
pnStatus

 

PSHORT
Returned status: 0 on success, negative number on failure.

Comments

The function sets the TTL Port value.

For protection, by default all channels are disabled after power-up and reset. The channels can be enabled and or disabled by calling Gx5642SetChannelOutputState.

Note: The channel should be set to Static I/O mode prior calling this function by calling Gx5642SetChannelMode otherwise the function returns an error.

Example

The following example sets channel 0 TTL Port value to 1:

 

Gx5642SetChannelTTLPort (nHandle, 0, 1, &nStatus);

 

See Also

Gx5642GetChannelTTLPort, Gx5642SetChannelMode, GxPioGetErrorString