Test and Measurement Forum

error with set_interval

Forum for discussing PicoLog

error with set_interval

Postby Guest » Sat Jan 26, 2008 1:59 pm

hi,
I have a problem with adc11/10 using adc11_set_interval. I' writing my project with C#.NET (Visual Studio 2005).
I call this function but I see this error "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." I looked adc11con.c then thouht maybe my parameters were wrong. so that I sent the same parameters with adc11con.c. but the problem wasn't solved. here is my code

public static ulong BUFFER_SIZE= 1000; (Global variable)
ulong actual;
short[] channels = {1,3};
short no_of_channels = 2;
actual = myproject.dlldeclaration.adc11_set_interval(100000, BUFFER_SIZE, channels, no_of_channels);
Console.WriteLine(actual.ToString());

and this is function declaration in my dll class

[DllImport("adc1132.dll")]
public static extern uint adc11_set_interval(int us_for_block, ulong ideal_no_of_samples, short[] channels, short no_of_channels);

Is it about my Visual Studio Version?
Can anyone help me?
Guest
 

Postby ziko » Mon Feb 11, 2008 12:40 pm

Hi one of the software engineer has kindly had a look at your query and found the following

"The function declaration is incorrect:

DllImport("adc1132.dll")]

public static extern uint adc11_set_interval(int us_for_block, ulong ideal_no_of_samples, short[] channels, short no_of_channels);


ulong is a 64 bit word, the function takes a 32 bit word and therefore should actually be


DllImport("adc1132.dll")]

public static extern uint adc11_set_interval(uint us_for_block, uint ideal_no_of_samples, short[] channels, short no_of_channels);
"

Hope this helps

Kind regards
Ziko

Technical Specialist
ziko
Zen Master
Zen Master
 
Posts: 1705
Joined: Fri Dec 01, 2006 10:03 am
Location: St Neots

solved

Postby Guest » Mon Feb 18, 2008 8:39 am

Hı and thanks for your help.
It's ok.
thanks again
Guest
 


Return to PicoLog

Who is online

Users browsing this forum: No registered users and 1 guest