GX1120
Function Generator mode only.
Sets the output to square duty cycle value.
GtWaveFuncSetOutToSquareDutyCycle (nHandle, nChannel, dDutyCycle, pnStatus)
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. |
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.
The following example sets the output to square duty cycle to 35%:
GtWaveFuncSetOutToSquareDutyCycle (nHandle, GTWAVE_CHANNEL_A, 35, &nStatus);
GtWaveFuncGetOutToSquareDutyCycle, GtWaveFuncSetWaveform, GtWaveFuncSetSquareWaveDutyCycle, GtWaveFuncSetFrequency, GtWaveFuncSetOutToSquareState, GtWaveFuncSetPhase, GtWaveGetErrorString