PS2205 with Borland turbo C++

Post any questions you may have about our current range of oscilloscopes
Post Reply
xlbiker
Newbie
Posts: 0
Joined: Fri Aug 20, 2010 12:19 pm

PS2205 with Borland turbo C++

Post by xlbiker »

Hello,
i try to write my own application using WinXP, Borland Turbo C++ 2006 and Picoscope2205.
After installing and testing “PicoScope 6” I started a new BCB Project, saved it an placed the PS2000 Files in the Project Folder: ps2000.c, resource.h and ps2000bc.lib these files I addet to the project too.
After that I searched for ps2000.rch and ps2000.h to put them into the compilation directory. But I can`t find the ps2000.rch so I took the ps2000.rc. Then I placed the ps2000.dll into the same folder as the executable.
Next I tried to compile and run the Project, it works.

But if I put an button to the form to call the function “ps200_open_unit()” like:

short ps2000_handle;
ps2000_handle = ps2000_open_unit();


I get an error:
AccessViolation at adress 10009062 in modul PS2000.DLL write adress 5201BA93 .

What is going wrong?

Thanks for your help!

Robin
Advanced User
Advanced User
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Re: PS2205 with Borland turbo C++

Post by Robin »

Hi

I'm not sure what is causing the error message, but you'll notice that the description at the top of ps2000.c says that the example applies to the 210x oscilloscopes only.

It should be fairly easy to modify this to work with the 2205. However, the console example will work with the 2205 and demonstrates the necessary API calls.

Robin

xlbiker
Newbie
Posts: 0
Joined: Fri Aug 20, 2010 12:19 pm

Re: PS2205 with Borland turbo C++

Post by xlbiker »

Hi Robin,
thank you for your quick response, I tried to build the C- Project, unfortunately without success.
If I start the project I get following reply:

PS2000 driver example programm
Version 1.0

Opening the device...
Handler: 0
Unable to open device
Unit Not Opened
Error Code: £+@

or:

...
Error Code: D+@


Do you have an idea?

Thanks

Robin
Advanced User
Advanced User
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Re: PS2205 with Borland turbo C++

Post by Robin »

Hi

It sounds like the example has been built successfully but that it can't open the scope. Can you check that you can see it in Device Manager and that it's not being used by any other application (such as PicoScope 6)?

The error code appears to be displayed incorrectly. To check the status returned by the driver, it's best to step in to the code.

Robin

xlbiker
Newbie
Posts: 0
Joined: Fri Aug 20, 2010 12:19 pm

Re: PS2205 with Borland turbo C++

Post by xlbiker »

"Handler: 0". I tried the XLS example and there is the return of this function 1.

I think one part of the driver and the Turbo Compiler don`t work together.

Do you have another idea?
Is it possible to get an complete c or c++ project for Borland?

Thanks
-->
Hi Robin,
i agree with you, the example could get built! The Device is shown in DeviceManager (whitout any error or warning), and i close all applications i don`t need. But the first funktion-call "ps2000_open_unit" returns 0 --> "Handler: 0". I tried the XLS example and there is the return of this function 1.

I think one part of the driver and the Turbo Compiler don`t work together.

Do you have another idea?
Is it possible to get an complete c or c++ project for Borland?

Thanks