PicoScope 7 Software
Available on Windows, Mac and Linux
Code: Select all
public enum IndexMode : int
{
PS2000A_SINGLE,
PS2000A_DUAL,
PS2000A_QUAD,
PS2000A_MAX_INDEX_MODES
}
public enum WaveType : int
{
PS2000A_SINE,
PS2000A_SQUARE,
PS2000A_TRIANGLE,
PS2000A_RAMP_UP,
PS2000A_RAMP_DOWN,
PS2000A_SINC,
PS2000A_GAUSSIAN,
PS2000A_HALF_SINE,
PS2000A_DC_VOLTAGE,
PS2000A_WHITE_NOISE,
PS2000A_MAX_WAVE_TYPES
}
public enum SweepType : int
{
PS2000A_UP,
PS2000A_DOWN,
PS2000A_UPDOWN,
PS2000A_DOWNUP,
PS2000A_MAX_SWEEP_TYPES
}
public enum ExtraOperations : int
{
PS2000A_ES_OFF,
PS2000A_WHITENOISE,
PS2000A_PRBS // Pseudo-Random Bit Stream
}
public enum SigGenTrigType : int
{
PS2000A_SIGGEN_RISING,
PS2000A_SIGGEN_FALLING,
PS2000A_SIGGEN_GATE_HIGH,
PS2000A_SIGGEN_GATE_LOW
}
public enum SigGenTrigSource : int
{
PS2000A_SIGGEN_NONE,
PS2000A_SIGGEN_SCOPE_TRIG,
PS2000A_SIGGEN_AUX_IN,
PS2000A_SIGGEN_EXT_IN,
PS2000A_SIGGEN_SOFT_TRIG
}
Code: Select all
[DllImport(_DRIVER_FILENAME, EntryPoint = "ps2000aSetSigGenBuiltIn")]
public static extern Int32 SetSigGenBuiltIn(
short handle,
int offsetVoltage,
uint pkToPk,
WaveType waveType,
float startFrequency,
float stopFrequency,
uint increment, //not double
uint dwellTime, //not double...
SweepType sweepType,
ExtraOperations operation,
uint shots,
uint sweeps,
SigGenTrigType triggerType,
SigGenTrigSource triggerSource,
short extInThreshold);
//Code snippet for a single rail 1Vpp ramp...
//add in the console application:
float freq = 1000.0F;
status = Imports.SetSigGenBuiltIn(
_handle,
(int) 500000, //offsetVoltage,
(uint) 1000000, //uint pkToPk,
Imports.WaveType.PS2000A_RAMP_UP, // waveType,
(float)freq, // Hz float startFrequency,
(float)freq, // Hz float stopFrequency,
0, // uint! Hz float increment,
0, // uint! float dwellTime,
Imports.SweepType.PS2000A_UP,
Imports.ExtraOperations.PS2000A_ES_OFF,
0, //Shots
0, //Sweeps
Imports.SigGenTrigType.PS2000A_SIGGEN_RISING,
Imports.SigGenTrigSource.PS2000A_SIGGEN_NONE,
0);