GtWaveFuncSetOutToSquareState

Supported By

GX1110, GX1120

Applies To

Function Generator mode only.

Purpose

Sets the output to square state.

Syntax

GtWaveFuncSetOutToSquareState (nHandle, nChannel, bState, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Handle to a GX11X0 board.
nChannel
SHORT
Specified Channel number.
GX1120:
0 = GTWAVE_CHANNEL_A: Channel A.
GX1120:
0 = GTWAVE_CHANNEL_A: Channel A.
1 = GTWAVE_CHANNEL_B: Channel B.
bState
BOOL
Output to square state:
0=FALSE: Out to square state not active.
1=TRUE: Out to square state active.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

The function is only applicable when generating a sine waveform. When enabled, a comparator is connected to the sine waveforms and convert the output to a square waveform. The duty cycle of that square waveform can be programmed by calling thGtWaveFuncSetOutToSquareDutyCycle API. The output square wave is much cleaner waveform since it was derived directly from a sine wave.

Example

The following example sets the output to square state:

 

GtWaveFuncSetOutToSquareState (nHandle, GTWAVE_CHANNEL_A, TRUE, &nStatus);

 

See Also

GtWaveFuncGetOutToSquareDutyCycle, GtWaveFuncSetWaveform, GtWaveFuncSetSquareWaveDutyCycle, GtWaveFuncSetFrequency, GtWaveFuncSetOutToSquareState, GtWaveFuncSetPhase, GtWaveGetErrorString