Problems with SDK PicoScope 3205

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

Problems with SDK PicoScope 3205

Post by Pedro Bertoleti »

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.

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

Re: Problems with SDK PicoScope 3205

Post by Robin »

Hi

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

Robin

Pedro Bertoleti

Re: Problems with SDK PicoScope 3205

Post by Pedro Bertoleti »

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.

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

Re: Problems with SDK PicoScope 3205

Post by Robin »

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

Pedro Bertoleti

Re: Problems with SDK PicoScope 3205

Post by Pedro Bertoleti »

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!

Post Reply