ps2000_get_times_and_values: times buffer

Post your .Net discussions here.

ps2000_get_times_and_values: times buffer

Postby Jimmy_Sk8a » Sun Nov 09, 2008 1:50 am

hello,

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
Jimmy_Sk8a
User
User
 
Posts: 2
Joined: Fri Oct 17, 2008 12:43 pm
Location: Zurich, Switzerland

Postby Erik » Tue Jan 13, 2009 7:50 pm

Erik
PICO STAFF
PICO STAFF
 
Posts: 51
Joined: Mon Oct 23, 2006 9:16 am
Location: Cambridgeshire, UK


Return to .Net Languages (C#, VB.Net, .)

Who is online

Users browsing this forum: No registered users and 0 guests