GtWaveFuncSetPwmWidth

Supported By

GX1120

Applies To

Function Generator mode only.

Purpose

Sets the pulse-width modulation width.

Syntax

GtWaveFuncSetPwmWidth (nHandle, nChannel, dWidth, 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.
dWidth    
SHORT
Pulse-width range is 0% to 100%
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Example

The following example sets the PWM width to 50%:

 

DOUBLE dWidth;

GtWaveFuncSetPwmWidth (nHandle, GTWAVE_CHANNEL_A, 50, &nStatus);

 

See Also

GtWaveFuncGetPwmWidth, GtWaveFuncSetPwmWaveform, GtWaveFuncSetPwmFrequency, GtWaveFuncSetPwmSource, GtWaveFuncSetPwmState, GtWaveGetErrorString