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 = "ps2000aSetSigGenArbitrary")]
public static extern Int32 SetSigGenArbitray(
short handle,
int offsetVoltage,
uint pkTopk,
uint StartDeltaPhase,
uint StopDeltaPhase,
uint deltaPhaseIncrement,
uint dwellCount,
ref short arbitaryWaveform,
int arbitaryWaveformSize,
SweepType sweepType,
ExtraOperations operation,
IndexMode indexMode,
uint shots,
uint sweeps,
SigGenTrigType triggerType,
SigGenTrigSource triggerSource,
short extInThreshold);
Code: Select all
[DllImport(_DRIVER_FILENAME, EntryPoint = "ps2000aSetSigGenBuiltIn")]
public static extern Int32 SetSigGenBuiltIn(
short handle,
int offsetVoltage,
uint pkToPk,
WaveType waveType,
uint startFrequency,
uint stopFrequency,
uint increment,
uint dwellTime,
SweepType sweepType,
uint sweeps
);
Code: Select all
[DllImport(_DRIVER_FILENAME, EntryPoint = "ps2000aSetSigGenArbitrary")]
public static extern Int32 SetSigGenArbitrary(
short handle,
int offsetVoltage,
uint pkTopk,
uint StartDeltaPhase,
uint StopDeltaPhase,
uint deltaPhaseIncrement,
uint dwellCount,
---> ref short[] arbitaryWaveform,
int arbitaryWaveformSize,
SweepType sweepType,
ExtraOperations operation,
IndexMode indexMode,
uint shots,
uint sweeps,
SigGenTrigType triggerType,
SigGenTrigSource triggerSource,
short extInThreshold);
Code: Select all
[DllImport(_DRIVER_FILENAME, EntryPoint = "ps2000aSetSigGenBuiltIn")]
public static extern Int32 SetSigGenBuiltIn(
short handle,
int offsetVoltage,
uint pkToPk,
WaveType waveType,
uint startFrequency,
uint stopFrequency,
uint increment,
uint dwellTime,
SweepType sweepType,
uint sweeps
);
Code: Select all
Int32 status;
Int32 waveLen= 1024;
short[] waveForm = new short[waveLen];
short ii = 0;
for (Int32 i = 0; i < waveLen; i++)
{
ii++;
if (ii == 254) ii = 0;
waveForm[i] = ii;
}
status=Imports.SetSigGenArbitrary(_handle,
0, //offsetVoltage
1000000, //peakTopeak
1, //StartDeltaPhase
1, //StopDeltaPhase
0, //deltaPhaseIncrement
0, //dwellCount,
ref waveForm,//ref short arbitaryWaveform,
waveLen,//arbitaryWaveformSize,
Imports.SweepType.PS2000A_UP, //SweepType sweepType,
Imports.ExtraOperations.PS2000A_ES_OFF, //ExtraOperations operation,
Imports.IndexMode.PS2000A_SINGLE, //indexMode,
0, //shots,
0, //sweeps,
Imports.SigGenTrigType.PS2000A_SIGGEN_RISING , //SigGenTrigType triggerType
Imports.SigGenTrigSource.PS2000A_SIGGEN_NONE, //SigGenTrigSource triggerSource,
0 //extInThreshold
);
Code: Select all
ref short[] arbitaryWaveform,
Code: Select all
short[] arbitaryWaveform,