GtWaveFuncSetOutToSquareDutyCycle

Supported By

GX1120

Applies To

Function Generator mode only.

Purpose

Sets the output to square duty cycle value.

Syntax

GtWaveFuncSetOutToSquareDutyCycle (nHandle, nChannel, dDutyCycle, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Handle to a GX11X0 board.
nChannel
SHORT
Specified Channel number.
GX1120:
0 = GTWAVE_CHANNEL_A: Channel A.
1 = GTWAVE_CHANNEL_B: Channel B.
dDutyCycle
DOUBLE
Output to square duty cycle, range is from 20% to 80%.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

This function is only active when the Output to square state is enabled.

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 the GtWaveFuncSetOutToSquareDutyCycle 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 duty cycle to 35%:

 

GtWaveFuncSetOutToSquareDutyCycle (nHandle, GTWAVE_CHANNEL_A, 35, &nStatus);

 

See Also

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