|
|
| Author |
Message |
victor.barna Newbie
Joined: 11 Jan 2008
Posts: 1
|
Posted: Fri Jan 11, 2008 7:19 pm Post subject: C# adc-11/12 need help, fast. |
|
|
hi,i'm writing a program in C# using interop and the adc1132.dll:
port = 101;
product = 111;
long opened=0;
opened= adc11_open_unit(port, product);
if (opened!=0) {
adc11_set_trigger(1, 1, 1000, 10, 0, 512, 0);
adc11_set_interval(1000000, 100, channels, 2);
adc11_run(100, 0);
adc11_get_times_and_values(times[0], values[0], 100);
}
this just pops up a nice little messagebox that says "unable to lock unknown global file: ./adc11usb.c line 1080".
the adc11_get_value method works just fine, i don't know what's wrong.
please help! |
|
| Back to top |
|
 |
picojohn Site Admin

Joined: 11 Jun 2007
Posts: 311
|
Posted: Tue Jan 15, 2008 4:00 pm Post subject: |
|
|
Hello Victor,
Are you using a Parallel or USB ADC-11 or, a Parallel ADC-11 with USB/Parallel adapter?
regards
John |
|
| Back to top |
|
 |
gruntman Guru

Joined: 28 Sep 2006
Posts: 88
Location: Garden City, KS USA
|
Posted: Fri Jan 25, 2008 6:22 pm Post subject: |
|
|
Victor,
Since you are using the USB ADC-11 I would recommend using the usbadc11.dll driver for your program. This will resolve the error you are getting. The functions are slightly different but are designed specifically for the USB ADC-11.
On your adc11_set_trigger you have the handle defined as 1, you will need to change this to the variable opened or you will run into issues down the line. I would recommend using the following function:
UsbAdc11SetTrigger (opened, TRUE, TRUE, 1000, 10, FALSE, 512, 0);
On adc11_set_interval you have the channels portion to the variable channels but in the code you posted you don't define this. You can define it something roughly like this:
short channels [] = {1, 3};
I would recommend using:
UsbAdc11SetInterval (opened, 1000000, 100, channels, 2);
Next you have the unit running then you go immediately into getting values. Between this you need to call UsbAdc11Ready (opened) until it returns true then you can call to get the values.
When you call to get the times and values call the following function: UsbAdc11GetTimesAndValues (opened, times, values, 100);
Times and values will need to be defined as an array.
A good idea is to look at the USBADC11CON.C.
While this isn't in C# like you are needing it will give you the right calls to make and all you will have to do is make it C# compatible.
Regards,
Richard Boyd
Technical Specialist
http://www.pc-oscilloscopes.com |
|
| Back to top |
|
 |
|
Powered by phpBB © 2001, 2005 phpBB Group
|