Intro and a .net project startup questions

Come here to introduce yourself, who you are, and what you do
Post Reply
yzhang
Newbie
Posts: 0
Joined: Sat Apr 26, 2014 2:54 pm

Intro and a .net project startup questions

Post by yzhang »

Hi,

I just got a Pico 5242. Plan to develop a VB application for it under Window 8 or 7. Do you have VB or C# examples for 5000 series available that I may use as my project start up? That would save my time to find the right references and get the scope initialization when I start the project in Microsoft Visual Studio.

Which version of Microsoft Visual Studio do you support? How about Visual Studio 2013?

Thank you for your kind support in advance.

Zhang

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

Re: Intro and a .net project startup questions

Post by Martyn »

We will be updating the SDK to include some example code in the near future. In the mean time attached is a VS2010 C# Block Mode Capture example
Attachments
PS5000ABlockCapture.zip
Block Capture Example
(16.37 KiB) Downloaded 483 times
Martyn
Technical Support Manager

yzhang
Newbie
Posts: 0
Joined: Sat Apr 26, 2014 2:54 pm

Re: Intro and a .net project startup questions

Post by yzhang »

Thank you for reply.

I downloaded your example, complied it on Visual Studio 2013 on 64 bits window 8 OS with warnings but no error. However, when I run it, it gave me the exception of "cannot load ps5000a.dll" on "short status = Imports.OpenUnit(out handle, null, resolution);"

Where may I download this dll? Is there anyone report issues with running via Visual Studio 2013 on 64 bits window 8 OS?

Zhang

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

Re: Intro and a .net project startup questions

Post by Martyn »

Please download the latest sdk from http://www.picotech.com/software.html and install the 64bit drivers.
Martyn
Technical Support Manager

yzhang
Newbie
Posts: 0
Joined: Sat Apr 26, 2014 2:54 pm

Re: Intro and a .net project startup questions

Post by yzhang »

Hi Martyn,

I downloaded Software Development Kit R10.5.2.1, a software development kit (SDK) containing drivers and example code is available for the PicoScope 5242. I did not find any installation program to run.

So I copied the ps5000a.dll to Window/sytem32 folder, the project folder, and the debug folder where PS5000a.exe is. None of them works. The PS5000a sample program still could not find /load the ps5000a.dll.

Can you help? I really need to get it going now.

Zhang

yzhang
Newbie
Posts: 0
Joined: Sat Apr 26, 2014 2:54 pm

Re: Intro and a .net project startup questions

Post by yzhang »

BTW, I did manually run the drinst.exe file from system/AMD64 folder. No difference.

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

Re: Intro and a .net project startup questions

Post by Martyn »

For a quick test if you are building a 64 bit application, copy the 64bit ps5000a.dll to the same directory as the exe , if building 32bit copy the 32bit dll.
Martyn
Technical Support Manager

yzhang
Newbie
Posts: 0
Joined: Sat Apr 26, 2014 2:54 pm

Re: Intro and a .net project startup questions

Post by yzhang »

Thank you for your reply.

I did that already but did not work.

What I am not sure is whether or not I got right 64 bits dll from Picoscope's website. Can you email the dll to me directly?

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

Re: Intro and a .net project startup questions

Post by Martyn »

The dll's you need to use on a 64 bit system are in the x64 directory of the sdk, attached here. You will need to put both dll's in your application directory.
Attachments
x64.zip
5000a 64bit driver
(7.57 MiB) Downloaded 427 times
Martyn
Technical Support Manager

yzhang
Newbie
Posts: 0
Joined: Sat Apr 26, 2014 2:54 pm

Re: Intro and a .net project startup questions

Post by yzhang »

Thank you so much Martyn.

I copied the 64 bit dlls to the related folder.

I recompiled the PS5000a program. Now it can starts and displays the first massage "PS5000a VB.Net example program". However, I got the exception as "An unhandled exception of type 'System.BadImageFormatException' occurred in PS5000a.exe
Additional information: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)"

when it runs to the next statement: status = ps5000aOpenUnit(handle, vbNullString, DeviceResolution.PS5000A_DR_12BIT) below:

Sub Main()

Dim status As UInteger
Dim handle As Short

Console.WriteLine("PS5000a VB.Net example program" & vbNewLine & "==============================" & vbNewLine)
status = ps5000aOpenUnit(handle, vbNullString, DeviceResolution.PS5000A_DR_12BIT)

Can you advise what could be wrong here?

Thanks a lot

Hitesh

Re: Intro and a .net project startup questions

Post by Hitesh »

This was resolved by yzhang by downloading the SDK and reinstalling the PS5000a folder.

Post Reply