Test and Measurement Forum

Problems with SDK PicoScope 3205

Post any questions you may have about our current range of oscilloscopes

Problems with SDK PicoScope 3205

Postby Pedro Bertoleti » Wed Jan 27, 2010 12:37 pm

Hi, my name is Pedro Bertoleti and I work at LAT-EFEI (High Voltage Laboratory of Federal University of Itajubá, Minas Gerais state, Brazil).
Here at laboratory we bought a PicoScope 3205 and I can´t compile the example code / project (p23000con.c). I did all the needed procedures (I added the library to my project) and it doesn´t works due to many compilation errors. I use DEV-CPP and Borland C++ 5.02 compilators, and in both compilers many compilation errors occured.
I must do a software to operate with this product and I need this example code works (so I can understand more about this kind of programming). May you help me?

Thanks for your time.
Pedro Bertoleti
 

Re: Problems with SDK PicoScope 3205

Postby Robin » Wed Jan 27, 2010 12:44 pm

Hi

If you are using Borland C, remember to use ps3000bc.lib rather than ps3000.lib

Robin
Robin
Zen Master
Zen Master
 
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Re: Problems with SDK PicoScope 3205

Postby Pedro Bertoleti » Thu Jan 28, 2010 12:37 am

I did it, but it doesn´t works. There are 2 erros when I try to compile the example code with Borland C++, and these erros are:

1- Cannot convert 'void *' to 'tTriggerConditions *' at line 239
( unitOpened.trigger.advanced.conditions = malloc (sizeof (TRIGGER_CONDITIONS) * unitOpened.trigger.advanced.nProperties); )

2- Cannot convert 'void *' to 'tTriggerProperties *' at line 256
( unitOpened.trigger.advanced.channelProperties = malloc (sizeof (TRIGGER_CHANNEL_PROPERTIES) * unitOpened.trigger.advanced.nProperties); )

Do you have more suggestions to solve this problem?



Thanks for your time.
Pedro Bertoleti
 

Re: Problems with SDK PicoScope 3205

Postby Robin » Thu Jan 28, 2010 12:05 pm

Hi

I don't get this problem in Visual Studio.

Have you tried casting the return value of Malloc?

Code: Select all
(TRIGGER_CONDITIONS*) malloc (sizeof (TRIGGER_CONDITIONS) * unitOpened.trigger.advanced.nProperties);


Robin
Robin
Zen Master
Zen Master
 
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Re: Problems with SDK PicoScope 3205

Postby Pedro Bertoleti » Fri Jan 29, 2010 1:50 pm

Hi Robin. This casting works! The code lines with these casting are:

(TRIGGER_CONDITIONS*) malloc (sizeof (TRIGGER_CONDITIONS) * unitOpened.trigger.advanced.nProperties);


( TRIGGER_CHANNEL_PROPERTIES*) malloc (sizeof (TRIGGER_CHANNEL_PROPERTIES) * unitOpened.trigger.advanced.nProperties);

Thanks a lot!
Pedro Bertoleti
 


Return to USB PC Oscilloscopes

Who is online

Users browsing this forum: No registered users and 1 guest