Test and Measurement Forum

Intro and a .net project startup questions

Come here to introduce yourself, who you are, and what you do

Intro and a .net project startup questions

Postby yzhang » Sat Apr 26, 2014 3:07 pm

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
yzhang
Newbie
 
Posts: 0
Joined: Sat Apr 26, 2014 2:54 pm

Re: Intro and a .net project startup questions

Postby Martyn » Mon Apr 28, 2014 8:12 am

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 131 times
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2355
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: Intro and a .net project startup questions

Postby yzhang » Thu May 15, 2014 12:26 am

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
yzhang
Newbie
 
Posts: 0
Joined: Sat Apr 26, 2014 2:54 pm

Re: Intro and a .net project startup questions

Postby Martyn » Thu May 15, 2014 10:21 am

Please download the latest sdk from http://www.picotech.com/software.html and install the 64bit drivers.
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2355
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: Intro and a .net project startup questions

Postby yzhang » Tue Jan 13, 2015 2:51 am

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

Postby yzhang » Tue Jan 13, 2015 2:56 am

BTW, I did manually run the drinst.exe file from system/AMD64 folder. No difference.
yzhang
Newbie
 
Posts: 0
Joined: Sat Apr 26, 2014 2:54 pm

Re: Intro and a .net project startup questions

Postby Martyn » Tue Jan 13, 2015 7:38 am

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 Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2355
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: Intro and a .net project startup questions

Postby yzhang » Wed Jan 14, 2015 3:33 am

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?
yzhang
Newbie
 
Posts: 0
Joined: Sat Apr 26, 2014 2:54 pm

Re: Intro and a .net project startup questions

Postby Martyn » Thu Jan 15, 2015 7:43 am

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 89 times
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2355
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: Intro and a .net project startup questions

Postby yzhang » Fri Jan 23, 2015 1:30 am

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
yzhang
Newbie
 
Posts: 0
Joined: Sat Apr 26, 2014 2:54 pm

Re: Intro and a .net project startup questions

Postby Hitesh » Thu Jan 29, 2015 4:15 pm

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

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2063
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire


Return to Introductions

Who is online

Users browsing this forum: No registered users and 3 guests