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 .
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.
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:
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.
"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?
A return value of 0 indicates that the unit can't be found and -1 indicates that it has failed to open.
I'm really not sure why you can't open the unit. You're using the correct .lib file (ps2000bc.lib). Data types should be the same. I wonder if it has something to do with name mangling. Are you building a C or C++ project?
It shouldn't be an issue as the header contains the following lines
Hi there,
now i have to pick up this project again, and i start with the old problems!
The PS2205 can`t be found.
I use the ps2000bc.lib, i place the file in the project folder like:
"C:\Projekte\NeueHardwareBeispiele\picoscopecon_c\ps2000bc.lib"
In these folder ther are also the other files:
ps2000con.c
ps2000.h
The ps2000.dll is here:
"C:\Projekte\NeueHardwareBeispiele\picoscopecon_c\Debug_Build\ps2000.dll"
I`m building a C project.
Can i be sure that the driver installation is correct? The PicoScope6 software and the Excel example is running.
Hi Chris,
yes, i took the example from the "PS2000sdk_r6_4_28.zip" file.
I took the "PS2000con.c" example, to create an c-console-application.
Now i can compile and start the project.
The console open and display following lines:
PS2000 driver example programm
Version 1.0
Opening the device...
Handler: 0
Unable to open device
Unit Not Opened
Error Code: £+@
...I think "Handler:" should return "1" not "0"....
I'd take the PS2000sdk_r6_4_28 project that you had working that didn't find the PS2205, and replace the PS2000con.c file with the one downloaded from the latest SDK.