PicoScope 7 Software
Available on Windows, Mac and Linux
Code: Select all
short status;
int range = 8;
status = Imports.SetChannel(_handle, 0, 1, 1, range);
Console.WriteLine("Collect streaming triggered...");
short auto_trigger_ms = 0; // start recording after x seconds, even if trigger was not found
short threshold = 10000; // (mv/range)*maxValue32512
short source = 0; // channel A
status = Imports.ps2000_set_trigger(_handle, source, threshold, 0, 0, auto_trigger_ms);
uint sampleCount = BUFFER_SIZE;
uint timeInterval = 1;
uint maxSamples = 1000;
uint noOfSamplesPerAggregate = 1; // samples that will be merged together
int timeUnits = 1; //milliseconds is 4
status = Imports.ps2000_run_streaming_ns(_handle, timeInterval, timeUnits, maxSamples, 0, noOfSamplesPerAggregate, 1000);
Console.WriteLine("Run Streaming with status: {0}", status);
Code: Select all
[DllImport(_DRIVER_FILENAME, EntryPoint = "ps2000_run_streaming_ns")]
public static extern short ps2000_run_streaming_ns(
short handle,
uint sample_interval,
int time_units,
uint max_samples,
short auto_stop,
uint noOfSamplesPerAggregate,
uint overview_buffer_size);
Code: Select all
uint timeInterval = 1;
uint maxSamples = 1000000;
uint noOfSamplesPerAggregate = 1;
int timeUnits = 3; //should be int and try usecs
uint overview_buffer_size= 20000; //This is the parameter that matters
Code: Select all
[DllImport("ps2000.dll")]
public static extern unsafe short ps2000_run_streaming_ns(short handle, ulong sample_interval, ReportedTimeUnits time_units, ulong max_samples, short auto_stop, ulong noOfSamplesPerAggregate, ulong overview_buffer_size);
ReportedTimeUnits is defined as int.
Code: Select all
if (ps2000_run_streaming_ns(pico_scope_handle, 1, ReportedTimeUnits.MicroSeconds, 2000, 0, 100, 15000) == 0)
{
tbConsole.AppendText("Pico: Streaming setup FAILED.\n");
result = false;
}
Code: Select all
pico_scope_handle = ps2000_open_unit();
ps2000_set_channel(pico_scope_handle, Channel.PS2000_CHANNEL_A, 1, 1, Range.Range_5V) ;
ps2000_set_channel(pico_scope_handle, Channel.PS2000_CHANNEL_B, 1, 1, Range.Range_5V) ;
ps2000_set_trigger(pico_scope_handle, Channel.PS2000_NONE, 0, Trigger.RISING, 0, 0);
ps2000_run_streaming_ns(pico_scope_handle, 1, ReportedTimeUnits.MicroSeconds, 2000, 0, 100, 15000);
Code: Select all
[DllImport(_DRIVER_FILENAME, EntryPoint = "ps2000_run_streaming_ns")]
public static extern short ps2000_run_streaming_ns(
short handle,
uint sample_interval,
ReportedTimeUnits time_units,
uint max_samples,
short autostop,
uint noOfSamplesPerAggregate,
uint overview_buffer_size);