PicoScope 2206 SDK Wont Run

Post any questions you may have about our current range of oscilloscopes
Post Reply
ARC
Newbie
Posts: 0
Joined: Wed Aug 08, 2012 8:38 am

PicoScope 2206 SDK Wont Run

Post by ARC »

Hello,

Now i have got the PicoScope i have ran it with PicoScope 6 after installing it from the cd that came with it and that runs fine but when i tried to run my program it crashes when trying to connect to the PicoScope.
So i put the example console application together with all the original files and that cant connect either i have taken a screen shot of the console if what it says is any help.

Im sure its something realy simple but when the original SDK doesnt run im not sure where to go?

Thanks for the help :)
Attachments
scopenorun.jpg

Martyn
Site Admin
Site Admin
Posts: 4491
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: PicoScope 2206 SDK Wont Run

Post by Martyn »

Please download the latest sdk from our website http://www.picotech.com/software.html that looks like the version for the 2204/2205 models and not the newer 2206. You need PS2000asdk_r10_4_1_6
Martyn
Technical Support Manager

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

Re: PicoScope 2206 SDK Wont Run

Post by ARC »

Ah ha Thank you very much :D

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

Re: PicoScope 2206 SDK Wont Run

Post by ARC »

I thought its better if i continue this thread rather than start another.

I have got communication with the PicoScope now and to start off im just trying to get function generator output.
Using my programing which is c# GUI using the C SDK as a dll to access the picoscope then i call setsignalgenerator and parse it frequency waveform filename offset and pktopk.

This returns code 46 which is "PICO_BUFFERS_NOT_SET. An attempt was made to get data before a data
buffer was defined." i have tried to put a set buffer function call into the C program but doesn't seem that easy.

I have attached my C code incase i have removed something i shouldnt have, im only commenting out at this point to try and avoid these situations, but i have compared against the original and i can't see anything.

Also is it possible this error could be caused by parsing incorrect datatypes? because its entirely possible i am parsing the variables in the wrong format?

Any ideas would be much appreciated.

Thanks very much :)
Attachments
PS2000Acon.c
(62.58 KiB) Downloaded 618 times

Hitesh

Re: PicoScope 2206 SDK Wont Run

Post by Hitesh »

Hi ARC,

The status values returned from the driver are decimal values but require conversion to Hexadecimal which gives you an error code of 2E from decimal 46.

Unfortunately, the document does not list this error number but the PicoStatus.h file lists it as 'PICO_SIG_GEN_PARAM' indicating that it is an issue with the parameters being passed to the function.

Please check the value of delta, and also confirm that the values in the arbitrary waveform file are in the range 0 - 4095.

Also, is your handle meant to be 1638 or 16384 (the normal default)?

There isn't a need to call the ps2000aSetDataBuffer() function in order to use the signal generator function.

I would recommend building the C console example and running it with the desired parameters in order to confirm that it works correctly, prior to combining it with your C# code.

I hope this helps.

Regards,

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

Re: PicoScope 2206 SDK Wont Run

Post by ARC »

Great thanks for the info.

Yes that handle value was a typo.

Im currently just trying to use the built in functions, sine, square,triangle, so is delta called in this situation?

So i have defined SetSignalGenerator in c# as:

Code: Select all

[DllImport("PS2000ACON.dll", CallingConvention = CallingConvention .Cdecl)]
        [return: MarshalAs(UnmanagedType.I4)]
        public static extern int SetSignalGenerator(int unit, long frequency, short waveform, string filename, long offset, long pktopk);
In c# i have struggled to find exact data types to confirm if these are the correct format for the DLL? Are any of them wrong?

Thanks so much for the help

Hitesh

Re: PicoScope 2206 SDK Wont Run

Post by Hitesh »

Hi ARC,

If you are using the ps2000aSetSigGenBuiltIn() function to output then the delta value does not apply - you specify values for the start and stop frequency instead.

With regards to your parameters to SetSignalGenerator, the UNIT variable is a structure although you have it declared as an int. You should be able to define a UNIT struct in C#.

Regards,

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

Re: PicoScope 2206 SDK Wont Run

Post by ARC »

Great got it working now thank you.

Moving onto Osciliscope functions :?

Thanks :)

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

Re: PicoScope 2206 SDK Wont Run

Post by ARC »

Don't worry i have got the oscilloscope side working now :)

Thanks :)

Post Reply