Gx5641GetChannelConversionMode

Purpose

Returns the specified channel Conversion Mode.

Syntax

Gx5641GetChannelConversionMode (nHandle, nChannel, pnMode, pnStatus)

Parameters

Name
Type
Description
nHandle
SHORT
Handle to a GX5641 board.
nChannel
SHORT
Channel range is: GX5641_FIRST_CHANNEL (0) to GX5641_LAST_CHANNEL (63).
pnMode
PSHORT
Conversion Mode can be as follows:
0. GX5641_CHANNEL_CONVERT_DIFFERENTIAL_TO_TTL – convert differential signal to TTL level.
1. GX5641_CHANNEL_CONVERT_TTL_TO_DIFFERENTIAL – convert TTL level to differential.
pnStatus
 
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

The function returns the specified channel conversion mode: differential signal to TTL level or convert TTL level to differential.

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

Note: The channel should be set to conversion mode prior calling this function by calling Gx5641SetChannelMode otherwise the function returns an error.

Example

The following example sets channel 0 to conversion mode, sets the conversion to be TTL level to differential, enables the channel and returns the channels conversion mode:

 

SHORT nMode;

Gx5641SetChannelMode (nHandle, 0, GX5641_CHANNEL_MODE_CONVERSION, &nStatus);

Gx5641SetChannelConversionMode (nHandle, 0, GX5641_CHANNEL_CONVERT_TTL_TO_DIFFERENTIAL,                 

                                &nStatus);

Gx5641SetChannelOutputState (nHandle, 0, GX5641_CHANNEL_OUTPUT_ENABLE, &nStatus);

Gx5641GetChannelConversionMode (nHandle, 0, &nMode, &nStatus);

 

See Also

Gx5641SetChannelMode, Gx5641SetChannelConversionMode, Gx5641SetChannelOutputState, GxPioGetErrorString