Gx3348FuncGenTrigger

Purpose

Triggers the Function Generator waveform to generate a single waveform.

Syntax

Gx3348FuncGenTrigger (nHandle, pnStatus)

Parameters

Name
Type
Description
nHandle
SHORT
Handle for the PXI board.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

The function is only valid if the Function Generator operation mode is set to Trigger.

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 do the following:

SHORT  nHandle, nState, nStatus, nMode;

DOUBLE dBase, dPeak;

DWORD  dwPulseDelay, &dwPulseWidth;

SHORT  nIsSupported;

CHAR   szTestResult[512];

 

// Function Generator settings

Gx3348FuncGenIsSupported (nHandle, &nIsSupported, &nStatus);

if (nIsSupported==0)

    printf(“Current firmware does not support Function Generator”);

else

{   printf(“Current firmware supports Function Generator”);

 

// Channel settings

Gx3348SetRailSource(nHandle, GX3348_RAIL_SOURCE_FUNC_GEN, &nStatus);

Gx3348SetChannelRail(nHandle, GX3348_GROUP_A, 0, GX3348_RAIL_A, &nStatus);

 

 

// Func Gen set Waveform

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);

 

// Set Pulse voltage levels and timing

Gx3348FuncGenPulseSetLevels (nHandle, 0.0, 5.0, &nStatus);

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

printf(“Pulse base Votage=%f, Pulse peak Votage=%f”, dBase, dPeak);

Gx3348FuncGenPulseSetTiming(nHandle, 10000, 20000, &nStatus);

Gx3348FuncGenPulseGetTiming(nHandle, &dwPulseDelay, &dwPulseWidth, &nStatus);

printf(“Pulse Delay=%i, Pulse Width=%i”, dwPulseDelay, dwPulseWidth);

 

Gx3348FuncGenSetMode(nHandle, GX3348_FUNC_GEN_MODE_TRIGGERED, &nStatus);

Gx3348FuncGenGetMode(nHandle, &nMode, &nStatus);

if (nMode== GX3348_FUNC_GEN_MODE_TRIGGERED)

    printf(“Function Generator waveform Mode is triggered”);

else

    printf(“Function Generator waveform Mode is continues”);

 

Gx3348FuncGenSetState(nHandle, GX3348_FUNC_GEN_ENABLED, &nStatus);

Gx3348FuncGenGetState(nHandle, &nState, &nStatus);

if (nState == GX3348_FUNC_GEN_DISABLED)

    printf(“Function Generator is disabled”);

else

    printf(“Function Generator is enabled”);

 

// Triggers the Function Generator waveform to generate a single waveform

Gx3348FuncGenTrigger(nHandle, &nStatus);

}

 

See Also

Gx3348FuncGenIsSupported, Gx3348FuncGenSetLevels, Gx3348FuncGenSetMode, Gx3348FuncGenPulseSetTiming, Gx3348FuncGenSetState, GxPdoGetErrorString