Triggers the Function Generator waveform to generate a single waveform.
Gx3348FuncGenTrigger (nHandle, pnStatus)
Name |
Type |
Description |
nHandle |
SHORT |
Handle for the PXI board. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
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.
The following example do the following:
Sets Rail A source to Function Generator.
Connect Rail A to Group A channel 0.
Check if the current firmware supports Function Generator
Sets the Pulse base voltage level to 0V, peak voltage to 5.0V, and return the voltage settings.
Sets the pulse delay to 10mSec and the width to 20mSec, and return the settings.
Sets the operation mode to trigger, and return the operation mode.
Enable the Function Generator, and return the Function Generator state
Trigger a single pulse
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);
}
Gx3348FuncGenIsSupported, Gx3348FuncGenSetLevels, Gx3348FuncGenSetMode, Gx3348FuncGenPulseSetTiming, Gx3348FuncGenSetState, GxPdoGetErrorString