Gx3348FuncGenSetWaveform

Purpose

Sets the Function Generator waveform.

Syntax

Gx3348FuncGenSetWaveform (nHandle, nWaveform, pnStatus)

Parameters

Name
Type
Description
nHandle
SHORT
Handle for the PXI board.
nWaveform
SHORT
Function Generator waveform:
0.      GX3348_FUNC_GEN_WAVEFORM_PULSE: Function Generator waveform pulse.
1.     GX3348_FUNC_GEN_WAVEFORM_SQUARE: Function Generator waveform square wave.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

The Function Generator waveform can output two waveforms: a pulse or a square.

The pulse base voltage can be set to any voltage between -20V to +32V, and peak voltage can be set to any voltage between -20V to +32V. Allowing for negative pulses. The pulse timing delay can be set from 1000 uSec to ~4294.9 Sec in 1 uSec resolution. The pulse timing width can be set from 1000 uSec to ~4294.9 Sec in 1 uSec resolution

The square waveform offset voltage can be set to any voltage between -20V to +20. The amplitude can be set form 0.0V to 40V peak-to-peak. The peak square waveform voltage can be Amplitude/2+Offset<=32.0 volts, and Amplitude/2-Offset>=-20.0 volts. The square waveform period can be set form 2usec to ~4294.9 Sec in 1 uSec resolution.

Calling Gx3348FuncGenSetWaveform() API will set the waveform parameters to default as follows:

Note: Function Generator functionality is only supported by firmware version 0x0000AC00 and above, use the Gx3348FuncGenIsSupported() API to check if supported.

Example

The following example sets the waveform to Pulse, sets the pulse base voltage level to 0V, peak voltage to -10V, and returning the settings. Enable the Pulse Generator, and return the Function Generator state

Note: see the Gx3348FuncGenTrigger() API for a complete C example.

 

SHORT nHandle, nState, nWaveform, nStatus;

DOUBLE dBase, dPeak;

 

Gx3348FuncGenSetWaveform(nHandle, GX3348_FUNC_GEN_WAVEFORM_PULSE, &nStatus);

Gx3348FuncGenGetWaveform(nHandle, &nWaveform, &nStatus);

if (nWaveform== GX3348_FUNC_GEN_WAVEFORM_PULSE)

    printf(“Func Gen Waveform is Pulse);

else if (nWaveform== GX3348_FUNC_GEN_WAVEFORM_SQUARE)

    printf(“Func Gen Waveform is Square);

 

Gx3348FuncGenPulseSetLevels (nHandle, 0.0, -10.0, &nStatus);

Gx3348FuncGenPulseGetLevels (nHandle, &dBase, &dPeak, &nStatus);

Gx3348FuncGenSetState(nHandle, GX3348_FUNC_GEN_ENABLED, &nStatus);

Gx3348FuncGenGetState(nHandle, &nState, &nStatus);

 

See Also

Gx3348FuncGenIsSupported, Gx3348FuncGenSetLevels, Gx3348FuncGenSetMode, Gx3348FuncGenPulseSetTiming, Gx3348FuncGenSetState, Gx3348FuncGenTrigger, GxPdoGetErrorString