getting values with ps2000_get_times_and_values works, but times array is filled with the same number for each value. i think it's a type problem. I tried different declarations:
- Code: Select all
[DllImport("PS2000.dll", EntryPoint = "ps2000_get_times_and_values")]
public static extern System.Int32 GetTimesAndValues1(short handle, System.Int32[] time_buffer, short[] buffer_a, short[] buffer_b, short[] buffer_c, short[] buffer_d, short overflow, short time_units, System.Int32 no_of_samples);
...
[DllImport("PS2000.dll", EntryPoint = "ps2000_get_times_and_values")]
public static extern int GetTimesAndValues2(short handle, int[] times, short [] buffer_a, short [] buffer_b, short [] buffer_c, short [] buffer_d, out short overflow, short time_units, int no_of_samples);
buffer declaration and function call:
- Code: Select all
short[] Values_a = new short[200000];
short[] Values_b = new short[200000];
System.Int32[] b_times = new System.Int32[200000];
GetTimesAndValues1(handle,b_times,Values_a,Values_b,new short[0],new short[0],overflow,2,100);
...
short[] Values_a = new short[200000];
short[] Values_b = new short[200000];
int[] b_times = new int[200000];
GetTimesAndValues2(handle,b_times,Values_a,Values_b,new short[0],new short[0],out overflow,2,100);
but times values have all the same values, eg. 204793
what am I doing wrong? In Delphi it works with a longint array, and the manuals says long* times, which should be a 32bit-Int in .Net if i'm right.
Thank you for your help!
jimmy
Cart

