Test and Measurement Forum

SDK Errors

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

SDK Errors

Postby ARC » Wed Aug 08, 2012 8:50 am

Hello,

I am trying to create a GUI that uses the PicoScope 2206 for testing, i have taken the console SDK files and edited them be parsed values rather than ask for them, this will then be converted into a DLL.
To convert it to a DLL i have copied the code into a C++ file in my project and it has 3 errors, which are parts that i have not changed and i cannot see how to fix. They are:
Code: Select all
unitOpened.trigger.advanced.conditions = malloc (sizeof (PS2000_TRIGGER_CONDITIONS) * unitOpened.trigger.advanced.nProperties);

With the error:
Error 1 error C2440: '=' : cannot convert from 'void *' to 'PS2000_TRIGGER_CONDITIONS *'

Code: Select all
   unitOpened.trigger.advanced.channelProperties = malloc (sizeof (PS2000_TRIGGER_CHANNEL_PROPERTIES) * unitOpened.trigger.advanced.nProperties);

with the error:
Error 2 error C2440: '=' : cannot convert from 'void *' to 'PS2000_TRIGGER_CHANNEL_PROPERTIES *'

Code: Select all
ps2000_set_sig_gen_built_in (unitOpened.handle,
                                          offset,
                                          1000000, // 1 volt
                                          waveform,
                                          (float)frequency,
                                          (float)frequency,
                                          0,
                                          0,
                                          PS2000_UPDOWN, 0);


the error is:
Error 3 error C2664: 'ps2000_set_sig_gen_built_in' : cannot convert parameter 4 from 'short' to 'PS2000_WAVE_TYPE'

i have defined "waveform" as a short like it was before but in the function title. but if i remove this and put it back inside the function the error remains.

Any body have any ideas about these?
i can attach my code if required?

Thanks for your help :)
Attachments
ps2000ops.cpp
obviously this expects the .h .lib etc thats in the SDK
(46.2 KiB) Downloaded 156 times
Last edited by ARC on Wed Aug 08, 2012 2:27 pm, edited 1 time in total.
ARC
Newbie
 
Posts: 0
Joined: Wed Aug 08, 2012 8:38 am

Re: SDK Errors

Postby Martyn » Wed Aug 08, 2012 2:24 pm

Yes, please attach your code and we can fire it up and see what is happening.
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2280
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: SDK Errors

Postby Erik » Thu Aug 09, 2012 2:54 pm

For error 1, try changing the line to

unitOpened.trigger.advanced.conditions = (PS2000_TRIGGER_CONDITIONS *)malloc (sizeof (PS2000_TRIGGER_CONDITIONS) * unitOpened.trigger.advanced.nProperties);
Erik
PICO STAFF
PICO STAFF
 
Posts: 52
Joined: Mon Oct 23, 2006 8:16 am
Location: Cambridgeshire, UK

Re: SDK Errors

Postby ARC » Fri Aug 10, 2012 7:08 am

Thank you very much that has fixed the 2 maloc errors.

Just the short for PS2000_WAVE_TYPE which i can't see how ive broken it. Its the same as it was before.

Thank you.
ARC
Newbie
 
Posts: 0
Joined: Wed Aug 08, 2012 8:38 am

Re: SDK Errors

Postby Martyn » Fri Aug 10, 2012 8:16 am

Try the following

Code: Select all
ps2000_set_sig_gen_built_in (unitOpened.handle,
                                          offset,
                                          1000000, // 1 volt
                                          (PS2000_WAVE_TYPE) waveform,
                                          (float)frequency,
                                          (float)frequency,
                                          0,
                                          0,
                                          PS2000_UPDOWN, 0);
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2280
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: SDK Errors

Postby ARC » Fri Aug 10, 2012 8:31 am

:D All fixed, thank you so much guys :D
ARC
Newbie
 
Posts: 0
Joined: Wed Aug 08, 2012 8:38 am


Return to USB PC Oscilloscopes

Who is online

Users browsing this forum: No registered users and 0 guests